Re: [Mingw-w64-public] [PATCH] headers/wintrust: Add forward declarations for structs

2025-07-19 Thread Jacek Caban via Mingw-w64-public
On 19.07.2025 15:47, LIU Hao wrote: +  struct _CRYPT_PROVIDER_DATA; +  struct _CRYPT_PROVIDER_SGNR; +  struct _CRYPT_PROVIDER_PRIVDATA; +  struct _CRYPT_PROVIDER_DEFUSAGE; We could also reorder declarations to define those structs earlier, but the patch looks fine to me too. Thanks, Jace

Re: [Mingw-w64-public] widl build error on Cygwin

2025-07-12 Thread Jacek Caban via Mingw-w64-public
On 15.06.2025 19:36, Jeremy Drake via Mingw-w64-public wrote: I just tried to build llvm-mingw on Cygwin, as part of testing builds of llvm/clang/lld on Cygwin, and got a new error building widl: In file included from /usr/include/limits.h:13, from /usr/lib/gcc/x86_64-pc-cygwin

Re: [Mingw-w64-public] Deduplicate lib32 and lib-common def files

2025-05-26 Thread Jacek Caban via Mingw-w64-public
On 26.05.2025 06:54, LIU Hao wrote: 在 2025-5-26 02:58, Martin Storsjö 写道: On Sun, 25 May 2025, Jacek Caban wrote: I think that kind of massive duplication just doesn't scale. For example, when adding a new target like ARM64EC, are you suggesting we duplicate all the .def files for a

Re: [Mingw-w64-public] [PATCH] headers: Don't mark RtlUnwind functions as noreturn*

2025-05-25 Thread Jacek Caban via Mingw-w64-public
On 25.05.2025 18:10, Martin Storsjö wrote: On Sun, 25 May 2025, Jacek Caban via Mingw-w64-public wrote: This reverts commit 8c2c00ef898f36d51613b45c2cab4f4448d35f0b. These functions can unwind to the current frame, in which case they effectively return. Therefore, they should not be marked

Re: [Mingw-w64-public] Deduplicate lib32 and lib-common def files

2025-05-25 Thread Jacek Caban via Mingw-w64-public
On 24.05.2025 12:25, LIU Hao wrote: 在 2025-5-24 18:12, Pali Rohár 写道: And it deduplicated 496 def files. What do you think about it? Just a robotic change and can decrease number of def files which needs to be maintained. I don't have a specific opinion on this change. Frankly speaking, I am

Re: [Mingw-w64-public] [PATCH] headers: Don't mark RtlUnwind functions as noreturn*

2025-05-25 Thread Jacek Caban via Mingw-w64-public
'*' in the commit message is a typo, I will remove it. Jacek ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

[Mingw-w64-public] [PATCH] headers: Don't mark RtlUnwind functions as noreturn*

2025-05-25 Thread Jacek Caban via Mingw-w64-public
This reverts commit 8c2c00ef898f36d51613b45c2cab4f4448d35f0b. These functions can unwind to the current frame, in which case they effectively return. Therefore, they should not be marked as noreturn. Use __builtin_unreachable in the ARM64EC longjmp implementation instead. Fixes https://gitlab.w

Re: [Mingw-w64-public] [PATCH 1/2] crt: Introduce F_ARM_NATIVE

2025-05-24 Thread Jacek Caban via Mingw-w64-public
On 23.05.2025 19:12, Martin Storsjö wrote: On Fri, 23 May 2025, Jacek Caban via Mingw-w64-public wrote: And use it for exports not available on ARM64EC. --- mingw-w64-crt/def-include/func.def.in    | 9 ++--- .../lib-common/api-ms-win-crt-math-l1-1-0.def.in | 2

[Mingw-w64-public] [PATCH 2/2] crt: Use fabsf.c in ARM64EC CRT importlibs

2025-05-23 Thread Jacek Caban via Mingw-w64-public
--- mingw-w64-crt/Makefile.am | 5 + 1 file changed, 5 insertions(+) diff --git a/mingw-w64-crt/Makefile.am b/mingw-w64-crt/Makefile.am index e5ca242db..e08173d9f 100644 --- a/mingw-w64-crt/Makefile.am +++ b/mingw-w64-crt/Makefile.am @@ -520,6 +520,10 @@ src_ucrtbasearm32=\ src_ucrtbasearm64

[Mingw-w64-public] [PATCH 1/2] crt: Introduce F_ARM_NATIVE

2025-05-23 Thread Jacek Caban via Mingw-w64-public
And use it for exports not available on ARM64EC. --- mingw-w64-crt/def-include/func.def.in| 9 ++--- .../lib-common/api-ms-win-crt-math-l1-1-0.def.in | 2 +- mingw-w64-crt/lib-common/msvcrt.def.in | 2 +- mingw-w64-crt/lib-common/ntdll.def.in

Re: [Mingw-w64-public] [PATCH 2/2] crt: Define F_ARM_ANY on ARM64EC

2025-05-22 Thread Jacek Caban via Mingw-w64-public
On 18.05.2025 21:08, Martin Storsjö wrote: On Sat, 17 May 2025, Jacek Caban via Mingw-w64-public wrote: --- mingw-w64-crt/def-include/func.def.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mingw-w64-crt/def-include/func.def.in b/mingw-w64-crt/def-include/func.def.in index

