This is an archive of the discontinued LLVM Phabricator instance.

If lld binary is named "ld" on darwin system, use darwin driver
ClosedPublic

Authored by kledzik on Sep 3 2014, 3:07 PM.

Details

Summary

To start qualifying lld for iOS and MacOSX, we'd like to make a drop in replacement for /usr/bin/ld (which is now buried inside Xcode.app). But the existing lld is not a drop in replacement because it requires "-flavor darwin" and the thousands of existing projects don't know to add that. We also cannot rename the lld binary to have "darwin" in the name (which the universal driver and pick up on) because existing projects invoke "ld".

My revised proposal is to check if the binary is named "ld" and was built on a darwin system, if so, use darwin driver.

Diff Detail

Event Timeline

kledzik updated this revision to Diff 13226.Sep 3 2014, 3:07 PM
kledzik retitled this revision from to Add CMake rules for lld-darwin.
kledzik updated this object.
kledzik edited the test plan for this revision. (Show Details)
kledzik added reviewers: Bigcheese, ruiu, t.p.northover.
kledzik added a project: lld.
kledzik added a subscriber: Unknown Object (MLST).
ruiu edited edge metadata.Sep 3 2014, 3:16 PM

I'm OK with this approach, but the other approach would be to
make "ld" smarter. The name "ld" is currently mapped to gnu_ld
but it's deprecated, so we can replace it with a dispatcher which
dispatch according to the system -- to darwin if compiled for Darwin
and gnu_ld for other Unices. Then you don't need to rename
lld-drawin to ld when installing.

kledzik updated this revision to Diff 13231.Sep 3 2014, 3:53 PM
kledzik retitled this revision from Add CMake rules for lld-darwin to If lld binary is named "ld" on darwin system, use darwin driver.
kledzik updated this object.
kledzik edited edge metadata.
ruiu accepted this revision.Sep 3 2014, 3:58 PM
ruiu edited edge metadata.

LGTM

This revision is now accepted and ready to land.Sep 3 2014, 3:58 PM
shankarke accepted this revision.Sep 3 2014, 4:14 PM
shankarke added a reviewer: shankarke.
kledzik closed this revision.Sep 3 2014, 5:15 PM

committed in r217112