From: Martell Malone Date: Sun, 15 Oct 2017 17:53:45 +0000 (+0000) Subject: Driver: use ld64.lld when -fuse-ld=lld for darwin X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=432111cbd3a937e0577a5b12407829370206ca7f;p=clang Driver: use ld64.lld when -fuse-ld=lld for darwin 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. This is the clang driver component change to use this new alias. Reviewers: ruiu, rnk Differential Revision: https://reviews.llvm.org/D38290 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315867 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Driver/ToolChain.cpp b/lib/Driver/ToolChain.cpp index de23bf6f3e..593cd82038 100644 --- a/lib/Driver/ToolChain.cpp +++ b/lib/Driver/ToolChain.cpp @@ -390,7 +390,11 @@ std::string ToolChain::GetLinkerPath() const { // 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()));