Skip to content

Add native Windows ARM64 (AArch64) support#1992

Open
rhemfur wants to merge 2 commits into
cemu-project:mainfrom
rhemfur:windows-arm64
Open

Add native Windows ARM64 (AArch64) support#1992
rhemfur wants to merge 2 commits into
cemu-project:mainfrom
rhemfur:windows-arm64

Conversation

@rhemfur

@rhemfur rhemfur commented Jul 16, 2026

Copy link
Copy Markdown

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):

  • 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.

x86 / Linux / macOS builds are unaffected. Build steps are documented in BUILD.md
(Ninja + clang-cl + -DCMAKE_LINKER_TYPE=MSVC).

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant