[PATCH] Add CMake rules for lld-darwin

Nick Kledzik kledzik at apple.com
Wed Sep 3 15:56:14 PDT 2014

On Sep 3, 2014, at 3:40 PM, Rui Ueyama <ruiu at google.com> wrote:
> On Wed, Sep 3, 2014 at 3:33 PM, Nick Kledzik <kledzik at apple.com> wrote:
> On Sep 3, 2014, at 3:25 PM, Chandler Carruth <chandlerc at google.com> wrote:
>> On Wed, Sep 3, 2014 at 3:16 PM, Rui Ueyama <ruiu at google.com> wrote:
>> 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.
>> Personally, I think it makes sense when the binary name is 'ld' to pick the default flavor based on the host. It still allows cross compiling toolchains to use a triple-prefixed '...-ld' binary name to default to their desired target.
> Interesting.  So we special case if the binary name (really argv[0]) is “ld” to look at the host.  If the binary is named “lld” (or any triple) then the current behavior remains.  

I changed the patch at:
to do that.

One question: do we have a better test host test than “#if __APPLE__”?  I did not see anything like LLVM_ON_UNIX that is constructed at configure time.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140903/cd8ddd52/attachment.html>

More information about the llvm-commits mailing list