https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124255
Bug ID: 124255
Summary: The ___cxa_thread_atexit function does not support
Windows 9x.
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: LYN_2019 at outlook dot com
Target Milestone: ---
in gcc/libstdc++-v3/libsupc++/atexit_thread.cc:202
```cpp
#ifdef _GLIBCXX_THREAD_ATEXIT_WIN32
/* Store the DLL address for a later call to FreeLibrary in new_elt and
increment DLL load count. This blocks the unloading of the DLL
before the thread-local dtors have been called. This does NOT help
if FreeLibrary/dlclose is called in excess. */
GetModuleHandleExW (GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS,
(LPCWSTR) dtor, &new_elt->dll);
#endif
```
The GetModuleHandleExW function is only supported on WinNT; it is not supported
on Win9x. This causes the use of thread_local to fail to find the symbol and
prevents the program from starting.