Bug 1412952: We want a HostX64 linker even with 32-bit clang-cl.exe. r=froydnj

32-bit clang-cl.exe was looking specifically for HostX86\x86\link.exe, which doesn't exist in our automation package. Make it look in HostX64\x86 instead.

This is an ugly hack and it would be preferable to just use a 64-bit compiler (bug 1414287).
This commit is contained in:
David Major 2017-11-03 12:29:58 -04:00
parent b7a86dd2b5
commit d250e3678b
2 changed files with 18 additions and 0 deletions

View File

@ -12,6 +12,7 @@
"cc": "cl.exe",
"cxx": "cl.exe",
"patches": [
"build/src/build/build-clang/msvc-host-x64.patch",
"build/src/build/build-clang/loosen-msvc-detection.patch"
]
}

View File

@ -0,0 +1,17 @@
When looking for a linker, 32-bit clang-cl.exe wants to use the 32-bit-native link.exe located in Hostx86/x86, but this executable does not exist in our releng package, because we only use 64-bit-host toolchains.
This patch makes clang-cl use the Hostx64/x86 linker instead. Ideally we wouldn't be using 32-bit clang-cl.exe in the first place. Bug 1414287 is on file to do so and remove this hack.
diff --git a/clang/lib/Driver/ToolChains/MSVC.cpp b/clang/lib/Driver/ToolChains/MSVC.cpp
--- a/clang/lib/Driver/ToolChains/MSVC.cpp
+++ b/clang/lib/Driver/ToolChains/MSVC.cpp
@@ -817,8 +816,7 @@
switch (Type) {
case SubDirectoryType::Bin:
if (VSLayout == ToolsetLayout::VS2017OrNewer) {
- const bool HostIsX64 =
- llvm::Triple(llvm::sys::getProcessTriple()).isArch64Bit();
+ const bool HostIsX64 = true;
const char *const HostName = HostIsX64 ? "HostX64" : "HostX86";
llvm::sys::path::append(Path, "bin", HostName, SubdirName);
} else { // OlderVS or DevDivInternal