Re: [Mingw-w64-public] [PATCH] crt: Regenerate oleacc.def from Windows 11 DLL

2025-05-17 Thread Jacek Caban via Mingw-w64-public
On 17.05.2025 12:15, LIU Hao wrote: Private exports are commented out. Signed-off-by: LIU Hao ---  mingw-w64-crt/lib-common/oleacc.def | 15 ++-  mingw-w64-crt/lib32/oleacc.def  | 15 ++-  2 files changed, 20 insertions(+), 10 deletions(-) Looks good to me. Thanks

[Mingw-w64-public] [PATCH 2/2] crt: Define F_ARM_ANY on ARM64EC

2025-05-17 Thread Jacek Caban via Mingw-w64-public
--- mingw-w64-crt/def-include/func.def.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mingw-w64-crt/def-include/func.def.in b/mingw-w64-crt/def-include/func.def.in index 1d542a1f4..f180b9ce7 100644 --- a/mingw-w64-crt/def-include/func.def.in +++ b/mingw-w64-crt/def-include/func.def.in

[Mingw-w64-public] [PATCH 1/2] crt: Remove F_ARM_ANY from entries in ntdll.def.in that also apply to x86

2025-05-17 Thread Jacek Caban via Mingw-w64-public
--- mingw-w64-crt/lib-common/ntdll.def.in | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mingw-w64-crt/lib-common/ntdll.def.in b/mingw-w64-crt/lib-common/ntdll.def.in index ee002c868..efa6145b6 100644 --- a/mingw-w64-crt/lib-common/ntdll.def.in +++ b/mingw-w64-crt/lib

Re: [Mingw-w64-public] [PATCH 3/8] crt: Deinline UCRT _vsnwprintf() from wchar.h and define import symbol

2025-05-05 Thread Jacek Caban
On 4.05.2025 23:29, Jacek Caban wrote: On 4.05.2025 11:37, Pali Rohár wrote: Function _vsnwprintf() is already deinlined from stdio.h. Do same in wchar.h and define import symbol. ---   mingw-w64-crt/stdio/ucrt__vsnwprintf.c | 1 +   mingw-w64-headers/crt/wchar.h  | 6 +-   2 files

Re: [Mingw-w64-public] [PATCH 3/8] crt: Deinline UCRT _vsnwprintf() from wchar.h and define import symbol

2025-05-04 Thread Jacek Caban
On 4.05.2025 11:37, Pali Rohár wrote: Function _vsnwprintf() is already deinlined from stdio.h. Do same in wchar.h and define import symbol. --- mingw-w64-crt/stdio/ucrt__vsnwprintf.c | 1 + mingw-w64-headers/crt/wchar.h | 6 +- 2 files changed, 2 insertions(+), 5 deletions(-)

Re: [Mingw-w64-public] [PATCH 2/2] winpthreads: Move SEH handler declaration to end of function

2025-04-25 Thread Jacek Caban
On 25.04.2025 05:33, LIU Hao wrote: 在 2025-4-25 05:28, Jacek Caban 写道: Avoiding those hacky labels in the middle of code would definitely be nice, but this seems more invasive. Wouldn’t we want a full _gnu_exception_handler to cover that code? Is it okay if I go ahead and push my patch

Re: [Mingw-w64-public] [PATCH] headers: Add buffer types for FSCTL_DUPLICATE_EXTENTS_TO_FILE(EX) in winioctl.h

2025-04-24 Thread Jacek Caban
On 24.04.2025 21:33, Biswapriyo Nath wrote: From 10cfcc41c79aa8cf4a62a9ded9b2a0a33a282ac1 Mon Sep 17 00:00:00 2001 From: Biswapriyo Nath Date: Thu, 24 Apr 2025 19:31:27 + Subject: [PATCH] headers: Add buffer types for FSCTL_DUPLICATE_EXTENTS_TO_FILE(EX) in winioctl.h Required forhttps://g

Re: [Mingw-w64-public] [PATCH 2/2] winpthreads: Move SEH handler declaration to end of function

2025-04-24 Thread Jacek Caban
On 24.04.2025 14:33, LIU Hao wrote: 在 2025-4-24 20:10, Martin Storsjö 写道: On Thu, 24 Apr 2025, Jacek Caban wrote: This avoids splitting the function into multiple .text chunks, which triggers an error on ARM64EC: error: cannot perform a PC-relative fixup with a non-zero symbol offset --- I

Re: [Mingw-w64-public] [PATCH 2/2] winpthreads: Move SEH handler declaration to end of function

2025-04-24 Thread Jacek Caban
On 24.04.2025 14:10, Martin Storsjö wrote: On Thu, 24 Apr 2025, Jacek Caban wrote: This avoids splitting the function into multiple .text chunks, which triggers an error on ARM64EC: error: cannot perform a PC-relative fixup with a non-zero symbol offset --- I haven't looked deeper int

[Mingw-w64-public] [PATCH 1/2] winpthreads: Disable dll_dependency.S assembly on ARM64EC

2025-04-24 Thread Jacek Caban
From: Billy Laws Bootstrapping is not a concern with LLVM toolchains. --- mingw-w64-libraries/winpthreads/src/libgcc/dll_dependency.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mingw-w64-libraries/winpthreads/src/libgcc/dll_dependency.S b/mingw-w64-libraries/winpthreads

