emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Building Emacs on MacOS with clang+LTO fails


From: dhruva
Subject: Building Emacs on MacOS with clang+LTO fails
Date: Sat, 4 May 2019 11:08:36 -0700

I am trying to build emacs using clang 8 (from home-brew) with link time optimization enabled.

Emacs configured as:
LD=lld CC=clang CFLAGS="-flto" ../../git/emacs/configure --with-mailutils --with-ns

I get an error in building lib-src/make-fingerprint:
make[2]: Nothing to be done for `info'.
  CCLD     make-fingerprint
ld: reference to bitcode symbol '_rpl_getopt' which LTO has not compiled in '_main' from /var/folders/5c/5w9bqxts6gl2pgfgdpzq94n0nhqj5f/T/cc-ebc71c.o for architecture x86_64
clang-8: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [make-fingerprint] Error 1
make: *** [lib-src] Error 2

The following patch fixes the build:
$ git diff
diff --git a/lib-src/make-fingerprint.c b/lib-src/make-fingerprint.c
index 79bd007a5f..d00dd26c9f 100644
--- a/lib-src/make-fingerprint.c
+++ b/lib-src/make-fingerprint.c
@@ -65,7 +65,7 @@ main (int argc, char **argv)
 {
   int c;
   bool raw = false;
-  while (0 <= (c = getopt (argc, argv, "rh")))
+  while (0 <= (c = getopt_long (argc, argv, "rh", NULL, NULL)))
     {
       switch (c)
         {

reply via email to

[Prev in Thread] Current Thread [Next in Thread]