Re: [Mingw-w64-public] [PATCH v3 2/5] headers: Expose the ARM64 CONTEXT structure to all build architectures

2025-01-08 Thread Martin Storsjö
On Wed, 8 Jan 2025, Jacek Caban wrote: On 8.01.2025 22:45, Martin Storsjö wrote: On Wed, 8 Jan 2025, Jacek Caban wrote: This is necessary to accommodate ARM64EC, under which CONTEXT refers to the X86_64 context structure but the regular ARM64 context structure is still exposed as ARM64_NT_

Re: [Mingw-w64-public] [PATCH v3 2/5] headers: Expose the ARM64 CONTEXT structure to all build architectures

2025-01-08 Thread Jacek Caban
On 8.01.2025 22:45, Martin Storsjö wrote: On Wed, 8 Jan 2025, Jacek Caban wrote: This is necessary to accommodate ARM64EC, under which CONTEXT refers to the X86_64 context structure but the regular ARM64 context structure is still exposed as ARM64_NT_CONTEXT. Based on patch by Billy Laws.

Re: [Mingw-w64-public] [PATCH v3 3/5] headers: Add missing ARM64 context defines.

2025-01-08 Thread Martin Storsjö
On Wed, 8 Jan 2025, Jacek Caban wrote: Based on patch by Billy Laws. Signed-off-by: Jacek Caban --- mingw-w64-headers/include/winnt.h | 10 ++ 1 file changed, 10 insertions(+) Thanks for splitting these patches! This does make it even clearer and nicer. This series looks good to me

Re: [Mingw-w64-public] [PATCH v3 2/5] headers: Expose the ARM64 CONTEXT structure to all build architectures

2025-01-08 Thread Martin Storsjö
On Wed, 8 Jan 2025, Jacek Caban wrote: This is necessary to accommodate ARM64EC, under which CONTEXT refers to the X86_64 context structure but the regular ARM64 context structure is still exposed as ARM64_NT_CONTEXT. Based on patch by Billy Laws. Signed-off-by: Jacek Caban --- v3: Better s

[Mingw-w64-public] [PATCH 4/6] crt: Add new crt header file msvcrt_or_emu_glue.h which generates common code for loading msvcrt function or using it emulation

2025-01-08 Thread Pali Rohár
--- mingw-w64-crt/include/msvcrt_or_emu_glue.h | 112 + mingw-w64-headers/crt/_mingw_mac.h | 15 +-- 2 files changed, 121 insertions(+), 6 deletions(-) create mode 100644 mingw-w64-crt/include/msvcrt_or_emu_glue.h diff --git a/mingw-w64-crt/include/msvcrt_or_emu_glue

[Mingw-w64-public] [PATCH 5/6] crt: Replace repeated code for loading of msvcrt.dll function by common code from msvcrt_or_emu_glue.h

2025-01-08 Thread Pali Rohár
--- mingw-w64-crt/misc/_create_locale.c | 25 ++- mingw-w64-crt/misc/_free_locale.c| 25 ++- mingw-w64-crt/misc/_get_current_locale.c | 32 - mingw-w64-crt/misc/output_format.c | 85 ++-- mingw-w64-crt/misc/wassert.c | 37 ++---

[Mingw-w64-public] [PATCH 2/6] crt: Use GetModuleHandleA() in __mingw_get_msvcrt_handle()

2025-01-08 Thread Pali Rohár
This allows to get msvcrt module also on non-NT systems, on which GetModuleHandleW() always returns NULL. --- mingw-w64-crt/include/msvcrt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mingw-w64-crt/include/msvcrt.h b/mingw-w64-crt/include/msvcrt.h index de708c60b528..348a8

[Mingw-w64-public] [PATCH 1/6] crt: Add include guard for msvcrt.h file

2025-01-08 Thread Pali Rohár
This allow to include msvcrt.h more times. --- mingw-w64-crt/include/msvcrt.h | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mingw-w64-crt/include/msvcrt.h b/mingw-w64-crt/include/msvcrt.h index c6f10522471a..de708c60b528 100644 --- a/mingw-w64-crt/include/msvcrt.h ++

[Mingw-w64-public] [PATCH 6/6] crt: Enable _create_locale.c, _free_locale.c and _get_current_locale.c for all pre-msvcr80 import libraries

