public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/21677] New: simply including ext/bitmap_allocator.h causes link-time errors
@ 2005-05-20 12:21 oms at home dot nl
  2005-05-20 12:25 ` [Bug libstdc++/21677] " oms at home dot nl
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: oms at home dot nl @ 2005-05-20 12:21 UTC (permalink / raw)
  To: gcc-bugs

Compiling the two following trivial files together causes link-time errors due
to multiply-defined symbols in bitmap_allocator.h. What am I missing here?

// t.cc
#include <ext/bitmap_allocator.h>

int main ()
{
}
// EOF
// t1.cc
#include <ext/bitmap_allocator.h>
// EOF


$ /usr/local/gcc-3.4.4/bin/g++ -v -save-temps t.cc t1.cc
Reading specs from
/usr/local0/gcc-3.4.4/bin/../lib/gcc/i686-pc-linux-gnu/3.4.4/specs
Configured with: ../configure --prefix=/usr/local/gcc-3.4.4
--enable-threads=posix --enable-version-specific-runtime-libs
--enable-languages=c,c++,f77
Thread model: posix
gcc version 3.4.4
 /usr/local0/gcc-3.4.4/bin/../libexec/gcc/i686-pc-linux-gnu/3.4.4/cc1plus -E
-quiet -v -iprefix /usr/local0/gcc-3.4.4/bin/../lib/gcc/i686-pc-linux-gnu/3.4.4/
-D_GNU_SOURCE t.cc -mtune=pentiumpro -o t.ii
ignoring nonexistent directory
"/usr/local0/gcc-3.4.4/bin/../lib/gcc/i686-pc-linux-gnu/3.4.4/../../../../i686-pc-linux-gnu/include"
ignoring duplicate directory
"/usr/local/gcc-3.4.4/lib/gcc/i686-pc-linux-gnu/3.4.4/include/c++"
ignoring duplicate directory
"/usr/local/gcc-3.4.4/lib/gcc/i686-pc-linux-gnu/3.4.4/include/c++/i686-pc-linux-gnu"
ignoring duplicate directory
"/usr/local/gcc-3.4.4/lib/gcc/i686-pc-linux-gnu/3.4.4/include/c++/backward"
ignoring duplicate directory
"/usr/local/gcc-3.4.4/lib/gcc/i686-pc-linux-gnu/3.4.4/include"
ignoring nonexistent directory
"/usr/local/gcc-3.4.4/lib/gcc/i686-pc-linux-gnu/3.4.4/../../../../i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local0/gcc-3.4.4/bin/../lib/gcc/i686-pc-linux-gnu/3.4.4/include/c++
 /usr/local0/gcc-3.4.4/bin/../lib/gcc/i686-pc-linux-gnu/3.4.4/include/c++/i686-pc-linux-gnu
 /usr/local0/gcc-3.4.4/bin/../lib/gcc/i686-pc-linux-gnu/3.4.4/include/c++/backward
 /usr/local0/gcc-3.4.4/bin/../lib/gcc/i686-pc-linux-gnu/3.4.4/include
 /usr/local/include
 /usr/local/gcc-3.4.4/include
 /usr/include
End of search list.
 /usr/local0/gcc-3.4.4/bin/../libexec/gcc/i686-pc-linux-gnu/3.4.4/cc1plus
-fpreprocessed t.ii -quiet -dumpbase t.cc -mtune=pentiumpro -auxbase t -version
-o t.s
GNU C++ version 3.4.4 (i686-pc-linux-gnu)
        compiled by GNU C version 3.4.4.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
 as -V -Qy -o t.o t.s
GNU assembler version 2.15 (i386-linux) using BFD version 2.15
 /usr/local0/gcc-3.4.4/bin/../libexec/gcc/i686-pc-linux-gnu/3.4.4/cc1plus -E
-quiet -v -iprefix /usr/local0/gcc-3.4.4/bin/../lib/gcc/i686-pc-linux-gnu/3.4.4/
-D_GNU_SOURCE t1.cc -mtune=pentiumpro -o t1.ii
ignoring nonexistent directory
"/usr/local0/gcc-3.4.4/bin/../lib/gcc/i686-pc-linux-gnu/3.4.4/../../../../i686-pc-linux-gnu/include"
ignoring duplicate directory
"/usr/local/gcc-3.4.4/lib/gcc/i686-pc-linux-gnu/3.4.4/include/c++"
ignoring duplicate directory
"/usr/local/gcc-3.4.4/lib/gcc/i686-pc-linux-gnu/3.4.4/include/c++/i686-pc-linux-gnu"
ignoring duplicate directory
"/usr/local/gcc-3.4.4/lib/gcc/i686-pc-linux-gnu/3.4.4/include/c++/backward"
ignoring duplicate directory
"/usr/local/gcc-3.4.4/lib/gcc/i686-pc-linux-gnu/3.4.4/include"
ignoring nonexistent directory
"/usr/local/gcc-3.4.4/lib/gcc/i686-pc-linux-gnu/3.4.4/../../../../i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local0/gcc-3.4.4/bin/../lib/gcc/i686-pc-linux-gnu/3.4.4/include/c++
 /usr/local0/gcc-3.4.4/bin/../lib/gcc/i686-pc-linux-gnu/3.4.4/include/c++/i686-pc-linux-gnu
 /usr/local0/gcc-3.4.4/bin/../lib/gcc/i686-pc-linux-gnu/3.4.4/include/c++/backward
 /usr/local0/gcc-3.4.4/bin/../lib/gcc/i686-pc-linux-gnu/3.4.4/include
 /usr/local/include
 /usr/local/gcc-3.4.4/include
 /usr/include
End of search list.
 /usr/local0/gcc-3.4.4/bin/../libexec/gcc/i686-pc-linux-gnu/3.4.4/cc1plus
-fpreprocessed t1.ii -quiet -dumpbase t1.cc -mtune=pentiumpro -auxbase t1
-version -o t1.s
GNU C++ version 3.4.4 (i686-pc-linux-gnu)
        compiled by GNU C version 3.4.4.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
 as -V -Qy -o t1.o t1.s
GNU assembler version 2.15 (i386-linux) using BFD version 2.15
 /usr/local0/gcc-3.4.4/bin/../libexec/gcc/i686-pc-linux-gnu/3.4.4/collect2
--eh-frame-hdr -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 /usr/lib/crt1.o
/usr/lib/crti.o
/usr/local0/gcc-3.4.4/bin/../lib/gcc/i686-pc-linux-gnu/3.4.4/crtbegin.o
-L/usr/local0/gcc-3.4.4/bin/../lib/gcc/i686-pc-linux-gnu/3.4.4
-L/usr/local0/gcc-3.4.4/bin/../lib/gcc
-L/usr/local/gcc-3.4.4/lib/gcc/i686-pc-linux-gnu/3.4.4
-L/usr/local0/gcc-3.4.4/bin/../lib/gcc/i686-pc-linux-gnu/3.4.4/../../..
-L/usr/local/gcc-3.4.4/lib/gcc/i686-pc-linux-gnu/3.4.4/../../.. t.o t1.o
-lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc
/usr/local0/gcc-3.4.4/bin/../lib/gcc/i686-pc-linux-gnu/3.4.4/crtend.o
/usr/lib/crtn.o
t1.o(.bss+0x0): multiple definition of `__gnu_cxx::_OOM_handler::_S_old_handler'
t.o(.bss+0x0): first defined here
t1.o(.bss+0x4): multiple definition of `__gnu_cxx::_OOM_handler::_S_handled_oom'
t.o(.bss+0x4): first defined here
t1.o(.bss+0x8): multiple definition of `__gnu_cxx::_OOM_handler::_S_oom_fcp'
t.o(.bss+0x8): first defined here
t1.o(.bss+0xc): multiple definition of
`__gnu_cxx::_BA_free_list_store::_S_bfl_mutex'
t.o(.bss+0xc): first defined here
t1.o(.bss+0x24): multiple definition of
`__gnu_cxx::_BA_free_list_store::_S_free_list'
t.o(.bss+0x24): first defined here
collect2: ld returned 1 exit status

