feat: add Windows ARM64 (Snapdragon X Elite) native build support#422
Open
abehrman wants to merge 8 commits into
Open
feat: add Windows ARM64 (Snapdragon X Elite) native build support#422abehrman wants to merge 8 commits into
abehrman wants to merge 8 commits into
Conversation
- 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>
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.
Summary
This PR adds native Windows ARM64 build support for Snapmaker OrcaSlicer, targeting Snapdragon X Elite and other Windows-on-ARM devices.
ARM64path alongside existingx64/x86VC-WIN64-ARMtarget on ARM64TARGET_CPU=ARM64andvc_arm64_liblib dirclangarm64packages in CI; MSVC-compatible import libs generated withllvm-dlltoolCGAL_DISABLE_GMP=ONon ARM64 (no prebuilt GMP needed)SLIC3R_ENABLE_STEPoption — OCCT 7.6 has no Windows ARM64 support; can be re-enabled when OCCT 7.7+ is adoptedbuild_release_vs2022.bat: acceptsarm64argument to pass-A ARM64to cmakebuild_windows_arm64.ymlworkflow running onwindows-11-armhosted runner, producing a downloadable native ARM64 artifactKnown limitations (follow-up work)
Test plan
windows-11-armrunner and artifact is producedLocal ARM64 build
Requires: MSYS2 with
mingw-w64-clang-aarch64-gmpandmingw-w64-clang-aarch64-mpfrpre-installed, andllvm-dlltoolon PATH (ships with VS 2022 ARM64 tools).🤖 Generated with Claude Code