2025-01-08 Thread Pali Rohár
With the previous change, these 3 files can be compiled and included also for non-msvcrt-os import library. --- mingw-w64-crt/Makefile.am | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mingw-w64-crt/Makefile.am b/mingw-w64-crt/Makefile.am index 97ab3b4742cc..7f8841a85f3f 100644 --- a/mingw

[Mingw-w64-public] [PATCH 3/6] crt: Fix return type of __mingw_get_msvcrt_handle() function

2025-01-08 Thread Pali Rohár
Function GetModuleHandle() returns HMODULE, not HANDLE. So function __mingw_get_msvcrt_handle() has to also return HMODULE. --- mingw-w64-crt/include/msvcrt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mingw-w64-crt/include/msvcrt.h b/mingw-w64-crt/include/msvcrt.h index 3

[Mingw-w64-public] [PATCH] crt: Update description about function in mingw-w64-crt/stdio/scanf.S file

2025-01-08 Thread Pali Rohár
--- mingw-w64-crt/stdio/scanf.S | 33 + 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/mingw-w64-crt/stdio/scanf.S b/mingw-w64-crt/stdio/scanf.S index 41ff64598c59..50e628a89268 100644 --- a/mingw-w64-crt/stdio/scanf.S +++ b/mingw-w64-crt/stdio/scan

[Mingw-w64-public] [PATCH] crt: Split fseeki64.c into _fseeki64.c and _ftelli64.c

2025-01-08 Thread Pali Rohár
File fseeki64.c provides two functions _fseeki64() and _ftelli64(). Function _fseeki64() is available in all CRT ARM versions, including system msvcrt.dll. For x86 versions, it is available since msvcr80.dll, for system msvcrt.dll it is disabled for backward compatibility. Function _ftelli64() is a

Re: [Mingw-w64-public] [PATCH 1/3] headers: Commonize _UNWIND_HISTORY_TABLE structure definition

2025-01-08 Thread Jacek Caban
On 8.01.2025 18:52, Biswapriyo Nath wrote: Those types use the same underlying type, so there should be no problem with printfs. DWORD, ULONG and ULONG_PTR are unsigned long on 32-bit, DWORD64, ULONG64 and ULONT_PTR are unsigned long long on 64-bit. Out of curiosity, are you sure about that ther

[Mingw-w64-public] [PATCH v2 3/5] headers: Add missing ARM64 context defines.

2025-01-08 Thread Jacek Caban
Based on patch by Billy Laws. Signed-off-by: Jacek Caban --- mingw-w64-headers/include/winnt.h | 5 + 1 file changed, 5 insertions(+) diff --git a/mingw-w64-headers/include/winnt.h b/mingw-w64-headers/include/winnt.h index 241be645e..e58336d35 100644 --- a/mingw-w64-headers/include/winnt.

Re: [Mingw-w64-public] [PATCH 1/3] headers: Commonize _UNWIND_HISTORY_TABLE structure definition

2025-01-08 Thread Biswapriyo Nath
> Those types use the same underlying type, so there should be no problem > with printfs. DWORD, ULONG and ULONG_PTR are unsigned long on 32-bit, > DWORD64, ULONG64 and ULONT_PTR are unsigned long long on 64-bit. Out of curiosity, are you sure about that there will be no problem? I remember gettin

Re: [Mingw-w64-public] [PATCH 3/3] headers: Add ARM64EC context structures

2025-01-08 Thread Jacek Caban
On 8.01.2025 14:59, Martin Storsjö wrote: On Mon, 6 Jan 2025, Jacek Caban wrote: From: Billy Laws Signed-off-by: Jacek Caban --- mingw-w64-headers/include/winnt.h | 128 ++ 1 file changed, 128 insertions(+) This is a bit tricky to reference/quote for commenting,

Re: [Mingw-w64-public] [PATCH 3/3] headers: Add ARM64EC context structures

2025-01-08 Thread Jacek Caban
On 8.01.2025 14:31, LIU Hao wrote: 在 2025-01-07 00:03, Jacek Caban 写道: +    ARM64_NT_NEON128 V[16];   /* 1a0 (XmmRegisters) */ +    BYTE    AMD64_XSAVE_FORMAT_Reserved4[96]; /* 2a0 */ +    } DUMMYSTRUCTNAME; +    M128A   AMD64_VectorRegist