-- 
           Summary: simply including ext/bitmap_allocator.h causes link-time
                    errors
           Product: gcc
           Version: 3.4.4
            Status: UNCONFIRMED
          Severity: critical
          Priority: P2
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: oms at home dot nl
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21677


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug libstdc++/21677] simply including ext/bitmap_allocator.h causes link-time errors
  2005-05-20 12:21 [Bug libstdc++/21677] New: simply including ext/bitmap_allocator.h causes link-time errors oms at home dot nl
@ 2005-05-20 12:25 ` oms at home dot nl
  2005-05-20 12:25 ` oms at home dot nl
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: oms at home dot nl @ 2005-05-20 12:25 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From oms at home dot nl  2005-05-20 12:24 -------
Created an attachment (id=8935)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=8935&action=view)
test source 1 of 2


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21677


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug libstdc++/21677] simply including ext/bitmap_allocator.h causes link-time errors
  2005-05-20 12:21 [Bug libstdc++/21677] New: simply including ext/bitmap_allocator.h causes link-time errors oms at home dot nl
  2005-05-20 12:25 ` [Bug libstdc++/21677] " oms at home dot nl
@ 2005-05-20 12:25 ` oms at home dot nl
  2005-05-20 12:54 ` pcarlini at suse dot de
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: oms at home dot nl @ 2005-05-20 12:25 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From oms at home dot nl  2005-05-20 12:25 -------
Created an attachment (id=8936)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=8936&action=view)
test source 2 of 2


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21677


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug libstdc++/21677] simply including ext/bitmap_allocator.h causes link-time errors
  2005-05-20 12:21 [Bug libstdc++/21677] New: simply including ext/bitmap_allocator.h causes link-time errors oms at home dot nl
  2005-05-20 12:25 ` [Bug libstdc++/21677] " oms at home dot nl
  2005-05-20 12:25 ` oms at home dot nl
@ 2005-05-20 12:54 ` pcarlini at suse dot de
  2005-05-20 13:01 ` pcarlini at suse dot de
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pcarlini at suse dot de @ 2005-05-20 12:54 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pcarlini at suse dot de  2005-05-20 12:54 -------
I cannot reproduce the problem: besides, we have simple testcases in our
testsuite for this usage and we have no problems on many different architectures.
Which version of binutils are you using?

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21677


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug libstdc++/21677] simply including ext/bitmap_allocator.h causes link-time errors
  2005-05-20 12:21 [Bug libstdc++/21677] New: simply including ext/bitmap_allocator.h causes link-time errors oms at home dot nl
                   ` (2 preceding siblings ...)
  2005-05-20 12:54 ` pcarlini at suse dot de
@ 2005-05-20 13:01 ` pcarlini at suse dot de
  2005-05-20 13:14 ` oms at home dot nl
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pcarlini at suse dot de @ 2005-05-20 13:01 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pcarlini at suse dot de  2005-05-20 13:01 -------
Can be related to 20979, fixed for 4.0 and mainline. Still cannot reproduce.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21677


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug libstdc++/21677] simply including ext/bitmap_allocator.h causes link-time errors
  2005-05-20 12:21 [Bug libstdc++/21677] New: simply including ext/bitmap_allocator.h causes link-time errors oms at home dot nl
                   ` (3 preceding siblings ...)
  2005-05-20 13:01 ` pcarlini at suse dot de
@ 2005-05-20 13:14 ` oms at home dot nl
  2005-05-20 13:51 ` pcarlini at suse dot de
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: oms at home dot nl @ 2005-05-20 13:14 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From oms at home dot nl  2005-05-20 13:14 -------
2.15. It's an up-to-date debian testing install, nothing special.

# ld --version
GNU ld version 2.15
Copyright 2002 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License.  This program has absolutely no warranty.
# dpkg -s binutils
Package: binutils
Status: install ok installed
Priority: standard
Section: devel
Installed-Size: 5972
Maintainer: James Troup <james@nocrew.org>
Architecture: i386
Version: 2.15-5
Provides: elf-binutils
Depends: libc6 (>= 2.3.2.ds1-4)
Suggests: binutils-doc (= 2.15-5)
Conflicts: gas, elf-binutils, modutils (<< 2.4.19-1)
Description: The GNU assembler, linker and binary utilities
 The programs in this package are used to assemble, link and manipulate
 binary and object files.  They may be used in conjunction with a compiler
 and various libraries to build programs.
#

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21677


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug libstdc++/21677] simply including ext/bitmap_allocator.h causes link-time errors
  2005-05-20 12:21 [Bug libstdc++/21677] New: simply including ext/bitmap_allocator.h causes link-time errors oms at home dot nl
                   ` (4 preceding siblings ...)
  2005-05-20 13:14 ` oms at home dot nl
@ 2005-05-20 13:51 ` pcarlini at suse dot de
  2005-05-24  4:36 ` bkoz at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pcarlini at suse dot de @ 2005-05-20 13:51 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pcarlini at suse dot de  2005-05-20 13:50 -------
I see. I tried both stock 2.15 and 2.16, no problems...

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2005-05-20 13:50:27
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21677


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug libstdc++/21677] simply including ext/bitmap_allocator.h causes link-time errors
  2005-05-20 12:21 [Bug libstdc++/21677] New: simply including ext/bitmap_allocator.h causes link-time errors oms at home dot nl
                   ` (5 preceding siblings ...)
  2005-05-20 13:51 ` pcarlini at suse dot de
@ 2005-05-24  4:36 ` bkoz at gcc dot gnu dot org
  2005-05-24  7:01 ` bkoz at gcc dot gnu dot org
  2005-07-11 17:55 ` pcarlini at suse dot de
  8 siblings, 0 replies; 10+ messages in thread
