https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125312
--- Comment #12 from Jonathan Wakely <redi at gcc dot gnu.org> --- Patch posted: https://gcc.gnu.org/pipermail/gcc-patches/2026-May/716860.html At https://github.com/msys2/MINGW-packages/pull/29502 I just wrote this, about how to deal with this in user code: It should be enough to just link to a fixed libstdc++.dll With the macro undefined, applications will call the __exchange_and_add function in the DLL, but with a fixed build of libstdc++ those non-inline function definitions will use the atomic builtins instead of global mutexes. Recompiling applications will mean that they just use always-inline version of __exchange_and_add which uses the builtins directly, but it's ABI compatible to use the inline or the fixed non-inline version. The problem is only when linking to a libstdc++.dll containing a non-inline version that uses a mutex.
