* Ralf Wildenhues wrote on Sun, Mar 28, 2010 at 05:33:44PM CEST: > > I'm still working on a patch to support -flto in libtool, it needs > changes in several places.
I have a preliminary(!) patch set here for LTO support in libtool. DO NOT submit this to your favorite distribution, it is not ready for general consumption yet. Several upstream issues to fix here: - gold bug http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42757 (common symbols not emitted with -fuse-linker-plugin) - GCC bug http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43576 (ICE w/ partial linking) - GCC bug http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43542 (segfault if __gnu_lto_v1 is referenced) - gold bug http://sourceware.org/bugzilla/show_bug.cgi?id=11182 (names in linker scripts in subdirs are relative to subdir) - GCC bug http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41584 (-fwhopr ICE with TU that contains no function) The patch set works around 43542. You need to wait until gold has bug 42757 fixed, or use the patch from that PR, or not use (a compiler that uses) gold for linking, because this bug causes a configure test to fail. Issues we need to coordinate with upstream: - conflicting declarations in symlist files, see also http://thread.gmane.org/gmane.comp.gcc.devel/112638 for this. - Do not parse too much from 'gcc -shared -v' output into postdep_objects, by grepping for the interesting line; see also http://thread.gmane.org/gmane.comp.gcc.devel/112719 for this. Especially the second issue will likely require a rework of the first patch in the series. With this patch series, using GCC + BFD ld and -flto in all compile flags, the only test failure is 18 'duplicate convenience archive names' due to GCC bug 43576. Using gold instead also lets pdemo-make fail after pdemo-conf, as well as most of the inner tests run from cmdline_wrap.at (105. Run tests with low max_cmd_len), all due to gold bug 11182. I'll reply (on libtool-patches@) with the actual patches. Thanks, Ralf