This option is meant to be used alongside --host=aarch64-w64-mingw32 to enable
a hybrid ARM64X build. Enable the compilation of all ARM64EC-specific files in
preparation for using -marm64x and ensure that including them on unintended
targets is harmless via preprocessor guards.
---
mingw-w64-crt/Makefile.am | 3 +--
mingw-w64-crt/configure.ac | 14 +++++++++++++-
mingw-w64-crt/crt/chpe.S | 4 ++++
mingw-w64-crt/math/fabsf.c | 5 +++++
mingw-w64-crt/misc/arm64ec/longjmp.c | 4 ++++
mingw-w64-crt/misc/arm64ec/setjmp.c | 4 ++++
mingw-w64-crt/stdio/scanf.S | 2 +-
7 files changed, 32 insertions(+), 4 deletions(-)
diff --git a/mingw-w64-crt/Makefile.am b/mingw-w64-crt/Makefile.am
index 443f6686d..b7fea893a 100644
--- a/mingw-w64-crt/Makefile.am
+++ b/mingw-w64-crt/Makefile.am
@@ -880,13 +880,12 @@ src_msvcrtarm64=\
stdio/_wstat32.c \
stdio/_wstat32i64.c \
stdio/gets.c \
+ stdio/scanf.S \
string/msvcr80plus_wcstok.c
if ARM64EC
src_msvcrtarm64+=math/fabsf.c
src_msvcrtarm64_x64=libarm64/stdio/scanf.x86_64.o
-else
-src_msvcrtarm64+=stdio/scanf.S
endif
src_pre_msvcrt20=\
diff --git a/mingw-w64-crt/configure.ac b/mingw-w64-crt/configure.ac
index 1f1c11eb6..5e5d2f7f3 100644
--- a/mingw-w64-crt/configure.ac
+++ b/mingw-w64-crt/configure.ac
@@ -170,6 +170,18 @@ AS_VAR_IF([enable_libarm64],[yes],[
AS_IF([AS_VAR_TEST_SET([LIB32]) || AS_VAR_TEST_SET([LIB64]) ||
AS_VAR_TEST_SET([LIBARM32])],
[AC_MSG_WARN([Building the runtime to use libarm64 with lib32, lib64 or
libarm32 is unsupported.])])])
+AC_MSG_CHECKING([whether to build the ARM64EC libraries])
+AC_ARG_ENABLE([arm64ec],
+ [AS_HELP_STRING([--enable-arm64ec], [Build the ARM64EC libraries])],
+ [],
+ [AS_VAR_SET([enable_arm64ec],[no])])
+AC_MSG_RESULT([$enable_arm64ec])
+AS_CASE([$enable_arm64ec],
+ [no],[],
+ [yes],[AS_VAR_SET([ARM64X])],
+ [AC_MSG_ERROR([invalid argument. Must be either yes or no.])])
+AM_CONDITIONAL([ARM64X], [AS_VAR_TEST_SET([ARM64X])])
+
AS_CASE([$host_cpu],
[x86_64],[
libx8664suffx=lib
@@ -210,7 +222,7 @@ AC_SUBST([LIBX8632SUFFIXDIR],[$libx8632suffx])
AC_SUBST([LIBARM64SUFFIXDIR],[$libarm64suffx])
AC_SUBST([LIBARM32SUFFIXDIR],[$libarm32suffx])
-AM_CONDITIONAL([ARM64EC],[test $host_cpu = arm64ec])
+AM_CONDITIONAL([ARM64EC],[test $host_cpu = arm64ec -o x$enable_arm64ec = xyes])
# Checks for features.
diff --git a/mingw-w64-crt/crt/chpe.S b/mingw-w64-crt/crt/chpe.S
index 20d962231..8acf4884a 100644
--- a/mingw-w64-crt/crt/chpe.S
+++ b/mingw-w64-crt/crt/chpe.S
@@ -4,6 +4,8 @@
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
*/
+#ifdef __arm64ec__
+
#define EXPORT_SYM(x) .globl x; x:
/*
@@ -106,3 +108,5 @@ EXPORT_SYM(__icall_helper_arm64ec)
.seh_endepilogue
br x11
.seh_endproc
+
+#endif
diff --git a/mingw-w64-crt/math/fabsf.c b/mingw-w64-crt/math/fabsf.c
index e7e9d8fa7..62cbec9ca 100644
--- a/mingw-w64-crt/math/fabsf.c
+++ b/mingw-w64-crt/math/fabsf.c
@@ -3,6 +3,9 @@
* This file is part of the mingw-w64 runtime package.
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
*/
+
+#ifndef __aarch64__
+
float fabsf (float x);
float
@@ -16,3 +19,5 @@ fabsf (float x)
return res;
#endif /* defined(__x86_64__) || defined(_AMD64_) || defined(__arm__) ||
defined(_ARM_) || defined(__aarch64__) || defined(_ARM64_) */
}
+
+#endif
diff --git a/mingw-w64-crt/misc/arm64ec/longjmp.c
b/mingw-w64-crt/misc/arm64ec/longjmp.c
index 4ad0435e0..e295f31d6 100644
--- a/mingw-w64-crt/misc/arm64ec/longjmp.c
+++ b/mingw-w64-crt/misc/arm64ec/longjmp.c
@@ -4,6 +4,8 @@
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
*/
+#ifdef __arm64ec__
+
#undef __MSVCRT_VERSION__
#define _UCRT
@@ -29,3 +31,5 @@ void __cdecl longjmp( jmp_buf b, int retval )
}
void (__cdecl *__MINGW_IMP_SYMBOL(longjmp))( jmp_buf b, int retval ) = longjmp;
+
+#endif
diff --git a/mingw-w64-crt/misc/arm64ec/setjmp.c
b/mingw-w64-crt/misc/arm64ec/setjmp.c
index 18f90b0e6..ef5012a5f 100644
--- a/mingw-w64-crt/misc/arm64ec/setjmp.c
+++ b/mingw-w64-crt/misc/arm64ec/setjmp.c
@@ -4,6 +4,8 @@
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
*/
+#ifdef __arm64ec__
+
#undef __MSVCRT_VERSION__
#define _UCRT
@@ -105,3 +107,5 @@ int __attribute__((naked)) __intrinsic_setjmpex( jmp_buf
buf, void *frame )
"b \"#do_setjmpex\"\n\t"
".seh_endproc" );
}
+
+#endif
diff --git a/mingw-w64-crt/stdio/scanf.S b/mingw-w64-crt/stdio/scanf.S
index 50e628a89..8898ade0a 100644
--- a/mingw-w64-crt/stdio/scanf.S
+++ b/mingw-w64-crt/stdio/scanf.S
@@ -25,7 +25,7 @@
expanded as variadic arguments when calling func
*/
-#if defined (__x86_64__)
+#if defined(__x86_64__) && !defined(__arm64ec__)
.text
.align 16
--
2.53.0
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public