From 4d83e142b68d1279050e464c7c106be8afa27e32 Mon Sep 17 00:00:00 2001 From: Billy Laws Date: Sat, 16 Sep 2023 00:03:00 +0100 Subject: [PATCH] crt: Add initial ARM64EC build system support This introduces basic ARM64EC build support by reusing a modified ARM64 configuration. In the future, the goal is to include both native and ARM64EC object files in aarch64 archives. This setup is still subject to change. Signed-off-by: Jacek Caban --- mingw-w64-crt/Makefile.am | 6 +++++- mingw-w64-crt/configure.ac | 10 ++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/mingw-w64-crt/Makefile.am b/mingw-w64-crt/Makefile.am index 4f0119be8..291d24b24 100644 --- a/mingw-w64-crt/Makefile.am +++ b/mingw-w64-crt/Makefile.am @@ -28,7 +28,11 @@ CPPFLAGS32=-m32 -masm=att CPPFLAGS64=-m64 -masm=att AM_DLLTOOLFLAGS=-k --as=$(AS) --output-lib $@ DLLTOOLFLAGSARM32=-m arm -DLLTOOLFLAGSARM64=-m arm64 +if ARM64EC + DLLTOOLFLAGSARM64=-m arm64ec +else + DLLTOOLFLAGSARM64=-m arm64 +endif DLLTOOLFLAGS32=--as-flags=--32 -m i386 DLLTOOLFLAGS64=--as-flags=--64 -m i386:x86-64 DTDEFARM32=$(DLLTOOL) $(DLLTOOLFLAGSARM32) $(AM_DLLTOOLFLAGS) --input-def diff --git a/mingw-w64-crt/configure.ac b/mingw-w64-crt/configure.ac index f4f8d954d..ee0e0e9b0 100644 --- a/mingw-w64-crt/configure.ac +++ b/mingw-w64-crt/configure.ac @@ -156,7 +156,7 @@ AC_ARG_ENABLE([libarm64], [Build the WinARM64 libraries])], [], [AS_CASE([$host_cpu], - [aarch64*],[enable_libarm64=yes], + [aarch64* | arm64*],[enable_libarm64=yes], [*],[enable_libarm64=no]) ]) AC_MSG_RESULT([$enable_libarm64]) @@ -181,7 +181,7 @@ AS_CASE([$host_cpu], libx8632suffx=lib libarm64suffx=libarm64 libarm32suffx=libarm32], - [aarch64*],[ + [aarch64* | arm64*],[ libx8664suffx=libx8664 libx8632suffx=libx8632 libarm64suffx=lib @@ -210,6 +210,8 @@ AC_SUBST([LIBX8632SUFFIXDIR],[$libx8632suffx]) AC_SUBST([LIBARM64SUFFIXDIR],[$libarm64suffx]) AC_SUBST([LIBARM32SUFFIXDIR],[$libarm32suffx]) +AM_CONDITIONAL([ARM64EC],[test $host_cpu = arm64ec]) + # Checks for features. AC_MSG_CHECKING([whether to enable globbing]) @@ -377,6 +379,10 @@ AC_MSG_CHECKING([whether the linker provides __ImageBase symbol]) cat <<_ACEOF >conftest.$ac_ext extern unsigned char __ImageBase[[]]; + +// Define a dummy call helper to satisfy the linker on ARM64EC +void *__os_arm64x_dispatch_ret = 0; + void __main(void) { } int main(void) {