[Mingw-w64-public] [PATCH 2/2] winpthreads: Move SEH handler declaration to end of function

2025-04-24 Thread Jacek Caban
This avoids splitting the function into multiple .text chunks, which triggers an error on ARM64EC: error: cannot perform a PC-relative fixup with a non-zero symbol offset --- I haven't looked deeper into the LLVM side. Even if there's something that could be improved there, splitting a function lik

Re: [Mingw-w64-public] [PATCH v3 1/3] headers: Use __builtin_sponentry for setjmp when available.

2025-04-24 Thread Jacek Caban
On 24.04.2025 12:49, Martin Storsjö wrote: On Thu, 24 Apr 2025, Jacek Caban wrote: Instead of for specific architectures. Fixes setjmp on ARM64EC. --- mingw-w64-headers/crt/setjmp.h | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/mingw-w64-headers

[Mingw-w64-public] [PATCH v3 3/3] crt: Add ARM64EC setjmp and longjmp implementation

2025-04-23 Thread Jacek Caban
Based on Wine code by Alexandre Julliard. --- mingw-w64-crt/Makefile.am| 8 +- mingw-w64-crt/misc/arm64ec/longjmp.c | 30 mingw-w64-crt/misc/arm64ec/setjmp.c | 106 +++ mingw-w64-crt/misc/longjmp.S | 2 + mingw-w64-crt/misc/setjmp.S

[Mingw-w64-public] [PATCH v3 2/3] headers: Mark RtlUnwind* functions as noreturn

2025-04-23 Thread Jacek Caban
--- mingw-w64-headers/include/winnt.h | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mingw-w64-headers/include/winnt.h b/mingw-w64-headers/include/winnt.h index 7da4c40d8..4d920fdbd 100644 --- a/mingw-w64-headers/include/winnt.h +++ b/mingw-w64-headers/include/winn

[Mingw-w64-public] [PATCH v3 1/3] headers: Use __builtin_sponentry for setjmp when available.

2025-04-23 Thread Jacek Caban
Instead of for specific architectures. Fixes setjmp on ARM64EC. --- mingw-w64-headers/crt/setjmp.h | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/mingw-w64-headers/crt/setjmp.h b/mingw-w64-headers/crt/setjmp.h index 2dc7d8739..11d736492 100644 --- a/

Re: [Mingw-w64-public] [PATCH 3/3] crt: Build __guard_dispatch_icall_dummy on ARM64EC

2025-04-23 Thread Jacek Caban
On 23.04.2025 19:30, Martin Storsjö wrote: So, I agree with the direction here; this patch also is fine. Thanks! Pushed, thanks! Jacek ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/l

Re: [Mingw-w64-public] [PATCH v2 1/2] headers: Use __builtin_sponentry for setjmp when available.

2025-04-23 Thread Jacek Caban
On 23.04.2025 18:50, Martin Storsjö wrote: On Wed, 23 Apr 2025, Martin Storsjö wrote: On Wed, 23 Apr 2025, Jacek Caban wrote: Instead of for specific architectures. Fixes setjmp on ARM64EC. --- v2: Reorder checks to simplify the code a bit. We could probably simplify it further by removing

Re: [Mingw-w64-public] [PATCH v2 2/2] crt: Add ARM64EC setjmp and longjmp implementation

2025-04-23 Thread Jacek Caban
On 23.04.2025 18:57, Martin Storsjö wrote: On Wed, 23 Apr 2025, Jacek Caban wrote: Based on Wine code by Alexandre Julliard. --- v2: - extended a comment about unwinding entry thunk in setjmp - __imp_ symbol more consistent with the codebase - added a local RtlUnwind declaration with

Re: [Mingw-w64-public] [PATCH 3/3] crt: Build __guard_dispatch_icall_dummy on ARM64EC

2025-04-23 Thread Jacek Caban
On 22.04.2025 17:38, Martin Storsjö wrote: On Sat, 12 Apr 2025, Jacek Caban wrote: --- There's an alternative way to handle this, see: https://github.com/llvm/llvm-project/pull/135280 It would work in this case, but I'm not convinced it's the right approach overall. Whil

Re: [Mingw-w64-public] [PATCH 1/3] crt: Build scanf.S as an x86_64 object on ARM64EC

2025-04-23 Thread Jacek Caban
On 22.04.2025 17:21, Martin Storsjö wrote: On Sat, 12 Apr 2025, Jacek Caban wrote: A proper ARM64EC implementation would be tricky, as it would need to handle a different calling convention and possibly use exit thunks for imported functions. Instead, we can simply use the x86_64 version

[Mingw-w64-public] [PATCH v2 1/2] headers: Use __builtin_sponentry for setjmp when available.

2025-04-23 Thread Jacek Caban
Instead of for specific architectures. Fixes setjmp on ARM64EC. --- v2: Reorder checks to simplify the code a bit. We could probably simplify it further by removing defined(__SEH__) checks. mingw-w64-headers/crt/setjmp.h | 16 +++- 1 file changed, 7 insertions(+), 9 deletions(-) dif

[Mingw-w64-public] [PATCH v2 2/2] crt: Add ARM64EC setjmp and longjmp implementation

