Bug 15412 - [3.4/4.0 Regression] _GLIBCXX_ symbols symbols defined and used in different namespaces
|
Bug#:
15412
|
Product: gcc
|
Version: 3.4.0
|
|
Host: mingw32
|
Target: mingw32
|
Build:
|
|
Status: RESOLVED
|
Severity: normal
|
Priority: P1
|
|
Resolution: FIXED
|
Assigned To: bkoz@gcc.gnu.org
|
Reported By: adah@netstd.com
|
|
Component: libstdc++
|
Target Milestone: 3.4.1
|
|
Summary: [3.4/4.0 Regression] _GLIBCXX_ symbols symbols defined and used in different namespaces
|
|
Keywords:
|
|
Opened: 2004-05-13 02:14
|
|
Description:
|
Last confirmed: 2004-05-13 03:04
|
Opened: 2004-05-13 02:14
|
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.
If, for some strange reason, this is not fixed, please re-open.