This is an archive of the discontinued LLVM Phabricator instance.

Implement the -fuse-ld= option.
ClosedPublic

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

Details

Summary

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 ld.gold 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 (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!

Tim.

Hi Tim,

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

  • ld.bfd for BFD linker
  • ld.gold 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
not.

Sincerely,
Logan

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. :-)