[Mingw-w64-public] [PATCH 07/11] crt, headers: Convert the UCRT *wprintf functions to non-inline

2025-04-05 Thread Martin Storsjö
Now these functions should respect UCRT stdio flags set by assigning to _CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, so there's no need to keep them inline. Making them non-inline helps referring to them via a plain symbol, using __MINGW_ASM_CALL(). fwprintf was already non-inline (since the start), and si

[Mingw-w64-public] [PATCH 1/5] headers: Add missing declaration for __mingw_aligned_offset_malloc()

2025-04-05 Thread Pali Rohár
There is already declaration for msvcrt _aligned_offset_malloc() function, so add export also declaration for mingw __mingw_aligned_offset_malloc() function. At the same time, remove also uneeded declaration of this function from mingw-w64-crt/misc/mingw-aligned-malloc.c file and use the new one f

[Mingw-w64-public] [PATCH] crt: Use more portable .short/.long/.quad directives in loadcfg.S.

2025-04-05 Thread Jacek Caban
Fixes the build on older binutils. --- mingw-w64-crt/crt/loadcfg.S | 44 ++--- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/mingw-w64-crt/crt/loadcfg.S b/mingw-w64-crt/crt/loadcfg.S index eb012b530..f907a1842 100644 --- a/mingw-w64-crt/crt/loadcfg

[Mingw-w64-public] [PATCH 2/3] crt: Move nearbyint implementation to C file.

2025-04-05 Thread Jacek Caban
In preparation for using naked functions. --- mingw-w64-crt/Makefile.am | 6 +++--- mingw-w64-crt/math/arm64/nearbyint.S | 17 - mingw-w64-crt/math/arm64/nearbyint.c | 14 ++ mingw-w64-crt/math/arm64/nearbyintf.S | 17 - mingw-w64-crt/math

[Mingw-w64-public] [PATCH 04/11] crt: Use _CRT_INTERNAL_LOCAL_SCANF_OPTIONS in non-inline scanf functions

2025-04-05 Thread Martin Storsjö
Now that these options can be set globally (within an executable), we should honor it within the non-inline functions as well. Signed-off-by: Martin Storsjö --- mingw-w64-crt/stdio/ucrt__snscanf.c | 2 +- mingw-w64-crt/stdio/ucrt_fscanf.c | 2 +- mingw-w64-crt/stdio/ucrt_scanf.c| 2 +- min

Re: [Mingw-w64-public] [PATCH 00/11] UCRT stdio option handling, __ms_ prefixed functions

2025-04-05 Thread Martin Storsjö
On Fri, 21 Mar 2025, Martin Storsjö wrote: On Thu, 20 Mar 2025, Pali Rohár wrote: On Thursday 20 March 2025 23:00:54 Martin Storsjö wrote: And with that in mind, I'm actually wondering if we should revert 581532b8e49a0e10cbdfe2332a8c1d61ff3d6820 regardless of this patchset? I'm actually less

Re: [Mingw-w64-public] [PATCH 07/11] crt, headers: Convert the UCRT *wprintf functions to non-inline

2025-04-05 Thread Martin Storsjö
On Thu, 20 Mar 2025, Jacek Caban wrote: On 20.03.2025 18:54, Martin Storsjö wrote: +int __cdecl (*__MINGW_IMP_SYMBOL(snwprintf))(wchar_t *__restrict__, size_t, const wchar_t *__restrict__, ...) = snwprintf; Do we need those |__imp_| symbols in these files? We don’t declare them as |dllimpor

Re: [Mingw-w64-public] [PATCH] crt: Use .def file aliases for _chgsignl on ARM targets.

2025-04-05 Thread Martin Storsjö
On Fri, 21 Mar 2025, Jacek Caban wrote: --- mingw-w64-crt/Makefile.am| 2 -- mingw-w64-crt/def-include/crt-aliases.def.in | 2 ++ .../lib-common/api-ms-win-crt-math-l1-1-0.def.in | 1 + mingw-w64-crt/math/arm/_chgsignl.S | 16 mingw-w64-c

[Mingw-w64-public] [PATCH 03/11] headers, crt: Convert the UCRT stdio options to a mutable state

2025-04-05 Thread Martin Storsjö
This makes things closer match how this works in MSVC. A few minor details still differ though: In MS UCRT headers, the __local_stdio_{printf,scanf}_options functions are inline in the public headers. I don't see any technical advantage in doing that (and getting that kind of inline correct in C i