2025-04-23 Thread Jacek Caban
Based on Wine code by Alexandre Julliard. --- v2: - extended a comment about unwinding entry thunk in setjmp - __imp_ symbol more consistent with the codebase - added a local RtlUnwind declaration with __MINGW_ATTRIB_NORETURN to avoid -Winvalid-noreturn warning mingw-w64-crt/Makefile.am

Re: [Mingw-w64-public] [PATCH 2/2] crt: Add ARM64EC setjmp and longjmp implementation

2025-04-22 Thread Jacek Caban
On 22.04.2025 14:27, Martin Storsjö wrote: On Fri, 11 Apr 2025, Jacek Caban wrote: diff --git a/mingw-w64-crt/misc/arm64ec/longjmp.c b/mingw-w64-crt/misc/arm64ec/longjmp.c new file mode 100644 index 0..ebf795f63 --- /dev/null +++ b/mingw-w64-crt/misc/arm64ec/longjmp.c @@ -0,0 +1,30

Re: [Mingw-w64-public] [PATCH 1/2] headers: Use __builtin_sponentry for setjmp when available.

2025-04-22 Thread Jacek Caban
On 22.04.2025 14:16, Martin Storsjö wrote: On Fri, 11 Apr 2025, Jacek Caban wrote: Instead of for specific architectures. Fixes setjmp on ARM64EC. --- mingw-w64-headers/crt/setjmp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mingw-w64-headers/crt/setjmp.h b/mingw-w64

Re: [Mingw-w64-public] [PATCH 2/3] crt: Move __guard_dispatch_icall_dummy to separated file

2025-04-14 Thread Jacek Caban
On 12.04.2025 12:45, Jacek Caban wrote: -// When CFGuard is not active, directly tail-call the target address, which -// is passed via %rax. I realized I dropped this comment, I'll add it to the .S file. I'll hold off on resending for now to see if there are any other comments o

[Mingw-w64-public] [PATCH 3/3] crt: Build __guard_dispatch_icall_dummy on ARM64EC

2025-04-12 Thread Jacek Caban
--- There???s an alternative way to handle this, see: https://github.com/llvm/llvm-project/pull/135280 It would work in this case, but I???m not convinced it???s the right approach overall. While extending the assembler to allow setting the flag is straightforward, handling the different relocation

[Mingw-w64-public] [PATCH 2/3] crt: Move __guard_dispatch_icall_dummy to separated file

2025-04-12 Thread Jacek Caban
In preparation for building as x86_64 on ARM64EC. --- mingw-w64-crt/Makefile.am | 3 ++- mingw-w64-crt/cfguard/guard_dispatch.S| 11 +++ mingw-w64-crt/cfguard/mingw_cfguard_support.c | 8 3 files changed, 13 insertions(+), 9 deletions(-) create mode

Re: [Mingw-w64-public] [PATCH 2/2] crt: Add ARM64EC setjmp and longjmp implementation

2025-04-12 Thread Jacek Caban
On 12.04.2025 00:14, Jacek Caban wrote: On 11.04.2025 23:34, Jacek Caban wrote: Based on Wine code by Alexandre Julliard. ---   mingw-w64-crt/Makefile.am    |   8 ++-   mingw-w64-crt/misc/arm64ec/longjmp.c |  30   mingw-w64-crt/misc/arm64ec/setjmp.c  | 104

[Mingw-w64-public] [PATCH 1/3] crt: Build scanf.S as an x86_64 object on ARM64EC

2025-04-12 Thread Jacek Caban
A proper ARM64EC implementation would be tricky, as it would need to handle a different calling convention and possibly use exit thunks for imported functions. Instead, we can simply use the x86_64 version. --- This series, together with setjmp/longjmp, finally allow building unmodified mingw-w64-c

Re: [Mingw-w64-public] [PATCH] headers: Define MapViewOfFile2 as inline function

2025-04-11 Thread Jacek Caban
On 11.04.2025 22:24, Biswapriyo Nath wrote: Subject: [PATCH] headers: Define MapViewOfFile2 as inline function As doucumented byhttps://github.com/MicrosoftDocs/sdk-api/commit/9173247d41163f99453c8169c517da359d2f64b4 Signed-off-by: Biswapriyo Nath --- mingw-w64-headers/include/memoryapi.h |

Re: [Mingw-w64-public] [PATCH 2/2] crt: Add ARM64EC setjmp and longjmp implementation

2025-04-11 Thread Jacek Caban
On 11.04.2025 23:34, Jacek Caban wrote: Based on Wine code by Alexandre Julliard. --- mingw-w64-crt/Makefile.am| 8 ++- mingw-w64-crt/misc/arm64ec/longjmp.c | 30 mingw-w64-crt/misc/arm64ec/setjmp.c | 104 +++ mingw-w64-crt/misc/longjmp.S

[Mingw-w64-public] [PATCH 1/2] headers: Use __builtin_sponentry for setjmp when available.

2025-04-11 Thread Jacek Caban
Instead of for specific architectures. Fixes setjmp on ARM64EC. --- mingw-w64-headers/crt/setjmp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mingw-w64-headers/crt/setjmp.h b/mingw-w64-headers/crt/setjmp.h index 2dc7d8739..f5208a0dc 100644 --- a/mingw-w64-headers/crt/setjm

