[Mingw-w64-public] [PATCH] crt: msvcr80.dll: Remove duplicated X64 fallback functions
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 + 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/mingw-w64-crt/Makefile.am b/mingw-w64-crt/Makefile.am index 08f5055e9303..30afe40cf314 100644 --- a/mingw-w64-crt/Makefile.am +++ b/mingw-w64-crt/Makefile.am @@ -571,13 +571,6 @@ src_msvcrtarm64=\ stdio/_setmaxstdio.c \ stdio/gets.c -src_msvcr80_64=\ - misc/__p___argv.c \ - misc/__p__acmdln.c \ - misc/__p__commode.c \ - misc/__p__fmode.c \ - misc/__p__wcmdln.c - src_crtdll=\ crt/crtdll_compat.c \ math/x86/_copysignf.c \ @@ -1543,7 +1536,7 @@ lib64_libmsvcrt_common_a_SOURCES = $(src_msvcrt_common64) lib64_libmsvcrt_common_a_CPPFLAGS=$(CPPFLAGS64) -D__LIBMSVCRT__ $(extra_include) $(sysincludes) lib64_libmsvcrt_extra_a_SOURCES = $(src_msvcrt64) lib64_libmsvcrt_extra_a_CPPFLAGS=$(CPPFLAGS64) -D__LIBMSVCRT__ -D__LIBMSVCRT_OS__ $(extra_include) $(sysincludes) -lib64_libmsvcr80_extra_a_SOURCES = $(src_msvcr80) $(src_msvcr80_64) +lib64_libmsvcr80_extra_a_SOURCES = $(src_msvcr80) lib64_libmsvcr80_extra_a_CPPFLAGS=$(CPPFLAGS64) -D__LIBMSVCRT__ $(extra_include) $(sysincludes) lib64_libmsvcr90_extra_a_SOURCES = $(src_msvcr90) lib64_libmsvcr90_extra_a_CPPFLAGS=$(CPPFLAGS64) -D__LIBMSVCRT__ $(extra_include) $(sysincludes) -- 2.20.1 ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
[Mingw-w64-public] [PATCH 3/3] crt: msvcrt.def.in: Move arch-specific comments in #ifdef sections
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 9043e9fb53c5..69068ae4bb43 100644 --- a/mingw-w64-crt/lib-common/msvcrt.def.in +++ b/mingw-w64-crt/lib-common/msvcrt.def.in @@ -3,8 +3,8 @@ EXPORTS #include "func.def.in" -; List of I386 C++ mangled symbols which matches the first I386 version of msvcrt.dll (Microsoft Visual C++ 4.2) #ifdef DEF_I386 +; List of I386 C++ mangled symbols which matches the first I386 version of msvcrt.dll (Microsoft Visual C++ 4.2) ; public: __thiscall __non_rtti_object::__non_rtti_object(class __non_rtti_object const &) ??0__non_rtti_object@@QAE@ABV0@@Z ; has WINAPI (@4) ; public: __thiscall __non_rtti_object::__non_rtti_object(char const *) @@ -103,8 +103,8 @@ EXPORTS ?what@exception@@UBEPBDXZ #endif -; List of X64 C++ mangled symbols which matches the first X64 version of msvcrt.dll (Windows Server 2003 SP1 / Windows XP x64) #ifdef DEF_X64 +; List of X64 C++ mangled symbols which matches the first X64 version of msvcrt.dll (Windows Server 2003 SP1 / Windows XP x64) ; public: __cdecl __non_rtti_object::__non_rtti_object(class __non_rtti_object const & __ptr64) __ptr64 ; GCC = __ZN17__non_rtti_objectC2ERKS_ ??0__non_rtti_object@@QEAA@AEBV0@@Z @@ -217,8 +217,8 @@ EXPORTS ?what@exception@@UEBAPEBDXZ #endif -; List of ARM32 C++ mangled symbols which matches the first ARM32 version of msvcrt.dll (Windows RT 8.0) #ifdef DEF_ARM32 +; List of ARM32 C++ mangled symbols which matches the first ARM32 version of msvcrt.dll (Windows RT 8.0) ; public: __cdecl __non_rtti_object::__non_rtti_object(class __non_rtti_object const &) ??0__non_rtti_object@@QAA@ABV0@@Z ; public: __cdecl __non_rtti_object::__non_rtti_object(char const *) @@ -313,8 +313,10 @@ EXPORTS ?what@exception@@UBAPBDXZ #endif +#ifdef DEF_ARM64 ; List of ARM64 C++ mangled symbols ; TODO: Fill this list with all symbols from the first ARM64 version of msvcrt.dll +#endif ; This is list of symbols available in the original Microsoft Visual C++ 4.2 version of msvcrt.dll -- 2.20.1 ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
[Mingw-w64-public] [PATCH 1/3] crt: msvcrt.def.in: Fix definitions of _ctype and _mbcasemap symbols
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 that _ctype is DATA symbol. --- mingw-w64-crt/lib-common/msvcrt.def.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mingw-w64-crt/lib-common/msvcrt.def.in b/mingw-w64-crt/lib-common/msvcrt.def.in index a27ff541e354..70b67a7bbd66 100644 --- a/mingw-w64-crt/lib-common/msvcrt.def.in +++ b/mingw-w64-crt/lib-common/msvcrt.def.in @@ -463,7 +463,7 @@ _cprintf _cputs _creat _cscanf -_ctype F_I386(DATA) +_ctype DATA _cwait _daylight DATA F_X86_ANY(_dstbias DATA) @@ -1039,7 +1039,7 @@ wscanf ; These symbols were added in Microsoft Visual C++ 5.0 SP1 and Windows 98 First Edition OS system versions of msvcrt.dll ; They are not available in Microsoft Visual C++ 4.2, nor in 5.0 and neither in Windows NT 4.0 OS system version F_I386(__p__mbcasemap) -_mbcasemap F_NON_I386(DATA) +_mbcasemap DATA ; These symbols were added in Microsoft Visual C++ 6.0 and Windows 98 Second Edition OS system versions of msvcrt.dll F_X86_ANY(__lc_collate_cp DATA) -- 2.20.1 ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
[Mingw-w64-public] [PATCH 2/3] crt: msvcrt.def.in: Add comments about first X64 and ARM32 msvcrt.dll versions
--- 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/msvcrt.def.in @@ -1152,6 +1152,7 @@ F_NON_I386(_rotr64) ; i386 _rotr64 replaced by emu _wctype ; These symbols were added in Windows Server 2003 SP1 and Windows XP x64 OS system version of msvcrt.dll +; This is the first X64 version of msvcrt.dll, all symbols in this section and also above this section are present in all X64 versions of msvcrt.dll #ifdef DEF_I386 ; public: __thiscall exception::exception(char const *const &,int) ??0exception@@QAE@ABQBDH@Z ; has WINAPI (@8) @@ -1764,6 +1765,7 @@ wprintf_s wscanf_s ; These symbols were added in Windows 8 OS system version of msvcrt.dll +; This is the first ARM32 version of msvcrt.dll, all symbols in this section and also above this section are present in all ARM32 versions of msvcrt.dll F_ARM_ANY(__jump_unwind) F_ARM_ANY(_create_locale) ; i386 and x64 _create_locale replaced by emu F_ARM_ANY(_free_locale) ; i386 and x64 _free_locale replaced by emu -- 2.20.1 ___ 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 1/9] crt: Move DECORATED_EXPORT from msvcrt-common.def.in to func.def.in
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 +++ lib32/msvcr100.def.in -strcmpi == _strcmpi +strcmpi == _stricmp -utime == _utime +utime == _utime32 --- lib32/msvcr110.def.in +++ lib32/msvcr110.def.in -strcmpi == _strcmpi +strcmpi == _stricmp -utime == _utime +utime == _utime32 --- lib32/msvcr120_app.def.in +++ lib32/msvcr120_app.def.in -strcmpi == _strcmpi +strcmpi == _stricmp -utime == _utime +utime == _utime32 --- lib32/msvcr120d.def.in +++ lib32/msvcr120d.def.in -strcmpi == _strcmpi +strcmpi == _stricmp -utime == _utime +utime == _utime32 --- lib32/msvcr120.def.in +++ lib32/msvcr120.def.in -strcmpi == _strcmpi +strcmpi == _stricmp -utime == _utime +utime == _utime32 --- lib32/msvcr80.def.in +++ lib32/msvcr80.def.in -strcmpi == _strcmpi +strcmpi == _stricmp -utime == _utime +utime == _utime32 --- lib32/msvcr90d.def.in +++ lib32/msvcr90d.def.in -strcmpi == _strcmpi +strcmpi == _stricmp -utime == _utime +utime == _utime32 --- lib32/msvcr90.def.in +++ lib32/msvcr90.def.in -strcmpi == _strcmpi +strcmpi == _stricmp -utime == _utime +utime == _utime32 --- lib64/msvcr100.def.in +++ lib64/msvcr100.def.in -strcmpi == _strcmpi +strcmpi == _stricmp -utime == _utime +utime == _utime64 --- lib64/msvcr110.def.in +++ lib64/msvcr110.def.in -strcmpi == _strcmpi +strcmpi == _stricmp -utime == _utime +utime == _utime64 --- lib64/msvcr120_app.def.in +++ lib64/msvcr120_app.def.in -strcmpi == _strcmpi +strcmpi == _stricmp -utime == _utime +utime == _utime64 --- lib64/msvcr120d.def.in +++ lib64/msvcr120d.def.in -strcmpi == _strcmpi +strcmpi == _stricmp -utime == _utime +utime == _utime64 --- lib64/msvcr120.def.in +++ lib64/msvcr120.def.in -strcmpi == _strcmpi +strcmpi == _stricmp -utime == _utime +utime == _utime64 --- lib64/msvcr80.def.in +++ lib64/msvcr80.def.in -strcmpi == _strcmpi +strcmpi == _stricmp -utime == _utime +utime == _utime64 --- lib64/msvcr90d.def.in +++ lib64/msvcr90d.def.in -strcmpi == _strcmpi +strcmpi == _stricmp -utime == _utime +utime == _utime64 --- lib64/msvcr90.def.in +++ lib64/msvcr90.def.in -strcmpi == _strcmpi +strcmpi == _stricmp -utime == _utime +utime == _utime64 ___ 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/9] crt: Fix DATA aliases for crtdll.dll
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-include/msvcrt-common.def.in b/mingw-w64-crt/def-include/msvcrt-common.def.in index 125982d5bf53..98ab6d6b62f8 100644 --- a/mingw-w64-crt/def-include/msvcrt-common.def.in +++ b/mingw-w64-crt/def-include/msvcrt-common.def.in @@ -2,6 +2,7 @@ #define ADD_UNDERSCORE(symbol) symbol == _ ## symbol #define ADD_UNDERSCORE_DATA(symbol) symbol DATA == _ ## symbol +#define ADD_UNDERSCORE_DATA_DLL(symbol) symbol DATA == _ ## symbol ## _dll #define ADD_DOUBLE_UNDERSCORE(symbol) symbol == __ ## symbol ; This is list of symbol aliases from the Visual C++ 1.0 oldnames.lib library @@ -22,14 +23,22 @@ ADD_UNDERSCORE(creat) ; ADD_UNDERSCORE(cscanf) ADD_UNDERSCORE(cwait) #ifndef UCRTBASE +#ifdef CRTDLL +ADD_UNDERSCORE_DATA_DLL(daylight) +#else ADD_UNDERSCORE_DATA(daylight) #endif +#endif ADD_UNDERSCORE(dup) ADD_UNDERSCORE(dup2) ADD_UNDERSCORE(ecvt) #ifndef UCRTBASE +#ifdef CRTDLL +; ADD_UNDERSCORE_DATA_DLL(environ) +#else ; ADD_UNDERSCORE_DATA(environ) #endif +#endif ADD_UNDERSCORE(eof) ADD_UNDERSCORE(execl) ADD_UNDERSCORE(execle) @@ -50,8 +59,12 @@ ADD_UNDERSCORE(fputchar) ; ADD_UNDERSCORE(fstat) ; ADD_UNDERSCORE(ftime) #ifndef UCRTBASE +#ifdef CRTDLL +; ADD_UNDERSCORE_DATA_DLL(HUGE) +#else ; ADD_UNDERSCORE_DATA(HUGE) #endif +#endif ADD_UNDERSCORE(gcvt) ADD_UNDERSCORE(getch) ADD_UNDERSCORE(getche) @@ -114,13 +127,23 @@ ADD_UNDERSCORE(strset) ADD_UNDERSCORE(strupr) ADD_UNDERSCORE(swab) #ifndef UCRTBASE +// sys_errlist is without _dll suffix in crtdll.dll ; ADD_UNDERSCORE_DATA(sys_errlist) +#ifdef CRTDLL +; ADD_UNDERSCORE_DATA_DLL(sys_nerr) +#else ; ADD_UNDERSCORE_DATA(sys_nerr) #endif +#endif ADD_UNDERSCORE(tell) ADD_UNDERSCORE(tempnam) #ifndef UCRTBASE +#ifdef CRTDLL +ADD_UNDERSCORE_DATA_DLL(timezone) +#else ADD_UNDERSCORE_DATA(timezone) +#endif +// tzname is without _dll suffix in crtdll.dll ADD_UNDERSCORE_DATA(tzname) ADD_UNDERSCORE(tzset) #endif diff --git a/mingw-w64-crt/lib32/crtdll.def.in b/mingw-w64-crt/lib32/crtdll.def.in index 47c5f4558085..06f4ee68ceee 100644 --- a/mingw-w64-crt/lib32/crtdll.def.in +++ b/mingw-w64-crt/lib32/crtdll.def.in @@ -623,6 +623,7 @@ _ltow _ultow ; include symbol aliases for compatibility with msvcrt.dll +#define CRTDLL #define PRE_C95_SWPRINTF #define FIXED_SIZE_SYMBOLS #define NO_WIDE_FIXED_SIZE -- 2.20.1 ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
[Mingw-w64-public] [PATCH 9/9] crt: Rename msvcrt-common.def.in to crt-aliases.def.in
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-w64-crt/lib-common/msvcr120_app.def.in | 2 +- mingw-w64-crt/lib-common/msvcrt.def.in| 4 ++-- mingw-w64-crt/lib-common/ucrtbase.def.in | 2 +- mingw-w64-crt/lib32/crtdll.def.in | 2 +- mingw-w64-crt/lib32/msvcr100.def.in | 2 +- mingw-w64-crt/lib32/msvcr110.def.in | 2 +- mingw-w64-crt/lib32/msvcr120.def.in | 2 +- mingw-w64-crt/lib32/msvcr120d.def.in | 2 +- mingw-w64-crt/lib32/msvcr70.def.in| 2 +- mingw-w64-crt/lib32/msvcr71.def.in| 2 +- mingw-w64-crt/lib32/msvcr80.def.in| 2 +- mingw-w64-crt/lib32/msvcr90.def.in| 2 +- mingw-w64-crt/lib32/msvcr90d.def.in | 2 +- mingw-w64-crt/lib32/msvcrt10.def.in | 2 +- mingw-w64-crt/lib32/msvcrt20.def.in | 2 +- mingw-w64-crt/lib32/msvcrt40.def.in | 2 +- mingw-w64-crt/lib64/msvcr100.def.in | 2 +- mingw-w64-crt/lib64/msvcr110.def.in | 2 +- mingw-w64-crt/lib64/msvcr120.def.in | 2 +- mingw-w64-crt/lib64/msvcr120d.def.in | 2 +- mingw-w64-crt/lib64/msvcr80.def.in| 2 +- mingw-w64-crt/lib64/msvcr90.def.in| 2 +- mingw-w64-crt/lib64/msvcr90d.def.in | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) rename mingw-w64-crt/def-include/{msvcrt-common.def.in => crt-aliases.def.in} (100%) diff --git a/mingw-w64-crt/def-include/msvcrt-common.def.in b/mingw-w64-crt/def-include/crt-aliases.def.in similarity index 100% rename from mingw-w64-crt/def-include/msvcrt-common.def.in rename to mingw-w64-crt/def-include/crt-aliases.def.in diff --git a/mingw-w64-crt/lib-common/msvcr120_app.def.in b/mingw-w64-crt/lib-common/msvcr120_app.def.in index 6f3376a58fc2..928c0d3a5c95 100644 --- a/mingw-w64-crt/lib-common/msvcr120_app.def.in +++ b/mingw-w64-crt/lib-common/msvcr120_app.def.in @@ -2502,4 +2502,4 @@ wscanf_s #define NO_STRCMPI_ALIAS #define FIXED_SIZE_SYMBOLS #endif -#include "msvcrt-common.def.in" +#include "crt-aliases.def.in" diff --git a/mingw-w64-crt/lib-common/msvcrt.def.in b/mingw-w64-crt/lib-common/msvcrt.def.in index 29d10767dd47..a27ff541e354 100644 --- a/mingw-w64-crt/lib-common/msvcrt.def.in +++ b/mingw-w64-crt/lib-common/msvcrt.def.in @@ -1739,7 +1739,7 @@ swscanf_s F_ARM_ANY(tanhf) ; i386 tanhf provided by emu and x64 tanhf replaced by emu tmpfile_s tmpnam_s -F_ARM_ANY(utime) ; i386 and x64 utime replaced by alias in msvcrt-common.def.in +F_ARM_ANY(utime) ; i386 and x64 utime replaced by alias in crt-aliases.def.in vfprintf_s vfwprintf_s vprintf_s @@ -1835,7 +1835,7 @@ F_ARM_ANY(fabsf) ; i386 and x64 fabsf provided by emu ; i386 strtoll, strtoull, strtoimax and strtoumax alias provided by emu #define WITH_STRTO64_ALIAS #endif -#include "msvcrt-common.def.in" +#include "crt-aliases.def.in" ; This is list of additional symbol aliases not available in any CRT library ; FIXME: check if these really are needed diff --git a/mingw-w64-crt/lib-common/ucrtbase.def.in b/mingw-w64-crt/lib-common/ucrtbase.def.in index 7453c2438ddf..914936f4f5dc 100644 --- a/mingw-w64-crt/lib-common/ucrtbase.def.in +++ b/mingw-w64-crt/lib-common/ucrtbase.def.in @@ -2630,4 +2630,4 @@ wmemcpy_s wmemmove_s #define UCRTBASE -#include "msvcrt-common.def.in" +#include "crt-aliases.def.in" diff --git a/mingw-w64-crt/lib32/crtdll.def.in b/mingw-w64-crt/lib32/crtdll.def.in index 06f4ee68ceee..06ca3759b504 100644 --- a/mingw-w64-crt/lib32/crtdll.def.in +++ b/mingw-w64-crt/lib32/crtdll.def.in @@ -629,4 +629,4 @@ _ultow #define NO_WIDE_FIXED_SIZE #define NO_I64_FIXED_SIZE #define NO_STRCMPI_ALIAS -#include "msvcrt-common.def.in" +#include "crt-aliases.def.in" diff --git a/mingw-w64-crt/lib32/msvcr100.def.in b/mingw-w64-crt/lib32/msvcr100.def.in index 31a3580110d2..67f8e4cfd751 100644 --- a/mingw-w64-crt/lib32/msvcr100.def.in +++ b/mingw-w64-crt/lib32/msvcr100.def.in @@ -1907,4 +1907,4 @@ wscanf_s #define WITH_IMAXDIV_ALIAS #define WITH_STRTO64_ALIAS #define WITH_STRTO64_L_ALIAS -#include "msvcrt-common.def.in" +#include "crt-aliases.def.in" diff --git a/mingw-w64-crt/lib32/msvcr110.def.in b/mingw-w64-crt/lib32/msvcr110.def.in index a2dffde27b10..7ece206ebbc4 100644 --- a/mingw-w64-crt/lib32/msvcr110.def.in +++ b/mingw-w64-crt/lib32/msvcr110.def.in @@ -2039,4 +2039,4 @@ wscanf_s #define
[Mingw-w64-public] [PATCH 8/9] crt: Move C11 symbol alias timespec_get to def-include/msvcrt-common.def.in
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-common.def.in b/mingw-w64-crt/def-include/msvcrt-common.def.in index 1e5e9c5aee38..a47142b6fb10 100644 --- a/mingw-w64-crt/def-include/msvcrt-common.def.in +++ b/mingw-w64-crt/def-include/msvcrt-common.def.in @@ -210,6 +210,12 @@ sinl == sin tanl == tan #endif +; This is list of symbol aliases for C11 functions +#ifdef UCRTBASE +F32(timespec_get == _timespec32_get) +F64(timespec_get == _timespec64_get) +#endif + ; This is list of symbol aliases for POSIX functions ADD_DOUBLE_UNDERSCORE(isascii) ADD_DOUBLE_UNDERSCORE(toascii) diff --git a/mingw-w64-crt/lib-common/ucrtbase.def.in b/mingw-w64-crt/lib-common/ucrtbase.def.in index c415cfcf1cd5..7453c2438ddf 100644 --- a/mingw-w64-crt/lib-common/ucrtbase.def.in +++ b/mingw-w64-crt/lib-common/ucrtbase.def.in @@ -2631,7 +2631,3 @@ wmemmove_s #define UCRTBASE #include "msvcrt-common.def.in" - -; These functions may satisfy configure scripts. -F32(timespec_get == _timespec32_get) -F64(timespec_get == _timespec64_get) -- 2.20.1 ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
[Mingw-w64-public] [PATCH 5/9] crt: Fix utime symbol alias for msvcr80-120 versions
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-crt/def-include/msvcrt-common.def.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mingw-w64-crt/def-include/msvcrt-common.def.in b/mingw-w64-crt/def-include/msvcrt-common.def.in index 41277606933f..125982d5bf53 100644 --- a/mingw-w64-crt/def-include/msvcrt-common.def.in +++ b/mingw-w64-crt/def-include/msvcrt-common.def.in @@ -128,7 +128,7 @@ ADD_UNDERSCORE(tzset) ADD_UNDERSCORE(umask) ADD_UNDERSCORE(ungetch) ADD_UNDERSCORE(unlink) -#ifndef UCRTBASE +#ifdef FIXED_SIZE_SYMBOLS ADD_UNDERSCORE(utime) #else F32(utime == _utime32) -- 2.20.1 ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
[Mingw-w64-public] [PATCH 7/9] crt: Move ARM long double symbol aliases to def-include/msvcrt-common.def.in
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/msvcrt.def.in| 15 - mingw-w64-crt/lib-common/ucrtbase.def.in | 14 3 files changed, 22 insertions(+), 29 deletions(-) diff --git a/mingw-w64-crt/def-include/msvcrt-common.def.in b/mingw-w64-crt/def-include/msvcrt-common.def.in index 98ab6d6b62f8..1e5e9c5aee38 100644 --- a/mingw-w64-crt/def-include/msvcrt-common.def.in +++ b/mingw-w64-crt/def-include/msvcrt-common.def.in @@ -188,6 +188,28 @@ ADD_UNDERSCORE(yn) ; ADD_UNDERSCORE(logb) ADD_UNDERSCORE(nextafter) +#if defined(DEF_ARM32) || defined(DEF_ARM64) +; This is list of symbol aliases for C99 ARM long double functions +; They are defined as aliases to regular double symbols as on ARM, long double is equal to regular double +acosl == acos +asinl == asin +atan2l == atan2 +atanl == atan +ceill == ceil +cosl == cos +expl == exp +floorl == floor +fmodl == fmod +log10l == log10 +logl == log +; FIXME: Why is powl alias defined only for UCRT? +#ifdef UCRTBASE +powl == pow +#endif +sinl == sin +tanl == tan +#endif + ; This is list of symbol aliases for POSIX functions ADD_DOUBLE_UNDERSCORE(isascii) ADD_DOUBLE_UNDERSCORE(toascii) diff --git a/mingw-w64-crt/lib-common/msvcrt.def.in b/mingw-w64-crt/lib-common/msvcrt.def.in index 186761c9d09b..29d10767dd47 100644 --- a/mingw-w64-crt/lib-common/msvcrt.def.in +++ b/mingw-w64-crt/lib-common/msvcrt.def.in @@ -1843,18 +1843,3 @@ F32(_ftime_s == _ftime32_s) F64(_ftime_s == _ftime64_s) snwprintf == _snwprintf vsnwprintf == _vsnwprintf - -; This is list of ARM long double symbols defined as alias to regular double symbols as on ARM, long double is equal to regular double -F_ARM_ANY(acosl == acos) -F_ARM_ANY(asinl == asin) -F_ARM_ANY(atan2l == atan2) -F_ARM_ANY(atanl == atan) -F_ARM_ANY(ceill == ceil) -F_ARM_ANY(cosl == cos) -F_ARM_ANY(expl == exp) -F_ARM_ANY(floorl == floor) -F_ARM_ANY(fmodl == fmod) -F_ARM_ANY(log10l == log10) -F_ARM_ANY(logl == log) -F_ARM_ANY(sinl == sin) -F_ARM_ANY(tanl == tan) diff --git a/mingw-w64-crt/lib-common/ucrtbase.def.in b/mingw-w64-crt/lib-common/ucrtbase.def.in index b5aff62bd878..c415cfcf1cd5 100644 --- a/mingw-w64-crt/lib-common/ucrtbase.def.in +++ b/mingw-w64-crt/lib-common/ucrtbase.def.in @@ -2172,7 +2172,6 @@ abort abs acos F_NON_I386(acosf) -F_ARM_ANY(acosl == acos) acosh acoshf acoshl F_X86_ANY(DATA) @@ -2180,16 +2179,13 @@ asctime asctime_s asin F_NON_I386(asinf) -F_ARM_ANY(asinl == asin) asinh asinhf asinhl F_X86_ANY(DATA) atan atan2 F_NON_I386(atan2f) -F_ARM_ANY(atan2l == atan2) F_NON_I386(atanf) -F_ARM_ANY(atanl == atan) atanh atanhf atanhl F_X86_ANY(DATA) @@ -2238,7 +2234,6 @@ ccoshl ccosl ceil F_NON_I386(ceilf) -F_ARM_ANY(ceill == ceil) cexp cexpf cexpl @@ -2262,7 +2257,6 @@ copysignf copysignl F_X86_ANY(DATA) cos F_NON_I386(cosf) -F_ARM_ANY(cosl == cos) cosh F_NON_I386(coshf) cpow @@ -2302,7 +2296,6 @@ exp2 exp2f exp2l F_X86_ANY(DATA) F_NON_I386(expf) -F_ARM_ANY(expl == exp) expm1 expm1f expm1l F_X86_ANY(DATA) @@ -2334,7 +2327,6 @@ fgetwc fgetws floor F_NON_I386(floorf) -F_ARM_ANY(floorl == floor) fma fmaf fmal F_X86_ANY(DATA) @@ -2346,7 +2338,6 @@ fminf fminl F_X86_ANY(DATA) fmod F_NON_I386(fmodf) -F_ARM_ANY(fmodl == fmod) fopen fopen_s fputc @@ -2425,7 +2416,6 @@ localeconv log log10 F_NON_I386(log10f) -F_ARM_ANY(log10l == log10) log1p log1pf log1pl F_X86_ANY(DATA) @@ -2436,7 +2426,6 @@ logb logbf logbl F_X86_ANY(DATA) F_NON_I386(logf) -F_ARM_ANY(logl == log) longjmp lrint lrintf @@ -2484,7 +2473,6 @@ norml perror pow F_NON_I386(powf) -F_ARM_ANY(powl == pow) putc putchar puts @@ -2527,7 +2515,6 @@ setvbuf signal sin F_NON_I386(sinf) -F_ARM_ANY(sinl == sin) ; if we implement sinh, we can set it DATA only. sinh F_NON_I386(sinhf) @@ -2572,7 +2559,6 @@ strxfrm system tan F_NON_I386(tanf) -F_ARM_ANY(tanl == tan) ; if we implement tanh, we can set it to DATA only. tanh F_NON_I386(tanhf) -- 2.20.1 ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
[Mingw-w64-public] [PATCH 1/9] crt: Move DECORATED_EXPORT from msvcrt-common.def.in to func.def.in
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-include/func.def.in index 58cc36d8604f..a5a4efada6d0 100644 --- a/mingw-w64-crt/def-include/func.def.in +++ b/mingw-w64-crt/def-include/func.def.in @@ -55,3 +55,8 @@ #ifndef F_NON_I386 #define F_NON_I386(x) #endif + +#if defined(DEF_I386) +// for __cdecl and __stdcall only +#define DECORATED_EXPORT(symbol) symbol == _ ## symbol +#endif diff --git a/mingw-w64-crt/def-include/msvcrt-common.def.in b/mingw-w64-crt/def-include/msvcrt-common.def.in index 26aa13e6b661..7f24d9a170c3 100644 --- a/mingw-w64-crt/def-include/msvcrt-common.def.in +++ b/mingw-w64-crt/def-include/msvcrt-common.def.in @@ -3,9 +3,6 @@ #define ADD_UNDERSCORE(symbol) symbol == _ ## symbol #define ADD_DOUBLE_UNDERSCORE(symbol) symbol == __ ## symbol -// for __cdecl and __stdcall only -#define DECORATED_EXPORT(symbol) symbol == _ ## symbol - ADD_DOUBLE_UNDERSCORE(iscsymf) ADD_DOUBLE_UNDERSCORE(iscsym) ADD_DOUBLE_UNDERSCORE(isascii) -- 2.20.1 ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
[Mingw-w64-public] [PATCH 3/9] crt: Document all common CRT aliases
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 latest oldnames.lib library. Aliases were not modified since Visual C++ 4.0. Missing symbol aliases were added as a comment (and they can be enabled later by additional changes). --- .../def-include/msvcrt-common.def.in | 109 -- 1 file changed, 75 insertions(+), 34 deletions(-) diff --git a/mingw-w64-crt/def-include/msvcrt-common.def.in b/mingw-w64-crt/def-include/msvcrt-common.def.in index 7f24d9a170c3..47ce52cb9f8a 100644 --- a/mingw-w64-crt/def-include/msvcrt-common.def.in +++ b/mingw-w64-crt/def-include/msvcrt-common.def.in @@ -1,31 +1,35 @@ #include "func.def.in" #define ADD_UNDERSCORE(symbol) symbol == _ ## symbol +#define ADD_UNDERSCORE_DATA(symbol) symbol DATA == _ ## symbol #define ADD_DOUBLE_UNDERSCORE(symbol) symbol == __ ## symbol -ADD_DOUBLE_UNDERSCORE(iscsymf) -ADD_DOUBLE_UNDERSCORE(iscsym) -ADD_DOUBLE_UNDERSCORE(isascii) -ADD_DOUBLE_UNDERSCORE(toascii) - -wcscmpi == _wcsicmp -strcasecmp == _stricmp -strncasecmp == _strnicmp - +; This is list of symbol aliases from the Visual C++ 1.0 oldnames.lib library +; FIXME: some of these symbol aliases are commented, check and document why #ifdef UCRTBASE ; access is provided as an alias for __mingw_access #else ADD_UNDERSCORE(access) #endif +; ADD_UNDERSCORE(cgets) ADD_UNDERSCORE(chdir) ADD_UNDERSCORE(chmod) ADD_UNDERSCORE(chsize) ADD_UNDERSCORE(close) +; ADD_UNDERSCORE(cprintf) +; ADD_UNDERSCORE(cputs) ADD_UNDERSCORE(creat) +; ADD_UNDERSCORE(cscanf) ADD_UNDERSCORE(cwait) +#ifndef UCRTBASE +ADD_UNDERSCORE_DATA(daylight) +#endif ADD_UNDERSCORE(dup) ADD_UNDERSCORE(dup2) ADD_UNDERSCORE(ecvt) +#ifndef UCRTBASE +; ADD_UNDERSCORE_DATA(environ) +#endif ADD_UNDERSCORE(eof) ADD_UNDERSCORE(execl) ADD_UNDERSCORE(execle) @@ -39,15 +43,15 @@ ADD_UNDERSCORE(fcloseall) ADD_UNDERSCORE(fcvt) ADD_UNDERSCORE(fdopen) ADD_UNDERSCORE(fgetchar) -ADD_UNDERSCORE(fgetwchar) ADD_UNDERSCORE(filelength) ADD_UNDERSCORE(fileno) -; Alias fpreset is set in CRT_fp10.c and CRT_fp8.c. -; ADD_UNDERSCORE(fpreset) +; ADD_UNDERSCORE(flushall) ADD_UNDERSCORE(fputchar) -ADD_UNDERSCORE(fputwchar) ; ADD_UNDERSCORE(fstat) ; ADD_UNDERSCORE(ftime) +#ifndef UCRTBASE +; ADD_UNDERSCORE_DATA(HUGE) +#endif ADD_UNDERSCORE(gcvt) ADD_UNDERSCORE(getch) ADD_UNDERSCORE(getche) @@ -60,11 +64,11 @@ ADD_UNDERSCORE(getpid) F_X86_ANY(ADD_UNDERSCORE(getpid)) #endif ADD_UNDERSCORE(getw) -ADD_UNDERSCORE(heapwalk) ADD_UNDERSCORE(isatty) ADD_UNDERSCORE(itoa) ADD_UNDERSCORE(kbhit) ADD_UNDERSCORE(lfind) +; ADD_UNDERSCORE(locking) ADD_UNDERSCORE(lsearch) ADD_UNDERSCORE(lseek) ADD_UNDERSCORE(ltoa) @@ -72,16 +76,14 @@ ADD_UNDERSCORE(memccpy) ADD_UNDERSCORE(memicmp) ADD_UNDERSCORE(mkdir) ADD_UNDERSCORE(mktemp) +; ADD_UNDERSCORE(onexit) ADD_UNDERSCORE(open) -ADD_UNDERSCORE(pclose) -ADD_UNDERSCORE(popen) ADD_UNDERSCORE(putch) ADD_UNDERSCORE(putenv) ADD_UNDERSCORE(putw) ADD_UNDERSCORE(read) ADD_UNDERSCORE(rmdir) ADD_UNDERSCORE(rmtmp) -ADD_UNDERSCORE(searchenv) ADD_UNDERSCORE(setmode) ADD_UNDERSCORE(sopen) ADD_UNDERSCORE(spawnl) @@ -98,7 +100,6 @@ ADD_UNDERSCORE(strcmpi) #endif ADD_UNDERSCORE(strdup) ADD_UNDERSCORE(stricmp) -ADD_UNDERSCORE(stricoll) ADD_UNDERSCORE(strlwr) ADD_UNDERSCORE(strnicmp) ADD_UNDERSCORE(strnset) @@ -106,11 +107,18 @@ ADD_UNDERSCORE(strrev) ADD_UNDERSCORE(strset) ADD_UNDERSCORE(strupr) ADD_UNDERSCORE(swab) +#ifndef UCRTBASE +; ADD_UNDERSCORE_DATA(sys_errlist) +; ADD_UNDERSCORE_DATA(sys_nerr) +#endif ADD_UNDERSCORE(tell) ADD_UNDERSCORE(tempnam) #ifndef UCRTBASE +ADD_UNDERSCORE_DATA(timezone) +ADD_UNDERSCORE_DATA(tzname) ADD_UNDERSCORE(tzset) #endif +; ADD_UNDERSCORE(ultoa) ADD_UNDERSCORE(umask) ADD_UNDERSCORE(ungetch) ADD_UNDERSCORE(unlink) @@ -120,6 +128,12 @@ ADD_UNDERSCORE(utime) F32(utime == _utime32) F64(utime == _utime64) #endif +ADD_UNDERSCORE(write) + +; This is list of symbol aliases added in the Visual C++ 2.0 oldnames.lib library +; All these symbols with leading underscore are present also in pre-2.0 CRT versions: crtdll.dll and msvcrt10.dll +; ADD_UNDERSCORE(control87) +; ADD_UNDERSCORE(fpreset) ; Alias fpreset is set in CRT_fp10.c and CRT_fp8.c ADD_UNDERSCORE(wcsdup) ADD_UNDERSCORE(wcsicmp) ADD_UNDERSCORE(wcsicoll) @@ -129,32 +143,32 @@ ADD_UNDERSCORE(wcsnset) ADD_UNDERSCORE(wcsrev) ADD_UNDERSCORE(wcsset) ADD_UNDERSCORE(wcsupr) -ADD_UNDERSCORE(wpopen) -ADD_UNDERSCORE(write) -; non-ANSI functions declared in math.h + +; This is list of symbol aliases added in the Visual C++ 4.0 oldnames.lib library +; All these symbols with leading underscore are present also in pre-4.0 CRT versions: crtdll.dll, msvcrt10.dll and msvcrt20.dll +; ADD_UNDERSCORE(cabs) +ADD_UNDERSCORE(hypot)
[Mingw-w64-public] [PATCH 2/9] crt: Include msvcrt-common.def.in after declaring all library symbols
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 | 13 mingw-w64-crt/lib-common/msvcrt.def.in | 32 +++- mingw-w64-crt/lib-common/ucrtbase.def.in | 6 ++-- mingw-w64-crt/lib32/crtdll.def.in| 15 - mingw-w64-crt/lib32/msvcr100.def.in | 18 +-- mingw-w64-crt/lib32/msvcr110.def.in | 17 +-- mingw-w64-crt/lib32/msvcr120.def.in | 5 ++- mingw-w64-crt/lib32/msvcr120d.def.in | 4 +-- mingw-w64-crt/lib32/msvcr70.def.in | 15 + mingw-w64-crt/lib32/msvcr71.def.in | 15 + mingw-w64-crt/lib32/msvcr80.def.in | 15 + mingw-w64-crt/lib32/msvcr90.def.in | 16 +- mingw-w64-crt/lib32/msvcr90d.def.in | 16 +- mingw-w64-crt/lib32/msvcrt10.def.in | 15 + mingw-w64-crt/lib32/msvcrt20.def.in | 15 - mingw-w64-crt/lib32/msvcrt40.def.in | 12 mingw-w64-crt/lib64/msvcr100.def.in | 17 +-- mingw-w64-crt/lib64/msvcr110.def.in | 17 +-- mingw-w64-crt/lib64/msvcr120.def.in | 5 ++- mingw-w64-crt/lib64/msvcr120d.def.in | 4 +-- mingw-w64-crt/lib64/msvcr80.def.in | 15 - mingw-w64-crt/lib64/msvcr90.def.in | 15 + mingw-w64-crt/lib64/msvcr90d.def.in | 15 + 23 files changed, 157 insertions(+), 160 deletions(-) diff --git a/mingw-w64-crt/lib-common/msvcr120_app.def.in b/mingw-w64-crt/lib-common/msvcr120_app.def.in index 695635caf16f..6f3376a58fc2 100644 --- a/mingw-w64-crt/lib-common/msvcr120_app.def.in +++ b/mingw-w64-crt/lib-common/msvcr120_app.def.in @@ -7,12 +7,6 @@ LIBRARY "msvcr120_app.dll" EXPORTS #include "func.def.in" -#define NO_GETPID_ALIAS -#ifdef DEF_ARM32 -#define NO_STRCMPI_ALIAS -#define FIXED_SIZE_SYMBOLS -#endif -#include "msvcrt-common.def.in" #ifdef DEF_X64 $I10_OUTPUT @@ -2502,3 +2496,10 @@ wprintf wprintf_s wscanf wscanf_s + +#define NO_GETPID_ALIAS +#ifdef DEF_ARM32 +#define NO_STRCMPI_ALIAS +#define FIXED_SIZE_SYMBOLS +#endif +#include "msvcrt-common.def.in" diff --git a/mingw-w64-crt/lib-common/msvcrt.def.in b/mingw-w64-crt/lib-common/msvcrt.def.in index 6ce7a0366702..186761c9d09b 100644 --- a/mingw-w64-crt/lib-common/msvcrt.def.in +++ b/mingw-w64-crt/lib-common/msvcrt.def.in @@ -1,22 +1,7 @@ LIBRARY "msvcrt.dll" EXPORTS -#define PRE_C95_SWPRINTF -#define FIXED_SIZE_SYMBOLS -#define NO_FIXED_SIZE_64_ALIAS -#define NO_TIME_ALIAS -#define NO_STRCMPI_ALIAS -#define WITH_ATOLL_ALIAS -#define WITH_ATOLL_L_ALIAS -#define WITH_STRTO64_L_ALIAS -#ifndef DEF_I386 -; i386 llabs and imaxabs alias provided by emu -#define WITH_LLABS_ALIAS -; i386 strtoll, strtoull, strtoimax and strtoumax alias provided by emu -#define WITH_STRTO64_ALIAS -#endif #include "func.def.in" -#include "msvcrt-common.def.in" ; List of I386 C++ mangled symbols which matches the first I386 version of msvcrt.dll (Microsoft Visual C++ 4.2) #ifdef DEF_I386 @@ -1835,6 +1820,23 @@ F_ARM_ANY(fabsf) ; i386 and x64 fabsf provided by emu +; This includes list of some symbol alises for compatibility with C99 and POSIX functions and symbols from other msvcr* libraries +#define PRE_C95_SWPRINTF +#define FIXED_SIZE_SYMBOLS +#define NO_FIXED_SIZE_64_ALIAS +#define NO_TIME_ALIAS +#define NO_STRCMPI_ALIAS +#define WITH_ATOLL_ALIAS +#define WITH_ATOLL_L_ALIAS +#define WITH_STRTO64_L_ALIAS +#ifndef DEF_I386 +; i386 llabs and imaxabs alias provided by emu +#define WITH_LLABS_ALIAS +; i386 strtoll, strtoull, strtoimax and strtoumax alias provided by emu +#define WITH_STRTO64_ALIAS +#endif +#include "msvcrt-common.def.in" + ; This is list of additional symbol aliases not available in any CRT library ; FIXME: check if these really are needed F32(_ftime_s == _ftime32_s) diff --git a/mingw-w64-crt/lib-common/ucrtbase.def.in b/mingw-w64-crt/lib-common/ucrtbase.def.in index 16127eb8169a..f42cf8f680bc 100644 --- a/mingw-w64-crt/lib-common/ucrtbase.def.in +++ b/mingw-w64-crt/lib-common/ucrtbase.def.in @@ -2,8 +2,6 @@ LIBRARY "ucrtbase.dll" EXPORTS #include "func.def.in" -#define UCRTBASE -#include "msvcrt-common.def.in" #ifdef DEF_I386 _CIacos @@ -2645,6 +2643,10 @@ wctrans wctype wmemcpy_s wmemmove_s + +#define UCRTBASE +#include "msvcrt-common.def.in" + ; These functions may satisfy configure scripts. F32(timespec_get == _timespec32_get) F64(timespec_get == _timespec64_get) diff --git a/mingw-w64-crt/lib32/crtdll.def.in b/mingw-w64-crt/lib32/crtdll.def.in index e12edb5ad7f3..47c5f4558085 100644 --- a/mingw-w64-crt/lib32/crtdll.def.in +++
[Mingw-w64-public] [PATCH 4/9] crt: Fix strcmpi symbol alias for msvcr80-120 versions
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-include/msvcrt-common.def.in | 8 +++- mingw-w64-crt/lib-common/ucrtbase.def.in | 1 - 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/mingw-w64-crt/def-include/msvcrt-common.def.in b/mingw-w64-crt/def-include/msvcrt-common.def.in index 47ce52cb9f8a..41277606933f 100644 --- a/mingw-w64-crt/def-include/msvcrt-common.def.in +++ b/mingw-w64-crt/def-include/msvcrt-common.def.in @@ -95,8 +95,14 @@ ADD_UNDERSCORE(spawnve) ADD_UNDERSCORE(spawnvp) ADD_UNDERSCORE(spawnvpe) ; ADD_UNDERSCORE(stat) -#ifndef UCRTBASE +#ifdef NO_STRCMPI_ALIAS +; Symbol _strcmpi is natively present and defined in the library def file +; So define strcmpi as an alias to _strcmpi ADD_UNDERSCORE(strcmpi) +#else +; Symbol _strcmpi is not present in the library, it provides only _stricmp symbol +; So define strcmpi as an alias to _stricmp +strcmpi == _stricmp #endif ADD_UNDERSCORE(strdup) ADD_UNDERSCORE(stricmp) diff --git a/mingw-w64-crt/lib-common/ucrtbase.def.in b/mingw-w64-crt/lib-common/ucrtbase.def.in index f42cf8f680bc..b5aff62bd878 100644 --- a/mingw-w64-crt/lib-common/ucrtbase.def.in +++ b/mingw-w64-crt/lib-common/ucrtbase.def.in @@ -2538,7 +2538,6 @@ strcat strcat_s strchr strcmp -strcmpi == _stricmp strcoll strcpy strcpy_s -- 2.20.1 ___ 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 v2 7/7] crt: Move find, stat and time aliases to def-include/msvcrt-common.def.in
在 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. For reference here is list of changes between individual outputs from: cpp -x c $FILE -Wp,-w -undef -P -Imingw-w64-crt/def-include -D$PLAT | sed -E 's/\s*;.*//' | LC_ALL=C sort -u Signed-off-by: Martin Storsjö --- This series of patches look good to me. Thanks for the work. -- Best regards, LIU Hao OpenPGP_signature.asc Description: OpenPGP digital signature ___ 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] headers: Use asm() for redirecting time functions, instead of inline functions
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 static inline to __mingw_ovr, which practically is static inline in C mode, but regular inline in C++ mode. By using regular inline in C++ mode, each use of the functions can (but doesn't need to) emit an external symbol for the inline function, and the callers may either call that function or inline the body of the function. This can have two potential issues; if different translation units are configured differently (with the _USE_32BIT_TIME_T define), but both use the same external symbol for it, the linker will only keep one of them (as they're both inline, and supposed to be the same). In practice, this is rare for _USE_32BIT_TIME_T though. Secondly, such an external symbol may conflict with the actual import library. Such a case was reported at https://github.com/mstorsjo/llvm-mingw/issues/427. (Practically, the issue there was that some built object files defined an external "_time" symbol, i.e. regular "time" with i386 cdecl underscore prefix, from the non-static inline functions. The object also files reference _time32 with dllimport, which via the weak aliases produced by llvm-dlltool end up pulling in the __imp__time symbol, which also brings in a conflicting "_time" symbol.) In short - inline functions can be problematic. Where possible, it's less problematic to use asm(), via __MINGW_ASM_CALL(), to redirect calls directly towards the right function. This has a slight drawback, that this ends up calling the thunks (as the declarations lack dllimport), while we previously could inline the call directly to a dllimported function (avoiding the thunk, fetching the target address via the __imp_ prefixed symbol). We could, easily, add the dllimport attributes on these declarations, but that triggers a GCC bug for how those symbol names are mangled on i386, see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114984. (The bug seems to be noted and mentioned as early as 2007, in https://sourceware.org/pipermail/cygwin/2007-February/154845.html, but it doesn't seem to have been fixed since.) Signed-off-by: Martin Storsjö --- mingw-w64-headers/crt/time.h | 62 1 file changed, 28 insertions(+), 34 deletions(-) Looks good to me. Thanks, Jacek ___ 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] headers: Use asm() for redirecting time functions, instead of inline functions
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 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 practically is static > inline in C mode, but regular inline in C++ mode. > > By using regular inline in C++ mode, each use of the functions > can (but doesn't need to) emit an external symbol for the > inline function, and the callers may either call that function > or inline the body of the function. > > This can have two potential issues; if different translation units > are configured differently (with the _USE_32BIT_TIME_T define), > but both use the same external symbol for it, the linker will only > keep one of them (as they're both inline, and supposed to be the > same). In practice, this is rare for _USE_32BIT_TIME_T though. > > Secondly, such an external symbol may conflict with the actual > import library. Such a case was reported at > https://github.com/mstorsjo/llvm-mingw/issues/427. > > (Practically, the issue there was that some built object files > defined an external "_time" symbol, i.e. regular "time" with i386 > cdecl underscore prefix, from the non-static inline functions. The > object also files reference _time32 with dllimport, which via the > weak aliases produced by llvm-dlltool end up pulling in the > __imp__time symbol, which also brings in a conflicting "_time" symbol.) > > In short - inline functions can be problematic. Where possible, > it's less problematic to use asm(), via __MINGW_ASM_CALL(), to > redirect calls directly towards the right function. > > This has a slight drawback, that this ends up calling the thunks > (as the declarations lack dllimport), while we previously could > inline the call directly to a dllimported function (avoiding the > thunk, fetching the target address via the __imp_ prefixed symbol). > > We could, easily, add the dllimport attributes on these declarations, > but that triggers a GCC bug for how those symbol names are mangled > on i386, see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114984. (The > bug seems to be noted and mentioned as early as 2007, in > https://sourceware.org/pipermail/cygwin/2007-February/154845.html, > but it doesn't seem to have been fixed since.) > > Signed-off-by: Martin Storsjö > --- > mingw-w64-headers/crt/time.h | 62 > 1 file changed, 28 insertions(+), 34 deletions(-) > > diff --git a/mingw-w64-headers/crt/time.h b/mingw-w64-headers/crt/time.h > index f8401903c..d94a9f619 100644 > --- a/mingw-w64-headers/crt/time.h > +++ b/mingw-w64-headers/crt/time.h > @@ -213,26 +213,20 @@ extern "C" { > > #if !defined (RC_INVOKED) && !defined (_INC_WTIME_INL) > #define _INC_WTIME_INL > - wchar_t *__cdecl _wctime(const time_t *) > __MINGW_ATTRIB_DEPRECATED_SEC_WARN; > -#ifndef __CRT__NO_INLINE > #ifndef _USE_32BIT_TIME_T > - __CRT_INLINE wchar_t *__cdecl _wctime(const time_t *_Time) { return > _wctime64(_Time); } > + wchar_t *__cdecl _wctime(const time_t *_Time) > __MINGW_ATTRIB_DEPRECATED_SEC_WARN __MINGW_ASM_CALL(_wctime64); > #else > - __CRT_INLINE wchar_t *__cdecl _wctime(const time_t *_Time) { return > _wctime32(_Time); } > + wchar_t *__cdecl _wctime(const time_t *_Time) > __MINGW_ATTRIB_DEPRECATED_SEC_WARN __MINGW_ASM_CALL(_wctime32); > #endif > -#endif /* __CRT__NO_INLINE */ > #endif > > #if !defined (RC_INVOKED) && !defined (_INC_WTIME_S_INL) > #define _INC_WTIME_S_INL > - errno_t __cdecl _wctime_s(wchar_t *, size_t, const time_t *); > -#ifndef __CRT__NO_INLINE > #ifndef _USE_32BIT_TIME_T > - __CRT_INLINE errno_t __cdecl _wctime_s (wchar_t *_Buffer,size_t > _SizeInWords,const time_t *_Time) { return _wctime64_s > (_Buffer,_SizeInWords,_Time); } > + errno_t __cdecl _wctime_s (wchar_t *_Buffer,size_t _SizeInWords,const > time_t *_Time) __MINGW_ASM_CALL(_wctime64_s); > #else > - __CRT_INLINE errno_t __cdecl _wctime_s (wchar_t *_Buffer,size_t > _SizeInWords,const time_t *_Time) { return _wctime32_s > (_Buffer,_SizeInWords,_Time); } > + errno_t __cdecl _wctime_s (wchar_t *_Buffer,size_t _SizeInWords,const > time_t *_Time) __MINGW_ASM_CALL(_wctime32_s); > #endif > -#endif /* __CRT__NO_INLINE */ > #endif > > #define _WTIME_DEFINED > @@ -241,33 +235,33 @@ extern "C" { > #ifndef RC_INVOKED > > #ifdef _USE_32BIT_TIME_T > -__mingw_ovr time_t __CRTDECL time(time_t *_Time) { return _time32(_Time); } > +time_t __CRTDECL time(time_t *_Time) __MINGW_ASM_CALL(_time32); > #ifdef _UCRT > -__mingw_ovr int __CRTDECL timespec_get(struct timespec* _Ts, int _Base) { > return _timespec32_get((struct _timespec32*)_Ts, _Base); } > -#endif > -__mingw_ovr double __CRTDECL difftime(time_t _Time1,time_t _Time2) { return >
[Mingw-w64-public] [PATCH] headers: Use asm() for redirecting time functions, instead of inline functions
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 practically is static inline in C mode, but regular inline in C++ mode. By using regular inline in C++ mode, each use of the functions can (but doesn't need to) emit an external symbol for the inline function, and the callers may either call that function or inline the body of the function. This can have two potential issues; if different translation units are configured differently (with the _USE_32BIT_TIME_T define), but both use the same external symbol for it, the linker will only keep one of them (as they're both inline, and supposed to be the same). In practice, this is rare for _USE_32BIT_TIME_T though. Secondly, such an external symbol may conflict with the actual import library. Such a case was reported at https://github.com/mstorsjo/llvm-mingw/issues/427. (Practically, the issue there was that some built object files defined an external "_time" symbol, i.e. regular "time" with i386 cdecl underscore prefix, from the non-static inline functions. The object also files reference _time32 with dllimport, which via the weak aliases produced by llvm-dlltool end up pulling in the __imp__time symbol, which also brings in a conflicting "_time" symbol.) In short - inline functions can be problematic. Where possible, it's less problematic to use asm(), via __MINGW_ASM_CALL(), to redirect calls directly towards the right function. This has a slight drawback, that this ends up calling the thunks (as the declarations lack dllimport), while we previously could inline the call directly to a dllimported function (avoiding the thunk, fetching the target address via the __imp_ prefixed symbol). We could, easily, add the dllimport attributes on these declarations, but that triggers a GCC bug for how those symbol names are mangled on i386, see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114984. (The bug seems to be noted and mentioned as early as 2007, in https://sourceware.org/pipermail/cygwin/2007-February/154845.html, but it doesn't seem to have been fixed since.) Signed-off-by: Martin Storsjö --- mingw-w64-headers/crt/time.h | 62 1 file changed, 28 insertions(+), 34 deletions(-) diff --git a/mingw-w64-headers/crt/time.h b/mingw-w64-headers/crt/time.h index f8401903c..d94a9f619 100644 --- a/mingw-w64-headers/crt/time.h +++ b/mingw-w64-headers/crt/time.h @@ -213,26 +213,20 @@ extern "C" { #if !defined (RC_INVOKED) && !defined (_INC_WTIME_INL) #define _INC_WTIME_INL - wchar_t *__cdecl _wctime(const time_t *) __MINGW_ATTRIB_DEPRECATED_SEC_WARN; -#ifndef __CRT__NO_INLINE #ifndef _USE_32BIT_TIME_T - __CRT_INLINE wchar_t *__cdecl _wctime(const time_t *_Time) { return _wctime64(_Time); } + wchar_t *__cdecl _wctime(const time_t *_Time) __MINGW_ATTRIB_DEPRECATED_SEC_WARN __MINGW_ASM_CALL(_wctime64); #else - __CRT_INLINE wchar_t *__cdecl _wctime(const time_t *_Time) { return _wctime32(_Time); } + wchar_t *__cdecl _wctime(const time_t *_Time) __MINGW_ATTRIB_DEPRECATED_SEC_WARN __MINGW_ASM_CALL(_wctime32); #endif -#endif /* __CRT__NO_INLINE */ #endif #if !defined (RC_INVOKED) && !defined (_INC_WTIME_S_INL) #define _INC_WTIME_S_INL - errno_t __cdecl _wctime_s(wchar_t *, size_t, const time_t *); -#ifndef __CRT__NO_INLINE #ifndef _USE_32BIT_TIME_T - __CRT_INLINE errno_t __cdecl _wctime_s (wchar_t *_Buffer,size_t _SizeInWords,const time_t *_Time) { return _wctime64_s (_Buffer,_SizeInWords,_Time); } + errno_t __cdecl _wctime_s (wchar_t *_Buffer,size_t _SizeInWords,const time_t *_Time) __MINGW_ASM_CALL(_wctime64_s); #else - __CRT_INLINE errno_t __cdecl _wctime_s (wchar_t *_Buffer,size_t _SizeInWords,const time_t *_Time) { return _wctime32_s (_Buffer,_SizeInWords,_Time); } + errno_t __cdecl _wctime_s (wchar_t *_Buffer,size_t _SizeInWords,const time_t *_Time) __MINGW_ASM_CALL(_wctime32_s); #endif -#endif /* __CRT__NO_INLINE */ #endif #define _WTIME_DEFINED @@ -241,33 +235,33 @@ extern "C" { #ifndef RC_INVOKED #ifdef _USE_32BIT_TIME_T -__mingw_ovr time_t __CRTDECL time(time_t *_Time) { return _time32(_Time); } +time_t __CRTDECL time(time_t *_Time) __MINGW_ASM_CALL(_time32); #ifdef _UCRT -__mingw_ovr int __CRTDECL timespec_get(struct timespec* _Ts, int _Base) { return _timespec32_get((struct _timespec32*)_Ts, _Base); } -#endif -__mingw_ovr double __CRTDECL difftime(time_t _Time1,time_t _Time2) { return _difftime32(_Time1,_Time2); } -__mingw_ovr struct tm *__CRTDECL localtime(const time_t *_Time) { return _localtime32(_Time); } -__mingw_ovr errno_t __CRTDECL localtime_s(struct tm *_Tm,const time_t *_Time) { return _localtime32_s(_Tm,_Time); } -__mingw_ovr struct tm *__CRTDECL gmtime(const time_t *_Time) { return _gmtime32(_Time); } -__mingw_ovr errno_t
[Mingw-w64-public] [PATCH v2 6/7] crt: UCRT: Change 32-bit mode time functions without suffix to use 32-bit time_t
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 functions which use 32-bit time_t, even for UCRT builds. Do the same in mingw-w64, change 32-bit mode 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 in 32-bit mode 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 Signed-off-by: Martin Storsjö --- 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 97ba61e7a..08f5055e9 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 219361b70..d676251b4 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
[Mingw-w64-public] [PATCH v2 1/7] crt: msvcr90d.def.in: Fix X64 ctime symbol alias to use 64-bit time_t
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/msvcr90d.def.in +++ b/mingw-w64-crt/lib64/msvcr90d.def.in @@ -418,7 +418,7 @@ _cscanf_l _cscanf_s _cscanf_s_l _ctime32 -ctime == _ctime32 +ctime == _ctime64 _ctime32_s _ctime64 _ctime64_s -- 2.34.1 ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
[Mingw-w64-public] [PATCH v2 4/7] crt: msvcr120_app.def.in: Fix X64 symbol aliases _stat and _stati64
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 index e2474e77c..8319ed012 100644 --- a/mingw-w64-crt/lib-common/msvcr120_app.def.in +++ b/mingw-w64-crt/lib-common/msvcr120_app.def.in @@ -1669,8 +1669,8 @@ _stat64 F_X86_ANY(_stat64i32) F_I386(_stat == _stat32) F_I386(_stati64 == _stat32i64) -F_X64(_stat = _stat64i32) -F_X64(_stati64 = _stat64) +F_X64(_stat == _stat64i32) +F_X64(_stati64 == _stat64) F_ARM32(_stati64) _statusfp F_I386(_statusfp2) -- 2.34.1 ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
[Mingw-w64-public] [PATCH v2 7/7] crt: Move find, stat and time aliases to def-include/msvcrt-common.def.in
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 between individual outputs from: cpp -x c $FILE -Wp,-w -undef -P -Imingw-w64-crt/def-include -D$PLAT | sed -E 's/\s*;.*//' | LC_ALL=C sort -u Signed-off-by: Martin Storsjö --- .../def-include/msvcrt-common.def.in | 157 ++ mingw-w64-crt/lib-common/msvcr120_app.def.in | 33 +--- mingw-w64-crt/lib-common/msvcrt.def.in| 23 +-- mingw-w64-crt/lib-common/ucrtbase.def.in | 24 --- mingw-w64-crt/lib32/crtdll.def.in | 12 +- mingw-w64-crt/lib32/msvcr100.def.in | 18 -- mingw-w64-crt/lib32/msvcr110.def.in | 18 -- mingw-w64-crt/lib32/msvcr120.def.in | 14 -- mingw-w64-crt/lib32/msvcr120d.def.in | 14 -- mingw-w64-crt/lib32/msvcr70.def.in| 12 +- mingw-w64-crt/lib32/msvcr71.def.in| 12 +- mingw-w64-crt/lib32/msvcr80.def.in| 22 --- mingw-w64-crt/lib32/msvcr90.def.in| 18 -- mingw-w64-crt/lib32/msvcr90d.def.in | 18 -- mingw-w64-crt/lib32/msvcrt10.def.in | 12 +- mingw-w64-crt/lib32/msvcrt20.def.in | 13 +- mingw-w64-crt/lib32/msvcrt40.def.in | 12 +- mingw-w64-crt/lib64/msvcr100.def.in | 18 -- mingw-w64-crt/lib64/msvcr110.def.in | 18 -- mingw-w64-crt/lib64/msvcr120.def.in | 14 -- mingw-w64-crt/lib64/msvcr120d.def.in | 13 -- mingw-w64-crt/lib64/msvcr80.def.in| 22 --- mingw-w64-crt/lib64/msvcr90.def.in| 18 -- mingw-w64-crt/lib64/msvcr90d.def.in | 18 -- 24 files changed, 172 insertions(+), 381 deletions(-) diff --git a/mingw-w64-crt/def-include/msvcrt-common.def.in b/mingw-w64-crt/def-include/msvcrt-common.def.in index 3e2c674d3..26aa13e6b 100644 --- a/mingw-w64-crt/def-include/msvcrt-common.def.in +++ b/mingw-w64-crt/def-include/msvcrt-common.def.in @@ -119,6 +119,9 @@ ADD_UNDERSCORE(ungetch) ADD_UNDERSCORE(unlink) #ifndef UCRTBASE ADD_UNDERSCORE(utime) +#else +F32(utime == _utime32) +F64(utime == _utime64) #endif ADD_UNDERSCORE(wcsdup) ADD_UNDERSCORE(wcsicmp) @@ -197,6 +200,160 @@ _strtoimax_l == _strtoi64_l _strtoumax_l == _strtoui64_l #endif +; This is list of find symbol aliases, every CRT library has either find symbols with SIZE suffix or without them +#ifdef FIXED_SIZE_SYMBOLS +F32(_findfirst32 == _findfirst) +F64(_findfirst64i32 == _findfirst) +#ifndef NO_I64_FIXED_SIZE +F32(_findfirst32i64 == _findfirsti64) +#ifndef NO_FIXED_SIZE_64_ALIAS +F64(_findfirst64 == _findfirsti64) +#endif +#endif +F32(_findnext32 == _findnext) +F64(_findnext64i32 == _findnext) +#ifndef NO_I64_FIXED_SIZE +F32(_findnext32i64 == _findnexti64) +#ifndef NO_FIXED_SIZE_64_ALIAS +F64(_findnext64 == _findnexti64) +#endif +#endif +#ifndef NO_WIDE_FIXED_SIZE +F32(_wfindfirst32 == _wfindfirst) +F64(_wfindfirst64i32 == _wfindfirst) +#ifndef NO_I64_FIXED_SIZE +F32(_wfindfirst32i64 == _wfindfirsti64) +#ifndef NO_FIXED_SIZE_64_ALIAS +F64(_wfindfirst64 == _wfindfirsti64) +#endif +#endif +F32(_wfindnext32 == _wfindnext) +F64(_wfindnext64i32 == _wfindnext) +#ifndef NO_I64_FIXED_SIZE +F32(_wfindnext32i64 == _wfindnexti64) +#ifndef NO_FIXED_SIZE_64_ALIAS +F64(_wfindnext64 == _wfindnexti64) +#endif +#endif +#endif +#else +F32(_findfirst == _findfirst32) +F64(_findfirst == _findfirst64i32) +F32(_findfirsti64 == _findfirst32i64) +F64(_findfirsti64 == _findfirst64) +F32(_findnext == _findnext32) +F64(_findnext == _findnext64i32) +F32(_findnexti64 == _findnext32i64) +F64(_findnexti64 == _findnext64) +F32(_wfindfirst == _wfindfirst32) +F64(_wfindfirst == _wfindfirst64i32) +F32(_wfindfirsti64 == _wfindfirst32i64) +F64(_wfindfirsti64 == _wfindfirst64) +F32(_wfindnext == _wfindnext32) +F64(_wfindnext == _wfindnext64i32) +F32(_wfindnexti64 == _wfindnext32i64) +F64(_wfindnexti64 == _wfindnext64) +#endif + +; This is list of stat symbol aliases, every CRT library has either stat symbols with SIZE suffix or without them +#ifdef FIXED_SIZE_SYMBOLS +F32(_fstat32 == _fstat) +F64(_fstat64i32 == _fstat) +#ifndef NO_I64_FIXED_SIZE +F32(_fstat32i64 == _fstati64) +#ifndef NO_FIXED_SIZE_64_ALIAS +F64(_fstat64 == _fstati64) +#endif +#endif +F32(_stat32 == _stat) +F64(_stat64i32 == _stat) +#ifndef NO_I64_FIXED_SIZE +F32(_stat32i64 == _stati64) +#ifndef NO_FIXED_SIZE_64_ALIAS +F64(_stat64 == _stati64) +#endif +#endif +#ifndef NO_WIDE_FIXED_SIZE +F32(_wstat32 == _wstat) +F64(_wstat64i32 == _wstat) +#ifndef NO_I64_FIXED_SIZE +F32(_wstat32i64 == _wstati64) +#ifndef NO_FIXED_SIZE_64_ALIAS +F64(_wstat64 == _wstati64) +#endif +#endif +#endif +#else +F32(_fstat == _fstat32) +F64(_fstat == _fstat64i32) +F32(_fstati64 == _fstat32i64) +F64(_fstati64 == _fstat64) +F32(_stat == _stat32) +F64(_stat ==
[Mingw-w64-public] [PATCH v2 5/7] crt: msvcr120_app.def.in: Remove duplicate symbol alias swab
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_app.def.in index 8319ed012..7fa9d0a32 100644 --- a/mingw-w64-crt/lib-common/msvcr120_app.def.in +++ b/mingw-w64-crt/lib-common/msvcr120_app.def.in @@ -1723,7 +1723,6 @@ _strupr_s _strupr_s_l _strxfrm_l _swab -F_I386(swab == _swab) _swprintf _swprintf_c _swprintf_c_l -- 2.34.1 ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
[Mingw-w64-public] [PATCH v2 2/7] crt: msvcr90d.def.in: Fix I386 symbol alias _wfindnext
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/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 4c31b6323..db2eb6e01 100644 --- a/mingw-w64-crt/lib32/msvcr90d.def.in +++ b/mingw-w64-crt/lib32/msvcr90d.def.in @@ -1295,7 +1295,7 @@ _wfindfirst32i64 _wfindfirst64 _wfindfirst64i32 _wfindnext32 -_wfindnext = _wfindnext32 +_wfindnext == _wfindnext32 _wfindnext32i64 _wfindnext64 _wfindnext64i32 -- 2.34.1 ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
[Mingw-w64-public] [PATCH v2 3/7] crt: msvcr120 and UCRT: Fix 64 bit _(w)findfirst and _(w)findnext symbol aliases
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-off-by: Martin Storsjö --- 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/msvcr120_app.def.in | 8 mingw-w64-crt/lib-common/ucrtbase.def.in | 6 -- mingw-w64-crt/lib64/msvcr120.def.in | 4 ++-- mingw-w64-crt/lib64/msvcr120d.def.in | 4 ++-- 6 files changed, 22 insertions(+), 12 deletions(-) rename mingw-w64-crt/lib-common/{api-ms-win-crt-filesystem-l1-1-0.def => api-ms-win-crt-filesystem-l1-1-0.def.in} (85%) diff --git a/mingw-w64-crt/Makefile.am b/mingw-w64-crt/Makefile.am index e6a21446b..97ba61e7a 100644 --- a/mingw-w64-crt/Makefile.am +++ b/mingw-w64-crt/Makefile.am @@ -1114,6 +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/vcruntime140_app.def endif @@ -1490,6 +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/vcruntime140_app.def endif @@ -1832,6 +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/vcruntime140_app.def endif @@ -2126,6 +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/vcruntime140_app.def endif diff --git a/mingw-w64-crt/lib-common/api-ms-win-crt-filesystem-l1-1-0.def b/mingw-w64-crt/lib-common/api-ms-win-crt-filesystem-l1-1-0.def.in similarity index 85% rename from mingw-w64-crt/lib-common/api-ms-win-crt-filesystem-l1-1-0.def rename to mingw-w64-crt/lib-common/api-ms-win-crt-filesystem-l1-1-0.def.in index 45ae728ba..219361b70 100644 --- a/mingw-w64-crt/lib-common/api-ms-win-crt-filesystem-l1-1-0.def +++ b/mingw-w64-crt/lib-common/api-ms-win-crt-filesystem-l1-1-0.def.in @@ -2,6 +2,8 @@ LIBRARY api-ms-win-crt-filesystem-l1-1-0 EXPORTS +#include "func.def.in" + _access ; access is provided as an alias for __mingw_access ; access == _access @@ -12,12 +14,14 @@ _chdrive _chmod chmod == _chmod _findclose -_findfirst == _findfirst64 +F32(_findfirst == _findfirst64) +F64(_findfirst == _findfirst64i32) _findfirst32 _findfirst32i64 _findfirst64 _findfirst64i32 -_findnext == _findnext64 +F32(_findnext == _findnext64) +F64(_findnext == _findnext64i32) _findnext32 _findnext32i64 _findnext64 diff --git a/mingw-w64-crt/lib-common/msvcr120_app.def.in b/mingw-w64-crt/lib-common/msvcr120_app.def.in index 1cc754856..e2474e77c 100644 --- a/mingw-w64-crt/lib-common/msvcr120_app.def.in +++ b/mingw-w64-crt/lib-common/msvcr120_app.def.in @@ -,7 +,7 @@ F_I386(_findfirst == _findfirst32) F_X86_ANY(_findfirst32i64)
Re: [Mingw-w64-public] [PATCH 2/7] crt: msvcr90d.def.in: Fix I386 symbol alias _wfindnext
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 difference. 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`. No, if this is used when linking a DLL, it does not export both names, it only exports "foo". I don't mind the casual use of "alias" for these purposes for how we normally use it - but I agree that saying "==" defines an alias, is incorrect. Anyway, I tried to clarify this bit in the commit messages (and fix a few other bits); I'll re-send the whole set of patches to the list before pushing. // Martin ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
Re: [Mingw-w64-public] Strange affect of "-std=c99" on 32-bit gcc
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 > > compilers - so I don't personally need a fix. > > I just wanted to mention this issue in case it's in the "public > interest". > > It looks like this is caused by `-fexcess-precision=standard`, as in GCC > manual: > > -fexcess-precision=style > > This option allows further control over excess precision on machines > where floating-point operations occur in a format with more precision > or range than the IEEE standard and interchange floating-point types. > By default, -fexcessprecision=fast is in effect; this means that > operations may be carried out in a wider precision than the types > specified in the source if that would result in faster code, and it is > unpredictable when rounding to the types specified in the source code > takes place. When compiling C or C++, if -fexcessprecision=standard is > specified then excess precision follows the rules specified in ISO C99 > or C++; in particular, both casts and assignments cause values to be > rounded to their semantic types (whereas -ffloat-store only affects > assignments). This option is enabled by default for C or C++ if a > strict conformance option such as -std=c99 or -std=c++17 is used. > -ffast-math enables -fexcess-precision=fast by default regardless of > whether a strict conformance option is used. > > -fexcess-precision=standard is not implemented for languages other > than C or C++. On the x86, it has no effect if -mfpmath=sse or > -mfpmath=sse+387 is specified; in the former case, IEEE semantics > apply without excess precision, and in the latter, rounding is > unpredictable. > > > By default the x87 FPU is used for floating-point arithmetic, so > `1.7976931348623157e+308` is more > precise than `double` and does not equal `0x1.fp+1023` due to > the extra significant bits. > > x86-64 is not subject to this, as SSE registers are exact `double` and > there is no excess precision. > > > -- > Best regards, > LIU Hao > > ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public