Fix DacTableGen build on Windows ARM64#49093
Conversation
…ersion of DacTableGen.exe with x64 version of msdia140.dll, which resulted in a BadImageFormatException.
|
Tagging subscribers to this area: @tommcdon Issue DetailsBuilding Runtime on a Windows ARM64 machine would produce the ARM64 version of
|
|
The failure in the test is # 45326. |
|
With this change, an x86 build ends up with this if it uses the global dotnet (x64). We always tend to use amd64. I aggree with the ARM64 part though, as long as you're not doing x86 emulation (are you using the native SDK)? |
|
@hoyosjs Could you please provide more details on your scenario? |
|
.\build.cmd Clr.DacTools+Clr.Runtime -rc release -arch x86 when BuildArchitecture is x86. However, I realized to get there users most likely need to go out of their way. There's also enough testing in place anyway such that if this regresses the official build, we would notice it (not in PR), so this feels OK. All the caveats for this are by setting BuildArchitecture (say x86 to try and force the use of a particular architecture under ARM64 emulation). On second thought this is already problematic in several places. |
|
With this, are you able to drive the full build on ARM64 with an ARM64 SDK? |
To build ARM64 on an ARM64 machine, we also need to resolve a couple of issues with crossgen2 and build-runtime.cmd, which forces building and using x64 binaries even when running on ARM64: runtime/src/coreclr/build-runtime.cmd Lines 230 to 233 in add68df We need to check the true machine architecture, and if it is ARM64, we should not set cross-building variables for the tools we build ourselves. |
Building Runtime on a Windows ARM64 machine would produce the ARM64 version of
DacTableGen.exewith the x64 version ofmsdia140.dll, which would result in aBadImageFormatException. The fix is to copy the correct version ofmsdia140.dll. Below is the tree structure of the%VSINSTALLDIR%DIA SDK\BINdirectory: