This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
configuring gcc 4.6 to use gold for LTO plugin
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: gcc-help <gcc-help at gcc dot gnu dot org>
- Date: Tue, 7 Jun 2011 12:16:41 +0100
- Subject: configuring gcc 4.6 to use gold for LTO plugin
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?
Thanks.