From: Shoaib Meenai Date: Tue, 6 Jun 2017 02:06:28 +0000 (+0000) Subject: [Driver] Don't force .exe suffix for lld X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6d3b995210ad0540ac6223bebbc158c1b1bb2425;p=clang [Driver] Don't force .exe suffix for lld 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 --- diff --git a/lib/Driver/ToolChains/MSVC.cpp b/lib/Driver/ToolChains/MSVC.cpp index 6f5f54165b..9e9d943610 100644 --- a/lib/Driver/ToolChains/MSVC.cpp +++ b/lib/Driver/ToolChains/MSVC.cpp @@ -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( diff --git a/test/Driver/cl-link.c b/test/Driver/cl-link.c index 4cc170c1cb..142725fed8 100644 --- a/test/Driver/cl-link.c +++ b/test/Driver/cl-link.c @@ -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