Commit Graph

7917 Commits

Author SHA1 Message Date
Pali Rohár
ec2f45aace crt: Split __initenv and __winitenv symbols into separate files
Every executable references only one of those symbols. So if symbols are
split into separate files, linker includes only the one which is used.

(While splitting, simplify the use of headers as well.)

crtdll.dll and msvcrt10.dll do not have entry point for wide wmain() and
therefore they do not need __winitenv init symbol. So do not provide
__winitenv symbol for these two CRT import libraries.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-07-24 12:27:42 +03:00
Martin Storsjö
97be41760d crt: Regenerate Makefile.in
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-07-23 13:04:20 +03:00
Pali Rohár
3c60ad9c7a crt: Remove duplicate file mingw-w64-crt/misc/initenv.c
File mingw-w64-crt/misc/initenv.c provides same implementation of __initenv
and __winitenv symbols as file mingw-w64-crt/misc/__initenv.c.

So remove duplicate file.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-07-23 13:04:20 +03:00
Pali Rohár
f1075a71a0 crt: msvcrt.def.in: Do not overwrite math frexp symbol on ARM
Same as for other math symbols, do not overwrite them in msvcrt.def.in on ARM.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-07-23 13:03:41 +03:00
Martin Storsjö
7cdb381e35 crt: Regenerate Makefile.in
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-07-23 11:58:23 +03:00
Pali Rohár
464266725d crt: Provide __badioinfo variable import symbol for all CRT libraries
Global variable __badioinfo is exported from VC42+ CRT import libraries.
It is not exported from UCRT.

So it is not available in UCRT, msvcrt40.dll and older CRT versions.

Symbol is just a global ioinfo structure with bad (-1) file descriptor.

Provide this structure also in import libraries for older CRT versions and
UCRT, so the symbols will be in all CRT import libraries.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-07-23 11:57:27 +03:00
Pali Rohár
e3da5d008d crt: Fix declaration of __badioinfo import symbol
Symbol __badioinfo represents a variable of structure type. Not a pointer
to structure and neither not a pointer to array of structures.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-07-23 11:57:27 +03:00
Pali Rohár
4a0288e861 headers: tchar.h: Use ll/max functions for _t*ll/_t*max macros
Expand _t*ll* and _t*[ui]max* macros to *ll* and *[ui]max** functions
(instead of *i64* functions). This is just for consistency and should not
change any behavior.

mingw-w64 for all CRT import libraries (which provide *i64* functions)
already provides also *ll* and *[ui]max* functions.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-07-23 11:17:35 +03:00
Pali Rohár
cb2010956e crt: crt-aliases.def.in: Provide _wtoll and _wtoll_l symbols aliases
Use same conditions for providing _wtoll and _wtoll_l symbols aliases as
are already used for atoll and _atoll_l symbol aliases.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-07-23 11:17:35 +03:00
Martin Storsjö
bca8736923 crt: Regenerate Makefile.in
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-07-23 11:17:35 +03:00
Pali Rohár
007cfa004b crt: Define C99 wcsto[u]ll/wcsto[iu]max functions for all CRT import libraries
Functions _wcstoi64() and _wcstoui64() are available since msvcr70.dll and
are equivalent to C99 wcstoll() and wcstoull() functions. As mingw-w64
defines intmax_t and uintmax_t types 64-bit, same as (unsigned) long long,
these functions are equivalent also to C99 wcstoimax() and wcstoumax()
functions.

So for msvcr70+ import libraries define C99 function symbols wcstoll,
wcstoull, wcstoimax and wcstoumax as aliases to _wcstoi64 and _wcstoui64
symbols in the same way as are defined aliases to _strtoi64 and _strtoui64
symbols.

For previous versions use mingw-w64 implementation from wcstoimax.c and
wcstoumax.c files. Move them from libmingwex library to individual CRT
import libraries, to ensure that for msvcr70+ is used the native version
(and not the one from libmingwex).

