The gcc 6.2.0 compiler fails to link temacs in a build of emacs 25.1 when the "-O0 -flto" flag is passed on CFLAGS and "-flto" on LDFLAGS. This issue occurs on x86_64-apple-darwin15 where the failure appears as... CCLD temacs /var/folders/vh/xthx1f251nqfj804049zl1wm0000gn/T//cc5Viitn.s:288358:1: error: assembler local symbol 'L1' not defined ... /var/folders/vh/xthx1f251nqfj804049zl1wm0000gn/T//cc5Viitn.s:288358:1: error: assembler local symbol 'L174' not defined and on x86_64 linux using a build gcc 6.2.0 with configure edited to set build_lto_plugin=no on ELF to use the same code LTO code generation path on linux as darwin... CCLD temacs /tmp/cc7ZBmmQ.ltrans0.ltrans.o:(.rodata+0x135a0): undefined reference to `.L1' ... /tmp/cc7ZBmmQ.ltrans0.ltrans.o:(.rodata+0x13bc8): more undefined references to `.L174' follow collect2: fatal error: ld returned 1 exit status On x86_64 linux, the issue is suppressed when the -O1 optimization level or higher is used. On x86_64 darwin, the linker failure in PR78077 occurs when the -O1 optimization level or higher is used.
Interestingly, the stock build of gcc 6.2.0 on x86_64 linux (with LTO plugin linker plugin support) runs into a different set of failures when building emacs 25.1 using '-O0 -flto'... CCLD etags /tmp/ccS55vep.ltrans4.ltrans.o: In function `skip_spaces.lto_priv.60': /home/howarth/emacs-25.1/build/lib-src/../../lib-src/etags.c:6677: undefined reference to `c_isspace' /tmp/ccS55vep.ltrans4.ltrans.o: In function `skip_non_spaces.lto_priv.71': /home/howarth/emacs-25.1/build/lib-src/../../lib-src/etags.c:6686: undefined reference to `c_isspace' ... /home/howarth/emacs-25.1/build/lib-src/../../lib-src/etags.c:1209: undefined reference to `rpl_optind' /home/howarth/emacs-25.1/build/lib-src/../../lib-src/etags.c:1263: undefined reference to `set_binary_mode' collect2: error: ld returned 1 exit status or using '-O2 -flto'... CCLD etags /tmp/ccaauRE2.ltrans1.ltrans.o: In function `strcaseeq': /home/howarth/emacs-25.1/build/lib-src/../../lib-src/etags.c:162: undefined reference to `c_strcasecmp' /home/howarth/emacs-25.1/build/lib-src/../../lib-src/etags.c:162: undefined reference to `c_strcasecmp' /tmp/ccaauRE2.ltrans1.ltrans.o: In function `main': ... /home/howarth/emacs-25.1/build/lib-src/../../lib-src/etags.c:174: undefined reference to `c_strncasecmp' /tmp/ccaauRE2.ltrans4.ltrans.o:/home/howarth/emacs-25.1/build/lib-src/../../lib-src/etags.c:174: more undefined references to `c_strncasecmp' follow collect2: error: ld returned 1 exit status
Note that these tests on linux used binutils-2.27.
LTO exposes certain classes of coding bugs. Ask firefox / libreoffice people. So as a start I assume these are all temacs bugs.
(In reply to Richard Biener from comment #3) > LTO exposes certain classes of coding bugs. Ask firefox / libreoffice > people. So as a start I assume these are all temacs bugs. I never got in touch with them; I guess we'll just assume this bug is actually with temacs then...