Re: [Mingw-w64-public] New implementation for C95 conversion functions

2025-07-13 Thread LIU Hao
在 2025-7-14 05:04, Kirill Makurin 写道: The replacements for mb*towc* and wc*tomb* functions are currently used only for pre-msvcr80.dll (including all msvcrt.dll). The tests should be skipped by returning 77 when compiled for msvcr80.dll and later (including UCRT). Is it possible that me checki

Re: [Mingw-w64-public] no_stack_protector attribute directive is ignored in file stack_chk_guard.c

2025-07-13 Thread LIU Hao
在 2025-7-13 23:02, Pali Rohár 写道: I see. But I think it is better to apply at least this "debugging purposes" attribute than nothing. It is only for older gcc versions. And with __SSP__ checks it can be targeted just for -fstack-protector-string CRT builds, which is what the original commit is ai

Re: [Mingw-w64-public] New implementation for C95 conversion functions

2025-07-13 Thread Kirill Makurin
The replacements for mb*towc* and wc*tomb* functions are currently used only for pre-msvcr80.dll (including all msvcrt.dll). The tests should be skipped by returning 77 when compiled for msvcr80.dll and later (including UCRT). Is it possible that me checking `__MSVCRT_VERSION__ >= 0x0800` is inc

Re: [Mingw-w64-public] New implementation for C95 conversion functions

2025-07-13 Thread Martin Storsjö
On Sat, 12 Jul 2025, Kirill Makurin wrote: ``` The new testcases don't build in UCRT mode - see https://github.com/mstorsjo/mingw-w64/actions/runs/16238894867/job/45852642 223#step:5:4386 ``` Right... I forgot that UCRT's mbstate_t is a structure when was writing the tests initially. I noticed

Re: [Mingw-w64-public] no_stack_protector attribute directive is ignored in file stack_chk_guard.c

2025-07-13 Thread Pali Rohár
On Sunday 13 July 2025 21:56:16 LIU Hao wrote: > z > 在 2025-7-13 21:43, Pali Rohár 写道: > > On Sunday 13 July 2025 21:35:23 LIU Hao wrote: > > > 在 2025-7-13 21:25, Pali Rohár 写道: > > > > And throws warning: ‘no_stack_protector’ attribute directive ignored > > > > [-Wattributes] > > > > > > > > >

Re: [Mingw-w64-public] no_stack_protector attribute directive is ignored in file stack_chk_guard.c

2025-07-13 Thread LIU Hao
z 在 2025-7-13 21:43, Pali Rohár 写道: On Sunday 13 July 2025 21:35:23 LIU Hao wrote: 在 2025-7-13 21:25, Pali Rohár 写道: And throws warning: ‘no_stack_protector’ attribute directive ignored [-Wattributes] If I understand correctly the code at 3d-4c is the stack protection check, which should ha

Re: [Mingw-w64-public] no_stack_protector attribute directive is ignored in file stack_chk_guard.c

2025-07-13 Thread Pali Rohár
On Sunday 13 July 2025 21:35:23 LIU Hao wrote: > 在 2025-7-13 21:25, Pali Rohár 写道: > > And throws warning: ‘no_stack_protector’ attribute directive ignored > > [-Wattributes] > > > > > > If I understand correctly the code at 3d-4c is the stack protection > > check, which should have been disable

Re: [Mingw-w64-public] no_stack_protector attribute directive is ignored in file stack_chk_guard.c

2025-07-13 Thread LIU Hao
在 2025-7-13 21:25, Pali Rohár 写道: And throws warning: ‘no_stack_protector’ attribute directive ignored [-Wattributes] If I understand correctly the code at 3d-4c is the stack protection check, which should have been disabled for that function. But because the ___stack_chk_guard is being change

Re: [Mingw-w64-public] no_stack_protector attribute directive is ignored in file stack_chk_guard.c

2025-07-13 Thread Pali Rohár
On Sunday 13 July 2025 21:19:08 LIU Hao wrote: > 在 2025-7-13 21:06, Pali Rohár 写道: > > Ok. Thanks for info. And what in the case if mingw-w64 is compiled with > > gcc-8 together with -fstack-protector in CFLAGS? > > It may be a default option of an environment. > > For example in MSYS2 when build

