Skip to content

feat: add Windows ARM64 (Snapdragon X Elite) native build support#422

Open
abehrman wants to merge 8 commits into
Snapmaker:mainfrom
abehrman:feat/windows-arm64
Open

feat: add Windows ARM64 (Snapdragon X Elite) native build support#422
abehrman wants to merge 8 commits into
Snapmaker:mainfrom
abehrman:feat/windows-arm64

Conversation

@abehrman
Copy link
Copy Markdown

@abehrman abehrman commented Jun 3, 2026

Summary

This PR adds native Windows ARM64 build support for Snapmaker OrcaSlicer, targeting Snapdragon X Elite and other Windows-on-ARM devices.

  • Architecture detection in CMake deps build: ARM64 path alongside existing x64/x86
  • OpenSSL: uses VC-WIN64-ARM target on ARM64
  • wxWidgets: TARGET_CPU=ARM64 and vc_arm64_lib lib dir
  • GMP/MPFR: provided via MSYS2 clangarm64 packages in CI; MSVC-compatible import libs generated with llvm-dlltool
  • CGAL: built with CGAL_DISABLE_GMP=ON on ARM64 (no prebuilt GMP needed)
  • STEP/OCCT: disabled by default on ARM64 via new SLIC3R_ENABLE_STEP option — OCCT 7.6 has no Windows ARM64 support; can be re-enabled when OCCT 7.7+ is adopted
  • build_release_vs2022.bat: accepts arm64 argument to pass -A ARM64 to cmake
  • CI: new build_windows_arm64.yml workflow running on windows-11-arm hosted runner, producing a downloadable native ARM64 artifact

Known limitations (follow-up work)

Feature Status
Core slicing, GUI, STL/3MF/OBJ ✅ Native ARM64
STEP import ❌ Disabled — needs OCCT 7.7+
Exact-arithmetic mesh boolean ⚠️ Falls back to floating-point (CGAL without GMP)

Test plan

  • CI passes on windows-11-arm runner and artifact is produced
  • Artifact launches and slices a model on Snapdragon X Elite device
  • Existing x64 CI is unaffected

Local ARM64 build

build_release_vs2022.bat arm64

Requires: MSYS2 with mingw-w64-clang-aarch64-gmp and mingw-w64-clang-aarch64-mpfr pre-installed, and llvm-dlltool on PATH (ships with VS 2022 ARM64 tools).

🤖 Generated with Claude Code

abehrman and others added 8 commits June 2, 2026 21:41
- Detect ARM64 in deps/CMakeLists.txt and deps-windows.cmake; set
  DEPS_ARCH=arm64 and DEP_PLATFORM=ARM64 / wxWidgets TARGET_CPU=ARM64
- OpenSSL: use VC-WIN64-ARM arch on ARM64 Windows
- FindGLEW: prevent Win32 fallthrough on ARM64
- build_release_vs2022.bat: accept 'arm64' arg; pass -A ARM64 to cmake
- Add SLIC3R_ENABLE_STEP option (default OFF on ARM64 Windows) to gate
  OpenCASCADE/STEP support; OCCT 7.6 has no Windows ARM64 support
- Gate GMP/MPFR DLL copies and OCCT deps behind SLIC3R_ENABLE_STEP /
  ARM64 checks in CMakeLists.txt
- Guard Format/STEP.hpp and its Model.hpp include with SLIC3R_ENABLE_STEP
- CGAL.cmake: build without GMP/MPFR on ARM64 (CGAL_DISABLE_GMP=ON)
- Add .github/workflows/build_windows_arm64.yml: native build on
  windows-11-arm runner; installs MSYS2 clangarm64 GMP/MPFR packages,
  generates MSVC-compatible import libs via llvm-dlltool, caches deps,
  uploads artifact

Known limitations (follow-up work):
  - STEP import disabled (needs OCCT 7.7+ for ARM64)
  - Exact-arithmetic CGAL ops unavailable (MeshBoolean uses floating-point)
  - GMP/MPFR provided by CI MSYS2; local arm64 builds need manual setup

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace the broken llvm-dlltool/dumpbin PowerShell approach with
MSYS2's native gendef + dlltool running in the CLANGARM64 shell.
- gendef produces a proper .def from the mingw DLL
- dlltool -m arm64 produces a COFF import .lib MSVC link.exe accepts
- Use cygpath to convert $GITHUB_WORKSPACE instead of hardcoded path
- Add mingw-w64-clang-aarch64-binutils to MSYS2 install (provides dlltool)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
gendef is not in mingw-w64-clang-aarch64-binutils. Use objdump -p
(which IS in binutils) to parse PE DLL export tables instead:
  objdump -p <dll> | awk '/^\[/{print $NF}' -> EXPORTS .def
  dlltool -m arm64 -D <dll> -d <def> -l <lib>

No additional packages needed beyond binutils.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
CLANGARM64 is LLVM-based — GNU objdump/dlltool don't exist there.
Switch to LLVM equivalents that ship with the clang toolchain:
  llvm-readobj --coff-exports <dll> | awk '/Name: /{print $2}'
  llvm-dlltool -m arm64 -D <dll> -d <def> -l <lib>
Also drop the explicit binutils install (not needed, not GNU).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
llvm-readobj/llvm-dlltool are not transitive deps of the GMP package.
Add mingw-w64-clang-aarch64-llvm explicitly. Also add a diagnostic
listing /clangarm64/bin/llvm-* so we can see what's actually available
if future tool lookups fail.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
MPFR 4.x ships as libmpfr-6.dll in MSYS2 CLANGARM64 (soname bump),
not libmpfr-4.dll. Discover the actual filename with a glob, generate
the import lib for whatever is present, then copy to libmpfr-4.{dll,lib}
so cmake's win-arm64 blob lookup finds the expected names.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ect builds

CMake 4.x dropped compatibility with cmake_minimum_required(VERSION < 3.5).
Some bundled deps have old cmake minimums. Pass CMAKE_POLICY_VERSION_MINIMUM=3.5
via ExternalProject CMAKE_ARGS in Snapmaker_Orca_add_cmake_project (all three
branches) and to the top-level deps configure in the ARM64 CI workflow.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
OpenEXR 2.5.5 cmake SSE2 detection succeeds on MSVC 14.44 ARM64
(emmintrin.h now lists ARM64 as supported) but IlmImf SIMD code
fails to compile. Force all SSE/SIMD flags off on arm64:
  OPENEXR_IMF_HAVE_SSE2=OFF
  OPENEXR_IMF_HAVE_SSSE3=OFF
  ILMBASE_HAVE_SSE=OFF
  ILMBASE_FORCE_DISABLE_INTEL_SSE=ON

Co-Authored-By: Claude Sonnet 4.6 <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