Re: Transitioning libgomp from C to C++ implementation: Windows ('*-*-mingw32*')

LIU Hao via Gcc <[email protected]> Tue, 7 Jul 2026 20:19:06 +0800
Newsgroups gmane.comp.gcc.devel
Message-ID <[email protected]>
在 2026-7-3 10:45, LIU Hao via Gcc 写道:
> This allows building libgomp with win32 or mcf thread model. When yesterday I tried to build GCC master 
> it ICE'd, so I had to backport the patches to GCC 16, and everything built successfully.
> 
> However, it turns out that any program that is linked against libgomp DLL deadlocks upon exit; the reason 
> is complex but tl;dr; mingw-w64 CRT has to be patched as well (which I'll push later today):

With https://sourceforge.net/p/mingw-w64/mingw-w64/ci/0fad182ff178044ee442b05e1913aa16cde8efcf/ 
committed, I tried updating mingw-w64 CRT and rebuilding GCC with win32 thread model.

The ICE was gone, so I went ahead and ran libgomp tests. There were ~20 failures in C and C++ tests; some 
of them didn't compile, for example, libgomp/testsuite/libgomp.c-c++-common/cancel-taskgroup-1.c contains 
a call to `random()` which doesn't exist on Windows, and libgomp/alloc_cache.h still contains calls to 
pthread functions. There were also many failures in Fortran tests which I'm not familiar with.

I think this attempt to port libgomp to Windows without winpthreads is almost complete, but there are 
still some remaining changes.




-- 
Best regards,
LIU Hao
OpenPGP_signature.asc (application/pgp-signature, 840 B)
-----BEGIN PGP SIGNATURE-----

wsF5BAABCAAjFiEEYmSQWY4DEzq4FUs4hfveZl3ogBsFAmpM7roFAwAAAAAACgkQhfveZl3ogBsk
eA/9GWz8PyPKTC+9Ka4bjMUrrA4HNcSFXUoBZFzc20RhHrJV6cTVtdXFJBSA2UXwL03XwNlRR7Kl
HsoV3CqqjUFBCrD9qtwrMRweG72kQBt1skQgBD4S5/HcfP1eKvQaT9kbYk71qz5wocmVR9V4J1gm
OaL8N75Ydd5jq1UpzI7BnE0e1vjhfMG3bFUN2fYL97wcQzXz6g52d9n6fVDWEqYse/GOmAX3W0OW
C3HXCgjSfM2AQe1pP1i00PgzbxhqWdcVKGc7jXsVWeaMF9kruwlsvor0f4x87/SutX5Q6m4DuEMK
4YgdYXZX+c/puBsqHbzPI4bOtPsAPzvfBuVM3C5XWFPGsJuvvuyhyrpr4jYYgOBkTY9yIBLLKH/6
EQaTIU4aG2Lq114YvpyM6HZgs4kr/4szyc1ROZlrEmHXcV1Tu54iLcMNGuUJvydGFKHHVUCJpQ43
daSl/h5YMhdZWy3w3mL0m25XKh47M/BT7IHQWLWXLme8CEVX++t+tuNISEWPt0cwn6yMxQzRPGOD
m1EzI70pwCu4UHDhv9m+5DSjk475EUJ3kplh+vRFOxB2ZEuiDIOkOS2IE6DoSKIgAfgU51kOv9NZ
j8IJpm5UTBNNeVcwsu04nTlBFsUG3LlWp07/wvGqYNF+eYcMrRWGRtia0HA47r87N7Uv9O1vBhnQ
x8c=
=MDea
-----END PGP SIGNATURE-----