mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-03 00:20:40 +03:00
Fix default cross-linker for MSVC targets on non-Windows hosts (#3282)
Fixes an annoyance reported in #3281, affecting non-LLD-enabled builds as well as linker invocations involving LTO.
This commit is contained in:
parent
540d02376c
commit
cef4b3d6ef
1 changed files with 4 additions and 0 deletions
|
@ -247,8 +247,12 @@ int linkObjToBinaryMSVC(llvm::StringRef outputPath,
|
|||
// try to call linker
|
||||
std::string linker = opts::linker;
|
||||
if (linker.empty()) {
|
||||
#ifdef _WIN32
|
||||
// default to lld-link.exe for LTO
|
||||
linker = opts::isUsingLTO() ? "lld-link.exe" : "link.exe";
|
||||
#else
|
||||
linker = "lld-link";
|
||||
#endif
|
||||
}
|
||||
|
||||
return executeToolAndWait(linker, args, global.params.verbose);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue