Re: [Mingw-w64-public] [PATCH] crt: msvcr70.def.in: Add missing @SIZE suffixes and __CxxCallUnwindVecDtor

2024-04-15 Thread Pali Rohár
On Monday 15 April 2024 09:19:09 LIU Hao wrote: > 在 2024-04-15 04:52, Pali Rohár 写道: > > Symbols _assert@4 and abort@4 in all versions of msvcr70.dll have @SIZE > > suffixes. Without @SIZE suffixes they are only in debug msvcr70d.dll > > library versions and Itanium

Re: [Mingw-w64-public] [PATCH] crt: msvcr70.def.in: Add missing @SIZE suffixes and __CxxCallUnwindVecDtor

2024-04-15 Thread Pali Rohár
On Monday 15 April 2024 10:49:43 Martin Storsjö wrote: > On Mon, 15 Apr 2024, Pali Rohár wrote: > > > On Monday 15 April 2024 09:19:09 LIU Hao wrote: > > > 在 2024-04-15 04:52, Pali Rohár 写道: > > > > Symbols _assert@4 and abort@4 in all versions of msvcr70.dll hav

Re: [Mingw-w64-public] [PATCH] crt: msvcr70.def.in: Add missing @SIZE suffixes and __CxxCallUnwindVecDtor

