This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: PATCH: Support --enable-gold=both --with-linker=[bfd|gold]
- From: Roland McGrath <roland at redhat dot com>
- To: Ian Lance Taylor <iant at google dot com>
- Cc: "H.J. Lu" <hjl dot tools at gmail dot com>, binutils at sourceware dot org, gcc at gcc dot gnu dot org
- Date: Tue, 5 Jan 2010 13:11:55 -0800 (PST)
- Subject: Re: PATCH: Support --enable-gold=both --with-linker=[bfd|gold]
- References: <20091102220634.GA21976@lucon.org> <6dc9ffc80911031419k53995085ib14214227979a55e@mail.gmail.com> <20091103222302.8D1AD71C3@magilla.sf.frob.com> <6dc9ffc80911031528v73b398f1s98e76a85baf9f56b@mail.gmail.com> <mcr8wccfjz1.fsf@dhcp-172-17-9-151.mtv.corp.google.com>
> 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