On Wed, Jan 13, 2016 at 02:02:42PM +0400, John Frankish wrote:
> >>>> Isn't this the same as compiling with CC="gcc -flto 
> >>>> -fuse-linker-plugin.."?
> >>>>
> >>>> If so, maybe just this could be mentioned.
> >>>>
> >>> Nope, two completely different animals. gold is a new linker that was 
> >>> introduced to binutils in 2008.
> >>> LTO (Link-time Optimization) was a feature that was introduced to GCC 
> >>> fairly recently...
> >>>
> >> Thanks for the clarification and links to further reading.
> >>
> >> Can you use ld-gold and lto together?
> >>
> >>
> > Yes. And sorry, I meant to find this link include it in my previous email 
> > as well.
> > https://gcc.gnu.org/wiki/LinkTimeOptimization.
> >
> Thanks.
> 
> After compiling binutils with "--enable-gold --enable-plugins" (ld.gold fails 
> without --enable-plugins) and gcc with "--enable-gold", the following seems 
> to work fine:
> 
> CC="gcc -fuse-ld=gold -flto -fuse-linker-plugin.." configure ...
> 
Just a minor update on gold : with binutils-2.26 the gold testsuite
needs static libstdc++.a and libpthread.a (as well as libz.a for the
existing testsuite) - trying this on a completed 7.8 system with
gcc-5.2.0, all tests for gold pass (228 and 3).

I also came across posts recording a massive improvement in link
times for webkit.  One of those posts said that the gtk buildbots
for webkit were forcing gold by putting /usr/lib/gold-ld/ at the
front of the PATH - but on a stock install binutils does not create
that.  Probably, the same can be achieved (for testing) by creating
/usr/bin/gold/ld as a symlink and then altering $PATH for the test
runs (those of us with a lot of scripts probably don't want to hack
the correct CC= into each script).

ĸen
-- 
This email was written using 100% recycled letters.
-- 
http://lists.linuxfromscratch.org/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to