2024-04-15 Thread Pali Rohár
On Monday 15 April 2024 10:49:43 Martin Storsjö wrote: > Or just compiling a test C file with the corresponding > MSVC version and looking at the generated object file to see what symbol > reference it generated. So... now I did an experiment with VC4.2 CL.EXE (first version which generate code fo

Re: [Mingw-w64-public] [PATCH] crt: msvcr70.def.in: Add missing @SIZE suffixes and __CxxCallUnwindVecDtor

2024-04-15 Thread Pali Rohár
On Monday 15 April 2024 23:50:09 Martin Storsjö wrote: > On Mon, 15 Apr 2024, Pali Rohár wrote: > > > On Monday 15 April 2024 10:49:43 Martin Storsjö wrote: > > > Or just compiling a test C file with the corresponding > > > MSVC version and looking at the generated

Re: [Mingw-w64-public] [PATCH] crt: msvcr70.def.in: Add missing @SIZE suffixes and __CxxCallUnwindVecDtor

2024-04-15 Thread Pali Rohár
On Monday 15 April 2024 23:40:34 Martin Storsjö wrote: > On Mon, 15 Apr 2024, Pali Rohár wrote: > > > > These functions are exported on the DLL interface as plain "name". When we > > > call them, via a declaration marked as stdcall in C, it does produce a >

Re: [Mingw-w64-public] [PATCH] crt: msvcr71.def.in: Add missing @SIZE suffixes

2024-04-15 Thread Pali Rohár
Please drop this change. It is also false positive stdcall decoration by gendef for functions which do not return. On Sunday 14 April 2024 22:52:59 Pali Rohár wrote: > Symbols _assert@4 and abort@4 in all versions of msvcr71.dll have @SIZE > suffixes. Without @SIZE suffixes they are only in

Re: [Mingw-w64-public] [PATCH] crt: msvcr70.def.in: Add missing @SIZE suffixes and __CxxCallUnwindVecDtor

2024-04-17 Thread Pali Rohár
On Tuesday 16 April 2024 10:20:50 Martin Storsjö wrote: > On Tue, 16 Apr 2024, LIU Hao wrote: > > > > I think it is better to be compatible with MSVC object level behavior > > > than inventing new/custom object level behavior. Meaning to export it > > > from def file without @SIZE. > > > > > > Bu

Re: [Mingw-w64-public] [PATCH] crt: msvcr70.def.in: Add missing @SIZE suffixes and __CxxCallUnwindVecDtor

2024-04-18 Thread Pali Rohár
On Wednesday 17 April 2024 23:59:34 Martin Storsjö wrote: > On Wed, 17 Apr 2024, Pali Rohár wrote: > > > I agree, it is impossible to have it at C level. Or at least I have not > > found a way how to do it. > > > > What is possible is to call that function from a

Re: [Mingw-w64-public] [PATCH 6/9] crt: msvcr80.def.in: Fix some some I386 symbol names which miss @SIZE suffix

2024-04-18 Thread Pali Rohár
On Friday 19 April 2024 00:22:31 Martin Storsjö wrote: > On Mon, 8 Apr 2024, Pali Rohár wrote: > > > I386 symbols __CxxLongjmpUnwind, _adj_fdiv_m*, _adj_fdivr_m* and > > _seh_longjmp_unwind have @SIZE suffix in I386 version of msvcr80.dll. > > I presume this is not a cas

[Mingw-w64-public] [PATCH 6/6] crt: msvcr80.def.in: Fix __fls_getvalue@4 and __fls_setvalue@8 symbols

2024-04-19 Thread Pali Rohár
Same change as in commit 9b17c3374aa9eb809938bbcf7cf37093e842a4a7 for the I386 msvcr80.def.in file. --- mingw-w64-crt/lib32/msvcr80.def.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mingw-w64-crt/lib32/msvcr80.def.in b/mingw-w64-crt/lib32/msvcr80.def.in index 6073d4c5

[Mingw-w64-public] [PATCH 1/6] crt: msvcrt.def.in: Remove wrong comment about _endthread/_endthreadex symbols

2024-04-19 Thread Pali Rohár
These functions do not return and gendef false positively detected stdcall calling convention for them on Windows XP and SP1 binaries. Remove wrong comment. --- mingw-w64-crt/lib-common/msvcrt.def.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mingw-w64-crt/lib-common/m

[Mingw-w64-public] [PATCH 4/6] crt: Fix _adj_fdiv_m* and _adj_fdivr_m* symbols

2024-04-19 Thread Pali Rohár
CRT library functions _adj_fdiv_m* and _adj_fdivr_m* have custom calling convention. These functions take two arguments. First argument is passed in x87 st(0) register and second argument on the stack (either 4 or 8 bytes). Function itself pops the stack (like stdcall convention) and return value i

[Mingw-w64-public] [PATCH 2/6] crt: msvcrt40.def.in: Fix informatin about __p__dstbias symbol

2024-04-19 Thread Pali Rohár
Symbol __p__dstbias is available in both NT and Win32s variants of Visual C++ 4.1 msvcrt40.dll version. --- mingw-w64-crt/lib32/msvcrt40.def.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mingw-w64-crt/lib32/msvcrt40.def.in b/mingw-w64-crt/lib32/msvcrt40.def.in index d

[Mingw-w64-public] [PATCH 3/6] crt: msvcrt40.def.in: Fix stdcall symbols with @SIZE suffix

2024-04-19 Thread Pali Rohár
_CxxThrowException, __CxxLongjmpUnwind, _adj_fdiv_*, _adj_fdivr_* and _seh_longjmp_unwind are present also in Windows NT-based OS system versions of msvcrt40.dll as redirects to msvcrt.dll library. gendef does not recognize stdcall convention by default for such redirected symbols and shows them w

Re: [Mingw-w64-public] [PATCH 6/9] crt: msvcr80.def.in: Fix some some I386 symbol names which miss @SIZE suffix

2024-04-19 Thread Pali Rohár
On Friday 19 April 2024 10:26:32 Martin Storsjö wrote: > On Fri, 19 Apr 2024, Martin Storsjö wrote: > > > On Thu, 18 Apr 2024, Pali Rohár wrote: > > > > > On Friday 19 April 2024 00:22:31 Martin Storsjö wrote: > > > > On Mon, 8 Apr 2024, Pali Rohár

[Mingw-w64-public] [PATCH 5/6] crt: msvcr70.def.in: Add missing __CxxCallUnwindVecDtor

2024-04-19 Thread Pali Rohár
Visual Studio .NET 2002 version of msvcr70.dll library (7.00.9466.0) contains additional symbol __CxxCallUnwindVecDtor. Some older library version (7.00.9210.0) does not have this symbol. Same set of symbols as in the released .NET 2002 version is available also in Visual Studio .NET 2002 Service P

Re: [Mingw-w64-public] [PATCH] crt: execv*/spawnv* const-correctness

2024-04-20 Thread Pali Rohár
> > > So we gain conformance with MSVC, but lose conformance with POSIX. (OTOH, > > > our functions are named with leading underscores, which can motivate them > > > differing.) > > > > AFAIK types (not even type-constness) are **not** a part of C ABI on any > > known platform to me. > > I didn't s

[Mingw-w64-public] [PATCH 02/10] crt: Remove _getwc_nolock symbol alias

2024-04-22 Thread Pali Rohár
Symbol _getwc_nolock is provided via mingw-w64-crt/stdio/_getwc_nolock.c --- mingw-w64-crt/lib32/msvcr80.def.in | 1 - mingw-w64-crt/lib32/msvcr90.def.in | 1 - mingw-w64-crt/lib32/msvcr90d.def.in | 1 - mingw-w64-crt/lib64/msvcr80.def.in | 1 - mingw-w64-crt/lib64/msvcr90.def.in | 1 - mingw-

[Mingw-w64-public] [PATCH 01/10] crt: Remove duplicate symbol alises for strlwr and wcslwr

2024-04-22 Thread Pali Rohár
These aliases are automatically added by including msvcrt-common.def.in file into every msvcr*.def.in file. --- mingw-w64-crt/lib-common/msvcr120_app.def.in | 2 -- mingw-w64-crt/lib32/crtdll.def.in| 2 -- mingw-w64-crt/lib32/msvcr100.def.in | 2 -- mingw-w64-crt/lib32/msvcr11

[Mingw-w64-public] [PATCH 06/10] crt: Move _atoi64 and _atoi64_l aliases to def-include/msvcrt-common.def.in

2024-04-22 Thread Pali Rohár
Define _atoi64 and _atoi64_l aliases based on a new WITH_ATOLL_ALIAS and WITH_ATOLL_L_ALIAS macros. --- mingw-w64-crt/def-include/msvcrt-common.def.in | 8 mingw-w64-crt/lib-common/msvcrt.def.in | 4 ++-- mingw-w64-crt/lib32/msvcr100.def.in| 4 ++-- mingw-w64-crt/lib32

[Mingw-w64-public] [PATCH 00/10] crt: Move symbol aliases from CRT def files to msvcrt-common.def.in

2024-04-22 Thread Pali Rohár
+_wfindfirsti64 == _wfindfirst64 +_wfindnexti64 == _wfindnext64 +_wutime == _wutime64 +difftime == _difftime64 Pali Rohár (10): crt: Remove duplicate symbol alises for strlwr and wcslwr crt: Remove _getwc_nolock symbol alias crt: Remove _fgetc_nolock symbol alias crt: Move __ms_* symbol

[Mingw-w64-public] [PATCH 05/10] crt: Move _strcmpi alias to def-include/msvcrt-common.def.in

2024-04-22 Thread Pali Rohár
Define _strcmpi alias based on a new NO_STRCMPI_ALIAS macro. --- mingw-w64-crt/def-include/msvcrt-common.def.in | 8 mingw-w64-crt/lib-common/msvcr120_app.def.in | 3 +++ mingw-w64-crt/lib-common/msvcrt.def.in | 1 + mingw-w64-crt/lib-common/ucrtbase.def.in | 1 - mingw-w6

[Mingw-w64-public] [PATCH 04/10] crt: Move __ms_* symbol aliases to def-include/msvcrt-common.def.in

2024-04-22 Thread Pali Rohár
def-include/msvcrt-common.def.in is included into every msvcr*.def.in file. So move them all common __ms_* symbol aliases which removes definition duplication. msvcr* library before version 8.0 have symbols swprintf/vswprintf which represents pre-C95 variants of these functions without maxlen argu

[Mingw-w64-public] [PATCH 07/10] crt: Move llabs and imaxabs aliases to def-include/msvcrt-common.def.in

2024-04-22 Thread Pali Rohár
Define llabs and imaxabs aliases based on a new WITH_LLABS_ALIAS and WITH_IMAXABS_ALIAS macros. --- mingw-w64-crt/def-include/msvcrt-common.def.in | 7 +++ mingw-w64-crt/lib-common/msvcrt.def.in | 6 -- mingw-w64-crt/lib32/msvcr100.def.in| 2 +- mingw-w64-crt/lib32/msvc

[Mingw-w64-public] [PATCH 03/10] crt: Remove _fgetc_nolock symbol alias

2024-04-22 Thread Pali Rohár
Symbol _fgetc_nolock is provided via mingw-w64-crt/stdio/_getc_nolock.c --- mingw-w64-crt/lib32/msvcr90.def.in | 1 - mingw-w64-crt/lib32/msvcr90d.def.in | 1 - mingw-w64-crt/lib64/msvcr90.def.in | 1 - mingw-w64-crt/lib64/msvcr90d.def.in | 1 - 4 files changed, 4 deletions(-) diff --git a/ming

[Mingw-w64-public] [PATCH 08/10] crt: Move imaxdiv alias to def-include/msvcrt-common.def.in

2024-04-22 Thread Pali Rohár
Define imaxdiv alias based on a new WITH_IMAXDIV_ALIAS macro. --- mingw-w64-crt/def-include/msvcrt-common.def.in | 4 mingw-w64-crt/lib32/msvcr100.def.in| 2 +- mingw-w64-crt/lib32/msvcr110.def.in| 2 +- mingw-w64-crt/lib64/msvcr100.def.in| 2 +- mingw-w64-

[Mingw-w64-public] [PATCH 09/10] crt: Move strto[u]ll(_l)/strto[iu]max(_l) aliases to def-include/msvcrt-common.def.in

2024-04-22 Thread Pali Rohár
Define symbol aliases based on a new WITH_STRTO64_ALIAS and WITH_STRTO64_L_ALIAS macros. --- mingw-w64-crt/def-include/msvcrt-common.def.in | 14 ++ mingw-w64-crt/lib-common/msvcrt.def.in | 13 +++-- mingw-w64-crt/lib32/msvcr100.def.in| 10 ++ mingw-

[Mingw-w64-public] [PATCH 10/10] crt: Move find, stat and time aliases to def-include/msvcrt-common.def.in

2024-04-22 Thread Pali Rohár
Add 4 new macros FIXED_SIZE_SYMBOLS, NO_I64_FIXED_SIZE, NO_FIXED_SIZE_64_ALIAS and NO_TIME_ALIAS to distinguish between different crt versions. --- .../def-include/msvcrt-common.def.in | 154 ++ mingw-w64-crt/lib-common/msvcr120_app.def.in | 33 +--- mingw-w64-crt/lib-co

Re: [Mingw-w64-public] [PATCH 00/10] crt: Move symbol aliases from CRT def files to msvcrt-common.def.in

2024-04-25 Thread Pali Rohár
On Wednesday 24 April 2024 23:34:50 Martin Storsjö wrote: > On Mon, 22 Apr 2024, Pali Rohár wrote: > > > This patch series moves all aliases defined in crtdll.def.in, and > > msvcr*.def.in files into one common include file msvcrt-common.def.in. > > > > It reduc

Re: [Mingw-w64-public] [PATCH 10/10] crt: Move find, stat and time aliases to def-include/msvcrt-common.def.in

2024-04-25 Thread Pali Rohár
On Wednesday 24 April 2024 23:41:24 Martin Storsjö wrote: > On Mon, 22 Apr 2024, Pali Rohár wrote: > > > Add 4 new macros FIXED_SIZE_SYMBOLS, NO_I64_FIXED_SIZE, > > NO_FIXED_SIZE_64_ALIAS and NO_TIME_ALIAS to distinguish > > between different crt versions. > >

Re: [Mingw-w64-public] [PATCH 00/10] crt: Move symbol aliases from CRT def files to msvcrt-common.def.in

2024-04-25 Thread Pali Rohár
On Thursday 25 April 2024 14:01:16 Martin Storsjö wrote: > On Wed, 24 Apr 2024, Martin Storsjö wrote: > > > On Mon, 22 Apr 2024, Pali Rohár wrote: > > > > > This patch series moves all aliases defined in crtdll.def.in, and > > > msvcr*.def.in files

Re: [Mingw-w64-public] [PATCH 00/10] crt: Move symbol aliases from CRT def files to msvcrt-common.def.in

2024-04-25 Thread Pali Rohár
On Thursday 25 April 2024 20:18:44 Pali Rohár wrote: > On Wednesday 24 April 2024 23:34:50 Martin Storsjö wrote: > > On Mon, 22 Apr 2024, Pali Rohár wrote: > > > > > This patch series moves all aliases defined in crtdll.def.in, and > > > msvcr*.def.in files in

Re: [Mingw-w64-public] [PATCH 10/10] crt: Move find, stat and time aliases to def-include/msvcrt-common.def.in

2024-04-25 Thread Pali Rohár
On Thursday 25 April 2024 23:41:24 Martin Storsjö wrote: > On Thu, 25 Apr 2024, Pali Rohár wrote: > > > On Wednesday 24 April 2024 23:41:24 Martin Storsjö wrote: > > > On Mon, 22 Apr 2024, Pali Rohár wrote: > > > > > > > diff --git a/mingw-w64-crt/lib-c

Re: [Mingw-w64-public] [PATCH 10/10] crt: Move find, stat and time aliases to def-include/msvcrt-common.def.in

2024-04-26 Thread Pali Rohár
On Friday 26 April 2024 14:51:17 Martin Storsjö wrote: > On Fri, 26 Apr 2024, Jacek Caban wrote: > > > On 25.04.2024 23:11, Pali Rohár wrote: > > > And also it would allow to create object file which > > > calls "_findfirst" symbol and then link it wit

[Mingw-w64-public] [PATCH 1/7] crt: msvcr90d.def.in: Fix X64 ctime symbol alias to use 64-bit time_t

2024-04-27 Thread Pali Rohár
--- mingw-w64-crt/lib64/msvcr90d.def.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mingw-w64-crt/lib64/msvcr90d.def.in b/mingw-w64-crt/lib64/msvcr90d.def.in index 3c7d7525a01d..f8f6ecae13ea 100644 --- a/mingw-w64-crt/lib64/msvcr90d.def.in +++ b/mingw-w64-crt/lib64/msvcr90

[Mingw-w64-public] [PATCH 5/7] crt: msvcr120_app.def.in: Remove duplicate symbol alias swab

2024-04-27 Thread Pali Rohár
This alias is already provided by the msvcrt-common.def.in file. --- mingw-w64-crt/lib-common/msvcr120_app.def.in | 1 - 1 file changed, 1 deletion(-) diff --git a/mingw-w64-crt/lib-common/msvcr120_app.def.in b/mingw-w64-crt/lib-common/msvcr120_app.def.in index 8319ed012060..7fa9d0a32c30 100644

[Mingw-w64-public] [PATCH 4/7] crt: msvcr120_app.def.in: Fix X64 symbol aliases _stat and _stati64

2024-04-27 Thread Pali Rohár
Symbol alias is defined by "==". --- mingw-w64-crt/lib-common/msvcr120_app.def.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mingw-w64-crt/lib-common/msvcr120_app.def.in b/mingw-w64-crt/lib-common/msvcr120_app.def.in index e2474e77c372..8319ed012060 100644 --- a/mingw

[Mingw-w64-public] [PATCH 3/7] crt: msvcr120 and UCRT: Fix X64 _(w)findfirst and _(w)findnext symbol aliases

2024-04-27 Thread Pali Rohár
These symbols on X64 should resolve to _findfirst64i32/_findnext64i32 functions, like in other CRT libraries and header files. --- mingw-w64-crt/Makefile.am | 4 ...l1-1-0.def => api-ms-win-crt-filesystem-l1-1-0.def.in} | 8 ++-- mingw-w64-crt/lib-common/ms

