Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building runtime on Windows 11 ARM machine targetting x64 #101668

Closed
quantumhu opened this issue Apr 29, 2024 · 6 comments
Closed

Building runtime on Windows 11 ARM machine targetting x64 #101668

quantumhu opened this issue Apr 29, 2024 · 6 comments

Comments

@quantumhu
Copy link

Hi!

I have a Surface ARM device running Windows 11. I read the docs explaining how to build from source and how to cross-compile but the cross-compile docs assume the Windows host machine is x64 and is targetting arm64. Is there a way to do the opposite? I tried passing the -x64 flag to the build.cmd command but I ran into several errors.

Thank you in advance!

@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Apr 29, 2024
Copy link
Contributor

Tagging subscribers to this area: @hoyosjs
See info in area-owners.md if you want to be subscribed.

@huoyaoyuan
Copy link
Member

Does -platform x64 work?

@quantumhu
Copy link
Author

Hi, I tried build.cmd -s clr -arch x64 -platform x64 as well as build.cmd -s clr -platform x64 with a git clean -xdf in between, no luck.

@vcsjones
Copy link
Member

I just gave this a shot on my DevKit with .\build.cmd -s clr -arch x64 and it failed with

  C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\xmmintrin.h(27): fatal error C1189: #error:  This header is specific to X86, X64, ARM64, and ARM64EC targets
  [92/525] Building CXX object utilcode\CMakeFiles\utilcode_dac.dir\format1.cpp.obj
  [93/525] Building CXX object utilcode\CMakeFiles\utilcode_dac.dir\sha1.cpp.obj
  [94/525] Building CXX object utilcode\CMakeFiles\utilcode_dac.dir\prettyprintsig.cpp.obj
  [95/525] Building CXX object utilcode\CMakeFiles\utilcode_dac.dir\sigparser.cpp.obj
  [96/525] Building CXX object jit\CMakeFiles\clrjit_win_x64_arm64.dir\cmake_pch.cxx.obj
  [97/525] Building CXX object utilcode\CMakeFiles\utilcode_dac.dir\sigbuilder.cpp.obj
  [98/525] Building CXX object utilcode\CMakeFiles\utilcode_dac.dir\loaderheap.cpp.obj
  [99/525] Building CXX object utilcode\CMakeFiles\utilcode_dac.dir\sstring.cpp.obj
  [100/525] Building CXX object utilcode\CMakeFiles\utilcode_dac.dir\util_nodependencies.cpp.obj

...

E:\code\runtime\src\coreclr\runtime.proj(94,5): error MSB3073: The command ""E:\code\runtime\src\coreclr\build-runtime.
cmd" -cmakeargs "-DCLR_CROSS_COMPONENTS_BUILD=1" -x64 -release -os windows -hostarch arm64 -hostos windows -outputrid w
in-x64 -component crosscomponents" exited with code 1.

@quantumhu
Copy link
Author

Yes thank you, that is the error I see. Are there any known workarounds?

@quantumhu
Copy link
Author

Closing this because I found another solution. My main goal was to get x64 instructions generated on an arm64 device, but I thought the only way was to build the runtime as x64.

There is an AltJit functionality that allows arm64 hosts to generate x64 instructions:

set DOTNET_AltJit=<FuncName>
set DOTNET_AltJitName=clrjit_win_x64_arm64

@dotnet-policy-service dotnet-policy-service bot removed the untriaged New issue has not been triaged by the area owner label May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants