[Mingw-w64-public] [PATCH 5/9] crt: exe: Check for memory allocation failure in duplicate_ppstrings()

2025-04-17 Thread Pali Rohár
--- mingw-w64-crt/crt/crtexe.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/mingw-w64-crt/crt/crtexe.c b/mingw-w64-crt/crt/crtexe.c index 1f3ad3a7a2b8..c68ac3734e8e 100644 --- a/mingw-w64-crt/crt/crtexe.c +++ b/mingw-w64-crt/crt/crtexe.c @@ -58,7 +58,7 @@ extern

Re: [Mingw-w64-public] [PATCH] github: use new public preview windows-11-arm runner

2025-04-17 Thread Martin Storsjö
On Wed, 16 Apr 2025, LIU Hao wrote: Windows 11 24H2 can no longer run 32-bit ARM programs. I think we shouldn't run armv7 tests any more. I wholeheartedly disagree. Yes, we can't run 32 bit arm programs on the latest versions of Windows, and modern cores also may lack the 32 bit execution mo

[Mingw-w64-public] [PATCH 7/9] crt: exe: Remove global variable mainret

2025-04-17 Thread Pali Rohár
Replace it by the local variable ret, as its value is used only in the __tmainCRTStartup() function. --- mingw-w64-crt/crt/crtexe.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mingw-w64-crt/crt/crtexe.c b/mingw-w64-crt/crt/crtexe.c index 4134b948b7ae..3d36983b8a0d 10

[Mingw-w64-public] [PATCH 6/9] crt: exe: Move mingw-w64 / gcc EXE runtime code into the guarded block

2025-04-17 Thread Pali Rohár
This will ensure that _pei386_runtime_relocator() is called as the first function and that all those runtime init code functions are called in guarded block which prevents duplicate code execution. --- mingw-w64-crt/crt/crtexe.c | 17 - 1 file changed, 8 insertions(+), 9 deletions(

[Mingw-w64-public] [PATCH 4/9] crt: exe: Move calling duplicate_ppstrings(argc, &argv) immediately after filling argc/argv

2025-04-17 Thread Pali Rohár
Code inside the block which fills argc/argv is already guarded and prevents duplicate code execution. So move the duplicate_ppstrings() here. --- mingw-w64-crt/crt/crtexe.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mingw-w64-crt/crt/crtexe.c b/mingw-w64-crt/crt/crtexe.c

[Mingw-w64-public] [PATCH 1/9] crt: exe: Enable per-thread locale if user asked for it

2025-04-17 Thread Pali Rohár
There is missing call _configthreadlocale(-1) in pre_c_init function. Startup code from Visual C++ runtime is doing same thing. This applies only for msvcr80+ and UCRT builds. For older msvcrt versions there is only empty wrapper. --- mingw-w64-crt/crt/crtexe.c | 1 + 1 file changed, 1 insertion(

[Mingw-w64-public] [PATCH 3/9] crt: exe: Invoke gcc c++ constructors after msvc c++ constructors

2025-04-17 Thread Pali Rohár
Function __main() is function for executing gcc c++ constructors. Move it into guarded code which prevents duplicate code execution, after executing msvc c++ constructors (__xc_a-__xc_z callbacks). --- mingw-w64-crt/crt/crtexe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/m

[Mingw-w64-public] [PATCH 2/9] crt: exe: Inline pre_c_init() and pre_cpp_init() into _CRT_INIT()

2025-04-17 Thread Pali Rohár
This allows to remove the whole pre_c_init() and pre_cpp_init() functions and registration of __mingw_pcinit and __mingw_pcppinit hooks. Inlining the code allows to easily figure out in which order is initialization code called. Also merge code which is protected by __native_startup_lock into one

[Mingw-w64-public] [PATCH 9/9] crt: exe: Remove custom declaration of _fpreset() function

2025-04-17 Thread Pali Rohár
Function _fpreset() is declared in float.h. --- mingw-w64-crt/crt/crtexe.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mingw-w64-crt/crt/crtexe.c b/mingw-w64-crt/crt/crtexe.c index 7d5ba01ad0e9..94bad6aaff27 100644 --- a/mingw-w64-crt/crt/crtexe.c +++ b/mingw-w64-crt/crt/

[Mingw-w64-public] [PATCH] winpthreads: check if __GNUC__ is defined to prevent -Wundef warning

2025-04-17 Thread Antonin Décimo
--- mingw-w64-libraries/winpthreads/src/thread.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mingw-w64-libraries/winpthreads/src/thread.c b/mingw-w64-libraries/winpthreads/src/thread.c index d5b3aaa05..f1af0ea44 100644 --- a/mingw-w64-libraries/winpthreads/src