This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/52300] Gthreads functions linking error at dynamic linking with libstdc++ when using MinGW.
- From: "ktietz at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 19 Feb 2012 17:12:13 +0000
- Subject: [Bug libstdc++/52300] Gthreads functions linking error at dynamic linking with libstdc++ when using MinGW.
- Auto-submitted: auto-generated
- References: <bug-52300-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52300
Kai Tietz <ktietz at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2012-02-19
CC| |ktietz at gcc dot gnu.org
Ever Confirmed|0 |1
--- Comment #1 from Kai Tietz <ktietz at gcc dot gnu.org> 2012-02-19 17:12:13 UTC ---
As pe-coff doesn't have fully compatible support for weaks to ELF ones, we
should disable it. In static version it works, but when used in shared variant
it doesn't.
I suggest the following patch to solve this problem:
Index: gthr.h
===================================================================
--- gthr.h (revision 184333)
+++ gthr.h (working copy)
@@ -135,6 +135,14 @@
*/
#if SUPPORTS_WEAK
+/* The pe-coff weak support isn't fully compatible to ELF's weak.
+ For static libraries it might would work, but as we need to deal
+ with shared versions too, we disable it for mingw-targets. */
+#ifdef __MINGW32__
+#undef GTHREAD_USE_WEAK
+#define GTHREAD_USE_WEAK 0
+#endif
+
#ifndef GTHREAD_USE_WEAK
#define GTHREAD_USE_WEAK 1
#endif