[Mingw-w64-public] [PATCH 6/7] crt: UCRT: Change I386 time functions without suffix to use 32-bit time_t

2024-04-27 Thread Pali Rohár
CRT header files ensures that time symbols without 32/64 suffixes are not emitted. And linker always sees time symbols with explicit 32 or 64 suffix name. When CRT header files are not included then 32-bit MSVC compiler + linker treats symbols without "64" suffix name as functions which use 32-bit

[Mingw-w64-public] [PATCH 2/7] crt: msvcr90d.def.in: Fix I386 symbol alias _wfindnext

2024-04-27 Thread Pali Rohár
Symbol alias is defined by "==". --- mingw-w64-crt/lib32/msvcr90d.def.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mingw-w64-crt/lib32/msvcr90d.def.in b/mingw-w64-crt/lib32/msvcr90d.def.in index 4c31b632351e..db2eb6e01991 100644 --- a/mingw-w64-crt/lib32/msvcr90d.def.in

[Mingw-w64-public] [PATCH 7/7] crt: Move find, stat and time aliases to def-include/msvcrt-common.def.in

2024-04-27 Thread Pali Rohár
Add 4 new macros FIXED_SIZE_SYMBOLS, NO_I64_FIXED_SIZE, NO_FIXED_SIZE_64_ALIAS and NO_TIME_ALIAS to distinguish between different crt versions. This change adds new symbol aliases which were missing. There is no symbol change or removal. For reference here is list of changes between individual ou

