On 18.05.2025 21:08, Martin Storsjö wrote:
On Sat, 17 May 2025, Jacek Caban via Mingw-w64-public wrote:
---
mingw-w64-crt/def-include/func.def.in | 3 +++
1 file changed, 3 insertions(+)
diff --git a/mingw-w64-crt/def-include/func.def.in
b/mingw-w64-crt/def-include/func.def.in
index 1d542a1f4..f180b9ce7 100644
--- a/mingw-w64-crt/def-include/func.def.in
+++ b/mingw-w64-crt/def-include/func.def.in
@@ -18,6 +18,9 @@
#define F_X86_ANY(x) x
#define F_NON_I386(x) x
#define F_NON_ARM64(x) x
+#if defined(__arm64ec__)
+#define F_ARM_ANY(x) x
+#endif
#elif defined(__i386__)
#define F32(x) x
#define F_I386(x) x
--
2.49.0
This looks ok to me.
Overall, what exact set of functions to export for arm64ec is a bit
unclear. As arm64ec is supposed to run any x86_64 binary, it must
export all symbols that regular x86_64 does, so the existing setup, to
treat arm64ec mainly as x86_64, looks correct.
Whether all arm64 specific symbols are available in arm64ec mode or
not, is not guaranteed however.
Checking what the actual situation is is not entirely obvious; the
regular arm64 DLLs on Windows 11 actually are arm64x hybrid images, so
the same DLL contains two views. Most tools just show the default
(native) view, while "llvm-readobj --coff-exports" with a recent
(20.x) version should show both variants. With that, I inspected
ucrtbase.dll and msvcrt.dll from Windows 11, and the arm64ec (hybrid)
view generally contains all symbols that the native arm64 form does,
plus a few extra ones that are needed for x86_64 specific things. For
ucrtbase.dll, the arm64ec view is strictly a superset of the arm64
view. For msvcrt.dll, it is almost; the arm64ec view lacks the symbols
_fpieee_flt and _memcpy_strict_align which are visible in native arm64
mode.
But as practical approximation, I guess it's fine to just include all
F_ARM_ANY() for arm64ec.
As practical example, this patch fixes linking code that uses "fabsf"
in arm64ec mode; the symbol isn't available in x86_64 msvcrt.dll or
ucrtbase.dll, but it is available in arm64 versions of those DLLs, and
it is available in arm64ec mode too.
It may be useful to include some of this as context for the change in
the commit message.
I extended the commit message and pushed. Thanks for reviews!
Jacek
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public