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.
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?