[PATCH] D98493: [WoA][MSVC] Use default linker setting in MSVC-compatible driver
Maxim Kuvyrkov via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Mar 12 05:11:01 PST 2021
maxim-kuvyrkov created this revision.
maxim-kuvyrkov requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
At the moment "link.exe" is hard-coded as default linker in MSVC.cpp,
so there's no way to use LLD as default linker for MSVC driver.
This patch adds checking of CLANG_DEFAULT_LINKER to MSVC.cpp.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D98493
Files:
clang/lib/Driver/ToolChains/MSVC.cpp
Index: clang/lib/Driver/ToolChains/MSVC.cpp
===================================================================
--- clang/lib/Driver/ToolChains/MSVC.cpp
+++ clang/lib/Driver/ToolChains/MSVC.cpp
@@ -577,7 +577,9 @@
// translate 'lld' into 'lld-link', and in the case of the regular msvc
// linker, we need to use a special search algorithm.
llvm::SmallString<128> linkPath;
- StringRef Linker = Args.getLastArgValue(options::OPT_fuse_ld_EQ, "link");
+ StringRef Linker = Args.getLastArgValue(options::OPT_fuse_ld_EQ, CLANG_DEFAULT_LINKER);
+ if (Linker.empty())
+ Linker = "link";
if (Linker.equals_lower("lld"))
Linker = "lld-link";
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98493.330213.patch
Type: text/x-patch
Size: 658 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210312/422e1a86/attachment.bin>
More information about the cfe-commits
mailing list