This change mimics commits c52f1eb099 and
4953f7746a but for wide-char functions.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-07-23 11:16:28 +03:00
Martin Storsjö
aea728e04b crt: Regenerate Makefile.in
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-07-22 23:41:03 +03:00
Martin Storsjö
e53cded112 crt: Fix the CPPFLAGS for libmsvcr110_extra.a for arm32
This was added incorrectly in 4899f4e895.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-07-22 23:38:52 +03:00
Martin Storsjö
9e6c327c15 crt: Regenerate Makefile.in
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-07-22 16:04:00 +03:00
Pali Rohár
09c8ca1e1a crt: Add import library for msvcr110d.dll
msvcr110d.dll is debug version of the msvcr110.dll and provides additional
debugging functions.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-07-22 16:03:17 +03:00
Pali Rohár
c69cd03f47 crt: Add import library for msvcr100d.dll
msvcr100d.dll is debug version of the msvcr100.dll and provides additional
debugging functions.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-07-22 16:03:17 +03:00
Martin Storsjö
a62f8fa282 crt: Regenerate Makefile.in
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-07-22 16:01:08 +03:00
Pali Rohár
4899f4e895 crt: Move isblank from libmingwex.a to individual CRT import libraries
C99 isblank symbol is natively available since msvcr120.dll, so include
mingw-w64 implementation of isblank to CRT import libraries only up to the
msvcr110 version.

This allows to use native isblank symbol for UCRT and msvcr120 builds.

Import libraries msvcr100 and msvcr110 currently do not have version
specific extra library, so define it and include it in MRI scripts.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-07-22 16:01:08 +03:00
Biswapriyo Nath
85ca1edc5c headers: Add new WSA error codes in winerror.h
From 6511cade21388aa4055b6f9058db6cc5ba52641f Mon Sep 17 00:00:00 2001
From: Biswapriyo Nath <nathbappai@gmail.com>
Date: Sun, 14 Jul 2024 17:52:19 +0000
Subject: [PATCH 2/2] headers: Add new WSA error codes in winerror.h

Signed-off-by: Biswapriyo Nath <nathbappai@gmail.com>
Signed-off-by: LIU Hao <lh_mouse@126.com>
2024-07-16 21:44:52 +08:00
Biswapriyo Nath
d5f47f39ac headers: Add DNS related error codes in winerror.h
From ab59761e3e4395ef118ddf02137ed4948d27115b Mon Sep 17 00:00:00 2001
From: Biswapriyo Nath <nathbappai@gmail.com>
Date: Sun, 14 Jul 2024 17:50:34 +0000
Subject: [PATCH 1/2] headers: Add DNS related error codes in winerror.h

Signed-off-by: Biswapriyo Nath <nathbappai@gmail.com>
Signed-off-by: LIU Hao <lh_mouse@126.com>
2024-07-16 21:44:52 +08:00
Biswapriyo Nath
a751e6401f include: Add WHV_ARM64_PROCESSOR_FEATURES for aarch64 in winhvplatformdefs.h
Signed-off-by: Biswapriyo Nath <nathbappai@gmail.com>
Signed-off-by: LIU Hao <lh_mouse@126.com>
2024-07-10 22:10:41 +08:00
Biswapriyo Nath
d9faaee6c5 headers: Rename WHV_PROCESSOR_FEATURES1 for x86_64 in winhvplatformdefs.h
Signed-off-by: Biswapriyo Nath <nathbappai@gmail.com>
Signed-off-by: LIU Hao <lh_mouse@126.com>
2024-07-10 22:10:41 +08:00
Biswapriyo Nath
12f03404e8 headers: Rename WHV_PROCESSOR_FEATURES for x86_64 in winhvplatformdefs.h
Signed-off-by: Biswapriyo Nath <nathbappai@gmail.com>
Signed-off-by: LIU Hao <lh_mouse@126.com>
2024-07-10 22:10:41 +08:00
Biswapriyo Nath
b128f9e697 include: Add new members in WHV_SYNTHETIC_PROCESSOR_FEATURES in winhvplatformdefs.h
Signed-off-by: Biswapriyo Nath <nathbappai@gmail.com>
Signed-off-by: LIU Hao <lh_mouse@126.com>
2024-07-10 22:10:41 +08:00
LIU Hao
d2d568e4e0 headers: Update to current Wine master
Signed-off-by: LIU Hao <lh_mouse@126.com>
2024-07-08 22:52:06 +08:00
Biswapriyo Nath
a885fe98b0 headers: Import x3daudio.h from wine
Required for https://github.com/microsoft/DirectXTK

