Re: [Mingw-w64-public] Strange affect of "-std=c99" on 32-bit gcc

2024-05-08 Thread sisyphus
Thanks for the detailed explanation. I now realize that there are many different values that are similarly affected. Cheers, Rob On Wed, May 8, 2024 at 1:09 AM LIU Hao wrote: > 在 2024-05-07 19:05, sisyphus 写道: > > Although I often test 32-bit gcc on Windows, I don't actually rely on > those > >

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

2024-05-08 Thread Martin Storsjö
On Sat, 27 Apr 2024, 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). For an import library, there is likely no differe

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

2024-05-08 Thread Martin Storsjö
From: Pali Rohár Symbol redirects in import libraries are defined by "==", while "=" in def files is used to rename a symbol on export, while linking a DLL (but that does not have any effect when creating an import library with dlltool). Signed-off-by: Martin Storsjö --- mingw-w64-crt/lib32/ms

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

2024-05-08 Thread Martin Storsjö
From: Pali Rohár These symbols on 64 bit should resolve to _findfirst64i32/_findnext64i32 functions, like in other CRT libraries and header files. The UCRT 32 bit aliases are kept as they were before (even if they are known to be incorrect); they are corrected in a separate later commit. Signed

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

2024-05-08 Thread Martin Storsjö
From: Pali Rohár This alias is already provided by the msvcrt-common.def.in file. Signed-off-by: Martin Storsjö --- 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_

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

2024-05-08 Thread Martin Storsjö
From: 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 be

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

2024-05-08 Thread Martin Storsjö
From: Pali Rohár Signed-off-by: Martin Storsjö --- 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 3c7d7525a..f8f6ecae1 100644 --- a/mingw-w64-crt/lib64/msvcr

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

2024-05-08 Thread Martin Storsjö
From: Pali Rohár Symbol alias is defined by "==". Signed-off-by: Martin Storsjö --- 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

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

2024-05-08 Thread Martin Storsjö
From: 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 functio

[Mingw-w64-public] [PATCH] headers: Use asm() for redirecting time functions, instead of inline functions

2024-05-08 Thread Martin Storsjö
Prior to 1652e9241b5d8a5a779c6582b1c3c4f4a7cc66e5, the inline functions always were static. Due to reexporting such symbols in C++20 modules (for the C++23 std module), the reexported symbols must not be static, so the inline functions were changed from static inline to __mingw_ovr, which practical

Re: [Mingw-w64-public] [PATCH] headers: Use asm() for redirecting time functions, instead of inline functions

2024-05-08 Thread Kai Tietz via Mingw-w64-public
Hi, thanks for working on this and unifying this inlining issues. Looks good to me. Thanks Kai Am Mi., 8. Mai 2024 um 14:23 Uhr schrieb Martin Storsjö : > > Prior to 1652e9241b5d8a5a779c6582b1c3c4f4a7cc66e5, the inline > functions always were static. Due to reexporting such symbols > in C++20 m

Re: [Mingw-w64-public] [PATCH] headers: Use asm() for redirecting time functions, instead of inline functions

2024-05-08 Thread Jacek Caban
On 8.05.2024 14:22, Martin Storsjö wrote: Prior to 1652e9241b5d8a5a779c6582b1c3c4f4a7cc66e5, the inline functions always were static. Due to reexporting such symbols in C++20 modules (for the C++23 std module), the reexported symbols must not be static, so the inline functions were changed from s

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

2024-05-08 Thread LIU Hao
在 2024-05-08 17:22, Martin Storsjö 写道: From: 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.

[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 +--