------- Additional Comments From bkoz at gcc dot gnu dot org 2005-05-24 04:34 -------
for 4.x and mainline, this is ok: %g++ -c -g -O2 t2.cc %g++ -c -g -O2 t1.cc %g++ t1.o t2.o For 3.4, I get: t2.o(.bss+0x0): In function `main': /home/bkoz/t2.cc:4: multiple definition of `__gnu_cxx::_BA_free_list_store::_S_free_list' t1.o(.bss+0x0):/usr/lib/gcc/i386-redhat-linux/3.4.3/../../../../include/c++/3.4.3/ext/bitmap_allocator.h:477: first defined here t2.o(.bss+0xc): In function `main': /home/bkoz/t2.cc:5: multiple definition of `__gnu_cxx::_BA_free_list_store::_S_bfl_mutex' t1.o(.bss+0xc):/usr/lib/gcc/i386-redhat-linux/3.4.3/../../../../include/c++/3.4.3/ext/bitmap_allocator.h:479: first defined here t2.o(.bss+0x24): In function `__tcf_1': /usr/lib/gcc/i386-redhat-linux/3.4.3/../../../../include/c++/3.4.3/bits/stl_vector.h:117: multiple definition of `__gnu_cxx::_OOM_handler::_S_oom_fcp' t1.o(.bss+0x24):/usr/lib/gcc/i386-redhat-linux/3.4.3/../../../../include/c++/3.4.3/ext/new_allocator.h:69: first defined here t2.o(.bss+0x28): In function `__tcf_1': /usr/lib/gcc/i386-redhat-linux/3.4.3/../../../../include/c++/3.4.3/ext/new_allocator.h:86: multiple definition of `__gnu_cxx::_OOM_handler::_S_handled_oom' t1.o(.bss+0x28):/home/bkoz/t1.cc:3: first defined here t2.o(.bss+0x2c): In function `__tcf_1': /usr/lib/gcc/i386-redhat-linux/3.4.3/../../../../include/c++/3.4.3/ext/new_allocator.h:86: multiple definition of `__gnu_cxx::_OOM_handler::_S_old_handler' t1.o(.bss+0x2c):/usr/lib/gcc/i386-redhat-linux/3.4.3/../../../../include/c++/3.4.3/i386-redhat-linux/bits/gthr-default.h:107: first defined here collect2: ld returned 1 exit status So, reproducible. __gnu_cxx::_BA_free_list_store::_S_bfl_mutex __gnu_cxx::_OOM_handler::_S_handled_oom __gnu_cxx::_OOM_handler::_S_old_handler The first symbol (the mutex) is solved for 4.x/mainline by the patch mentioned by Paolo. The other two, with a quick look at the code, will obviously cause multiple def errors. Soooo.... dunno. I'm tempted to just say this allocator doesn't work in 3.4.x, and be done with it. There's been a lot of work done on it, and porting the 4.x code to 3.4.x is a non-starter. Sorry. -benjamin -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21677