forcing the linker to be a particular one (i.e. gold vs bfd)
Marc Glisse
marc.glisse@inria.fr
Sun Oct 10 19:25:00 GMT 2010
On Sun, 10 Oct 2010, Basile Starynkevitch wrote:
> I am a mostly happy user of the GOLD binutils linker (thanks Ian!) and
> it is the default /usr/bin/ld on my Debian/Testing system.
>
> However, in some occasions, it could be useful to use another linker
> (ie the plain BFD one).
[...]
> Of course, one can always force ld to be a particular linker (i.e. the
> BFD one on a system where the default is GOLD, or vice versa) with ugly
> $PATH and symlink tricks. But that is ugly.
>
> Wouldn't it be sensible to provide a gcc switch to force a particular
> ld to be used? Something like CC='gcc -fforce-ld=/usr/bin/ld.bfd' ?
> Or, if there is some other way (excluding dirty PATH manipuation),
> document it better perhaps in
> http://gcc.gnu.org/onlinedocs/gcc/Link-Options.html#Link-Options
On Debian (since this is the system you mention), you can just use:
gcc -B/usr/lib/compat-ld
gcc -B/usr/lib/gold-ld
to select the ld you want.
--
Marc Glisse
More information about the Gcc
mailing list