unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Building Emacs on MacOS with clang+LTO fails
@ 2019-05-04 18:08 dhruva
  2019-05-04 20:21 ` Paul Eggert
  0 siblings, 1 reply; 2+ messages in thread
From: dhruva @ 2019-05-04 18:08 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1097 bytes --]

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)
         {

[-- Attachment #2: Type: text/html, Size: 2278 bytes --]

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-05-04 20:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-04 18:08 Building Emacs on MacOS with clang+LTO fails dhruva
2019-05-04 20:21 ` Paul Eggert

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).