PATCH: Support --enable-gold=both --with-linker=[bfd|gold]
Roland McGrath
roland@redhat.com
Tue Jan 5 21:12:00 GMT 2010
> I'm still not entirely convinced that this is the way to go. It seems
> to me that ideally one wants to be able to select the linker at
> runtime. I don't see how this patch supports that. What am I
> missing?
It covers the first step by letting you run "ld.bfd" or "ld.gold" to
choose. Having the two binaries installed by those names is a good start
and seems likely to be part of how any fancier plan would work, so why not
start there?
This setup is compatible with using "alternatives" to switch a $(bindir)/ld
symlink. Using "alternatives" is outside the scope of what 'make install'
should do, so having it install a plain symlink makes sense. Packagers
will drop the ld symlink and do their own thing. (This is exactly what we
are doing now in Fedora >= 13.)
Another obvious approach is to add a wrapper script for $(bindir)/ld that
groks an argument like --gold or --bfd to choose which real ld to run.
That could be used by hand and by gcc -Wl,--gold, etc. That is also fine
by me. But it requires inventing some new plan for where the system-wide
default is configured. IMHO it seems better just to leave that sort of
thing to packagers.
Thanks,
Roland
More information about the Gcc
mailing list