Re: [Mingw-w64-public] [PATCH 10/10] crt: Move find, stat and time aliases to def-include/msvcrt-common.def.in

2024-04-27 Thread Pali Rohár
On Saturday 27 April 2024 10:38:58 Martin Storsjö wrote: > On Sat, 27 Apr 2024, Jacek Caban wrote: > > > On 26.04.2024 21:43, Pali Rohár wrote: > > > I played a bit with different msvc 19.x versions and 32-bit x86 variant > > > recognize time symbol and maps it

Re: [Mingw-w64-public] [PATCH 2/7] crt: msvcr90d.def.in: Fix I386 symbol alias _wfindnext

2024-04-27 Thread Pali Rohár
On Saturday 27 April 2024 22:47:33 LIU Hao wrote: > 在 2024-04-27 19:46, Pali Rohár 写道: > > Symbol alias is defined by "==". > > This message is incorrect. `=` really defines an alias [1]. `==` specifies > the export name (the name before `==` is used by the linker).

Re: [Mingw-w64-public] [PATCH 2/7] crt: msvcr90d.def.in: Fix I386 symbol alias _wfindnext

2024-04-29 Thread Pali Rohár
On Saturday 27 April 2024 22:47:33 LIU Hao wrote: > The difference arises when building a DLL with this DEF file: > > * `foo = bar` (aliasing) indicates that a function called `bar` exists in > the > DLL's source code, and it is exported both as `foo` and `bar`. In the > case of > x86

Re: [Mingw-w64-public] [PATCH 2/7] crt: msvcr90d.def.in: Fix I386 symbol alias _wfindnext

2024-04-29 Thread Pali Rohár
On Tuesday 30 April 2024 00:52:53 Martin Storsjö wrote: > On Tue, 30 Apr 2024, Martin Storsjö wrote: > > > On Mon, 29 Apr 2024, Pali Rohár wrote: > > > > > So based on these experiments when building library, I can conclude > > > that: > > &

Re: [Mingw-w64-public] [PATCH 2/7] crt: msvcr90d.def.in: Fix I386 symbol alias _wfindnext

2024-04-29 Thread Pali Rohár
On Saturday 27 April 2024 13:46:38 Pali Rohár wrote: > Symbol alias is defined by "==". So, in my opinion, the improved commit message could be: Right part of the single '=' operator is not used for creating import library. If DLL library symbol name differs from the s

Re: [Mingw-w64-public] [PATCH 6/7] crt: UCRT: Change I386 time functions without suffix to use 32-bit time_t

2024-04-30 Thread Pali Rohár
On Tuesday 30 April 2024 11:54:48 Martin Storsjö wrote: > On Sat, 27 Apr 2024, Pali Rohár wrote: > > > CRT header files ensures that time symbols without 32/64 suffixes are not > > emitted. And linker always sees time symbols with explicit 32 or 64 suffix > > name. > &

Re: [Mingw-w64-public] [PATCH 3/7] crt: msvcr120 and UCRT: Fix X64 _(w)findfirst and _(w)findnext symbol aliases