Re: [Mingw-w64-public] no_stack_protector attribute directive is ignored in file stack_chk_guard.c

2025-07-13 Thread LIU Hao
在 2025-7-13 21:06, Pali Rohár 写道: Ok. Thanks for info. And what in the case if mingw-w64 is compiled with gcc-8 together with -fstack-protector in CFLAGS? It may be a default option of an environment. For example in MSYS2 when building a native package with `makepkg-mingw` the default flags ar

Re: [Mingw-w64-public] no_stack_protector attribute directive is ignored in file stack_chk_guard.c

2025-07-13 Thread Pali Rohár
On Sunday 13 July 2025 20:53:18 LIU Hao wrote: > 在 2025-7-13 20:47, Pali Rohár 写道: > > The attribute __no_stack_protector__ was introduced in the commit > > a0e69f7bc83a ("crt/ssp: fix stack smashing protection bootstrapping"). > > > > Could you look at this issue? It looks like that gcc ignores t

[Mingw-w64-public] [SPAM] Re: no_stack_protector attribute directive is ignored in file stack_chk_guard.c

2025-07-13 Thread LIU Hao
在 2025-7-13 20:47, Pali Rohár 写道: The attribute __no_stack_protector__ was introduced in the commit a0e69f7bc83a ("crt/ssp: fix stack smashing protection bootstrapping"). Could you look at this issue? It looks like that gcc ignores this attribute and hence the commit for this gcc build does noth

[Mingw-w64-public] no_stack_protector attribute directive is ignored in file stack_chk_guard.c

2025-07-13 Thread Pali Rohár
Hello, When I'm trying to compile mingw-w64 with gcc 8.3 with enabled all warnings, I'm getting following compile warning: i686-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -m32 -masm=att -I./include "-I/usr/local/include" -I/mingw-w64/mingw-w64-headers/crt/ -I/mingw-w64/mingw-w64-headers/include/ -pip