From: bkoz at gcc dot gnu dot org @ 2005-05-24  4:36 UTC (permalink / raw)
  To: gcc-bugs


------- 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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug libstdc++/21677] simply including ext/bitmap_allocator.h causes link-time errors
  2005-05-20 12:21 [Bug libstdc++/21677] New: simply including ext/bitmap_allocator.h causes link-time errors oms at home dot nl
                   ` (6 preceding siblings ...)
  2005-05-24  4:36 ` bkoz at gcc dot gnu dot org
@ 2005-05-24  7:01 ` bkoz at gcc dot gnu dot org
  2005-07-11 17:55 ` pcarlini at suse dot de
  8 siblings, 0 replies; 10+ messages in thread
From: bkoz at gcc dot gnu dot org @ 2005-05-24  7:01 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bkoz at gcc dot gnu dot org  2005-05-24 04:36 -------

Downgrade from critical, which extension allocators certainly are not.

-benjamin

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|critical                    |normal


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21677


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug libstdc++/21677] simply including ext/bitmap_allocator.h causes link-time errors
  2005-05-20 12:21 [Bug libstdc++/21677] New: simply including ext/bitmap_allocator.h causes link-time errors oms at home dot nl
                   ` (7 preceding siblings ...)
  2005-05-24  7:01 ` bkoz at gcc dot gnu dot org
@ 2005-07-11 17:55 ` pcarlini at suse dot de
  8 siblings, 0 replies; 10+ messages in thread
From: pcarlini at suse dot de @ 2005-07-11 17:55 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pcarlini at suse dot de  2005-07-11 17:46 -------
Ok, we can close it, then.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WONTFIX


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21677


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2005-07-11 17:47 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-20 12:21 [Bug libstdc++/21677] New: simply including ext/bitmap_allocator.h causes link-time errors oms at home dot nl
2005-05-20 12:25 ` [Bug libstdc++/21677] " oms at home dot nl
2005-05-20 12:25 ` oms at home dot nl
2005-05-20 12:54 ` pcarlini at suse dot de
2005-05-20 13:01 ` pcarlini at suse dot de
2005-05-20 13:14 ` oms at home dot nl
2005-05-20 13:51 ` pcarlini at suse dot de
2005-05-24  4:36 ` bkoz at gcc dot gnu dot org
2005-05-24  7:01 ` bkoz at gcc dot gnu dot org
2005-07-11 17:55 ` pcarlini at suse dot de

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).