2024-04-30 Thread Pali Rohár
On Tuesday 30 April 2024 11:57:02 Martin Storsjö wrote: > On Sat, 27 Apr 2024, Pali Rohár wrote: > > > These symbols on X64 should resolve to _findfirst64i32/_findnext64i32 > > functions, like in other CRT libraries and header files. > > It could be worth mentioning in

Re: [Mingw-w64-public] [PATCH 7/7] crt: Move find, stat and time aliases to def-include/msvcrt-common.def.in

2024-04-30 Thread Pali Rohár
On Tuesday 30 April 2024 12:01:53 Martin Storsjö wrote: > On Sat, 27 Apr 2024, Pali Rohár wrote: > > > Add 4 new macros FIXED_SIZE_SYMBOLS, NO_I64_FIXED_SIZE, > > NO_FIXED_SIZE_64_ALIAS and NO_TIME_ALIAS to distinguish > > between different crt versions. > > &

Re: [Mingw-w64-public] [PATCH] crt: execv*/spawnv* const-correctness

2024-05-04 Thread Pali Rohár
On Saturday 20 April 2024 12:24:53 Pali Rohár wrote: > > > > So we gain conformance with MSVC, but lose conformance with POSIX. > > > > (OTOH, > > > > our functions are named with leading underscores, which can motivate > > > > them > >

Re: [Mingw-w64-public] [PATCH] crt: execv*/spawnv* const-correctness

2024-05-04 Thread Pali Rohár
On Saturday 04 May 2024 23:46:03 LIU Hao wrote: > 在 2024-05-04 20:18, Pali Rohár 写道: > > msvcrt's execve splits every member of arglist to more arguments by > > space. If you want to prevent this splitting then you need to quote > > argument as: > > Each Windows p

[Mingw-w64-public] [PATCH 2/9] crt: Include msvcrt-common.def.in after declaring all library symbols

2024-05-08 Thread Pali Rohár
File msvcrt-common.def.in adds just symbol aliases, so include it in CRT def files after having all symbols declared. Note that some def files use DECORATED_EXPORT macro from func.def.in file, so include func.def.in at beginning of each def file. --- mingw-w64-crt/lib-common/msvcr120_app.def.in |

[Mingw-w64-public] [PATCH 4/9] crt: Fix strcmpi symbol alias for msvcr80-120 versions

2024-05-08 Thread Pali Rohár
msvcrt versions 8.0 - 12.0 and UCRT do not have _strcmpi symbol. For these CRT versions (which have NO_STRCMPI_ALIAS) is later in the file symbol _strcmpi defined as an alias to _stricmp symbol. So for these affected CRT versions define strcmpi as an alias to _stricmp. --- mingw-w64-crt/def-incl

[Mingw-w64-public] [PATCH 3/9] crt: Document all common CRT aliases

2024-05-08 Thread Pali Rohár
Add a new helper macro ADD_UNDERSCORE_DATA for defining alias for underscored DATA symbol. Move symbol aliases into categories and document from which oldnames.lib version they comes from or what is the reason for defining them (C99, POSIX or GNU compatibility). Document all symbols from the late

[Mingw-w64-public] [PATCH 1/9] crt: Move DECORATED_EXPORT from msvcrt-common.def.in to func.def.in

2024-05-08 Thread Pali Rohár
So it can be used in any def file, not only msvcrt-based. --- mingw-w64-crt/def-include/func.def.in | 5 + mingw-w64-crt/def-include/msvcrt-common.def.in | 3 --- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/mingw-w64-crt/def-include/func.def.in b/mingw-w64-crt/def-

[Mingw-w64-public] [PATCH 7/9] crt: Move ARM long double symbol aliases to def-include/msvcrt-common.def.in

2024-05-08 Thread Pali Rohár
Deduplicate aliases from msvcrt.def.in and ucrtbase.def.in to def-include/msvcrt-common.def.in. Note that powl alias was defined only in ucrtbase.def.in, so do not define it for non-UCRT builds. --- .../def-include/msvcrt-common.def.in | 22 +++ mingw-w64-crt/lib-common/m

[Mingw-w64-public] [PATCH 5/9] crt: Fix utime symbol alias for msvcr80-120 versions

2024-05-08 Thread Pali Rohár
msvcrt versions 8.0 - 12.0 and UCRT do not have _utime symbol. For these CRT versions (which do not have FIXED_SIZE_SYMBOLS) is later in the file symbol _utime defined as an alias to _utime32 or _utime64 symbol. So for these affected CRT versions define utime as an alias to _utime32 or _utime64.

[Mingw-w64-public] [PATCH 8/9] crt: Move C11 symbol alias timespec_get to def-include/msvcrt-common.def.in

2024-05-08 Thread Pali Rohár
Other symbol aliases for ISO C functions are already in msvcrt-common.def.in. --- mingw-w64-crt/def-include/msvcrt-common.def.in | 6 ++ mingw-w64-crt/lib-common/ucrtbase.def.in | 4 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/mingw-w64-crt/def-include/msvcrt-comm

[Mingw-w64-public] [PATCH 9/9] crt: Rename msvcrt-common.def.in to crt-aliases.def.in

2024-05-08 Thread Pali Rohár
This file contains definitions of symbol aliases for any CRT library. It is already used by msvcrt, crtdll and ucrt. So rename msvcrt-common.def.in to crt-aliases.def.in as new name better match the purpose of the file. --- .../def-include/{msvcrt-common.def.in => crt-aliases.def.in} | 0 mingw-w

[Mingw-w64-public] [PATCH 6/9] crt: Fix DATA aliases for crtdll.dll

2024-05-08 Thread Pali Rohár
crtdll.dll library has some DATA symbols with _dll suffix. Fix generating aliases for these symbols. --- .../def-include/msvcrt-common.def.in | 23 +++ mingw-w64-crt/lib32/crtdll.def.in | 1 + 2 files changed, 24 insertions(+) diff --git a/mingw-w64-crt/def-i

Re: [Mingw-w64-public] [PATCH 1/9] crt: Move DECORATED_EXPORT from msvcrt-common.def.in to func.def.in

2024-05-08 Thread Pali Rohár
For reference these patches changes final def files. There is no change in ucrtbase.def and msvcrt.def. --- lib32/crtdll.def.in +++ lib32/crtdll.def.in -daylight DATA == _daylight +daylight DATA == _daylight_dll -timezone DATA == _timezone +timezone DATA == _timezone_dll --- lib32/msvcr100.def.in

[Mingw-w64-public] [PATCH 2/3] crt: msvcrt.def.in: Add comments about first X64 and ARM32 msvcrt.dll versions

2024-05-08 Thread Pali Rohár
--- mingw-w64-crt/lib-common/msvcrt.def.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mingw-w64-crt/lib-common/msvcrt.def.in b/mingw-w64-crt/lib-common/msvcrt.def.in index 70b67a7bbd66..9043e9fb53c5 100644 --- a/mingw-w64-crt/lib-common/msvcrt.def.in +++ b/mingw-w64-crt/lib-common/msvc

[Mingw-w64-public] [PATCH 1/3] crt: msvcrt.def.in: Fix definitions of _ctype and _mbcasemap symbols

2024-05-08 Thread Pali Rohár
Both symbols refers to global variable, not the function. So mark them with DATA for all platforms. gendef detects that _mbcasemap is DATA for all I386 versions of msvcrt.dll (Visual C++ 5.0, 6.0, Win9x, 2000, XP, ... up to 10). But gendef since Windows XP version of msvcrt.dll cannot autodetect th

[Mingw-w64-public] [PATCH 3/3] crt: msvcrt.def.in: Move arch-specific comments in #ifdef sections

2024-05-08 Thread Pali Rohár
So comments unrelated to processing architecture would be dropped by preprocessor. --- mingw-w64-crt/lib-common/msvcrt.def.in | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mingw-w64-crt/lib-common/msvcrt.def.in b/mingw-w64-crt/lib-common/msvcrt.def.in index 9043e9fb

[Mingw-w64-public] [PATCH] crt: msvcr80.dll: Remove duplicated X64 fallback functions

2024-05-08 Thread Pali Rohár
Symbols __p___argv, __p__acmdln, __p__commode, __p__fmode, and __p__wcmdln are available in X64 version of msvcr80.dll. This was clarified and fixed in commit e0426704cce399a7517e4ec71360bbd1d5f880e3. So remove duplicated definitions of fallback functions. --- mingw-w64-crt/Makefile.am | 9 +--

[Mingw-w64-public] [PATCH] crt: Add missing find, stat and time aliases to api-ms-win-crt-*.def.in

2024-05-12 Thread Pali Rohár
Some find, stat and time aliases are missing in UCRT def files: api-ms-win-crt-filesystem-l1-1-0.def.in api-ms-win-crt-time-l1-1-0.def.in They are already present in ucrtbase.def.in file after change from the commit b4638756158e947ce3ddde9e1b3b6f1f63d2ba03. Add those aliases which are missing. --

[Mingw-w64-public] [PATCH] crt: Do not provide duplicate _fstat64i32 symbol

2024-05-12 Thread Pali Rohár
Symbol _fstat64i32 is available in all 64-bit CRT import libraries as an alias. For 32-bit CRT import libraries it is present as native import symbol since msvcr80. MinGW-w64 fallback implementation of _fstat64i32() function uses _fstat64() call which in 32-bit versions is available since msvcr70

[Mingw-w64-public] [PATCH] crt: crtdll.def.in: Fix library name and time symbol exports

2024-05-12 Thread Pali Rohár
Change library name to uppercase CRTDLL.dll and remove DATA keyword for all time function symbols. This is how the original crtdll.dll library is defined. --- mingw-w64-crt/lib32/crtdll.def.in | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mingw-w64-crt/lib32/crtd

Re: [Mingw-w64-public] [PATCH 1/3] crt: msvcrt.def.in: Fix definitions of _ctype and _mbcasemap symbols

2024-05-17 Thread Pali Rohár
Hello, have you looked at this and other changes? ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Re: [Mingw-w64-public] [PATCH 2/9] crt: Include msvcrt-common.def.in after declaring all library symbols

2024-05-20 Thread Pali Rohár
On Monday 20 May 2024 13:04:33 Martin Storsjö wrote: > On Thu, 9 May 2024, Pali Rohár wrote: > > > File msvcrt-common.def.in adds just symbol aliases, so include it in CRT > > def files after having all symbols declared. > > > > Note that some def files u

Re: [Mingw-w64-public] [PATCH 6/9] crt: Fix DATA aliases for crtdll.dll

2024-05-20 Thread Pali Rohár
On Monday 20 May 2024 13:07:29 Martin Storsjö wrote: > On Thu, 9 May 2024, Pali Rohár wrote: > > > crtdll.dll library has some DATA symbols with _dll suffix. > > Fix generating aliases for these symbols. > > --- > > .../def-include/msvcrt-common.def.in | 23

[Mingw-w64-public] [PATCH 1/5] crt: crtdll.dll: Define __GetMainArgs with _CRTIMP as the function is being imported

2024-05-28 Thread Pali Rohár
--- mingw-w64-crt/crt/crtdll_compat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mingw-w64-crt/crt/crtdll_compat.c b/mingw-w64-crt/crt/crtdll_compat.c index 7ab3a82984e0..81e37aad 100644 --- a/mingw-w64-crt/crt/crtdll_compat.c +++ b/mingw-w64-crt/crt/crtdll_compat.c @

[Mingw-w64-public] [PATCH 3/3] crt: Document why the stat symbol alias is not used

2024-05-28 Thread Pali Rohár
--- mingw-w64-crt/def-include/crt-aliases.def.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mingw-w64-crt/def-include/crt-aliases.def.in b/mingw-w64-crt/def-include/crt-aliases.def.in index 62744a54ab54..aca031d4b027 100644 --- a/mingw-w64-crt/def-include/crt-aliases.def.

[Mingw-w64-public] [PATCH 4/5] crt: msvcrt20: Fix calling __getmainargs() and __wgetmainargs() functions

2024-05-28 Thread Pali Rohár
API for __getmainargs() and __wgetmainargs() functions in msvcrt20.dll is slightly different than in new msvcrt versions. In msvcrt20.dll these functions return void and take new_mode parameter instead of the pointer to the _startupinfo structure. So for compatibility with mingw-w64 startup code,

[Mingw-w64-public] [PATCH 5/5] crt: crtdll.dll and msvcrt10.dll: Fix linking of the WinMain() function

2024-05-28 Thread Pali Rohár
WinMain() entry point defined by the application is called by mingw-w64 startup code, more precisely by function main() from crtexewin.c file. mingw-w64 startup code in file crtexewin.c calls _ismbblead() function. Function _ismbblead() is not available in earlier versions of crtdll.dll and is com

[Mingw-w64-public] [PATCH 1/4] crt: Add import library for msvcr40d.dll

2024-05-28 Thread Pali Rohár
msvcr40d.dll is debug version of the msvcrt40.dll and provides additional debugging functions. msvcr40d.def.in def file was generated by gendef from the original msvcr40d.dll library version and modified with same changes (mostly documentation) which were done to the msvcrt40.def.in def file. ---

[Mingw-w64-public] [PATCH] crt: Fix definitions of __MINGW_IMP_SYMBOL aliases

2024-05-28 Thread Pali Rohár
GCC documentation for alias attribute for variables says: https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html Using both the alias and the alias target to access the same object is undefined in a translation unit without a declaration of the alias with the attribute. So dec

Re: [Mingw-w64-public] [PATCH] crt: Add missing __cdecl decoration for functions: mbrtowc mbsrtowcs mbrlen wcrtomb wcsrtombs

2024-05-28 Thread Pali Rohár
On Monday 27 May 2024 13:04:56 LIU Hao wrote: > 在 2024-05-26 20:39, Pali Rohár 写道: > > --- > > mingw-w64-crt/misc/mbrtowc.c | 3 +++ > > mingw-w64-crt/misc/wcrtomb.c | 5 - > > 2 files changed, 7 insertions(+), 1 deletion(-) > > > > This patch seem

[Mingw-w64-public] [PATCH 1/3] headers: Fix *stat* macros in _mingw_stat64.h header file

2024-05-28 Thread Pali Rohár
All CRT import libraries provides UCRT-compatible *stat* symbols since commit b4638756158e947ce3ddde9e1b3b6f1f63d2ba03. So define all stat* macros consistently with definitions of aliases in def files based on UCRT. There is no need to have ifdef for non-UCRT version anymore. --- mingw-w64-header

[Mingw-w64-public] [PATCH 2/3] crt: Provide fstat function symbol via alias

2024-05-28 Thread Pali Rohár
For 32-bit time_t (detected by _USE_32BIT_TIME_T), functions _fstat32(), _fstat() and fstat() are same. So fstat() can be defined as simple alias in def file. Same applies for functions _fstat64i32(), _fstat() and fstat() when time_t is 64-bit. Simplify fstat() function, remove it from mingw-w64-

[Mingw-w64-public] [PATCH 3/5] crt: msvcrt10: Fix calling __getmainargs() function

2024-05-28 Thread Pali Rohár
API for __getmainargs() function in msvcrt10.dll is same as __GetMainArgs() function in crtdll.dll. It is slightly different than in any other msvcrt versions. It returns void and does not the pointer to the _startupinfo structure as a last argument. So for compatibility with mingw-w64 startup cod

[Mingw-w64-public] [PATCH 2/4] crt: Add import library for msvcrtd.dll

2024-05-28 Thread Pali Rohár
msvcrtd.dll is debug version of the Visual C++ 4.2, 5.x and 6.x msvcrt.dll library and provides additional debugging functions. --- mingw-w64-crt/Makefile.am | 7 +- mingw-w64-crt/lib32/msvcrtd.def.in | 864 + mingw-w64-crt/lib32/msvcrtd.mri| 6 + 3 fil

[Mingw-w64-public] [PATCH 2/5] crt: crtdll.dll: Rename crtdll_compat.c to crtdll_getmainargs.c

2024-05-28 Thread Pali Rohár
Filename crtdll_getmainargs.c better describe which function it provides. --- mingw-w64-crt/Makefile.am | 2 +- mingw-w64-crt/crt/{crtdll_compat.c => crtdll_getmainargs.c} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename mingw-w64-crt/crt/{crtdll_compat

[Mingw-w64-public] [PATCH 4/4] crt: Add import library for msvcr71d.dll

2024-05-28 Thread Pali Rohár
msvcr71d.dll is debug version of the msvcr71.dll and provides additional debugging functions. --- mingw-w64-crt/Makefile.am | 6 +- mingw-w64-crt/lib32/msvcr71d.def.in | 945 mingw-w64-crt/lib32/msvcr71d.mri| 6 + 3 files changed, 956 insertions(+), 1

[Mingw-w64-public] [PATCH 3/4] crt: Add import library for msvcr70d.dll

2024-05-28 Thread Pali Rohár
msvcr70d.dll is debug version of the msvcr70.dll and provides additional debugging functions. --- mingw-w64-crt/Makefile.am | 6 +- mingw-w64-crt/lib32/msvcr70d.def.in | 951 mingw-w64-crt/lib32/msvcr70d.mri| 6 + 3 files changed, 962 insertions(+), 1

[Mingw-w64-public] [PATCH] crt: Add missing __cdecl decoration for functions: mbrtowc mbsrtowcs mbrlen wcrtomb wcsrtombs

2024-05-28 Thread Pali Rohár
--- mingw-w64-crt/misc/mbrtowc.c | 3 +++ mingw-w64-crt/misc/wcrtomb.c | 5 - 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/mingw-w64-crt/misc/mbrtowc.c b/mingw-w64-crt/misc/mbrtowc.c index 2eb480749f76..3c01156755ad 100644 --- a/mingw-w64-crt/misc/mbrtowc.c +++ b/mingw-w64-crt

[Mingw-w64-public] [PATCH] crt: getopt: Use argv[0] from getopt function argument instead from the global __argv[] array

2024-05-28 Thread Pali Rohár
getopt* functions receive also argv[0] argument. So use it for printing program name instead of the global __argv[0] variable. This avoids using and importing of the __argv[] DATA symbol from the linked CRT library, as it is not needed. --- mingw-w64-crt/misc/getopt.c | 28 +++

Re: [Mingw-w64-public] [PATCH] crt: Fix definitions of __MINGW_IMP_SYMBOL aliases

2024-05-29 Thread Pali Rohár
On Wednesday 29 May 2024 16:00:06 Martin Storsjö wrote: > On Sun, 26 May 2024, Pali Rohár wrote: > > > GCC documentation for alias attribute for variables says: > > > > https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html > > Using both the alias

Re: [Mingw-w64-public] [PATCH 5/5] crt: crtdll.dll and msvcrt10.dll: Fix linking of the WinMain() function

2024-05-29 Thread Pali Rohár
On Wednesday 29 May 2024 16:21:33 Martin Storsjö wrote: > On Sun, 26 May 2024, Pali Rohár wrote: > > > WinMain() entry point defined by the application is called by mingw-w64 > > startup code, more precisely by function main() from crtexewin.c file. > > > >

Re: [Mingw-w64-public] [PATCH 4/4] crt: Add import library for msvcr71d.dll

2024-05-29 Thread Pali Rohár
On Wednesday 29 May 2024 23:53:26 Martin Storsjö wrote: > On Sun, 26 May 2024, Pali Rohár wrote: > > > msvcr71d.dll is debug version of the msvcr71.dll and provides additional > > debugging functions. > > --- > > mingw-w64-crt/Makefile.am | 6 +- > >

Re: [Mingw-w64-public] [PATCH] crt: Add missing __cdecl decoration for functions: mbrtowc mbsrtowcs mbrlen wcrtomb wcsrtombs

2024-06-02 Thread Pali Rohár
On Wednesday 29 May 2024 15:38:19 Martin Storsjö wrote: > On Mon, 27 May 2024, Pali Rohár wrote: > > > On Monday 27 May 2024 13:04:56 LIU Hao wrote: > > > 在 2024-05-26 20:39, Pali Rohár 写道: > > > > --- > > > > mingw-w64-crt/misc/mbrtowc.c | 3 +

Re: [Mingw-w64-public] [PATCH 5/5] crt: crtdll.dll and msvcrt10.dll: Fix linking of the WinMain() function

2024-06-02 Thread Pali Rohár
On Wednesday 29 May 2024 22:15:06 Pali Rohár wrote: > On Wednesday 29 May 2024 16:21:33 Martin Storsjö wrote: > > On Sun, 26 May 2024, Pali Rohár wrote: > > > > > WinMain() entry point defined by the application is called by mingw-w64 > > > startup code, more

[Mingw-w64-public] [PATCH v2] crt: crtdll.dll and msvcrt10.dll: Fix linking of the WinMain() function

2024-06-02 Thread Pali Rohár
WinMain() entry point provided by the application is called by mingw-w64 startup code, more precisely by function main() from crtexewin.c file. mingw-w64 startup code in file crtexewin.c calls _ismbblead() function. Function _ismbblead() is not available in some versions of crtdll.dll and is compl

[Mingw-w64-public] [PATCH] crt: Add import library for msvcr80d.dll

2024-06-02 Thread Pali Rohár
msvcr80d.dll is debug version of the msvcr80.dll and provides additional debugging functions. --- mingw-w64-crt/Makefile.am | 13 +- mingw-w64-crt/lib-common/msvcr80d.mri |6 + mingw-w64-crt/lib32/msvcr80d.def.in | 1633 + mingw-w64-crt/lib64/msvcr80d.de

[Mingw-w64-public] [PATCH] crt: Move __uncaught_exception symbol out of the C++ mangled symbol section in all .def.in files

2024-06-02 Thread Pali Rohár
--- mingw-w64-crt/lib32/msvcr100.def.in | 3 ++- mingw-w64-crt/lib32/msvcr110.def.in | 3 ++- mingw-w64-crt/lib32/msvcr120.def.in | 3 ++- mingw-w64-crt/lib32/msvcr120d.def.in | 3 ++- mingw-w64-crt/lib32/msvcr70.def.in | 3 ++- mingw-w64-crt/lib32/msvcr70d.def.in | 3 ++- mingw-w64-crt/lib3

Re: [Mingw-w64-public] [PATCH] crt: Add import library for msvcr80d.dll

2024-06-03 Thread Pali Rohár
On Monday 03 June 2024 14:32:06 Martin Storsjö wrote: > On Sun, 2 Jun 2024, Pali Rohár wrote: > > > msvcr80d.dll is debug version of the msvcr80.dll and provides additional > > debugging functions. > > --- > > mingw-w64-crt/Makefile.am | 13 +

Re: [Mingw-w64-public] [PATCH] crt: Fix definitions of __MINGW_IMP_SYMBOL aliases

2024-06-03 Thread Pali Rohár
On Wednesday 29 May 2024 21:52:12 Pali Rohár wrote: > Ok. Then it means, it is needed to just rewrite commit message. What about this commit message? crt: Declare aliased __MINGW_IMP_SYMBOL symbols via __attribute__((alias)) Currently __MINGW_IMP_SYMBOL symbols for aliased functions are defi

Re: [Mingw-w64-public] [PATCH] crt: Fix definitions of __MINGW_IMP_SYMBOL aliases

2024-06-03 Thread Pali Rohár
On Sunday 26 May 2024 02:21:20 Pali Rohár wrote: > GCC documentation for alias attribute for variables says: > > https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html > Using both the alias and the alias target to access the same object is > undefined in a t

[Mingw-w64-public] [PATCH 1/4] crt: Preprocess all .def.in files with -DDEF_

2024-06-03 Thread Pali Rohár
Having -DDEF_ is required by func.def.in which is used either directly or indirectly by crt-aliases.def.in in all CRT def.in files. Some symbols in crt-aliases.def.in are defined via F* macros and these symbols are currently missing in versioned non-os msvcrt import libraries. This change is fixin

[Mingw-w64-public] [PATCH 2/4] crt: Add guards in func.def.in file

2024-06-03 Thread Pali Rohár
Add once-guard to ensure that the file is processed only once. Add arch-guard to ensure that DEF_ is always defined to prevent an issue that symbols defined via F32() macro completely disappeared and which was fixed in previous change. This change applied before the previous change cause compile

<    1   2   3   4   5   6   >