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

2025-04-06 Thread LIU Hao
在 2025-3-31 21:23, LIU Hao 写道: These macros are to be used with `fesetenv()`, so they belong there. Having these `selectany` variables in 'fenv.h' causes them to be defined with external linkage in every source file which includes 'fenv.h'. They can also be exported inappropriately from a DLL, w

[Mingw-w64-public] [PATCH 3/3] crt: Implement the indirect call helper ARM64EC adjustor thunk

2025-04-06 Thread Jacek Caban
From: Billy Laws Calls to this are synthesized by the linker where it is used for calling into import libraries, this is referred to as an 'Adjustor Thunk' in ARM64EC documentation. --- mingw-w64-crt/crt/chpe.S | 23 +++ 1 file changed, 23 insertions(+) diff --git a/mingw-w6

[Mingw-w64-public] [PATCH 2/3] crt: Define metadata structures used for ARM64EC

2025-04-06 Thread Jacek Caban
From: Billy Laws These are populated by the linker, and then used by the loader and emulator at runtime to allow for ARM64EC <-> X86_64 interoperability. --- mingw-w64-crt/Makefile.am | 3 ++ mingw-w64-crt/crt/chpe.S| 85 + mingw-w64-crt/crt/loadcfg.S |

[Mingw-w64-public] [PATCH 1/3] crt: Add initial ARM64EC build system support

2025-04-06 Thread Jacek Caban
From: Billy Laws This introduces basic ARM64EC build support by reusing a modified ARM64 configuration. In the future, the goal is to include both native and ARM64EC object files in aarch64 archives. This setup is still subject to change. --- mingw-w64-crt/Makefile.am | 6 +- mingw-w64-cr

Re: [Mingw-w64-public] stat, _stat, and _stat64i32 issues

2025-04-06 Thread Pali Rohár
On Saturday 29 March 2025 18:56:56 Lasse Collin wrote: > On 2025-03-29 Pali Rohár wrote: > > On Saturday 29 March 2025 12:19:19 Lasse Collin wrote: > > > On 2025-03-28 Pali Rohár wrote: > > > > On Saturday 22 March 2025 15:35:48 Lasse Collin wrote: > > > > > If I build with "clang -O2 -fsanitiz

[Mingw-w64-public] [PATCH v2 6/6] crt: Add test case for _aligned_* and *_recalloc functions

2025-04-06 Thread Pali Rohár
--- mingw-w64-crt/Makefile.am | 1 + mingw-w64-crt/testcases/t_aligned_alloc.c | 134 ++ 2 files changed, 135 insertions(+) create mode 100644 mingw-w64-crt/testcases/t_aligned_alloc.c diff --git a/mingw-w64-crt/Makefile.am b/mingw-w64-crt/Makefile.am index

[Mingw-w64-public] [PATCH v2 4/6] crt: Implement __mingw_aligned_msize() function

2025-04-06 Thread Pali Rohár
It mimics msvc _aligned_msize() function. --- mingw-w64-crt/misc/mingw-aligned-malloc.c | 23 +++ mingw-w64-headers/crt/malloc.h| 1 + 2 files changed, 24 insertions(+) diff --git a/mingw-w64-crt/misc/mingw-aligned-malloc.c b/mingw-w64-crt/misc/mingw-aligned-mall

[Mingw-w64-public] [PATCH v2 2/6] crt: Provide _aligned_* functions

2025-04-06 Thread Pali Rohár
Functions _aligned_free(), _aligned_malloc(), _aligned_offset_malloc(), _aligned_offset_realloc() and _aligned_realloc() are available since msvcr70.dll. For older CRT import libraries provide emulation via mingw functions __mingw_aligned_free(), __mingw_aligned_malloc(), __mingw_aligned_offset_mal

[Mingw-w64-public] [PATCH v2 5/6] crt: Provide _aligned_msize function for all CRT import libraries

2025-04-06 Thread Pali Rohár
Function _aligned_msize() is available only in msvcr80+ and UCRT. It is not available in msvcrt.dll system os library. --- mingw-w64-crt/Makefile.am | 2 ++ mingw-w64-crt/misc/_aligned_msize.c | 13 + mingw-w64-headers/crt/crtdbg.h | 2 -- mingw-w64-headers/crt/malloc.

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

2025-04-06 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 v2 1/6] headers: Add missing declaration for __mingw_aligned_offset_malloc()

2025-04-06 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 v2 0/6] Improve _aligned_* function support

2025-04-06 Thread Pali Rohár
This patch series provides all _aligned_* functions for all CRT import libs. PATCH v2 contains fixes and new test case. Pali Rohár (6): headers: Add missing declaration for __mingw_aligned_offset_malloc() crt: Provide _aligned_* functions crt: Provide *_recalloc functions crt: Implement _

Re: [Mingw-w64-public] [PATCH] headers: Get rid of unused declarations from math.h.

2025-04-06 Thread Martin Storsjö
On Sun, 6 Apr 2025, Jacek Caban wrote: --- mingw-w64-headers/crt/math.h | 162 --- 1 file changed, 162 deletions(-) LGTM, thanks! // Martin ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net ht

[Mingw-w64-public] [PATCH] headers: Get rid of unused declarations from math.h.

2025-04-06 Thread Jacek Caban
--- mingw-w64-headers/crt/math.h | 162 --- 1 file changed, 162 deletions(-) diff --git a/mingw-w64-headers/crt/math.h b/mingw-w64-headers/crt/math.h index dc1599ed5..65c41cd6d 100644 --- a/mingw-w64-headers/crt/math.h +++ b/mingw-w64-headers/crt/math.h @@ -766,90

Re: [Mingw-w64-public] [PATCH 2/3] headers: Use aarch64 logbl function variant for ARM64EC.

2025-04-06 Thread Jacek Caban
On 4.04.2025 21:25, Martin Storsjö wrote: On Fri, 4 Apr 2025, Jacek Caban wrote: From: Billy Laws Signed-off-by: Jacek Caban --- mingw-w64-headers/crt/math.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mingw-w64-headers/crt/math.h b/mingw-w64-headers/crt/math.h index d