This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Applied: PATCH for thread-safe C++ static local initialization
- From: Richard Earnshaw <rearnsha at buzzard dot freeserve dot co dot uk>
- To: Jason Merrill <jason at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Benjamin Kosnik <bkoz at redhat dot com>, joel at oarcorp dot com, rearnsha at buzzard dot freeserve dot co dot uk
- Date: Sun, 29 Aug 2004 21:53:39 +0100
- Subject: Re: Applied: PATCH for thread-safe C++ static local initialization
Jason
> * libsupc++/guard.cc (static_mutex): Internal class implementing a
> recursive mutex which controls initialization of local statics.
> (__gnu_cxx::recursive_init): New exception class.
> (__cxa_guard_acquire): Deal with locking and recursion detection.
> (acquire_1, __cxa_guard_abort, __cxa_guard_release): Likewise.
This bit (well, I presume it's this bit) is causing a build error on
*-netbsdelf with -enable-threads=posix.
/work/rearnsha/gnu/egcs/gcc/g++ -shared-libgcc -B/work/rearnsha/gnu/egcs/gc
c/ -nostdinc++ -B/work/rearnsha/gnu/testinstall/i386-unknown-netbsdelf2.0./
bin/ -B/work/rearnsha/gnu/testinstall/i386-unknown-netbsdelf2.0./lib/
-isystem /work/rearnsha/gnu/testinstall/i386-unknown-netbsdelf2.0./include
-isystem /work/rearnsha/gnu/testinstall/i386-unknown-netbsdelf2.0./sys-incl
ude -g -O2 -D_GLIBCXX_ASSERT -ffunction-sections -fdata-sections
-fmessage-length=0 -DLOCALEDIR=/work/rearnsha/gnu/egcs/i386-unknown-netbsde
lf2.0./libstdc++-v3/po/share/locale -g -O2 -o abi_check abi_check.o
-L/work/rearnsha/gnu/egcs/i386-unknown-netbsdelf2.0./libstdc++-v3/src
-L/work/rearnsha/gnu/egcs/i386-unknown-netbsdelf2.0./libstdc++-v3/src/.libs
-lv3test -L/work/rearnsha/gnu/egcs/i386-unknown-netbsdelf2.0./libstdc++-v3
/testsuite -lm -Wl,--rpath -Wl,/work/rearnsha/gnu/egcs/gcc -Wl,--rpath
-Wl,/work/rearnsha/gnu/egcs/i386-unknown-netbsdelf2.0./libstdc++-v3/src/.li
bs
/work/rearnsha/gnu/egcs/i386-unknown-netbsdelf2.0./libstdc++-v3/src/.libs/l
ibstdc++.so: undefined reference to `pthread_mutexattr_destroy'
/work/rearnsha/gnu/egcs/i386-unknown-netbsdelf2.0./libstdc++-v3/src/.libs/l
ibstdc++.so: undefined reference to `pthread_mutexattr_settype'
/work/rearnsha/gnu/egcs/i386-unknown-netbsdelf2.0./libstdc++-v3/src/.libs/l
ibstdc++.so: undefined reference to `pthread_mutexattr_init'
/work/rearnsha/gnu/egcs/i386-unknown-netbsdelf2.0./libstdc++-v3/src/.libs/l
ibstdc++.so: undefined reference to `pthread_mutex_init'
collect2: ld returned 1 exit status
The pthreads library has this symbol, but we obviously aren't linking the
library in in this case for some reason (no -pthreads flag?).
R.