[Bug target/41810] Cannot build gcc: gthr-default.h:466: error: '__mutex' was not declared in this scope
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41810 Rainer Orth changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution||FIXED --- Comment #13 from Rainer Orth 2011-07-18 16:25:13 UTC --- Long fixed.
[Bug target/41810] Cannot build gcc: gthr-default.h:466: error: '__mutex' was not declared in this scope
--- Comment #12 from ro at gcc dot gnu dot org 2009-11-27 15:17 --- Subject: Bug 41810 Author: ro Date: Fri Nov 27 15:17:04 2009 New Revision: 154708 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=154708 Log: PR target/41810 * gthr-solaris.h (__gthread_mutex_destroy): Remove UNUSED. [SUPPORTS_WEAK && GTHREAD_USE_WEAK] (__gthread_active_p): Use __extension__ to allow cast from function pointer to object pointer in C++. * doc/install.texi (--enable-threads): Clarify use of Solaris threads. Modified: trunk/gcc/ChangeLog trunk/gcc/doc/install.texi trunk/gcc/gthr-solaris.h -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41810
[Bug target/41810] Cannot build gcc: gthr-default.h:466: error: '__mutex' was not declared in this scope
--- Comment #11 from ro at gcc dot gnu dot org 2009-11-20 17:17 --- Mine. -- ro at gcc dot gnu dot org changed: What|Removed |Added CC|ro at techfak dot uni- | |bielefeld dot de| AssignedTo|unassigned at gcc dot gnu |ro at gcc dot gnu dot org |dot org | Status|UNCONFIRMED |ASSIGNED Ever Confirmed|0 |1 Last reconfirmed|-00-00 00:00:00 |2009-11-20 17:17:12 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41810
[Bug target/41810] Cannot build gcc: gthr-default.h:466: error: '__mutex' was not declared in this scope
--- Comment #10 from ro at CeBiTec dot Uni-Bielefeld dot DE 2009-11-20 17:10 --- Subject: Re: Cannot build gcc: gthr-default.h:466: error: '__mutex' was not declared in this scope > The #c4 patch looks wrong, instead of that you should IMHO just not use UNUSED > macro on __gthread_mutex_destroy argument. It is perfectly fine on > __gthread_key_delete. You're right, of course. I should have looked closer. Testing and comparison with pthread results found two other bugs, one of which I could already fix in gthr-solaris.h. I've tried to debug the other (objc) testcase, but gdb 6.6 cannot fully handle it, and I couldn't yet get a gdb 7.0 to debug a 64-bit binary. Given that this is a bootstrap failure, I'll submit and install the fix now and check the remainder later. Rainer -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41810
[Bug target/41810] Cannot build gcc: gthr-default.h:466: error: '__mutex' was not declared in this scope
--- Comment #9 from jakub at gcc dot gnu dot org 2009-11-19 11:54 --- The #c4 patch looks wrong, instead of that you should IMHO just not use UNUSED macro on __gthread_mutex_destroy argument. It is perfectly fine on __gthread_key_delete. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41810
[Bug target/41810] Cannot build gcc: gthr-default.h:466: error: '__mutex' was not declared in this scope
--- Comment #8 from ro at CeBiTec dot Uni-Bielefeld dot DE 2009-11-19 11:25 --- Subject: Re: Cannot build gcc: gthr-default.h:466: error: '__mutex' was not declared in this scope > --- Comment #7 from alanpae at ilkda dot com 2009-11-18 19:39 --- > changing to --disable-threads also works. True, but why not omit any --{enable, disable}-threads option and use the default? Rainer -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41810
[Bug target/41810] Cannot build gcc: gthr-default.h:466: error: '__mutex' was not declared in this scope
--- Comment #7 from alanpae at ilkda dot com 2009-11-18 19:39 --- changing to --disable-threads also works. alan -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41810
[Bug target/41810] Cannot build gcc: gthr-default.h:466: error: '__mutex' was not declared in this scope
--- Comment #6 from ro at CeBiTec dot Uni-Bielefeld dot DE 2009-11-18 11:17 --- Subject: Re: Cannot build gcc: gthr-default.h:466: error: '__mutex' was not declared in this scope > --- Comment #5 from YLitvinenko at astana dot oilfield dot slb dot com > 2009-11-18 07:03 --- > Is it better to let configure guess about thread model on OpenSolaris x86 > 32bit > build >= snv_126? Sure: the default should be fine unless you have specific reasons to prefer UI threads instead. This has nothing to do with OpenSolaris in any way, but is true for any recent Solaris 2 release. Rainer -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41810
[Bug target/41810] Cannot build gcc: gthr-default.h:466: error: '__mutex' was not declared in this scope
--- Comment #5 from YLitvinenko at astana dot oilfield dot slb dot com 2009-11-18 07:03 --- (In reply to comment #4) > Why are you building with --enable-threads=solaris in the first place? > Just omit --enable-threads (defaulting to posix); the implementation of > both on Solaris 2 is the same, anyway. It is beyond me why anyone would > want to program to the old UI Threads interface. Is it better to let configure guess about thread model on OpenSolaris x86 32bit build >= snv_126? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41810
[Bug target/41810] Cannot build gcc: gthr-default.h:466: error: '__mutex' was not declared in this scope
--- Comment #4 from ro at techfak dot uni-bielefeld dot de 2009-11-17 19:43 --- Subject: Re: Cannot build gcc: gthr-default.h:466: error: '__mutex' was not declared in this scope > --- Comment #3 from alanpae at ilkda dot com 2009-11-17 19:18 --- [...] > Will try building it again with threads=none or the equivalent. Why are you building with --enable-threads=solaris in the first place? Just omit --enable-threads (defaulting to posix); the implementation of both on Solaris 2 is the same, anyway. It is beyond me why anyone would want to program to the old UI Threads interface. That said, I'm testing the obvious fix: Index: gcc/gthr-solaris.h === --- gcc/gthr-solaris.h (revision 154216) +++ gcc/gthr-solaris.h (working copy) @@ -37,7 +37,7 @@ #include #ifdef __cplusplus -#define UNUSED(x) +#define UNUSED(x) x #else #define UNUSED(x) x __attribute__((unused)) #endif I've now idea what other problems with --enable-threads=solaris might exist, though. This isn't regularly tested. Rainer -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41810
[Bug target/41810] Cannot build gcc: gthr-default.h:466: error: '__mutex' was not declared in this scope
--- Comment #3 from alanpae at ilkda dot com 2009-11-17 19:18 --- I'm getting the except same error message. /build/new-gcc/./gcc/xgcc -shared-libgcc -B/build/new-gcc/./gcc -nostdinc++ -L/build/new-gcc/i386-pc-solaris2.11/libstdc++-v3/src -L/build/new-gcc/i386-pc-solaris2.11/libstdc++-v3/src/.libs -B/opt/gcc/i386-pc-solaris2.11/bin/ -B/opt/gcc/i386-pc-solaris2.11/lib/ -isystem /opt/gcc/i386-pc-solaris2.11/include -isystem /opt/gcc/i386-pc-solaris2.11/sys-include -x c++-header -g -O2 -I/build/new-gcc/i386-pc-solaris2.11/libstdc++-v3/include/i386-pc-solaris2.11 -I/build/new-gcc/i386-pc-solaris2.11/libstdc++-v3/include -I/build/gcc-4.4.2/libstdc++-v3/libsupc++ -O0 -g /build/gcc-4.4.2/libstdc++-v3/include/precompiled/stdc++.h -o i386-pc-solaris2.11/bits/stdc++.h.gch/O0g.gch In file included from /build/new-gcc/i386-pc-solaris2.11/libstdc++-v3/include/i386-pc-solaris2.11/bits/gthr.h:162, from /build/new-gcc/i386-pc-solaris2.11/libstdc++-v3/include/ext/atomicity.h:34, from /build/new-gcc/i386-pc-solaris2.11/libstdc++-v3/include/bits/basic_string.h:41, from /build/new-gcc/i386-pc-solaris2.11/libstdc++-v3/include/string:53, from /build/new-gcc/i386-pc-solaris2.11/libstdc++-v3/include/bitset:49, from /build/gcc-4.4.2/libstdc++-v3/include/precompiled/stdc++.h:64: /build/new-gcc/i386-pc-solaris2.11/libstdc++-v3/include/i386-pc-solaris2.11/bits/gthr-default.h: In function int __gthread_mutex_destroy(__gthread_mutex_t*): /build/new-gcc/i386-pc-solaris2.11/libstdc++-v3/include/i386-pc-solaris2.11/bits/gthr-default.h:466: error: __mutex was not declared in this scope gmake[4]: *** [i386-pc-solaris2.11/bits/stdc++.h.gch/O0g.gch] Error 1 gmake[4]: Leaving directory `/build/new-gcc/i386-pc-solaris2.11/libstdc++-v3/include' gmake[3]: *** [all-recursive] Error 1 gmake[3]: Leaving directory `/build/new-gcc/i386-pc-solaris2.11/libstdc++-v3' gmake[2]: *** [all] Error 2 gmake[2]: Leaving directory `/build/new-gcc/i386-pc-solaris2.11/libstdc++-v3' gmake[1]: *** [all-target-libstdc++-v3] Error 2 gmake[1]: Leaving directory `/build/new-gcc' gmake: *** [bootstrap] Error 2 Will try building it again with threads=none or the equivalent. alan -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41810
[Bug target/41810] Cannot build gcc: gthr-default.h:466: error: '__mutex' was not declared in this scope
--- Comment #2 from paolo dot carlini at oracle dot com 2009-10-23 18:14 --- Let's CC Rainer. IMHO something is broken in gthr-solaris.h, I see: #ifdef __cplusplus #define UNUSED(x) #else #define UNUSED(x) x __attribute__((unused)) #endif ... static inline int __gthread_mutex_destroy (__gthread_mutex_t * UNUSED(__mutex)) { if (__gthread_active_p ()) return __gthrw_(mutex_destroy) (__mutex); else return 0; } which cannot be Ok when __cplusplus is defined. Not a libstdc++ proper issue. -- paolo dot carlini at oracle dot com changed: What|Removed |Added CC||ro at techfak dot uni- ||bielefeld dot de Component|libstdc++ |target http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41810