winpthreads: Unify setup of winpthreads_init callback between gcc and msvc builds
For all builds register callback via .CRT$XCT section (same what is
already done for msvc builds).
For gcc builds, the .CRT$XC* callbacks are executed before all other
__attribute__((constructor(0))) callbacks. So the change should be safe.
To prevent garbage collecting the __xc_t variable, it is enough to mark it
with __attribute__((used)). It does not have to be exported, so mark it as
static.
Co-authored-by: LIU Hao <lh_mouse@126.com>
Signed-off-by: LIU Hao <lh_mouse@126.com>
1 file changed