]> granicus.if.org Git - clang/commitdiff
[Driver] Don't force .exe suffix for lld
authorShoaib Meenai <smeenai@fb.com>
Tue, 6 Jun 2017 02:06:28 +0000 (02:06 +0000)
committerShoaib Meenai <smeenai@fb.com>
Tue, 6 Jun 2017 02:06:28 +0000 (02:06 +0000)
When cross-compiling to Windows using lld, we want the driver to invoke
it as lld-link rather than lld-link.exe. On Windows, the LLVM fs
functions take care of adding the .exe suffix where necessary, so we can
just drop the addition in the toolchain entirely.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304761 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/ToolChains/MSVC.cpp
test/Driver/cl-link.c

index 6f5f54165b3b243fc6b260c1bc0901be1000e6e1..9e9d943610beeba4b5a8ee94b0afc59d9ee40dbf 100644 (file)
@@ -529,9 +529,7 @@ void visualstudio::Linker::ConstructJob(Compilation &C, const JobAction &JA,
   SkipSettingEnvironment:;
 #endif
   } else {
-    linkPath = Linker;
-    llvm::sys::path::replace_extension(linkPath, "exe");
-    linkPath = TC.GetProgramPath(linkPath.c_str());
+    linkPath = TC.GetProgramPath(Linker.str().c_str());
   }
 
   auto LinkCmd = llvm::make_unique<Command>(
index 4cc170c1cbb8a5b00256fe5576c74edd541f4da1..142725fed8eb2ee1b0265460495a4eb3fd632224 100644 (file)
@@ -56,4 +56,4 @@
 // NONEXISTENT: nonexistent
 
 // RUN: %clang_cl /Tc%s -fuse-ld=lld -### 2>&1 | FileCheck --check-prefix=USE_LLD %s
-// USE_LLD: lld-link.exe
+// USE_LLD: lld-link