On Tue, 24 Jun 2025, Pali Rohár wrote:


I see. How insane. msvcrt has _fseeki64() function but does not have
_ftelli64() function. This change should address this issue:

diff --git a/mingw-w64-crt/def-include/crt-aliases.def.in 
b/mingw-w64-crt/def-include/crt-aliases.def.in
index 1edb042baf94..3c4f7c352132 100644
--- a/mingw-w64-crt/def-include/crt-aliases.def.in
+++ b/mingw-w64-crt/def-include/crt-aliases.def.in
@@ -321,10 +321,11 @@ stat64i32 == _stat64i32
#if defined(NO_FIXED_SIZE_64_ALIAS) && !defined(NO_FSTAT64_ALIAS)
fstat64 == _fstat64
#endif
+#ifdef WITH_FSEEKO64_ALIAS
+fseeko64 == _fseeki64
+#endif
#else
fstat64 == _fstat64
-#endif
-#ifndef FIXED_SIZE_SYMBOLS
fseeko64 == _fseeki64
ftello64 == _ftelli64
#endif
diff --git a/mingw-w64-crt/lib-common/msvcrt.def.in 
b/mingw-w64-crt/lib-common/msvcrt.def.in
index 1fa3ffc9ad3a..7b903360acfe 100644
--- a/mingw-w64-crt/lib-common/msvcrt.def.in
+++ b/mingw-w64-crt/lib-common/msvcrt.def.in
@@ -1930,5 +1930,6 @@ F_I386(_libm_sse2_tan_precise)
#endif
#if defined(__arm__) || defined(__aarch64__)
#define USE_WCSTOK_S_FOR_WCSTOK
+#define WITH_FSEEKO64_ALIAS
#endif
#include "crt-aliases.def.in"

This does seem to work.

In which of the existing patches do you want to squash this change? Or does it go as a separate patch somewhere?

Yes, the binary does use the real UCRT functions here - so it seems like
there is a real bug in them.

That's probably fine for us, and reflecting reality, but we'd want to waive
this failure in the testsuite somehow. We can mark some tests as XFAIL, but
here we'd want it XFAIL only in one specific combination.

I guess we can add ifdefs in the test to just skip some parts of the test
for "#if defined(__aarch64__) && defined(_UCRT)" or so, printing some
warning, and maybe adding a "&& !defined(ACTUALLY_TEST_IT)" or so, for
really making it test what we want it to.

// Martin

I'm for adding ifdef to skip the test.
"#if defined(__aarch64__) && defined(_UCRT)" sounds good.

Ok, will post a patch with that. FWIW, msvcrt.dll also seems to have this issue (we don't use any emulation of these functions there either).

// Martin

_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to