[Mingw-w64-public] [PATCH 2/2] crt: Add ARM64EC setjmp and longjmp implementation

2025-04-11 Thread Jacek Caban
Based on Wine code by Alexandre Julliard. --- mingw-w64-crt/Makefile.am| 8 ++- mingw-w64-crt/misc/arm64ec/longjmp.c | 30 mingw-w64-crt/misc/arm64ec/setjmp.c | 104 +++ mingw-w64-crt/misc/longjmp.S | 2 + mingw-w64-crt/misc/setjmp.S

Re: [Mingw-w64-public] [PATCH] github: Add an optional set of smoke tests for github actions

2025-04-11 Thread Jacek Caban
On 11.04.2025 17:10, NightStrike wrote: On Wed, Apr 9, 2025, 07:16 Martin Storsjö wrote: This adds an optional github actions workflow, with a number of smoke test verifications of mingw-w64: - With an existing release of llvm-mingw, rebuild all the runtimes - This done for the CRT configura

Re: [Mingw-w64-public] [PATCH] github: Add an optional set of smoke tests for github actions

2025-04-09 Thread Jacek Caban
On 9.04.2025 13:15, Martin Storsjö wrote: This adds an optional github actions workflow, with a number of smoke test verifications of mingw-w64: - With an existing release of llvm-mingw, rebuild all the runtimes - This done for the CRT configurations ucrtbase, ucrt and msvcrt - Run the llvm-min

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

2025-04-08 Thread Jacek Caban
On 7.04.2025 14:13, Martin Storsjö wrote: On Sun, 6 Apr 2025, Jacek Caban wrote: 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

Re: [Mingw-w64-public] [PATCH] crt: Fix condition for fabsf in api-ms-win-crt-math

2025-04-07 Thread Jacek Caban
On 7.04.2025 15:16, Martin Storsjö wrote: This was changed erroneously in 95ad23696f57b0f966525b574096bd53d48c773a; fabsf is only available on arm/aarch64 - it doesn't have anything to do with whether we are compatible with UCRT regarding long doubles. Also fix _o_fabsf in ucrtbase-common.def.in

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

2025-04-07 Thread Jacek Caban
On 31.03.2025 15:23, LIU Hao wrote: 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

