[PATCH] Implement the -fuse-ld= option.

Logan Chien tzuhsiang.chien at gmail.com
Thu Jun 26 07:18:08 PDT 2014


Is it OK to commit this?  Thanks.


On Thu, Jun 26, 2014 at 4:01 PM, David Chisnall <David.Chisnall at cl.cam.ac.uk
> wrote:

> On 25 Jun 2014, at 19:20, Tim Northover <t.p.northover at gmail.com> wrote:
> >> It's a bit binutils-centric isn't it? Can't we make it accept a
> >> basename instead, so that any new or otherwise odd (ld.gold-2.25? lld?
> >> mclinker?) linker can be used instead without modifying Clang.
> >
> > *Sigh*. Apologies. I've just noticed this comes from GCC land, so
> > we've probably got to follow for compatibility. After all, why would
> > anyone want to use anything except the system-default ld.gold or
> > ld.bfd, they're perfect!
> The gcc version hard-codes gold and bfd as the two valid options.  My
> patch, which Logan has cleaned up and fixed, allows --fuse-ld= to take a
> string and then searches for a program called ld.{whatever the argument
> string was}.  This means that you can install lld and create an ld.lld->lld
> symlink and have -fuse-ld=lld work without having to change the clang code.
> In discussion when I wrote this patch, the consensus was that we should
> (initially, at least), only support linkers that had command-line syntax
> compatible with the system linker via this option.  If the linker needs
> different arguments, then some more invasive changes are required.  This
> should be enough for users to switch between bfd ld, gold, lld, and
> mclinker, however (and hopefully bold once it is released) on ELF platforms.
> David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140626/25749df1/attachment.html>

More information about the cfe-commits mailing list