[Mingw-w64-public] [PATCH] headers: Deduplicate *wprintf/*wscanf functions across UCRT/msvcrt builds

2025-07-13 Thread Pali Rohár
All these functions have same declarations in #ifdef _UCRT and #else blocks. The only difference is that in non-UCRT block functions vfwscanf, vswscanf and vwscanf are declared without __cdecl. As all those functions are with __cdecl calling convenion, they should be declared with __cdecl. --- min

[Mingw-w64-public] [PATCH 10/10] crt: Add emulation of _set_fmode() function for pre-msvcr80 import libs

2025-07-13 Thread Pali Rohár
Function _set_fmode() is available in msvcr80+, UCRT and also in msvcrt.dll since Windows Vista. --- mingw-w64-crt/Makefile.am | 3 +++ mingw-w64-crt/lib-common/msvcrt.def.in | 2 +- mingw-w64-crt/misc/_set_fmode.c| 13 + 3 files changed, 17 insertions(+), 1 dele

[Mingw-w64-public] [PATCH 02/10] crt: Add emulation of _get_dstbias() function for pre-msvcr80 import libs

2025-07-13 Thread Pali Rohár
Function _get_dstbias() is available in msvcr80+ and UCRT. --- mingw-w64-crt/Makefile.am | 2 ++ mingw-w64-crt/misc/_get_dstbias.c | 20 2 files changed, 22 insertions(+) create mode 100644 mingw-w64-crt/misc/_get_dstbias.c diff --git a/mingw-w64-crt/Makefile.am b/m

[Mingw-w64-public] [PATCH 08/10] crt: Add emulation of _set_doserrno() function for pre-msvcr80 import libs

2025-07-13 Thread Pali Rohár
Function _set_doserrno() is available in msvcr80+, UCRT and also in msvcrt.dll since Windows Vista. --- mingw-w64-crt/Makefile.am | 3 +++ mingw-w64-crt/lib-common/msvcrt.def.in | 2 +- mingw-w64-crt/misc/_set_doserrno.c | 13 + 3 files changed, 17 insertions(+), 1 d

[Mingw-w64-public] [PATCH 04/10] crt: Add emulation of _get_tzname() function for pre-msvcr80 import libs

2025-07-13 Thread Pali Rohár
Function _get_tzname() is available in msvcr80+ and UCRT. --- mingw-w64-crt/Makefile.am| 2 ++ mingw-w64-crt/misc/_get_tzname.c | 42 2 files changed, 44 insertions(+) create mode 100644 mingw-w64-crt/misc/_get_tzname.c diff --git a/mingw-w64-crt/Makefil

[Mingw-w64-public] [PATCH 09/10] crt: Add emulation of _get_fmode() function for pre-msvcr80 import libs

2025-07-13 Thread Pali Rohár
Function _get_fmode() is available in msvcr80+, UCRT and also in msvcrt.dll since Windows Vista. --- mingw-w64-crt/Makefile.am | 3 +++ mingw-w64-crt/lib-common/msvcrt.def.in | 2 +- mingw-w64-crt/misc/_get_fmode.c| 20 3 files changed, 24 insertions(+),

[Mingw-w64-public] [PATCH 06/10] crt: Add emulation of _get_wpgmptr() function for pre-msvcr80 import libs

2025-07-13 Thread Pali Rohár
Function _get_wpgmptr() is available in msvcr80+, UCRT and also in i386 and x64 msvcrt.dll since Windows Vista. It is not available in arm msvcrt.dll. --- mingw-w64-crt/Makefile.am | 2 ++ mingw-w64-crt/lib-common/msvcrt.def.in | 2 +- mingw-w64-crt/misc/_get_wpgmptr.c | 20 +++

[Mingw-w64-public] [PATCH 01/10] crt: Add emulation of _get_daylight() function for pre-msvcr80 import libs

2025-07-13 Thread Pali Rohár
Function _get_daylight() is available in msvcr80+ and UCRT. --- mingw-w64-crt/Makefile.am | 2 ++ mingw-w64-crt/misc/_get_daylight.c | 20 2 files changed, 22 insertions(+) create mode 100644 mingw-w64-crt/misc/_get_daylight.c diff --git a/mingw-w64-crt/Makefile.am

[Mingw-w64-public] [PATCH 03/10] crt: Add emulation of _get_timezone() function for pre-msvcr80 import libs

2025-07-13 Thread Pali Rohár
Function _get_timezone() is available in msvcr80+ and UCRT. --- mingw-w64-crt/Makefile.am | 2 ++ mingw-w64-crt/misc/_get_timezone.c | 20 2 files changed, 22 insertions(+) create mode 100644 mingw-w64-crt/misc/_get_timezone.c diff --git a/mingw-w64-crt/Makefile.am

[Mingw-w64-public] [PATCH 05/10] crt: Add emulation of _get_pgmptr() function for pre-msvcr80 import libs

2025-07-13 Thread Pali Rohár
Function _get_pgmptr() is available in msvcr80+, UCRT and also in i386 and x64 msvcrt.dll since Windows Vista. It is not available in arm msvcrt.dll. --- mingw-w64-crt/Makefile.am | 2 ++ mingw-w64-crt/lib-common/msvcrt.def.in | 2 +- mingw-w64-crt/misc/_get_pgmptr.c | 20

[Mingw-w64-public] [PATCH 07/10] crt: Add emulation of _get_doserrno() function for pre-msvcr80 import libs

2025-07-13 Thread Pali Rohár
Function _get_doserrno() is available in msvcr80+, UCRT and also in msvcrt.dll since Windows Vista. --- mingw-w64-crt/Makefile.am | 3 +++ mingw-w64-crt/lib-common/msvcrt.def.in | 2 +- mingw-w64-crt/misc/_get_doserrno.c | 20 3 files changed, 24 insertions(

Re: [Mingw-w64-public] New implementation for C95 conversion functions

2025-07-13 Thread LIU Hao
在 2025-7-13 05:45, Kirill Makurin 写道: ``` The new testcases don't build in UCRT mode - see https://github.com/mstorsjo/mingw-w64/actions/runs/16238894867/job/45852642223#step:5:4386 ``` Right... I forgot that UCRT's mbstate_t is a structure when was writing the tests initially. I noticed and fi