[Mingw-w64-public] [PATCH v3 3/5] headers: Add missing ARM64 context defines.

2025-01-08 Thread Jacek Caban
Based on patch by Billy Laws. Signed-off-by: Jacek Caban --- mingw-w64-headers/include/winnt.h | 10 ++ 1 file changed, 10 insertions(+) diff --git a/mingw-w64-headers/include/winnt.h b/mingw-w64-headers/include/winnt.h index 2b76698f1..e58336d35 100644 --- a/mingw-w64-headers/include

[Mingw-w64-public] [PATCH v3 2/5] headers: Expose the ARM64 CONTEXT structure to all build architectures

2025-01-08 Thread Jacek Caban
This is necessary to accommodate ARM64EC, under which CONTEXT refers to the X86_64 context structure but the regular ARM64 context structure is still exposed as ARM64_NT_CONTEXT. Based on patch by Billy Laws. Signed-off-by: Jacek Caban --- v3: Better split. mingw-w64-headers/include/winnt.h

[Mingw-w64-public] [PATCH v3 4/5] headers: Include CONTEXT_ARM64_FLOATING_POINT in CONTEXT_ARM64_FULL and CONTEXT_ARM64_X18 in CONTEXT_ARM64_ALL.

2025-01-08 Thread Jacek Caban
Based on patch by Billy Laws. Signed-off-by: Jacek Caban --- mingw-w64-headers/include/winnt.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mingw-w64-headers/include/winnt.h b/mingw-w64-headers/include/winnt.h index e58336d35..a49c1632c 100644 --- a/mingw-w64-headers

[Mingw-w64-public] [PATCH v3 5/5] headers: Add ARM64EC context structures

2025-01-08 Thread Jacek Caban
From: Billy Laws Signed-off-by: Jacek Caban --- mingw-w64-headers/include/winnt.h | 128 ++ 1 file changed, 128 insertions(+) diff --git a/mingw-w64-headers/include/winnt.h b/mingw-w64-headers/include/winnt.h index a49c1632c..366bd807e 100644 --- a/mingw-w64-heade

[Mingw-w64-public] [PATCH v3 1/5] headers: Remove duplicated EXCEPTION_* macros on ARM64.

2025-01-08 Thread Jacek Caban
Based on patch by Billy Laws. Signed-off-by: Jacek Caban --- mingw-w64-headers/include/winnt.h | 4 1 file changed, 4 deletions(-) diff --git a/mingw-w64-headers/include/winnt.h b/mingw-w64-headers/include/winnt.h index 3fe530f0a..b4fab0174 100644 --- a/mingw-w64-headers/include/winnt.h

Re: [Mingw-w64-public] [PATCH 2/3] headers: Expose the ARM64 CONTEXT structure to all build architectures

2025-01-08 Thread Jacek Caban
On 8.01.2025 14:49, Martin Storsjö wrote: On Mon, 6 Jan 2025, Jacek Caban wrote: This is necessary to accommodate ARM64EC, under which CONTEXT refers to the X86_64 context structure but the regular ARM64 context structure is still exposed as ARM64_NT_CONTEXT. Based on patch by Billy Laws.

[Mingw-w64-public] [PATCH v2 5/5] headers: Add ARM64EC context structures

2025-01-08 Thread Jacek Caban
From: Billy Laws Signed-off-by: Jacek Caban --- mingw-w64-headers/include/winnt.h | 128 ++ 1 file changed, 128 insertions(+) diff --git a/mingw-w64-headers/include/winnt.h b/mingw-w64-headers/include/winnt.h index a49c1632c..366bd807e 100644 --- a/mingw-w64-heade

[Mingw-w64-public] [PATCH v2 4/5] headers: Include CONTEXT_ARM64_FLOATING_POINT in CONTEXT_ARM64_FULL and CONTEXT_ARM64_X18 in CONTEXT_ARM64_ALL.

2025-01-08 Thread Jacek Caban
Based on patch by Billy Laws. Signed-off-by: Jacek Caban --- mingw-w64-headers/include/winnt.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mingw-w64-headers/include/winnt.h b/mingw-w64-headers/include/winnt.h index e58336d35..a49c1632c 100644 --- a/mingw-w64-headers

[Mingw-w64-public] [PATCH v2 2/5] headers: Expose the ARM64 CONTEXT structure to all build architectures