Signed-off-by: Biswapriyo Nath <nathbappai@gmail.com>
Signed-off-by: LIU Hao <lh_mouse@126.com>
2024-07-08 22:44:47 +08:00
Biswapriyo Nath
0cf06d5cb6 headers: Add macros for all inline functions in intsafe.h
Required for https://github.com/microsoft/DirectXShaderCompiler

Signed-off-by: Biswapriyo Nath <nathbappai@gmail.com>
Signed-off-by: LIU Hao <lh_mouse@126.com>
2024-07-08 22:40:10 +08:00
Jacek Caban
4ef04b0a7f headers: Updated imported headers to current Wine version.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
2024-07-06 11:01:36 +02:00
Jacek Caban
b18c569f47 widl: Updated to Wine version 69e3c712dca9cc697830c74725e07daa46d23bdf.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
2024-07-06 10:54:14 +02:00
Biswapriyo Nath
5528297739 headers: Add new symbols in bcrypt.h
Required for https://github.com/googleapis/google-cloud-cpp

Signed-off-by: Biswapriyo Nath <nathbappai@gmail.com>
Signed-off-by: LIU Hao <lh_mouse@126.com>
2024-07-05 23:11:13 +08:00
Biswapriyo Nath
da831a04d5 headers: Add new _Pre and _Post macros in sal.h
Signed-off-by: Biswapriyo Nath <nathbappai@gmail.com>
Signed-off-by: LIU Hao <lh_mouse@126.com>
2024-07-03 22:32:00 +08:00
Biswapriyo Nath
dbb781a800 headers: Add more error codes in winerror.h
Required for https://github.com/microsoft/DirectXShaderCompiler

Signed-off-by: Biswapriyo Nath <nathbappai@gmail.com>
Signed-off-by: LIU Hao <lh_mouse@126.com>
2024-06-30 14:07:52 +08:00
Martin Storsjö
ed0024ccd2 crt: Regenerate Makefile.in
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-06-30 00:20:59 +03:00
Pali Rohár
d8c084656c crt: msvcrt.def.in: Replace F_I386+F_ARM_ANY by new F_NON_X64() macro
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-06-30 00:20:58 +03:00
Pali Rohár
68336bc7b7 crt: msvcrt.def.in: Add comments for symbols provided by mingw-w64
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-06-30 00:20:58 +03:00
Pali Rohár
34b300e480 crt: msvcrt.def.in: Do not use emulation of Vista+ symbols on ARM32/64
ARM32 and ARM64 always contain all Vista symbols. So use them directly
instead of the mingw-w64 emulation.

The only Vista+ symbol which stay disabled in the def file is vsnprintf.
It is because this Vista+ vsnprintf symbol is not C99 compatible and is
just an alias to _vsnprintf symbol which does not fill nul term byte.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-06-30 00:20:58 +03:00
Pali Rohár
ddf0d28bc4 crt: msvcrt.def.in: Remove Windows 10 TODO
There are no new i386/x64/arm32/arm64 symbols in Windows 10 (up to 22H2
version) since Windows 8.1.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-06-30 00:20:58 +03:00
Pali Rohár
1c75d326c6 crt: msvcrt.def.in: Fix list of ARM64 symbols
Include all ARM64 C++ mangled symbols. Add _local_unwind symbol which is
present also in ARM64 version. And remove _setjmp, setjmp and __jump_unwind
symbols which are not present in any ARM64 version.

As a reference were checked msvcrt.dll versions 7.0.17083.1000 and
7.0.19041.546 and all have same set of symbols.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-06-30 00:20:58 +03:00
Pali Rohár
f4641b617e crt: msvcrt.def.in: Symbols _memcpy_strict_align and fabsf are available on ARM since Win RT 8.0
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-06-30 00:20:58 +03:00
Pali Rohár
16eea155ed crt: msvcrt.def.in: Use F_I386() instead of #ifdef DEF_I386
Usage of F_I386() macro per symbol allows to easily identify via "git grep"
if the particular symbol is available for specific architecture or not.
"#ifdef DEF_I386" prevents easy usage of "git grep".

So change remaining "#ifdef DEF_I386" blocks by per-symbol F_I386() macros.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-06-30 00:20:58 +03:00
Martin Storsjö
af1549375b crt: Regenerate Makefile.in
Signed-off-by: Martin Storsjö <martin@martin.st>
2024-06-30 00:20:58 +03:00
Pali Rohár
c6a4bfe95f crt: Provide _fseeki64() and _ftelli64() functions for all CRT import libraries
Functions _fseeki64() and _ftelli64() are natively available since
msvcr80.dll.

