[PATCH] Support -fuse-ld=bfd and -fuse-ld=gold

Matthias Klose doko@ubuntu.com
Thu Nov 29 15:50:00 GMT 2012


Am 29.11.2012 09:43, schrieb Richard Biener:
> Do we need to consider GNU ld and gold coming from different binutils versions
> and thus do we need two sets of linker feature tests at configure
> time?

both GNU ld and gold are built from the same sources. So it is likely that they
come from the same binutils version (at least that is the current situation).

> Eventually
> also if GNU ld and gold are not in feature-parity for the same binutils version?
> 
> That is, isn't this going to create hard to debug issues for users?

How would that be different than today's issues? If both versions are built,
then any of them can be picked up once these are installed.

How is today's situation? Debian/Ubuntu do build both linkers (and I assume
other distributions do as well).

One is the default (currently GNU ld), and you can make the other the system
wide default using diversions (a distribution mechanism to change /usr/bin/ld).

I have:

$ ls -l /usr/lib/*-ld
/usr/lib/compat-ld:
lrwxrwxrwx 1 root root 16 Nov 26 08:13 ld -> ../../bin/ld.bfd

/usr/lib/gold-ld:
lrwxrwxrwx 1 root root 17 Nov 26 08:13 ld -> ../../bin/ld.gold

so to explicitly use one linker you have to know the location, and then pass the
appropriate -B option. Having this option makes this choice independent of the
location. Having this location independence is my rationale for this patch.

  Matthias



More information about the Gcc-patches mailing list