Fix CXX initializers
- Dominant language
- C++
- Stars
- 99
- Forks
- 21
- PR merge metrics
- No merged PRs in 30d
Description
Recent MSVC compiler uses
```c++
using ktl::crt::global_c_handler_t = int(__cdecl*)();
using ktl::crt::global_cxx_handler_t = void(__cdecl*)();
CRTALLOC(".CRT$XIA")
ktl::crt::global_c_handler_t __xi_a[] {nullptr}; // C initializers (first)
CRTALLOC(".CRT$XIZ")
ktl::crt::global_c_handler_t __xi_z[] {nullptr}; // C initializers (last)
CRTALLOC(".CRT$XCA")
ktl::crt::global__cxx_handler_t __xc_a[] {nullptr}; // C++ initializers (first)
CRTALLOC(".CRT$XCZ")
ktl::crt::global_cxx_handler_t __xc_z[] {nullptr}; // C++ initializers (last)
CRTALLOC(".CRT$XPA")
ktl::crt::global_cxx_handler_t __xp_a[] {nullptr}; // C pre-terminators (first)
CRTALLOC(".CRT$XPZ")
ktl::crt::global_cxx_handler_t __xp_z[] {nullptr}; // C pre-terminators (last)
CRTALLOC(".CRT$XTA")
ktl::crt::global_cxx_handler_t __xt_a[] {nullptr}; // C terminators (first)
CRTALLOC(".CRT$XTZ")
ktl::crt::global_cxx_handler_t __xt_z[] {nullptr}; // C terminators (last)
```
instead of [old initializers provided by KTL](https://github.com/DymOK93/KTL/blob/master/runtime/include/crt_runtime.hpp).
Usually MSVC places C++ initializers between `__cxx_ctors_begin__` and `__cxx_ctors_end__` symbols as expected, but with LTO enabled (`/GL` compiler option) includes these symbols in reverse order into a weird `?__cxx_c` section without the initializers themselves:

Reproducible on MSVC 19.28+
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.