Page MenuHomePhabricator

Please use GitHub pull requests for new patches. Phabricator shutdown timeline

Implement the -fuse-ld= option.

Authored by logan on Jun 25 2014, 11:07 AM.



This commit implements the -fuse-ld= option, so that the user
can specify -fuse-ld=bfd to use ld.bfd.

This commit re-applies r194328 with some test case changes.
It seems that r194328 was breaking macosx or mingw build
because clang can't find ld.bfd or in the given sysroot.
We should use -B to specify the executable search path instead.

Patch originally by David Chisnall.

Diff Detail

Event Timeline

logan updated this revision to Diff 10842.Jun 25 2014, 11:07 AM
logan retitled this revision from to Implement the -fuse-ld= option..
logan updated this object.
logan edited the test plan for this revision. (Show Details)
logan added reviewers: theraven, rafael.
logan added a subscriber: Unknown Object (MLST).

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 ( 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 or
ld.bfd, they're perfect!


Hi Tim,

AFAIK, the naming convention is something like "ld."+name, e.g.

  • ld.bfd for BFD linker
  • for Gold
  • ld.mcld for MCLinker

Thus, it won't be the problem for these linkers. Although, I am not sure
about lld.

Alternatively, I can slightly extend this option to search both the given
name and "ld."+name. However, I am not sure whether this is a good idea or


emaste added a subscriber: emaste.Jun 25 2014, 12:31 PM
logan accepted this revision.Jun 26 2014, 7:37 AM
logan added a reviewer: logan.
This revision is now accepted and ready to land.Jun 26 2014, 7:37 AM
logan closed this revision.Jun 26 2014, 7:37 AM

Thanks for your review. Committed as rL211785. I will monitor the buildbots tonight. :-)