SYMPTOM) # grep -B 3 Error 1367883332-install-x11-libs_gtkglext-1.2.0-r1:0::gentoo.out /usr/bin/nm -B .libs/gdkglversion.o .libs/gdkglinit.o .libs/gdkglquery.o .libs/gdkglconfig.o .libs/gdkglcontext.o .libs/gdkgldrawable.o .libs/gdkglpixmap.o .libs/gdkglwindow.o .libs/gdkglshapes.o .libs/gdkglglext.o .libs/gdkglenumtypes.o x11/.libs/libgdkglext-x11.a | | /bin/sed 's/.* //' | sort | uniq > .libs/libgdkglext-x11-1.0.exp ../libtool: eval: line 4394: syntax error near unexpected token `|' ../libtool: eval: line 4394: `/usr/bin/nm -B .libs/gdkglversion.o .libs/gdkglinit.o .libs/gdkglquery.o .libs/gdkglconfig.o .libs/gdkglcontext.o .libs/gdkgldrawable.o .libs/gdkglpixmap.o .libs/gdkglwindow.o .libs/gdkglshapes.o .libs/gdkglglext.o .libs/gdkglenumtypes.o x11/.libs/libgdkglext-x11.a | | /bin/sed 's/.* //' | sort | uniq > .libs/libgdkglext-x11-1.0.exp' make[4]: *** [libgdkglext-x11-1.0.la] Error 2 ANALYSIS) - there is an empty pipe command between two consecutive pipe operators - .. caused by configure-generated ./libtool # grep -r global_symbol_pipe /var/tmp/paludis/x11-libs-gtkglext-1.2.0-r1/work/gtkglext-1.2.0/libtool [...] global_symbol_pipe="" export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols" - .... caused by a failed test in configure 1.2.0/config.log configure:5912: checking command to parse /usr/bin/nm -B output from x86_64-pc-linux-gnu-gcc object configure:6017: x86_64-pc-linux-gnu-gcc -c -march=native -pipe -O2 -mfpmath=sse -flto=4 -floop-block -floop-interchange -floop-strip-mine -fuse-linker-plugin conftest.c >&5 configure:6020: $? = 0 configure:6024: /usr/bin/nm -B conftest.o \| sed -n -e 's/^.*[ ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[ ][ ]*\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2 \2/p' \> conftest.nm configure:6027: $? = 0 configure:6079: x86_64-pc-linux-gnu-gcc -o conftest -march=native -pipe -O2 -mfpmath=sse -flto=4 -floop-block -floop-interchange -floop-strip-mine -fuse-linker-plugin -march=native -pipe -O2 -mfpmath=sse -flto=4 -floop-block -floop-interchange -floop-strip-mine -fuse-linker-plugin -Wl,--as-needed -Wl,-O1 -Wl,--hash-style=gnu -Wl,--sort-common conftest.c conftstm.o >&5 In file included from :0:0: conftest.c:7:12: error: function 'nm_test_func' redeclared as variable In file included from conftest.c:24:0, from :0: conftest.c:5:6: note: previously declared here In file included from :0:0: conftest.c:6:12: warning: type of 'nm_test_var' does not match original declaration [enabled by default] In file included from conftest.c:24:0, from :0: conftest.c:4:6: note: previously declared here lto1: fatal error: errors during merging of translation units compilation terminated. lto-wrapper: /usr/x86_64-pc-linux-gnu/gcc-bin/4.7.2/x86_64-pc-linux-gnu-gcc returned 1 exit status /usr/lib/gcc/x86_64-pc-linux-gnu/4.7.2/../../../../x86_64-pc-linux-gnu/bin/ld: fatal error: lto-wrapper failed collect2: error: ld returned 1 exit status configure:6082: $? = 1 configure:6017: x86_64-pc-linux-gnu-gcc -c -march=native -pipe -O2 -mfpmath=sse -flto=4 -floop-block -floop-interchange -floop-strip-mine -fuse-linker-plugin conftest.c >&5 configure:6020: $? = 0 configure:6024: /usr/bin/nm -B conftest.o \| sed -n -e 's/^.*[ ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[ ][ ]*_\([_A-Za-z][_A-Za-z0-9]*\)$/\1 _\2 \2/p' \> conftest.nm configure:6027: $? = 0 cannot find nm_test_var in conftest.nm configure:6117: result: failed - ...... caused by the different type gcc links the compilation units conftest.c conftstm.o when LTO is used conftest.c:7:12: error: function 'nm_test_func' redeclared as variable CURE) The test program will succeed/survive LTO compilation, if 'nm_test_func' is not redeclared as a variable, but as a function. There is architecture specific code in configure that already does exactly this, we can reuse it. The following changes are sed'd using the ebuild patch attached. The patch listed here is to demonstrate what is done. Note that configure is ONLY patched, IF flto is detected within at least one of {C,CXX,LD}FLAGS. --- configure 2006-02-05 04:17:47.000000000 +0100 +++ /dev/fd/63 2013-05-08 00:52:11.964616992 +0200 @@ -5948,9 +5948,10 @@ linux*) if test "$host_cpu" = ia64; then symcode='[ABCDGIRSTW]' + fi + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' Have fun closing this as invalid. However, if you decide to give early adopters of lto a chance by applying the patch, note that sed will only effect configure IF flto is detected within at least one of {C,CXX,LD}FLAGS. This way, gentooers not using flto will compile vanilla code. Imho this should be safe enough to start supporting it. Reproducible: Always
Created attachment 347664 [details, diff] gtkglext-1.2.0-r1.ebuild.patch See first comment to see the diff between vanilla and sed'd configure produced by the updated ebuild attached.
Created attachment 347666 [details] build log -flto on stock ebuild 1367883332-install-x11-libs_gtkglext-1.2.0-r1:0::gentoo.out
(In reply to cmuelle8 from comment #1) > Created attachment 347664 [details, diff] [details, diff] > gtkglext-1.2.0-r1.ebuild.patch > > See first comment to see the diff between vanilla and sed'd configure > produced by the updated ebuild attached. Not sure if this is the right fix for LTO issues :/
Also, the patches need to change configure.ac/in, not final configure
As seen in pertinent bug report, this needs to be solved in libtool side, not for every package with wrongly generated files due libtool bug *** This bug has been marked as a duplicate of bug 324107 ***