Add native Windows ARM64 (AArch64) support#1992
Open
rhemfur wants to merge 2 commits into
Open
Conversation
Enables building and running Cemu natively on Windows on ARM (e.g. Snapdragon devices) with clang-cl. The existing AArch64 recompiler backend is used, so no x64 emulation is involved. Build system (CMakeLists.txt, dependencies/ih264d, src/Cafe): - Auto-select the arm64-windows-static vcpkg triplet and detect the AArch64 architecture even when the emulated host shell misreports it. - Disable IPO for clang-cl (LTO would force lld-link, which cannot read vcpkg's MSVC /GL objects) and link clang_rt.builtins for the compiler-rt calls (e.g. __udivti3) that lld-link does not add. - Set the static CRT on the xbyak_aarch64 target. - Locate pkgconf under the actual vcpkg host triplet instead of a hardcoded x64-windows path. - Build the bundled ih264d decoder as portable C on ARM64/Windows; its NEON .s files use ELF-only :got: relocations that do not assemble for COFF targets. Source (precompiled.h, ExceptionHandler_win32, Debugger, LatteTextureCache): - Guard x86-only intrinsics/paths behind ARCH_X86_64. clang-cl defines _MSC_VER but not __GNUC__, so several `#if defined(_MSC_VER)` branches wrongly selected x86 intrinsics on ARM64. Adds AArch64 register dumping to the crash handler. Manifest: use processorArchitecture="*" for Common-Controls so it resolves on ARM64. See BUILD.md for the build steps (Ninja + clang-cl + -DCMAKE_LINKER_TYPE=MSVC). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Builds Cemu for windows-11-arm with clang-cl + Ninja and uploads the ARM64 exe as an artifact, so official ARM64 Windows builds can be produced. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses #1890.
After seeing #1890 I decided to give this a shot, since I have a Surface Laptop 7
(ARM). Hope you like it!
This enables building and running Cemu natively on Windows on ARM (e.g. Snapdragon
devices) with clang-cl. The existing AArch64 recompiler backend is used, so no x64
emulation is involved. Verified building and running on my device.
Build system (CMakeLists.txt, dependencies/ih264d, src/Cafe):
architecture even when the emulated host shell misreports it.
/GL objects) and link clang_rt.builtins for the compiler-rt calls (e.g. __udivti3)
that lld-link does not add.
x64-windows path.
use ELF-only :got: relocations that do not assemble for COFF targets.
Source (precompiled.h, ExceptionHandler_win32, Debugger, LatteTextureCache):
not GNUC, so several
#if defined(_MSC_VER)branches wrongly selected x86intrinsics on ARM64. Adds AArch64 register dumping to the crash handler.
Manifest: use processorArchitecture="*" for Common-Controls so it resolves on ARM64.
x86 / Linux / macOS builds are unaffected. Build steps are documented in BUILD.md
(Ninja + clang-cl + -DCMAKE_LINKER_TYPE=MSVC).