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.
> > 
> > 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
> > time_t, even for UCRT builds.
> > 
> > Do some in mingw-w64, change I386 time symbol aliases which do not have
> > "64" in symbol name, to point to symbols which use 32-bit time_t type.
> 
> Typo in this sentence, I presume you mean "Do the same" or something like
> that?

Yes.

> Another nitpick for the commit messages in this whole series; the commit
> messages talk about I386 and X64, while it actually is generic for 32 and 64
> bit, as we do support armv7 and aarch64 too. So in order to avoid confusion,
> especially as there actually are lots of cases that are i386 specific too,
> but not these, it would be good to refer more generically to this as 32/64
> bit in these commit messages.

I see, that is truth.

Anyway, feel free to modify commit messages. I have no problem with it.
And I would be happy if somebody else can improve them.


___
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 6/7] crt: UCRT: Change I386 time functions without suffix to use 32-bit time_t

2024-04-30 Thread Martin Storsjö

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.

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
time_t, even for UCRT builds.

Do some in mingw-w64, change I386 time symbol aliases which do not have
"64" in symbol name, to point to symbols which use 32-bit time_t type.


Typo in this sentence, I presume you mean "Do the same" or something like 
that?


Another nitpick for the commit messages in this whole series; the commit 
messages talk about I386 and X64, while it actually is generic for 32 and 
64 bit, as we do support armv7 and aarch64 too. So in order to avoid 
confusion, especially as there actually are lots of cases that are i386 
specific too, but not these, it would be good to refer more generically to 
this as 32/64 bit in these commit messages.


// Martin

___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[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
time_t, even for UCRT builds.

Do some in mingw-w64, change I386 time symbol aliases which do not have
"64" in symbol name, to point to symbols which use 32-bit time_t type.

With this change, time symbols on I386 have same meaning across all CRT
libraries provided by mingw-w64. For example symbol "time" points to
function "time" function which always takes 32-bit time_t.

This change fixes previous commits 42aa3325fcfee934d7b706b701e49ee7a3c94982
and e37b315bc039a10507c5cb1046d6b891506022be
---
 mingw-w64-crt/Makefile.am |  8 ++--
 .../api-ms-win-crt-filesystem-l1-1-0.def.in   |  4 +-
 def => api-ms-win-crt-time-l1-1-0.def.in} | 35 --
 mingw-w64-crt/lib-common/ucrtbase.def.in  | 37 ---
 4 files changed, 54 insertions(+), 30 deletions(-)
 rename mingw-w64-crt/lib-common/{api-ms-win-crt-time-l1-1-0.def => 
api-ms-win-crt-time-l1-1-0.def.in} (60%)

diff --git a/mingw-w64-crt/Makefile.am b/mingw-w64-crt/Makefile.am
index 97ba61e7a213..08f5055e9303 100644
--- a/mingw-w64-crt/Makefile.am
+++ b/mingw-w64-crt/Makefile.am
@@ -1114,7 +1114,7 @@ processed_defs += lib32/crtdll.def lib32/msvcrt10.def 
lib32/msvcrt20.def lib32/m
  lib32/msvcr80.def lib32/msvcr90.def 
lib32/msvcr90d.def lib32/msvcr100.def lib32/msvcr110.def lib32/msvcr120.def 
lib32/msvcr120d.def \
  lib32/msvcr120_app.def lib32/msvcp120_app.def 
lib32/ucrtbase.def \
  lib32/api-ms-win-crt-math-l1-1-0.def 
lib32/api-ms-win-crt-private-l1-1-0.def lib32/api-ms-win-crt-runtime-l1-1-0.def 
\
- lib32/api-ms-win-crt-filesystem-l1-1-0.def \
+ lib32/api-ms-win-crt-filesystem-l1-1-0.def 
lib32/api-ms-win-crt-time-l1-1-0.def \
  lib32/vcruntime140_app.def
 
 endif
@@ -1491,7 +1491,7 @@ processed_defs += lib64/msvcrt.def lib64/msvcr80.def 
lib64/msvcr90.def lib64/msv
  lib64/advapi32.def lib64/clbcatq.def 
lib64/kernel32.def lib64/ole32.def \
  lib64/oleaut32.def lib64/user32.def 
lib64/ws2_32.def \
  lib64/api-ms-win-crt-math-l1-1-0.def 
lib64/api-ms-win-crt-private-l1-1-0.def lib64/api-ms-win-crt-runtime-l1-1-0.def 
\
- lib64/api-ms-win-crt-filesystem-l1-1-0.def \
+ lib64/api-ms-win-crt-filesystem-l1-1-0.def 
lib64/api-ms-win-crt-time-l1-1-0.def \
  lib64/vcruntime140_app.def
 
 endif
@@ -1834,7 +1834,7 @@ processed_defs += libarm32/msvcrt.def 
libarm32/msvcr80.def libarm32/msvcr90.def
  libarm32/advapi32.def libarm32/clbcatq.def 
libarm32/kernel32.def libarm32/ole32.def libarm32/oleaut32.def \
  libarm32/user32.def libarm32/ws2_32.def \
  libarm32/api-ms-win-crt-math-l1-1-0.def 
libarm32/api-ms-win-crt-private-l1-1-0.def 
libarm32/api-ms-win-crt-runtime-l1-1-0.def \
- libarm32/api-ms-win-crt-filesystem-l1-1-0.def 
\
+ libarm32/api-ms-win-crt-filesystem-l1-1-0.def 
libarm32/api-ms-win-crt-time-l1-1-0.def \
  libarm32/vcruntime140_app.def
 
 endif
@@ -2129,7 +2129,7 @@ processed_defs += libarm64/msvcrt.def 
libarm64/ucrtbase.def \
  libarm64/advapi32.def libarm64/clbcatq.def 
libarm64/kernel32.def libarm64/ole32.def libarm64/oleaut32.def \
  libarm64/user32.def libarm64/ws2_32.def \
  libarm64/api-ms-win-crt-math-l1-1-0.def 
libarm64/api-ms-win-crt-private-l1-1-0.def 
libarm64/api-ms-win-crt-runtime-l1-1-0.def \
- libarm64/api-ms-win-crt-filesystem-l1-1-0.def 
\
+ libarm64/api-ms-win-crt-filesystem-l1-1-0.def 
libarm64/api-ms-win-crt-time-l1-1-0.def \
  libarm64/vcruntime140_app.def
 
 endif
diff --git a/mingw-w64-crt/lib-common/api-ms-win-crt-filesystem-l1-1-0.def.in 
b/mingw-w64-crt/lib-common/api-ms-win-crt-filesystem-l1-1-0.def.in
index 219361b7047f..d676251b4aea 100644
--- a/mingw-w64-crt/lib-common/api-ms-win-crt-filesystem-l1-1-0.def.in
+++ b/mingw-w64-crt/lib-common/api-ms-win-crt-filesystem-l1-1-0.def.in
@@ -14,13 +14,13 @@ _chdrive
 _chmod
 chmod == _chmod
 _findclose
-F32(_findfirst == _findfirst64)
+F32(_findfirst == _findfirst32)
 F64(_findfirst == _findfirst64i32)
 _findfirst32
 _findfirst32i64
 _findfirst64
 _findfirst64i32
-F32(_findnext ==