On Tue, 26 Aug 2025, LIU Hao wrote:
在 2025-8-26 18:00, Martin Storsjö 写道:
Currently, the global AM_CFLAGS used for building mingw-w64-crt
also applies when trying to build the tests. These flags force
a specific static CRT configuration, while the tests should
test the toolchain's default configuration.
This sounds a bit counterintuitive, does it? I don't see `-nostdlib` anywhere
in tests, so I'm assuming that test programs are linked against the installed
CRT, instead of the built CRT; and only after the built CRT is installed, can
issues in it be discovered.
Yes, this is true - the tests don't use -nostdlib but expect to build and
run against the installed libs.
However this is not something I'm changing in this patch - this is how
this testsuite is set up so far as well.
I'm presenting this as a less brittle and less messy version of
https://sourceforge.net/p/mingw-w64/mailman/message/59197829/ - which both
try to get rid of the global AM_CFLAGS (which sets
-D__MSVCRT_VERSION__=0x600) for the tests.
It would be more straightforward if tests are linked against the built CRT,
with `-nostdlib` and all libraries and object files linked explicitly, so
tests should test the built CRT, instead of the installed, default CRT.
Yes, that's true. However you'd still need to install the matching headers
somewhere in order to be able to build the crt anyway, so it's not quite
as simple as that.
Feel free to work on that as extra steps to make these tests even easier
to run; I'm just presenting this as an initial step to make them work _at
all_ for current configurations, so we can get CI coverage of them.
// Martin
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public