[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

[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

[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] 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. Than

[Mingw-w64-public] [PATCH 1/2] crt: Use headers: Use __SIZEOF_LONG_DOUBLE__ instead of arch checks in some math functions.

2025-04-04 Thread Jacek Caban
--- This includes functions needed for ARM64EC support that are not covered by Martin's WIP long-double-64 branch. mingw-w64-crt/math/cephes_mconf.h | 4 ++-- mingw-w64-crt/math/fmal.c | 2 +- mingw-w64-crt/math/fpclassifyl.c | 6 +++--- mingw-w64-crt/math/frexpl.c | 2 +- mingw-w6

[Mingw-w64-public] [PATCH v2] crt: Use F_LD64 for long double functions.

2025-04-04 Thread Jacek Caban
--- v2: Preserved comments and updated on top of 49c2f4e2bda45454ae9bbd66ca3fe0fbb9bcd60d. mingw-w64-crt/def-include/crt-aliases.def.in | 30 ++- .../api-ms-win-crt-convert-l1-1-0.def.in | 8 +- .../api-ms-win-crt-math-l1-1-0.def.in | 148 +++--- .../api-ms-win-crt-priva

[Mingw-w64-public] [PATCH 1/3] headers: Use __SIZEOF_LONG_DOUBLE__ == __SIZEOF_DOUBLE__ instead of arch checks

2025-04-04 Thread Jacek Caban
From: Martin Storsjö --- mingw-w64-headers/crt/math.h | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/mingw-w64-headers/crt/math.h b/mingw-w64-headers/crt/math.h index 85ef06773..dc1599ed5 100644 --- a/mingw-w64-headers/crt/math.h +++ b/mingw-w64-header

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

2025-04-04 Thread Jacek Caban
On 1.04.2025 22:16, Jeremy Drake via Mingw-w64-public wrote: On Tue, 1 Apr 2025, Jacek Caban wrote: diff --git a/mingw-w64-crt/include/internal.h b/mingw-w64-crt/include/internal.h index 84d52c991..b30ae0e5f 100644 --- a/mingw-w64-crt/include/internal.h +++ b/mingw-w64-crt/include/internal.h

Re: [Mingw-w64-public] [PATCH] crt, headers: Use headers to redirect __ms_v*scanf functions to v*scanf functions.

2025-04-04 Thread Jacek Caban
On 26.03.2025 14:12, Martin Storsjö wrote: On Sat, 22 Mar 2025, Jacek Caban wrote: --- mingw-w64-crt/Makefile.am    | 11 ++- mingw-w64-crt/def-include/crt-aliases.def.in |  8 - mingw-w64-crt/lib-common/msvcr120_app.def.in |  1 - mingw-w64-crt/lib32/msvcr120.def.in

[Mingw-w64-public] [PATCH 3/3] crt: Use __SIZEOF_LONG_DOUBLE__ == __SIZEOF_DOUBLE__ instead of arch checks

2025-04-04 Thread Jacek Caban
From: Martin Storsjö --- mingw-w64-crt/gdtoa/strtodnrp.c | 3 +-- mingw-w64-crt/gdtoa/strtopx.c | 23 --- mingw-w64-crt/math/coshl.c | 2 +- mingw-w64-crt/math/erfl.c | 2 +- mingw-w64-crt/math/fabsl.c | 6 +++--- mingw-w64-crt/math/fp_constsl.c | 2 +-

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

2025-04-04 Thread Jacek Caban
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 dc1599ed5..58636984e 100644 --- a/mingw-w64-headers/crt/math.h +++ b/mingw-w64

Re: [Mingw-w64-public] [PATCH 1/2] crt: Use headers: Use __SIZEOF_LONG_DOUBLE__ instead of arch checks in some math functions.

2025-04-04 Thread Jacek Caban
On 4.04.2025 15:37, Martin Storsjö wrote: On Thu, 3 Apr 2025, Jacek Caban wrote: --- This includes functions needed for ARM64EC support that are not covered by Martin's WIP long-double-64 branch. mingw-w64-crt/math/cephes_mconf.h | 4 ++-- mingw-w64-crt/math/fmal.c | 2 +- mingw-w6

Re: [Mingw-w64-public] [PATCH 2/2] crt: Use aarch64 assembly variants for ARM64EC math functions.

2025-04-04 Thread Jacek Caban
On 4.04.2025 13:42, Martin Storsjö wrote: On Thu, 3 Apr 2025, Jacek Caban wrote: From: Billy Laws --- mingw-w64-crt/math/fma.c  |  2 +- mingw-w64-crt/math/fmaf.c |  2 +- mingw-w64-crt/math/llrint.c   |  2 +- mingw-w64-crt/math/llrintf.c  |  2 +- mingw-w64-crt/math/llrintl.c  |  3

Re: [Mingw-w64-public] [PATCH 1/2] crt: Use headers: Use __SIZEOF_LONG_DOUBLE__ instead of arch checks in some math functions.

2025-04-04 Thread Jacek Caban
On 4.04.2025 13:39, Martin Storsjö wrote: On Thu, 3 Apr 2025, Jacek Caban wrote: --- This includes functions needed for ARM64EC support that are not covered by Martin's WIP long-double-64 branch. Feel free to send patches from that WIP branch that you find use for here - I haven

Re: [Mingw-w64-public] [PATCH v2 3/3] crt: Use naked functions for ARM64 assembly functions.

2025-04-04 Thread Jacek Caban
On 4.04.2025 13:35, Martin Storsjö wrote: On Thu, 3 Apr 2025, Jacek Caban wrote: On 3.04.2025 14:32, Martin Storsjö wrote: On Wed, 2 Apr 2025, Jacek Caban wrote: On ARM64EC, function declarations have additional nuances: - Function names are mangled by prefixing them with "#" - An

[Mingw-w64-public] [PATCH 2/2] crt: Use aarch64 assembly variants for ARM64EC math functions.

2025-04-03 Thread Jacek Caban
From: Billy Laws --- mingw-w64-crt/math/fma.c | 2 +- mingw-w64-crt/math/fmaf.c | 2 +- mingw-w64-crt/math/llrint.c | 2 +- mingw-w64-crt/math/llrintf.c | 2 +- mingw-w64-crt/math/llrintl.c | 3 ++- mingw-w64-crt/math/lrint.c| 14 +++--- mingw-w64-crt/math/lrintf.c

Re: [Mingw-w64-public] [PATCH v2 3/3] crt: Use naked functions for ARM64 assembly functions.

2025-04-03 Thread Jacek Caban
On 3.04.2025 14:32, Martin Storsjö wrote: On Wed, 2 Apr 2025, Jacek Caban wrote: On ARM64EC, function declarations have additional nuances: - Function names are mangled by prefixing them with "#" - An unmangled symbol is defined as a weak anti-dependency alias to the mangled  s

Re: [Mingw-w64-public] [PATCH 1/2] crt: Respect automake silent rules

2025-04-03 Thread Jacek Caban
On 2.04.2025 21:47, Martin Storsjö wrote: If configuring mingw-w64-crt with the autoconf/automake config option --enable-silent-rules, the default automake rules will print e.g. " CC misc/lib64_libmsvcrt_extra_a-wctype.o" when compiling such a file. However, any custom makefile rules will

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

2025-04-02 Thread Jacek Caban
In preparation for using naked functions. --- mingw-w64-crt/Makefile.am | 4 ++-- mingw-w64-crt/include/internal.h | 8 mingw-w64-crt/math/arm64/{trunc.S => trunc.c} | 14 +- mingw-w64-crt/math/arm64/truncf.S | 16

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

2025-04-02 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 v2 3/3] crt: Use naked functions for ARM64 assembly functions.

2025-04-02 Thread Jacek Caban
On ARM64EC, function declarations have additional nuances: - Function names are mangled by prefixing them with "#" - An unmangled symbol is defined as a weak anti-dependency alias to the mangled symbol - An entry thunk is generated to convert from the x86_64 calling convention to the ARM64EC ca

Re: [Mingw-w64-public] [PATCH 3/3] crt: Use naked functions for ARM64 assembly functions.

2025-04-02 Thread Jacek Caban
On 1.04.2025 22:55, Martin Storsjö wrote: On Tue, 1 Apr 2025, Jacek Caban wrote: On ARM64EC, function declarations have additional nuances: - Function names are mangled by prefixing them with "#" - An unmangled symbol is defined as a weak anti-dependency alias to the mangled  s

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

2025-04-02 Thread Jacek Caban
On 1.04.2025 22:43, Martin Storsjö wrote: 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-public] [PATCH 3/3] crt: Use naked functions for ARM64 assembly functions.

