[Bug libstdc++/108225] canadian compilation of gdb error for libstdc++'s std_mutex.h on x86_64-w64-mingw32 host

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Jan 11 09:55:36 GMT 2023


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108225

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|MOVED                       |---
             Status|RESOLVED                    |REOPENED

--- Comment #23 from Jonathan Wakely <redi at gcc dot gnu.org> ---
The problem now is that using a different value of _WIN32_WINNT invalidates
what was used during libstdc++'s configure, making _GLIBCXX_HAS_GTHREADS
incorrect.

Maybe we want something like this:

diff --git a/libstdc++-v3/config/os/mingw32-w64/os_defines.h
b/libstdc++-v3/config/os/mingw32-w64/os_defines.h
index ee02ff82e86..68ac100acc8 100644
--- a/libstdc++-v3/config/os/mingw32-w64/os_defines.h
+++ b/libstdc++-v3/config/os/mingw32-w64/os_defines.h
@@ -96,4 +96,13 @@
 // See libstdc++/94268
 #define _GLIBCXX_BUFSIZ 4096

+#if _WIN32_WINNT < 0x0600
+// For the win32 thread model, setting _WIN32_WINNT to an old version might
+// invalidate the value of _GLIBCXX_HAS_GTHREADS decided during configure.
+# include <gthr.h>
+# ifndef __GTHREADS_CXX0X
+#  undef _GLIBCXX_HAS_GTHREADS
+# endif
+#endif
+
 #endif


More information about the Gcc-bugs mailing list