This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Bootstrap broken on HEAD for i686-pc-linux-gnu


Hi all,

/usr/ritzert/compile/gcc/HEAD/gcc/xgcc -shared-libgcc 
-B/usr/ritzert/compile/gcc/HEAD/gcc/ -nostdinc++ 
-L/usr/ritzert/compile/gcc/HEAD/i686-pc-linux-gnu/libstdc++-v3/src 
-L/usr/ritzert/compile/gcc/HEAD/i686-pc-linux-gnu/libstdc++-v3/src/.libs 
-B/opt/gcc-HEAD/i686-pc-linux-gnu/bin/ -B/opt/gcc-HEAD/i686-pc-linux-gnu/lib/ 
-isystem /opt/gcc-HEAD/i686-pc-linux-gnu/include -isystem 
/opt/gcc-HEAD/i686-pc-linux-gnu/sys-include -nostdinc++ 
-I/usr/ritzert/compile/gcc/HEAD/i686-pc-linux-gnu/libstdc++-v3/include/i686-pc-linux-gnu 
-I/usr/ritzert/compile/gcc/HEAD/i686-pc-linux-gnu/libstdc++-v3/include 
-I/home/ritzert/gcc/HEAD/gcc/libstdc++-v3/libsupc++ 
-I/home/ritzert/gcc/HEAD/gcc/libstdc++-v3/libmath -O2 -g -O2 -g -O2 
-D_GNU_SOURCE -fno-implicit-templates -Wall -Wno-format -W -Wwrite-strings 
-fdiagnostics-show-location=once -ffunction-sections -fdata-sections -c 
/home/ritzert/gcc/HEAD/gcc/libstdc++-v3/src/ext-inst.cc  -fPIC -DPIC -o 
.libs/ext-inst.o
In file included from 
/usr/ritzert/compile/gcc/HEAD/i686-pc-linux-gnu/libstdc++-v3/include/ext/rope:60,
                 from 
/home/ritzert/gcc/HEAD/gcc/libstdc++-v3/src/ext-inst.cc:34:
/usr/ritzert/compile/gcc/HEAD/i686-pc-linux-gnu/libstdc++-v3/include/ext/stl_rope.h: 
In
   constructor `__gnu_cxx::_Rope_RopeRep<_CharT,
   _Alloc>::_Rope_RopeRep(__gnu_cxx::_Rope_RopeRep<_CharT, _Alloc>::_Tag, int,
   bool, unsigned int, typename __gnu_cxx::_Rope_rep_base<_CharT,
   _Alloc>::allocator_type)':
/usr/ritzert/compile/gcc/HEAD/i686-pc-linux-gnu/libstdc++-v3/include/ext/stl_rope.h:503: 
error: expected
   primary-expression
/usr/ritzert/compile/gcc/HEAD/i686-pc-linux-gnu/libstdc++-v3/include/ext/stl_rope.h:503: 
error: expected
   `)'
/usr/ritzert/compile/gcc/HEAD/i686-pc-linux-gnu/libstdc++-v3/include/ext/stl_rope.h:503: 
error: expected
   primary-expression
/usr/ritzert/compile/gcc/HEAD/i686-pc-linux-gnu/libstdc++-v3/include/ext/stl_rope.h:503: 
error: expected
   `;'
make[4]: *** [ext-inst.lo] Error 1
make[4]: Leaving directory 
`/usr/ritzert/compile/gcc/HEAD/i686-pc-linux-gnu/libstdc++-v3/src'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory 
`/usr/ritzert/compile/gcc/HEAD/i686-pc-linux-gnu/libstdc++-v3'
make[2]: *** [all-recursive-am] Error 2
make[2]: Leaving directory 
`/usr/ritzert/compile/gcc/HEAD/i686-pc-linux-gnu/libstdc++-v3'
make[1]: *** [all-target-libstdc++-v3] Error 2
make[1]: Leaving directory `/usr/ritzert/compile/gcc/HEAD'
make: *** [bootstrap] Error 2


Obviously caused by
http://gcc.gnu.org/ml/libstdc++/2003-05/msg00096.html

2003-05-05  Loren J. Rittle  <ljrittle@acm.org>
          (Inspired by an alternate patch from Danny Smith.)

      * include/bits/stl_threads.h (_Atomic_swap): Kill it...
      (_Swap_lock_struct<>): ...and the horse it rode in on.
      * src/globals.cc (_Swap_lock_struct<>): Likewise.
      * include/ext/stl_rope.h (_Rope_RopeRep<>::_M_c_string_lock): New
      member to support...
      * include/ext/ropeimpl.h (rope<>::c_str): Follow *all* memory
      visibility rules related to POSIX threads.
       * testsuite/thread/pthread7-rope.cc: New test.

The new code

+#ifdef __GTHREAD_MUTEX_INIT
+         , _M_c_string_lock (__GTHREAD_MUTEX_INIT)
     { }
+#else
+    { __GTHREAD_MUTEX_INIT_FUNCTION (&_M_c_string_lock); }
+#endif

with __GTHREAD_MUTEX_INIT defined to PTHREAD_MUTEX_INITIALIZER in gthr-posix.h
is fine for FreeBSD, because there we have
#define PTHREAD_MUTEX_INITIALIZER        NULL
but for GNU/Linux
#define PTHREAD_MUTEX_INITIALIZER \
  {0, 0, 0, PTHREAD_MUTEX_TIMED_NP, __LOCK_INITIALIZER}

I really don't know if it is a compiler bug to accept
var = __GTHREAD_MUTEX_INIT and to reject var (__GTHREAD_MUTEX_INIT) in a 
constructor, but apparently this is what happens here.

Maybe doing sth. like
Index: stl_rope.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/ext/stl_rope.h,v
retrieving revision 1.20
diff -u -3 -p -r1.20 stl_rope.h
--- stl_rope.h  5 May 2003 22:28:16 -0000       1.20
+++ stl_rope.h  6 May 2003 09:21:32 -0000
@@ -500,8 +500,7 @@ struct _Rope_RopeRep : public _Rope_rep_
 #         endif
           _M_tag(__t), _M_is_balanced(__b), _M_depth(__d), _M_c_string(0)
 #ifdef __GTHREAD_MUTEX_INIT
-         , _M_c_string_lock (__GTHREAD_MUTEX_INIT)
-    { }
+    { _M_c_string_lock = __GTHREAD_MUTEX_INIT; }
 #else
     { __GTHREAD_MUTEX_INIT_FUNCTION (&_M_c_string_lock); }
 #endif

works around that issue. I'm just testing that.

Michael


Michael


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]