[PATCH] D38290: Add a ld64.lld alias for the MACHO LLD target

Martell Malone via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 27 06:07:53 PDT 2017


martell updated this revision to Diff 116801.
martell added a comment.

address comment


Repository:
  rL LLVM

https://reviews.llvm.org/D38290

Files:
  tools/clang/lib/Driver/ToolChain.cpp
  tools/lld/tools/lld/CMakeLists.txt
  tools/lld/tools/lld/lld.cpp


Index: tools/lld/tools/lld/lld.cpp
===================================================================
--- tools/lld/tools/lld/lld.cpp
+++ tools/lld/tools/lld/lld.cpp
@@ -45,7 +45,7 @@
   return StringSwitch<Flavor>(S)
       .CasesLower("ld", "ld.lld", "gnu", Gnu)
       .CaseLower("link", WinLink)
-      .CaseLower("darwin", Darwin)
+      .CasesLower("ld64", "ld64.lld", "darwin", Darwin)
       .Default(Invalid);
 }
 
Index: tools/lld/tools/lld/CMakeLists.txt
===================================================================
--- tools/lld/tools/lld/CMakeLists.txt
+++ tools/lld/tools/lld/CMakeLists.txt
@@ -17,7 +17,7 @@
   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})
Index: tools/clang/lib/Driver/ToolChain.cpp
===================================================================
--- tools/clang/lib/Driver/ToolChain.cpp
+++ tools/clang/lib/Driver/ToolChain.cpp
@@ -390,7 +390,11 @@
     // then use whatever the default system linker is.
     return GetProgramPath(getDefaultLinker());
   } else {
-    llvm::SmallString<8> LinkerName("ld.");
+    llvm::SmallString<8> LinkerName;
+    if (Triple.isOSDarwin())
+      LinkerName.append("ld64.");
+    else
+      LinkerName.append("ld.");
     LinkerName.append(UseLinker);
 
     std::string LinkerPath(GetProgramPath(LinkerName.c_str()));


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D38290.116801.patch
Type: text/x-patch
Size: 1472 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170927/8427de57/attachment.bin>


More information about the cfe-commits mailing list