Timo Kreuzer
5b633d64f1
[UCRTBASE] Build without debug exports
...
Windows ships ucrtbase without debug exports and ucrtbased with debug exports. The wine test tests ucrtbase and loads it dynamically in some cases. Compiling it with _DEBUG requires it to be linked to ucrtbased, which causes problems, because it also dynamically loads ucrtbase, which will cause it to crash.
2025-03-24 23:02:06 +00:00
Doug Lyons
45ed1a9b6d
[UCRT] Fix MSVC compiling on VS 2017 after Timo's UCRT commits ( #7718 )
...
CORE-19996
Verified using https://godbolt.org .
2025-02-15 20:03:52 -06:00
Timo Kreuzer
9186b861a6
[VCRUNTIME][VCSTARTUP] Add separate vcruntime and vcstartup lib
...
vcruntime contains the code that is linked into ucrtbase (in VS it is also provided as vcruntime140.dll)
vcstartup contains the code that is statically linked into executables that link to ucrtbase.dll. In Visual Studio this is part of msvcrt.lib (the import library for msvcrt), similar to our current msvcrtex, and it gets linked when you link to ucrtbase as well. The name is based on the folder name in the library.
Both libraries share some code, but each file is only compiled once.
2025-02-06 09:17:37 +02:00
Timo Kreuzer
41ffe7f3c6
[UCRTBASE] Add ucrtbase.dll to build
2025-01-26 18:08:55 +02:00
Timo Kreuzer
9f15d9ee57
[UCRT:MATH] Implement _dtest, _fdtest
2025-01-26 18:08:55 +02:00
Timo Kreuzer
59c55e003e
[UCRT:MATH] Implement _dclass, _fdclass
2025-01-26 18:08:55 +02:00
Timo Kreuzer
efe84ec41a
[UCRT] Add "aliases" for some hacked clang builtins
2025-01-26 18:08:55 +02:00
Timo Kreuzer
b09b5584e0
[UCRT:MATH] Implement math error support functions
2025-01-26 18:08:55 +02:00
Timo Kreuzer
8aab548ecd
[UCRT:VCRUNTIME] Implement __isa_available_init()
2025-01-26 18:08:55 +02:00
Timo Kreuzer
9c887efa0e
[UCRT:VCRUNTIME] Add initializer sections
...
Use #pragma section only for MSVC (and Clang-cl), because Clang doesn't like allocating non-const variables in a read-only section, while GCC doesn't understand these pragmas and ignores them.
2025-01-26 18:08:55 +02:00
Timo Kreuzer
4198ceb83a
[UCRT:VCRUNTIME] Implement vcruntime init stubs
2025-01-26 18:08:55 +02:00
Timo Kreuzer
4d80956566
[UCRT:VCRUNTIME] Implement __report_rangecheckfailure()
2025-01-26 18:08:55 +02:00
Timo Kreuzer
b0f3e623b7
[UCRT:VCRUNTIME] Implement __report_gsfailure()
2025-01-26 18:08:55 +02:00
Timo Kreuzer
5dcd1d1714
[UCRT:VCRUNTIME] Implement __security_init_cookie and __security_check_cookie
2025-01-26 18:08:55 +02:00
Timo Kreuzer
055875fbd8
[UCRT:FLOAT] Add _fltused
2025-01-26 18:08:55 +02:00
Timo Kreuzer
4462342076
[UCRT:STARTUP] Implement __scrt_uninitialize_crt stub
2025-01-26 18:08:55 +02:00
Timo Kreuzer
d21fd37650
[UCRT:LOCALE] Implement __acrt_WideCharToMultiByte
2025-01-26 18:08:55 +02:00
Timo Kreuzer
bd3c7654ec
[UCRT:LOCALE] Implement __acrt_MultiByteToWideChar
2025-01-26 18:08:55 +02:00
Timo Kreuzer
4ea1841f31
[UCRT:LOCALE] Implement __acrt_GetStringTypeW
2025-01-26 18:08:55 +02:00
Timo Kreuzer
f07ea94798
[UCRT] Fix build of memcpy_s.cpp
...
extern inline creates a global symbol on MSVC, but not on GCC. Use extern instead.
2025-01-22 18:56:08 +02:00
Timo Kreuzer
fea0f9243d
[UCRT] Remove __inline from conversion functions
...
Otherwise no actual symbols will be created.
2025-01-22 18:56:08 +02:00
Timo Kreuzer
61175644d0
[UCRT] Add architecturally optimized code to build
2025-01-22 18:56:08 +02:00
Timo Kreuzer
94eb475177
[UCRT][ASM] Make asm code GCC compatible
2025-01-22 18:56:08 +02:00
Timo Kreuzer
4fec953e6e
[UCRT][ASM] Rename all .asm files to .s
2025-01-22 18:56:08 +02:00
Timo Kreuzer
72aed01dbd
[ASM] Fix up some x86 assembly code
2025-01-22 18:56:08 +02:00
Timo Kreuzer
e2ffc35894
[UCRT] Fix/improve __crt_state_management
2025-01-22 18:56:08 +02:00
Timo Kreuzer
c2b1271dbe
[UCRT] Improve __crt_seh_guarded_call
...
This is a workaround for an MSVC compiler bug, which would result in degraded performance. See https://developercommunity.visualstudio.com/t/_local_unwind-generated-when-returning-f/10673261 ?
2025-01-22 18:56:08 +02:00
Timo Kreuzer
a58b713a5e
[UCRT] Properly implement __crt_fast_encode/decode_pointer
2025-01-22 18:56:08 +02:00
Timo Kreuzer
c1145f0c89
[UCRT] Properly implement parameter checking macros
...
Partly copied from corecrt_internal_strtox.h, partly imported from dotnet runtime (https://github.com/dotnet/runtime/blob/release/8.0/src/coreclr/pal/src/safecrt/internal.h )
2025-01-22 18:56:08 +02:00
Timo Kreuzer
7bb12665d6
[UCRT] Add CMake files
2025-01-16 14:18:53 +02:00
Timo Kreuzer
ef440b9aef
[UCRT] Add a hack for a clang bug
...
See CORE-19902
2025-01-16 14:18:53 +02:00
Timo Kreuzer
2eb3149565
[UCRT] Make includes unix compatible
2025-01-16 14:18:53 +02:00
Timo Kreuzer
90dad446b7
[UCRT] Fix GCC build of __crt_char_traits
...
This is a workaround for GCC. It will disable debugging for tdupenv_s_crt.
How it works on MSVC? Magic.
2025-01-16 14:18:53 +02:00
Timo Kreuzer
693f9f51a0
[UCRT] Hack some template code, so that retarded compilers can handle it
2025-01-16 14:18:53 +02:00
Timo Kreuzer
f9dc185ede
[UCRT] Use a C cast instead of const_cast for GCC
...
This is because GCC will generate errors for both const_cast and static_cast depending on the template parameter:
- With const_cast: error: invalid 'const_cast' from type 'std::nullptr_t' to type 'const wchar_t**'
- With static_cast: error: invalid 'static_cast' from type 'wchar_t** const' to type 'const wchar_t**'
2025-01-16 14:18:53 +02:00
Timo Kreuzer
47e3f49e52
[UCRT] No __declspec(spectre(nomitigation)) for GCC/Clang
2025-01-16 14:18:53 +02:00
Timo Kreuzer
97e20ef342
[UCRT] Fix GCC/Clang build of SSE2/AVX code
...
On GCC the code using extended ISA cannot be inlined and must either be marked with a function attribute or compiled with the proper target options ('-mavx2' on the command line or '#pragma GCC target("avx2")' inside the code)
2025-01-16 14:18:53 +02:00
Timo Kreuzer
e98e9000c7
[UCRT] Make SEH blocks ReactOS PSEH compatible
2025-01-16 14:18:53 +02:00
Timo Kreuzer
7bb9f6bf28
[UCRT] Fix GCC/Clang build of enum_system_locales_ex_nolock
...
Add static function for Clang.
Add missing __stdcall in a lambda for GCC.
MSVC does this automagically. See https://devblogs.microsoft.com/oldnewthing/20150220-00/?p=44623 .
2025-01-16 14:18:53 +02:00
Timo Kreuzer
2cc6699f0d
[UCRT] Silence warning about returning noreturn function
2025-01-16 14:18:53 +02:00
Timo Kreuzer
a21a206c89
[UCRT] Add workaround for va_arg warning about type promotion
2025-01-16 14:18:53 +02:00
Timo Kreuzer
faedd8ff75
[UCRT] Use GCC inline assembler
...
Clang requires the asm to be split, otherwise it complains that it doesn't have enough registers.
2025-01-16 14:18:53 +02:00
Timo Kreuzer
0cdde63c57
[UCRT] Add casts to make GCC happy
2025-01-16 14:18:53 +02:00
Timo Kreuzer
dbd58d7666
[UCRT] Fix GCC/Clang compilation of template specializations
2025-01-16 14:18:53 +02:00
Timo Kreuzer
c15b618a17
[UCRT] Add using declatarions for template base-classes (GCC compatibility)
2025-01-16 14:18:53 +02:00
Timo Kreuzer
5ba105e9b5
[UCRT] Add some missing typename for GCC compatibility
2025-01-16 14:18:53 +02:00
Timo Kreuzer
90fb8391fc
[UCRT] Fix shadowing template parameters
2025-01-16 14:18:53 +02:00
Timo Kreuzer
482f318a23
[UCRT] Fix template specialization
2025-01-16 14:18:53 +02:00
Timo Kreuzer
7a764cf610
[UCRT] Fix invalid storage type specification
2025-01-16 14:18:53 +02:00
Timo Kreuzer
4de4349109
[UCRT] Fix non-standard literal suffixes
2025-01-16 14:18:53 +02:00