First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 15412
Product:  
Component:  
Status: RESOLVED
Resolution: FIXED
Assigned To: Benjamin Kosnik <bkoz@gcc.gnu.org>
Host:
Reported against  
Priority:  
Severity:  
Target Milestone:  
 
 
Target:
Reporter: Wu Yongwei <adah@netstd.com>
Add CC:
CC:
Remove selected CCs
Build:
URL:
Summary:
Keywords:
Known to work:
Known to fail:

Attachment Description Type Created Size Actions
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 15412 depends on: Show dependency tree
Show dependency graph
Bug 15412 blocks:

Additional Comments:






View Bug Activity   |   Format For Printing   |   Clone This Bug


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.

------- Comment #1 From Andrew Pinski 2004-05-13 02:56 -------
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.

------- Comment #2 From Andrew Pinski 2004-05-13 03:04 -------
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.

------- Comment #3 From CVS Commits 2004-05-13 14:54 -------
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


------- Comment #4 From Benjamin Kosnik 2004-05-13 14:58 -------
This is now fixed.

------- Comment #5 From CVS Commits 2004-05-13 15:26 -------
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


------- Comment #6 From Benjamin Kosnik 2004-05-18 01:19 -------
If, for some strange reason, this is not fixed, please re-open.

First Last Prev Next    No search results available      Search page      Enter new bug