mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-26 19:33:31 +00:00
llvm-mingw's static runtime (libc++, libmingwex, libc++abi, libunwind) references symbols the NT 5.2 export surface does not provide. Add a static library, linked into the Clang runtime chain below DLL_EXPORT_VERSION 0x601, providing: - C99 vsnprintf/snprintf on top of _vsnprintf/_vscprintf. - __imp_* aliases binding dllimport references to the static CRT definitions instead of ucrtbase import thunks, which collide with them (lld: "<sym> was replaced"). - K32EnumProcessModules, forwarded to psapi's EnumProcessModules. - The Win7 SRW lock and Vista condition variable surface, bound to the RTL implementation linked statically from rtl_vista. Modules get one self-contained, consistent synchronization implementation (ReactOS' lock layout is not Windows-compatible), no kernel32_vista.dll dependency, and stay runnable on any Windows version. Static SRW linking suggested by Timo Kreuzer. Address review feedback on the llvm-compat shims: sync_static.c now uses the proper SDK/NDK headers with WINAPI/NTAPI, imp_alias.h moved to sdk/include/reactos and fixes the msvcrtex slot decorations too, and a new InitOnceExecuteOnce shim lets us drop libkernel32_vista from the interface.
Big chunks of this CRT library are taken from Wine's msvcrt implementation, you can find a list of synced files in README.WINE file. Notes: 1. When syncing, omit MSVCRT_ prefix where possible, Wine has to keep this because they are linking with *both* original crt, and ms crt implementation. ReactOS has the only CRT, so no need to make distinct functions. 2. ReactOS compiles two versions of the CRT library, one for usermode (called just "crt"), and one version for kernelmode usage (called "libcntpr"). In order to separate the code, you can use #ifdef _LIBCNT_ for libcntpr code.