[PATCH] D30991: [Driver] Fix cross compiling with Visual Studio 2017

Hamza Sood via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 16 11:19:49 PDT 2017


hamzasood added a comment.

In https://reviews.llvm.org/D30991#702965, @thakis wrote:

> When you say "cross-compiling", you mean targeting Windows while running on non-Windows, right? How do dlls get loaded there at all?
>
> Also, when does clang invoke link.exe? Normally on Windows the linker is invoked directly, no through the compiler driver. Are you using clang.exe instead of clang-cl.exe?


Sorry, I should have been more specific. @zturner is correct, I meant using an x64 link.exe to build for x86 (or vice-versa).

The new 2017 toolchains are split up by host architecture and target architecture:
HostX64/x64. Native compilation. Compile for x64 on an x64 host.
HostX64/x86. Cross-compilation. Compile for x86 on an x64 host.
HostX86/x64. Cross-compilation. Compile for x64 on an x86 host
HostX86/x86. Native compilation. Compile for x86 on an x86 host.

The cross compiling toolchains (HostX64/x86, HostX86/x64) are incomplete as they rely on components containing in the corresponding native toolchains (e.g. HostX64/x86 uses components from HostX64/x64).
You can see this in the vcvars bat scripts supplied with Visual Studio. They setup %PATH% in the same way when cross-compiling.
mspdbcore.dll is an example of something missing from the cross-compiling toolchains. There are probably others but I didn't check.


https://reviews.llvm.org/D30991





More information about the cfe-commits mailing list