configuring gcc 4.6 to use gold for LTO plugin

Jonathan Wakely jwakely.gcc@gmail.com
Tue Jun 7 13:39:00 GMT 2011


On 7 June 2011 12:16, Jonathan Wakely wrote:
> I installed binutils with --enable-gold=default then I configured gcc
> 4.6-20110520 with the same prefix as the newly installed binutils.
>
> config.log shows:
>
> configure:13814: checking where to find the target ld
> configure:13842: result: pre-installed in
> /home/wakelj/tools/Linux-x86_64/lto/x86_64-unknown-linux-gnu/bin
>
> and gcc/config.log shows:
>
> configure:21077: checking whether we are using gold
> configure:21086: result: yes
> configure:21097: checking what linker to use
> configure:21122: result:
> /home/wakelj/tools/Linux-x86_64/lto/x86_64-unknown-linux-gnu/bin/ld
>
> So it has found the desired binutils and $ld_is_gold=yes, but:
>
> configure:23116: checking linker plugin support
> configure:23136: result: no
>
> This is because I don't have an in-tree ld and "ld --version 2>&1 |
> fgrep plugin-opt" fails, so $gcc_cv_lto_plugin=no
>
> So will this gcc use a linker plugin?
>
> It looks like I could get it to by adding
> --with-plugin-ld=blahblah/ld.bfd but then it uses ld.bfd not gold.
>
> The test in gcc/configure on trunk is completely different and seems
> to do what I expected (setting $gcc_cv_lto_plugin=yes based on the
> version of ld/gold being used, not on whether grepping for plugin-opt
> works)
>
> If I want to use 4.6+LTO+plugin do I need an in-tree gold, or don't use gold?
>
> And if I don't have an in-tree binutils but want gold+LTO+plugin I
> need to use 4.7?

Oh ... or does all that configury only affect whether
-fuse-linker-plugin is enabled by default, and I can make it work with
gold by using -fuse-linker-plugin on the command line when I use
-flto?



More information about the Gcc-help mailing list