dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
14.55k stars 4.54k forks source link

Building runtime on ARM64 uses x86 tools? #96141

Open vcsjones opened 6 months ago

vcsjones commented 6 months ago

When I build the runtime on an ARM64 Windows machine using .\build.cmd -rc release -s clr (and cleaning artifacts first), I noticed it using native compilation tools from C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\bin\Hostx86\arm64.

According to the task manager, the compiler and linker tooling in this directory is x86, so it's using emulation.

I would expect the build to use tools in the directory C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\bin\Hostarm64\arm64

Which contains native ARM64 build tools.

When I forced the build to use the native ARM64 tooling, there is a non-trivial performance improvement in compilation speed. The ARM64 tooling takes 8m52s whereas the x86 tooling takes 13m21s.

ghost commented 6 months ago

Tagging subscribers to this area: @dotnet/runtime-infrastructure See info in area-owners.md if you want to be subscribed.

Issue Details
When I build the runtime on an ARM64 Windows machine using `.\build.cmd -rc release -s clr` (and cleaning artifacts first), I noticed it using native compilation tools from `C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\bin\Hostx86\arm64`. According to the task manager, the compiler and linker tooling in this directory is x86, so it's using emulation. I would expect the build to use tools in the directory `C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\bin\Hostarm64\arm64` Which contains native ARM64 build tools. When I forced the build to use the native ARM64 tooling, there is a non-trivial performance improvement in compilation speed. The ARM64 tooling takes 8m52s whereas the x86 tooling takes 13m21s.
Author: vcsjones
Assignees: -
Labels: `area-Infrastructure`
Milestone: -
jkotas commented 6 months ago

Related #76516