Add ARM64X support

Extend the aarch64-w64-mingw32 prefix to provide ARM64EC libraries
alongside standard AArch64 libraries, replacing the separate
arm64ec-w64-mingw32 prefix. This aligns with how MSVC distributes
ARM64EC libraries and enables the linker to process both targets
simultaneously into a single hybrid binary.

This extensively utilizes LLVM's -marm64x option, compiling both
targets in a single compiler invocation to produce hybrid object
files (unlike MSVC tools, which require separate compilation passes).
This commit is contained in:
Jacek Caban authored and Martin Storsjö committed 2026-07-27 19:08:32 +02:00
1 parent 5e3f73a650
commit 64effa9a71
10 files changed
+127 -33

No files matched your search

+16
View File
@@ -72,6 +72,12 @@ else
esac
fi
for arch in $ARCHS; do
case $arch in
arm64ec) ARM64X_FLAGS="-marm64x" ;;
esac
done
for arch in $ARCHS; do
[ -z "$CLEAN" ] || rm -rf build-$arch
mkdir -p build-$arch
@@ -79,12 +85,20 @@ for arch in $ARCHS; do
[ -n "$NO_RECONF" ] || rm -rf CMake*
EXTRA_CFLAGS=""
EXTRA_LDFLAGS=""
case $arch in
i686|x86_64)
# Force using the mingw stdio functions, for correct long double
# printing.
EXTRA_CFLAGS="-D__USE_MINGW_ANSI_STDIO=1"
;;
aarch64)
EXTRA_CFLAGS="$ARM64X_FLAGS"
EXTRA_LDFLAGS="$ARM64X_FLAGS"
;;
arm64ec)
continue
;;
esac
cmake \
@@ -119,6 +133,8 @@ for arch in $ARCHS; do
-DLIBCXXABI_LIBDIR_SUFFIX="" \
-DCMAKE_C_FLAGS_INIT="$CFGUARD_CFLAGS $EXTRA_CFLAGS" \
-DCMAKE_CXX_FLAGS_INIT="$CFGUARD_CFLAGS $EXTRA_CFLAGS" \
-DCMAKE_ASM_FLAGS_INIT="$EXTRA_CFLAGS" \
-DCMAKE_SHARED_LINKER_FLAGS="$EXTRA_LDFLAGS" \
..
cmake --build . ${CORES:+-j${CORES}}