[lld] r315865 - MACHO: ld64.lld alias for the MACHO LLD target

Martell Malone via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 15 10:41:20 PDT 2017


Author: martell
Date: Sun Oct 15 10:41:20 2017
New Revision: 315865

URL: http://llvm.org/viewvc/llvm-project?rev=315865&view=rev
Log:
MACHO: ld64.lld alias for the MACHO LLD target

When using lld on macOS the current level of detection between ld and
ld64 forces us to rename lld to ld.

For ELF targets we have the ld.lld alias so for MACHO we should have
ld64.lld so we can use lld without replacing the system compiler.

This also solves the additional issue of cross compiling for MACHO
where renaming lld to ld with only target ELF.

The clang driver component changes will be in a follow-up commit.

Reviewers: ruiu, rnk

Differential Revision: https://reviews.llvm.org/D38290

Modified:
    lld/trunk/tools/lld/CMakeLists.txt
    lld/trunk/tools/lld/lld.cpp

Modified: lld/trunk/tools/lld/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/tools/lld/CMakeLists.txt?rev=315865&r1=315864&r2=315865&view=diff
==============================================================================
--- lld/trunk/tools/lld/CMakeLists.txt (original)
+++ lld/trunk/tools/lld/CMakeLists.txt Sun Oct 15 10:41:20 2017
@@ -17,7 +17,7 @@ install(TARGETS lld
   RUNTIME DESTINATION bin)
 
 if(NOT LLD_SYMLINKS_TO_CREATE)
-  set(LLD_SYMLINKS_TO_CREATE lld-link ld.lld)
+  set(LLD_SYMLINKS_TO_CREATE lld-link ld.lld ld64.lld)
 endif()
 
 foreach(link ${LLD_SYMLINKS_TO_CREATE})

Modified: lld/trunk/tools/lld/lld.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/tools/lld/lld.cpp?rev=315865&r1=315864&r2=315865&view=diff
==============================================================================
--- lld/trunk/tools/lld/lld.cpp (original)
+++ lld/trunk/tools/lld/lld.cpp Sun Oct 15 10:41:20 2017
@@ -45,7 +45,7 @@ static Flavor getFlavor(StringRef S) {
   return StringSwitch<Flavor>(S)
       .CasesLower("ld", "ld.lld", "gnu", Gnu)
       .CaseLower("link", WinLink)
-      .CaseLower("darwin", Darwin)
+      .CasesLower("ld64", "ld64.lld", "darwin", Darwin)
       .Default(Invalid);
 }
 




More information about the llvm-commits mailing list