2025-04-01 Thread Jacek Caban
On ARM64EC, function declarations have additional nuances: - Function names are mangled by prefixing them with "#" - An unmangled symbol is defined as a weak anti-dependency alias to the mangled symbol - An entry thunk is generated to convert from the x86_64 calling convention to the ARM64EC ca

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

2025-04-01 Thread Jacek Caban
In preparation for using naked functions. --- mingw-w64-crt/Makefile.am | 4 ++-- mingw-w64-crt/include/internal.h | 8 mingw-w64-crt/math/arm64/{trunc.S => trunc.c} | 14 +- mingw-w64-crt/math/arm64/truncf.S | 16

Re: [Mingw-w64-public] [PATCH] crt: Implement exp2/exp2f/exp2l in C on ARM targets.

2025-04-01 Thread Jacek Caban
On 31.03.2025 22:31, Martin Storsjö wrote: On Mon, 31 Mar 2025, Jacek Caban wrote: --- mingw-w64-crt/Makefile.am | 10 ++ .../math/{arm64/exp2f.S => arm-common/exp2.c} | 16 ++-- .../math/{arm/exp2f.S => arm-common/exp2f.c}  | 16 ++-- min

[Mingw-w64-public] [PATCH] crt: Implement exp2/exp2f/exp2l in C on ARM targets.

2025-03-31 Thread Jacek Caban
--- mingw-w64-crt/Makefile.am | 10 ++ .../math/{arm64/exp2f.S => arm-common/exp2.c} | 16 ++-- .../math/{arm/exp2f.S => arm-common/exp2f.c} | 16 ++-- mingw-w64-crt/math/arm-common/exp2l.c | 12 mingw-w64-crt/math/arm/exp2.

Re: [Mingw-w64-public] [PATCH v2 6/7] crt: Build with -fno-builtin.

2025-03-31 Thread Jacek Caban
On 26.03.2025 14:07, Martin Storsjö wrote: On Sat, 22 Mar 2025, Jacek Caban wrote: mingw-w64-crt implements a number of functions that the compiler considers built-in. Currently, we must be cautious about compiler optimizations, as they may not align with our intentions. In theory, the

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

2025-03-31 Thread Jacek Caban
On 31.03.2025 03:35, LIU Hao wrote: The effect that `__mingw_fe_dfl_env` etc. are defined everywhere is probably not good. Jacek, do you agree with this change? I can adjust the patch if we agree on that. Yes, I agree, but with Martin's comment addressed and x86-specific declarations #ifdefe

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

2025-03-30 Thread Jacek Caban
On 29.03.2025 20:53, Martin Storsjö wrote: 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

Re: [Mingw-w64-public] mingw-w64 loadcfg.S compile error

2025-03-29 Thread Jacek Caban
On 20.03.2025 20:29, Pali Rohár wrote: I suspect that the change is related to recent commit cd45d275754e ("crt: Always include load config in mingwex."). Jacek, could you look at it? For the record, my old gcc, ld and as versions are: gcc version 8.3-win32 20190406 (GCC) GNU ld (GNU Binutils)

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

2025-03-28 Thread Jacek Caban
--- mingw-w64-crt/Makefile.am| 2 -- mingw-w64-crt/def-include/crt-aliases.def.in | 1 + .../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] Revert "ucrtbase: Make sure that compat symbols aren't autoexported"

