This short program cannot build: ------------------------------------------------------------------ #include <memory> #include <ext/pool_allocator.h> int main() { void* ptr = __gnu_cxx::__pool_alloc<true,0>::allocate(10); __gnu_cxx::__pool_alloc<true,0>::deallocate(ptr, 10); } ------------------------------------------------------------------ A number of link errors will appear: d:/mingw-gcc3.4/bin/../lib/gcc/mingw32/3.4.0/../../../libstdc++.a(allocator.o) (.text$_ZN9__gnu_cxx12__pool_allocILb1ELi0EE5_LockC1Ev+0x31):allocator.cc: undefined reference to `__gnu_cxx::_GLIBCXX_mutex_address' d:/mingw-gcc3.4/bin/../lib/gcc/mingw32/3.4.0/../../../libstdc++.a(allocator.o) (.text$_ZN9__gnu_cxx12__pool_allocILb1ELi0EE5_LockC1Ev+0x4c):allocator.cc: undefined reference to `__gnu_cxx::_GLIBCXX_mutex' d:/mingw-gcc3.4/bin/../lib/gcc/mingw32/3.4.0/../../../libstdc++.a(allocator.o) (.text$_ZN9__gnu_cxx12__pool_allocILb1ELi0EE5_LockC1Ev+0x84):allocator.cc: undefined reference to `__gnu_cxx::_GLIBCXX_once' d:/mingw-gcc3.4/bin/../lib/gcc/mingw32/3.4.0/../../../libstdc++.a(allocator.o) (.text$_ZN9__gnu_cxx12__pool_allocILb1ELi0EE5_LockC1Ev+0x89):allocator.cc: undefined reference to `__gnu_cxx::_GLIBCXX_mutex_init()' ... The cause is that libstdc++-v3/include/bits/stl_threads.h references these symbols in namespace `__gnu_cxx', and libstdc++-v3/src/globals_io.cc defines them in namespace `__gnu_internal'. It seems to affect all platforms.
Note the template argument for __pool_alloc has changed on the mainline. And no this does effect all targets, it only not define __GTHREAD_MUTEX_INIT but __GTHREAD_MUTEX_INIT_FUNCTION in gthr-*.h So it is not including them for some reason.
Confirmed. Was broken by: 2003-10-21 Benjamin Kosnik <bkoz@redhat.com> * include/ext/mt_allocator.h: Change include to gthr.h. * include/ext/rope: Same. Add _Refcount_base definitions. * include/ext/pool_allocator.h: Adjust namespaces. * include/bits/stl_threads.h (_Refcount_base): Move. Put remaining into namespace __gnu_cxx.
Subject: Bug 15412 CVSROOT: /cvs/gcc Module name: gcc Changes by: bkoz@gcc.gnu.org 2004-05-13 14:54:25 Modified files: libstdc++-v3 : ChangeLog libstdc++-v3/include/bits: stl_threads.h Log message: 2004-05-13 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/15412 * include/bits/stl_threads.h (_GLIBCXX_mutex): Move to namespace __gnu_internal. (_GLIBCXX_mutex_address): Same. (_GLIBCXX_once): Same. (_GLIBCXX_mutex_init): Same. (_GLIBCXX_mutex_address_init): Same. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&r1=1.2469&r2=1.2470 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/bits/stl_threads.h.diff?cvsroot=gcc&r1=1.21&r2=1.22
This is now fixed.
Subject: Bug 15412 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_4-branch Changes by: bkoz@gcc.gnu.org 2004-05-13 15:25:54 Modified files: libstdc++-v3 : ChangeLog libstdc++-v3/include/bits: stl_threads.h Log message: 2004-05-13 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/15412 * include/bits/stl_threads.h (_GLIBCXX_mutex): Move to namespace __gnu_internal. (_GLIBCXX_mutex_address): Same. (_GLIBCXX_once): Same. (_GLIBCXX_mutex_init): Same. (_GLIBCXX_mutex_address_init): Same. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.2224.2.97&r2=1.2224.2.98 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/bits/stl_threads.h.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.20.10.1&r2=1.20.10.2
If, for some strange reason, this is not fixed, please re-open.