On Tuesday 24 June 2025 14:41:10 Martin Storsjö wrote:
> On Tue, 24 Jun 2025, Martin Storsjö wrote:
> 
> > On Sat, 21 Jun 2025, Pali Rohár wrote:
> > 
> > > AM_CFLAGS contains cflags required to build the mingw-w64 CRT source code.
> > > They are not intended to compile applications (including those used in
> > > mingw-w64 testsuite). Setting per-target <target>_CFLAGS variable
> > > overwrites the AM_CFLAGS. So for every testcase sets the custom
> > > <target>_CFLAGS variable. This ensures that the testcase would not be
> > > compiled with -D_CRTBLD or -D__MSVCRT_VERSION__=0x600 which is unsuitable
> > > when the mingw-w64 uses the UCRT by default.
> > > ---
> > > Should be applied on top of the:
> > > - "crt: Improve LFS 64-bit functions"
> > > - "crt: Improve LFS 64-bit functions (part 2)"
> > > - crt: Fix _*stat32 and _*stat32i64 functions for 64-bit msvcrt.dll builds
> > > ---
> > > mingw-w64-crt/Makefile.am                   | 73 +++++++++++++++++++--
> > > mingw-w64-crt/testcases/complex/Makefile.am | 50 ++++++++++++++
> > > 2 files changed, 116 insertions(+), 7 deletions(-)
> > 
> > FWIW, this doesn't seem to be quite enough for making the existing
> > testcases build properly.
> > 
> > I set up the CI to run these tests, with these patches applied:
> > https://github.com/mstorsjo/mingw-w64/commits/refs/heads/ci-testsuite/
> > 
> > The run results are at 
> > https://github.com/mstorsjo/mingw-w64/actions/runs/15848888686/job/44677297831,
> > but you won't be able to see the logs if you're not logged in to github.
> > 
> > The issues encountered by both the Clang and GCC builds are:
> > 
> > ../testcases/t_ansi_io.c: In function 'main':
> > ../testcases/t_ansi_io.c:11:10: fatal error: _mingw_print_push.h: No
> > such file or directory
> >   11 | #include <_mingw_print_push.h>
> > 
> > (This header was removed in 2018 in
> > 70860d945e6be713af352ee62820bccb653589c2.)
> > 
> > ../testcases/t_trycatch.cpp:3:18: error: ISO C++17 does not allow
> > dynamic exception specifications
> >    3 | void foo (int d) throw (int)
> >      |                  ^~~~~
> > 
> > 
> > 
> > Additionally, a UCRT build hits this error:
> > 
> > D:/a/_temp/msys64/gcc-mingw/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe:
> > testcases/tstmain_sys_xxx-tstmain_sys_xxx.o: in function `main':
> > D:\a\mingw-w64\mingw-w64\mingw-w64-crt\build/../testcases/tstmain_sys_xxx.c:13:(.text.startup+0xc):
> > undefined reference to `__imp__sys_errlist'
> > collect2.exe: error: ld returned 1 exit status
> > make[2]: *** [Makefile:27717: testcases/tstmain_sys_xxx.exe] Error 1
> > 
> > 
> > A 32 bit msvcrt build hits these errors:
> > 
> > D:/a/_temp/msys64/gcc-mingw/bin/../lib/gcc/i686-w64-mingw32/14.1.0/../../../../i686-w64-mingw32/bin/ld.exe:
> > testcases/t_lfs-t_lfs.o: in function `main':
> > D:\a\mingw-w64\mingw-w64\mingw-w64-crt\build/../testcases/t_lfs.c:10:(.text.startup+0x2c):
> > undefined reference to `_imp__ftello64'
> > D:/a/_temp/msys64/gcc-mingw/bin/../lib/gcc/i686-w64-mingw32/14.1.0/../../../../i686-w64-mingw32/bin/ld.exe:
> >  
> > D:\a\mingw-w64\mingw-w64\mingw-w64-crt\build/../testcases/t_lfs.c:13:(.text.startup+0x7d):
> > undefined reference to `_imp__fseeko64'
> > D:/a/_temp/msys64/gcc-mingw/bin/../lib/gcc/i686-w64-mingw32/14.1.0/../../../../i686-w64-mingw32/bin/ld.exe:
> >  
> > D:\a\mingw-w64\mingw-w64\mingw-w64-crt\build/../testcases/t_lfs.c:21:(.text.startup+0x14e):
> > undefined reference to `freopen64'
> > D:/a/_temp/msys64/gcc-mingw/bin/../lib/gcc/i686-w64-mingw32/14.1.0/../../../../i686-w64-mingw32/bin/ld.exe:
> >  
> > D:\a\mingw-w64\mingw-w64\mingw-w64-crt\build/../testcases/t_lfs.c:24:(.text.startup+0x15b):
> > undefined reference to `tmpfile64'
> > D:/a/_temp/msys64/gcc-mingw/bin/../lib/gcc/i686-w64-mingw32/14.1.0/../../../../i686-w64-mingw32/bin/ld.exe:
> >  
> > D:\a\mingw-w64\mingw-w64\mingw-w64-crt\build/../testcases/t_lfs.c:26:(.text.startup+0x180):
> > undefined reference to `open64'
> > D:/a/_temp/msys64/gcc-mingw/bin/../lib/gcc/i686-w64-mingw32/14.1.0/../../../../i686-w64-mingw32/bin/ld.exe:
> >  
> > D:\a\mingw-w64\mingw-w64\mingw-w64-crt\build/../testcases/t_lfs.c:21:(.text.startup+0x1bc):
> > undefined reference to `freopen64'
> > D:/a/_temp/msys64/gcc-mingw/bin/../lib/gcc/i686-w64-mingw32/14.1.0/../../../../i686-w64-mingw32/bin/ld.exe:
> >  
> > D:\a\mingw-w64\mingw-w64\mingw-w64-crt\build/../testcases/t_lfs.c:24:(.text.startup+0x1c9):
> > undefined reference to `tmpfile64'
> > D:/a/_temp/msys64/gcc-mingw/bin/../lib/gcc/i686-w64-mingw32/14.1.0/../../../../i686-w64-mingw32/bin/ld.exe:
> >  
> > D:\a\mingw-w64\mingw-w64\mingw-w64-crt\build/../testcases/t_lfs.c:24:(.text.startup+0x1d6):
> > undefined reference to `tmpfile64'
> > collect2.exe: error: ld returned 1 exit status
> > make[2]: *** [Makefile:27525: testcases/t_lfs.exe] Error 1
> 
> Also, I'm hitting these errors also when targeting "ucrtbase" x86_64,
> instead of "ucrt".
> 
> // Martin

Do you have "[PATCH 09/10] crt: Define LFS open64, freopen64, tmpfile64
symbols as aliases in crt-aliases.def.in"? It is part of those
dependency patch series.


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

Reply via email to