[PATCH] --enable-gold=both

Matthias Klose doko@ubuntu.com
Fri Oct 16 09:06:00 GMT 2009


On 16.10.2009 08:08, Ian Lance Taylor wrote:
> Roland McGrath<roland@redhat.com>  writes:
>
>> This lets you configure with --enable-gold=both to build both ld and gold.
>> It installs them as "ld.bfd" and "ld.gold" respectively, making "ld" a
>> symlink to ld.bfd.  This is a good fit for e.g. packaging for systems using
>> the "alternatives" mechanism to switch /usr/bin/ld between the two at will.
>
> Perhaps we should build ld even with --enable-gold=yes, but symlink ld
> to ld.gold.  Perhaps we should install only gold if we use
> --enable-gold=only, or something like that.

Having the option to build both together is nice.

> One issue with the approach you propose is that there is no simple way
> to have gcc invoke ld.  What we do internally here is install GNU ld
> in a directory named compat-ld.  It then becomes possible to use gcc
> with the option -B .../compat-ld/ in order to use the GNU linker
> instead of gold.  In order to make that work, the binaries have to
> have the name "ld" or "real-ld", without the suffixes.
>
> Anybody else have a different approach to suggest?

When relying on a -B option it becomes difficult for e.g. configure scripts to 
get to the ld/gold version wanted, as it's installed in a separate path, which 
is not standardized. Passing an option gcc without a specific location would be 
preferred from my point of view.

   Matthias



More information about the Binutils mailing list