2025-01-08 Thread Jacek Caban
This is necessary to accommodate ARM64EC, under which CONTEXT refers to the X86_64 context structure but the regular ARM64 context structure is still exposed as ARM64_NT_CONTEXT. Based on patch by Billy Laws. Signed-off-by: Jacek Caban --- mingw-w64-headers/include/winnt.h | 91 ++

[Mingw-w64-public] [PATCH v2 1/5] headers: Remove duplicated EXCEPTION_* macros on ARM64.

2025-01-08 Thread Jacek Caban
Based on patch by Billy Laws. Signed-off-by: Jacek Caban --- mingw-w64-headers/include/winnt.h | 4 1 file changed, 4 deletions(-) diff --git a/mingw-w64-headers/include/winnt.h b/mingw-w64-headers/include/winnt.h index 3fe530f0a..b4fab0174 100644 --- a/mingw-w64-headers/include/winnt.h

Re: [Mingw-w64-public] [PATCH 1/3] headers: Commonize _UNWIND_HISTORY_TABLE structure definition

2025-01-08 Thread Martin Storsjö
On Wed, 8 Jan 2025, Jacek Caban wrote: On 8.01.2025 14:22, Martin Storsjö wrote: On Mon, 6 Jan 2025, Jacek Caban wrote: From: Billy Laws This structure is the same across every architecture that uses it, so avoid needlessly duplicating its definition. Signed-off-by: Jacek Caban --- With

Re: [Mingw-w64-public] [PATCH 3/3] headers: Add ARM64EC context structures

2025-01-08 Thread Martin Storsjö
On Wed, 8 Jan 2025, Martin Storsjö wrote: On Mon, 6 Jan 2025, Jacek Caban wrote: From: Billy Laws Signed-off-by: Jacek Caban --- mingw-w64-headers/include/winnt.h | 128 ++ 1 file changed, 128 insertions(+) This is a bit tricky to reference/quote for commenting

Re: [Mingw-w64-public] [PATCH 3/3] headers: Add ARM64EC context structures

2025-01-08 Thread Martin Storsjö
On Mon, 6 Jan 2025, Jacek Caban wrote: From: Billy Laws Signed-off-by: Jacek Caban --- mingw-w64-headers/include/winnt.h | 128 ++ 1 file changed, 128 insertions(+) This is a bit tricky to reference/quote for commenting, when the patch isn't inline... I presum

Re: [Mingw-w64-public] [PATCH 2/3] headers: Expose the ARM64 CONTEXT structure to all build architectures

2025-01-08 Thread Martin Storsjö
On Mon, 6 Jan 2025, Jacek Caban wrote: This is necessary to accommodate ARM64EC, under which CONTEXT refers to the X86_64 context structure but the regular ARM64 context structure is still exposed as ARM64_NT_CONTEXT. Based on patch by Billy Laws. Signed-off-by: Jacek Caban --- mingw-w64-hea

Re: [Mingw-w64-public] [PATCH 1/3] headers: Commonize _UNWIND_HISTORY_TABLE structure definition

2025-01-08 Thread Jacek Caban
On 8.01.2025 14:22, Martin Storsjö wrote: On Mon, 6 Jan 2025, Jacek Caban wrote: From: Billy Laws This structure is the same across every architecture that uses it, so avoid needlessly duplicating its definition. Signed-off-by: Jacek Caban --- With this series, platform headers are useful

Re: [Mingw-w64-public] [PATCH 3/3] headers: Add ARM64EC context structures

2025-01-08 Thread LIU Hao
在 2025-01-07 00:03, Jacek Caban 写道: +ARM64_NT_NEON128 V[16]; /* 1a0 (XmmRegisters) */ +BYTEAMD64_XSAVE_FORMAT_Reserved4[96]; /* 2a0 */ +} DUMMYSTRUCTNAME; +M128A AMD64_VectorRegister[26]; /* 300 */ I su

Re: [Mingw-w64-public] [PATCH 1/3] headers: Commonize _UNWIND_HISTORY_TABLE structure definition

2025-01-08 Thread Martin Storsjö
On Mon, 6 Jan 2025, Jacek Caban wrote: From: Billy Laws This structure is the same across every architecture that uses it, so avoid needlessly duplicating its definition. Signed-off-by: Jacek Caban --- With this series, platform headers are useful on arm64ec target. mingw-w64-headers/incl