Re: [Mingw-w64-public] [EXTERNAL] Re: [PATCH] Add `-mno-outline-atomics` to `CFLAGS`` when building `mingw-w64-crt` and `mingw-w64-libraries/winpthreads` for `aarch64-*`

2025-04-05 Thread Martin Storsjö
On Wed, 26 Mar 2025, Radek Barton wrote: Thank you for your feedback. That message was not intended to be a commit message but message of context for the reviewers. I cannot use `git send-patch` but next time I'll copy and paste the entire output of `git format-patch` including the first part

Re: [Mingw-w64-public] [PATCH] crt: Move definitions of `__mingw_fe_dfl_env` to 'fesetenv.c'

2025-04-05 Thread Martin Storsjö
On Sun, 30 Mar 2025, LIU Hao wrote: -- This eliminates such warnings in C: .../mingw-w64-headers/crt/fenv.h:64:39: warning: ‘__mingw_fe_dfl_env’ initialized and declared ‘extern’ extern const __MINGW_SELECTANY fenv_t __mingw_fe_dfl_env = { 0, 0 };

[Mingw-w64-public] [PATCH 05/11] crt: Use the default _CRT_INTERNAL_LOCAL_PRINTF_OPTIONS in __ms_fwprintf

2025-04-05 Thread Martin Storsjö
The existing form stems from the very early stages of the UCRT implementation in mingw-w64; there is no reason why we shouldn't honor the default settings of the executable here. Signed-off-by: Martin Storsjö --- mingw-w64-crt/stdio/ucrt_ms_fwprintf.c | 2 +- 1 file changed, 1 insertion(+), 1 de

Re: [Mingw-w64-public] libgcc_s_seh-1.dll and libwinpthread-1.dll, gcc 12.1.0

2025-04-05 Thread LIU Hao
在 2025-3-31 01:10, Tom Kacvinsky 写道: Full link line /c/DEV/MINGW-packages/mingw-w64-gcc/src/build-UCRT64/./gcc/xgcc (... ...) unwind-sjlj_s.o unwind-c_s.o emutls_s.o Emutls still exists on Linux: $ objdump -T /usr/lib/x86_64-linux-gnu/libgcc_s.so.1 | grep -F emutls 0

Re: [Mingw-w64-public] [PATCH] crt: Use more portable .short/.long/.quad directives in loadcfg.S.

2025-04-05 Thread Martin Storsjö
On Thu, 20 Mar 2025, Jacek Caban wrote: Fixes the build on older binutils. --- mingw-w64-crt/crt/loadcfg.S | 44 ++--- 1 file changed, 22 insertions(+), 22 deletions(-) LGTM // Martin ___ Mingw-w64-public mailing li

Re: [Mingw-w64-public] [PATCH 1/3] crt: Move trunc implementation to C file.

2025-04-05 Thread Martin Storsjö
On Tue, 1 Apr 2025, Jacek Caban wrote: In preparation for using naked functions. --- For the commit message subject, perhaps you could squeeze in an "arm64" there too, as this only covers that function? That goes for all of these patches. mingw-w64-crt/Makefile.am | 4

[Mingw-w64-public] [PATCH 3/5] crt: Provide *_recalloc functions

2025-04-05 Thread Pali Rohár
They are natively available since msvcr80.dll, they are not available in msvcrt.dll. Provide compatibility emulation into all import libraries where they are not available. Adjust check for _aligned_msize() which is also available since msvcr80.dll. --- mingw-w64-crt/Makefile.am

[Mingw-w64-public] [PATCH] crt: Use .def file aliases for _chgsignl on ARM targets.

2025-04-05 Thread Jacek Caban
--- mingw-w64-crt/Makefile.am| 2 -- mingw-w64-crt/def-include/crt-aliases.def.in | 2 ++ .../lib-common/api-ms-win-crt-math-l1-1-0.def.in | 1 + mingw-w64-crt/math/arm/_chgsignl.S | 16 mingw-w64-crt/math/arm64/_chgsignl.S

Re: [Mingw-w64-public] [PATCH v2 1/3] crt: Move trunc implementation to C file.

2025-04-05 Thread Jacek Caban
On 3.04.2025 14:28, Martin Storsjö wrote: On Wed, 2 Apr 2025, Jacek Caban wrote: In preparation for using naked functions. --- Please add "arm64" somewhere in the subject. I reworded commit messages, swapped macro arguments and pushed. Thanks, Jacek _

Re: [Mingw-w64-public] [PATCH 3/4] crt: api-ms-win-crt-private-l1-1-0.def.in: Don't provide long double functions on x86

2025-04-05 Thread Martin Storsjö
On Tue, 18 Mar 2025, Pali Rohár wrote: But it should probably be updated to use F_LD64() instead of F_ARM_ANY(), like the other patch currently in review. // Martin I'm not sure if the F_LD64 is the best option. It's specifically about whether long doubles are 64 bit or not, so it's exactl

[Mingw-w64-public] [PATCH 06/11] crt: Sort the stdio filenames in src_ucrtbase in alphabetical order

2025-04-05 Thread Martin Storsjö
This eases adding more files to the list. Signed-off-by: Martin Storsjö --- mingw-w64-crt/Makefile.am | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/mingw-w64-crt/Makefile.am b/mingw-w64-crt/Makefile.am index 345eac0aa..5be85382f 100644 --- a/mingw-w64-crt/M

Re: [Mingw-w64-public] [PATCH 3/5] crt: Provide *_recalloc functions

2025-04-05 Thread Martin Storsjö
On Thu, 20 Mar 2025, Pali Rohár wrote: They are natively available since msvcr80.dll, they are not available in msvcrt.dll. Provide compatibility emulation into all import libraries where they are not available. Adjust check for _aligned_msize() which is also available since msvcr80.dll. --- mi