On Tuesday 06 May 2025 22:16:16 Martin Storsjö wrote:
> On Tue, 6 May 2025, Pali Rohár wrote:
> 
> > On Sunday 13 April 2025 18:34:33 Pali Rohár wrote:
> > > All 64-bit CRT import libraries already provides _fstat64i32, _stat64i32
> > > and _wstat64i32 function symbols. These symbols are either directly
> > > exported from 64-bit CRT DLL library or def file contains alias to other
> > > ABI compatible symbols (_fstat, _stat and _wstat).
> > > 
> > > Also all these functions _fstat64i32, _stat64i32 and _wstat64i32 are
> > > provided by msvcr80+ and UCRT, so ensure that mingw-w64 does not provide
> > > any replacement for msvcr80+ import libraries. And ensure that 
> > > libmingwex.a
> > > library does not provide duplication of these symbols.
> > > 
> > > For 32-bit pre-msvcr80 CRT import libraries provides mingw-w64 emulation
> > > via _fstat64, _stat64 and _wstat64, which just truncates 64-bit st_size
> > > (returned by _*stat64 function) to 32-bit st_size (which is ABI of
> > > _*stat64i32). Do not use any _mingw_no_trailing_slash workaround as for 
> > > all
> > > these functions with underscore prefix, it is expected that behavior is
> > > same as for other stat functions with underscore prefix.
> > > 
> > > These _fstat64i32, _stat64i32 and _wstat64i32 functions in msvcr80+ and
> > > UCRT DLL libraries do not touch output struct stat buffer on error. So do
> > > same thing in mingw-w64 emulation and remove memset(stat, 0, sizeof(stat))
> > > call in failure path.
> > > 
> > > And add missing __MINGW_IMP_SYMBOL import symbols into mingw-w64 emulation
> > > code for these functions as msvcr80+ import libraries already have them.
> > > ---
> > >  mingw-w64-crt/Makefile.am         | 10 +++-
> > >  mingw-w64-crt/stdio/_fstat64i32.c | 27 +++++++---
> > >  mingw-w64-crt/stdio/_stat64i32.c  | 88 +++++++------------------------
> > >  mingw-w64-crt/stdio/_wstat64i32.c | 88 +++++++------------------------
> > >  4 files changed, 66 insertions(+), 147 deletions(-)
> > > 
> > > diff --git a/mingw-w64-crt/Makefile.am b/mingw-w64-crt/Makefile.am
> > > index 6987e6a93873..2b5c6e83d83d 100644
> > > --- a/mingw-w64-crt/Makefile.am
> > > +++ b/mingw-w64-crt/Makefile.am
> > > @@ -548,9 +548,11 @@ src_msvcrt32=\
> > >    stdio/_scprintf.c \
> > >    stdio/_scwprintf.c \
> > >    stdio/_stat64.c \
> > > +  stdio/_stat64i32.c \
> > >    stdio/_vscprintf.c \
> > >    stdio/_vscwprintf.c \
> > >    stdio/_wstat64.c \
> > > +  stdio/_wstat64i32.c \
> > >    string/wcstok.c
> > > 
> > >  # Files included in libmsvcrt-os.a (for msvcrt.dll) on x86_64
> > > @@ -632,6 +634,8 @@ src_msvcrtarm32=\
> > >    misc/__winitenv.c \
> > >    stdio/_fstat64i32.c \
> > >    stdio/_setmaxstdio.c \
> > > +  stdio/_stat64i32.c \
> > > +  stdio/_wstat64i32.c \
> > 
> > Hello Martin, the above change stdio/_stat64i32.c + stdio/_wstat64i32.c
> > for the src_msvcrtarm32 section you have merged in git into the
> > src_msvcrtarm64 section.
> > 
> > I think that this is a rebase issue as it should really go to the arm32.
> 
> Yes, there were conflicts when applying this patch, and I did try to fix it,
> but apparently it didn't go right.
> 
> Please do send a patch with how you want it fixed instead of trying to
> verbally suggest what should be changed.
> 
> // Martin

diff --git a/mingw-w64-crt/Makefile.am b/mingw-w64-crt/Makefile.am
index 05e3300e5247..35dd71346bd4 100644
--- a/mingw-w64-crt/Makefile.am
+++ b/mingw-w64-crt/Makefile.am
@@ -649,6 +649,8 @@ src_msvcrtarm32=\
   misc/__winitenv.c \
   stdio/_fstat64i32.c \
   stdio/_setmaxstdio.c \
+  stdio/_stat64i32.c \
+  stdio/_wstat64i32.c \
   stdio/gets.c \
   stdio/scanf.S
 
@@ -768,8 +770,6 @@ src_msvcrtarm64=\
   misc/__initenv.c \
   misc/__winitenv.c \
   stdio/_setmaxstdio.c \
-  stdio/_stat64i32.c \
-  stdio/_wstat64i32.c \
   stdio/gets.c
 
 if ARM64EC


_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to