2025-03-27 Thread Jacek Caban
On 20.03.2025 23:24, Martin Storsjö wrote: This reverts commit 91459ac35276522b0e4405c76795d91822bb395a. That commit was a workaround for older binutils or LLD versions, that would otherwise autoexport symbols from the CRT libraries. Since 9d9c67b06c1bf4c4550e3de0eb575c2bfbe96df9 in binutils (i

[Mingw-w64-public] [PATCH 2/2] crt: Implement sincos in C.

2025-03-24 Thread Jacek Caban
--- mingw-w64-crt/Makefile.am | 20 +- mingw-w64-crt/math/arm-common/sincosl.c | 13 +++ mingw-w64-crt/math/arm/sincos.S | 32 mingw-w64-crt/math/arm/sincosf.S| 29 -- mingw-w64-crt/math/arm64/sincos.S | 34 --

[Mingw-w64-public] [PATCH 1/2] crt: Build with -fno-builtin.

2025-03-23 Thread Jacek Caban
mingw-w64-crt implements a number of functions that the compiler considers built-in. Currently, we must be cautious about compiler optimizations, as they may not align with our intentions. In theory, the compiler could optimize an implementation of such a function back into a call to itself. Rathe

[Mingw-w64-public] [PATCH] crt, headers: Use headers to redirect __ms_v*scanf functions to v*scanf functions.

2025-03-22 Thread Jacek Caban
--- mingw-w64-crt/Makefile.am| 11 ++- mingw-w64-crt/def-include/crt-aliases.def.in | 8 - mingw-w64-crt/lib-common/msvcr120_app.def.in | 1 - mingw-w64-crt/lib32/msvcr120.def.in | 1 - mingw-w64-crt/lib64/msvcr120.def.in | 1 - mingw-w64-crt/libar

[Mingw-w64-public] [PATCH v2 6/7] crt: Build with -fno-builtin.

2025-03-22 Thread Jacek Caban
mingw-w64-crt implements a number of functions that the compiler considers built-in. Currently, we must be cautious about compiler optimizations, as they may not align with our intentions. In theory, the compiler could optimize an implementation of such a function back into a call to itself. Rathe

[Mingw-w64-public] [PATCH v2 1/7] crt: Remove redundant STARTUPINFO initialization.

2025-03-22 Thread Jacek Caban
--- mingw-w64-crt/crt/crtexewin.c | 1 - 1 file changed, 1 deletion(-) diff --git a/mingw-w64-crt/crt/crtexewin.c b/mingw-w64-crt/crt/crtexewin.c index 26179fa90..af860f3e7 100644 --- a/mingw-w64-crt/crt/crtexewin.c +++ b/mingw-w64-crt/crt/crtexewin.c @@ -56,7 +56,6 @@ int _tmain (int __UNUS

[Mingw-w64-public] [PATCH v2 2/7] crt: Avoid memset calls in libsrc/ws2tcpip.

2025-03-22 Thread Jacek Caban
--- mingw-w64-crt/libsrc/ws2tcpip/in6_set_addr_loopback.c| 2 +- mingw-w64-crt/libsrc/ws2tcpip/in6_set_addr_unspecified.c | 2 +- mingw-w64-crt/libsrc/ws2tcpip/in6addr_setany.c | 5 + mingw-w64-crt/libsrc/ws2tcpip/in6addr_setloopback.c | 7 --- 4 files changed, 3 inserti

[Mingw-w64-public] [PATCH v2 7/7] crt: Implement sincos in C.

2025-03-22 Thread Jacek Caban
--- mingw-w64-crt/Makefile.am | 19 + mingw-w64-crt/math/arm-common/sincosl.c | 13 +++ mingw-w64-crt/math/arm/sincos.S | 32 mingw-w64-crt/math/arm/sincosf.S| 29 -- mingw-w64-crt/math/arm64/sincos.S | 34 ---

[Mingw-w64-public] [PATCH v2 5/7] crt: Avoid memset call in profile_ctl.

2025-03-22 Thread Jacek Caban
--- mingw-w64-crt/profile/profil.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mingw-w64-crt/profile/profil.c b/mingw-w64-crt/profile/profil.c index 0c0387136..c566bb6dd 100644 --- a/mingw-w64-crt/profile/profil.c +++ b/mingw-w64-crt/profile/profil.c @@ -185,7 +185,7 @@ pro

[Mingw-w64-public] [PATCH v2 3/7] crt: Avoid memset calls in stat functions implementation.

2025-03-22 Thread Jacek Caban
--- mingw-w64-crt/stdio/_findfirst64i32.c | 2 +- mingw-w64-crt/stdio/_findnext64i32.c | 2 +- mingw-w64-crt/stdio/_fstat64i32.c | 2 +- mingw-w64-crt/stdio/_stat.c| 4 ++-- mingw-w64-crt/stdio/_stat64i32.c | 2 +- mingw-w64-crt/stdio/_wfindfirst64i32.c | 2 +- mingw-w64-

[Mingw-w64-public] [PATCH v2 4/7] crt: Avoid memset calls in stdio format functions.

2025-03-22 Thread Jacek Caban
--- mingw-w64-crt/stdio/mingw_pformat.c | 21 +++-- mingw-w64-crt/stdio/mingw_sformat.c | 10 -- mingw-w64-crt/stdio/mingw_swformat.c | 10 +- mingw-w64-crt/stdio/mingw_vfscanf.c | 4 +--- mingw-w64-crt/stdio/mingw_vfwscanf.c | 4 +--- mingw-w64-crt/stdio/mingw

Re: [Mingw-w64-public] [PATCH 2/2] crt: Implement sincos in C.

2025-03-21 Thread Jacek Caban
On 21.03.2025 22:52, Martin Storsjö wrote: On Fri, 21 Mar 2025, Jacek Caban wrote: --- mingw-w64-crt/Makefile.am   | 20 +- mingw-w64-crt/math/arm-common/sincosl.c | 13 +++ mingw-w64-crt/math/arm/sincos.S | 32 mingw-w64-crt/math/arm/sincosf.S

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

2025-03-21 Thread Jacek Caban
On 21.03.2025 22:43, Martin Storsjö wrote: 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

Re: [Mingw-w64-public] [PATCH 1/2] crt: Build with -fno-builtin.

2025-03-21 Thread Jacek Caban
On 21.03.2025 18:39, LIU Hao wrote: 在 2025-3-21 23:25, Jacek Caban 写道: mingw-w64-crt implements a number of functions that the compiler considers built-in. Currently, we must be cautious about compiler optimizations, as they may not align with our intentions. In theory, the compiler could

  1   2   3   4   5   6   7   8   9   10   >