14 Commits
Author SHA1 Message Date
Timo Kreuzer d0b292cda6 [VCSTARTUP] Separate the library from vcruntime
Previously this was mixed with vcruntime, with some objects being shared. But this is messy. Instead use a separate library and link ucrtbase to this as well. This also matches more closely how native libraries are organized, where vcstartup is merged into the CRT import libraries, while vcruntime is merged into the static CRT libraries.
2026-06-21 12:30:32 +00:00
Timo Kreuzer 4c19b94ae9 [VCRUNTIME] Implement _chkesp / _chkesp_failed 2026-02-01 11:46:59 +02:00
Timo Kreuzer 89506818c4 [VCRUNTIME] Implement purecall handler support
Implements _get_purecall_handler, _set_purecall_handler and _purecall
2026-02-01 11:46:59 +02:00
Timo Kreuzer e8d190a29e [VCRUNTIME] Implement _seh_longjmp_unwind 2025-08-22 09:12:51 +03:00
Timo Kreuzer a5448b04c6 [VCRUNTIME] Properly implement setjmp/longjmp 2025-08-22 09:12:51 +03:00
Timo Kreuzer e2deec8235 [UCRT] Fix __crt_fast_encode_pointer
GCC was optimizing away the xor with __security_cookie when passing nullptr_t, because the return value was also nullptr_t, assuming it must be nullptr.
2025-07-29 09:22:15 +03:00
Timo Kreuzer 52719b52ae [VCRUNTIME] Fix a bug in x64 __security_init_cookie 2025-04-07 13:57:17 +00:00
Timo Kreuzer f81c82f5fa [VCSTARTUP] Implement atexit and _onexit
These must use a local table and cannot use the one from ucrtbase.
The table is initialized with a .CRT section initializer.
2025-03-24 23:02:06 +00:00
Timo Kreuzer 92d479a54b [VCRUNTIME] Add initialization / cleanup of wine code 2025-02-06 09:17:37 +02:00
Timo Kreuzer 32c349d30e [VCRUNTIME] Add TLS callback support 2025-02-06 09:17:37 +02:00
Timo Kreuzer 7f050e0a6d [VCRUNTIME] Improve includes in internal_shared.h 2025-02-06 09:17:37 +02:00
Timo Kreuzer a978879ddb [VCSTARTUP] Implement (w)mainCRTStartup
__acrt_initialize is here as a stub to later support linking ucrt statically. When it is statically linked the real function should be called, but when the executable links to ucrtdll, the initialization happens when the DLL is loaded, so we call a stub here.
2025-02-06 09:17:37 +02:00
Timo Kreuzer d243b6cdf3 [VCRUNTIME] Implement __std_terminate() 2025-02-06 09:17:37 +02: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