mingw-w64 already provides emulation of _fseeki64() and _ftelli64()
functions for msvcrt.dll import library via _filelengthi64(), fgetpos(),
fsetpos() and fflush() functions.

So include this emulation into all pre-msvcr80 CRT import libraries as all
of import libraries for them already contains all ABI-compatible dependent
functions.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-06-30 00:20:58 +03:00
Pali Rohár
012344caed crt: Provide _filelengthi64() function for crtdll.dll, msvcrt10.dll and msvcrt20.dll
Function _filelengthi64() is available since msvcrt40.dll.

For previous CRT versions, which have only 32-bit file offsets, define it
as wrapper around 32-bit _filelength() function.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-06-30 00:20:58 +03:00
Pali Rohár
4bc1b2bfe7 crt: Define fgetpos64() and fsetpos64() functions in crt-aliases.def.in as symbol aliases
Functions fgetpos64() and fsetpos64() are just aliases for functions
fgetpos() and fsetpos() as they are already using 64-bit fpos_t type.

Most aliased functions are defined in crt-aliases.def.in file. Do same also
for fgetpos64() and fsetpos64() functions by moving them from individual C
files stdio/fgetpos64.c and stdio/fsetpos64.c.

Libraries which do not have real fgetpos() and fsetpos() have aliases
defined in the same file were are defined compatibility wrappers.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-06-30 00:20:58 +03:00
Pali Rohár
2437bc9459 crt: Fix fgetpos() and fsetpos() functions for crtdll.dll, msvcrt10.dll and msvcrt20.dll
Functions fgetpos() and fsetpos() in these libraries have different ABI
than in all later versions starting with msvcrt40.

Their second argument is pointer to 32-bit signed value, which is not
compatible with the fpos_t type (64-bit), used by all later versions.

So rename these functions in these import libraries to names with suffix 32
and provides mingw-w64 fpos_t (64-bit) wrappers around them for ABI
compatibility.

This change fixes ABI compatibility for those older DLL libraries.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-06-30 00:20:58 +03:00
Pali Rohár
b59ca53d7b crt: Provide _get_errno() and _set_errno() functions for all CRT import libraries
Functions _get_errno() and _set_errno() are natively available since
msvcr80.dll and also since Windows Vista version of msvcrt.dll.

Import libraries for crtdll, msvcrt10-40 and msvcrt.dll already contains
emulation of these functions. Include this emulation also for msvcr70 and
msvcr71, so these functions would be available in all CRT import libraries.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-06-30 00:20:58 +03:00
Pali Rohár
e3194476ad crt: Provide _wassert() function for all CRT import libraries
Function _wassert() is natively available since msvcr80.dll and also since
Windows Vista version of msvcrt.dll.

Import library for i386 version of msvcrt.dll already contains emulation of
this function.

Include this emulation into x64 version of msvcrt.dll and also into crtdll,
msvcrt10-40 and msvcr70-71 libraries, so function _wassert() would be
available in all CRT import libraries.

For import libraries other than msvcrt.dll, improve emulation code, so it
does not try to resolve that function from DLL as in other versions it is
never available.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-06-30 00:20:58 +03:00
Pali Rohár
335425724b crt: Provide _set_purecall_handler() function for all CRT import libraries
Function _set_purecall_handler() is natively available since msvcr70.dll.
For all previous CRT versions include mingw-w64 emulation.

Emulation is already included for msvcrt-os.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-06-30 00:20:58 +03:00
Pali Rohár
0ad7f73fdc crt: Provide _get_output_format() and _set_output_format() functions for all CRT import libraries
These functions are natively available since msvcr80.dll and also since
Vista version of msvcrt.dll. They are available also in ARM versions.
For all older CRT versions include mingw-w64 emulation.

Emulation in misc/output_format.c is slightly updated to optimize code for
non-msvcrt.dll version which do not provide these functions.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-06-30 00:20:58 +03:00
Pali Rohár
f6af09e2d3 crt: Provide _configthreadlocale() function for all CRT import libraries
Function _configthreadlocale() is natively available since msvcr80.dll.
For all previous CRT versions include mingw-w64 emulation.

Emulation is already included for msvcrt-os.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-06-30 00:20:58 +03:00