duplicate symbol bug with egcs-1.0.1

Stefan Meixner stefan@physik.uni-wuerzburg.de
Wed Jan 14 05:54:00 GMT 1998


I would like to report a bug with g++ in the egcs-1.0.1 release
on HPUX 10.20:

I get multiply defined symbols for the following simple testcode:

g++ -c file0.cc
g++ -c file1.cc
g++ -v -o bbb file0.o file1.o
Reading specs from /users/stefan/opt/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.23/specs
gcc version egcs-2.90.23 980102 (egcs-1.0.1 release)
 /users/stefan/opt/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.23/ld -L/lib/pa1.1 -L/usr/lib/pa1.1 -z -u main
 -o bbb /usr/ccs/lib/crt0.o -L/users/stefan/opt/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.23 -L/users/stefa
n/opt/hppa1.1-hp-hpux10.20/lib -L/usr/ccs/bin -L/usr/ccs/lib -L/users/stefan/opt/lib file0.o file1.o -lstdc+
+ -lm -lgcc -lc -lgcc
/usr/ccs/bin/ld: Duplicate symbol "__default_alloc_template<false, 0>::start_free" in files file0.o and file
1.o
/usr/ccs/bin/ld: Duplicate symbol "__default_alloc_template<false, 0>::free_list" in files file0.o and file1
.o
/usr/ccs/bin/ld: Duplicate symbol "__default_alloc_template<false, 0>::end_free" in files file0.o and file1.
o
/usr/ccs/bin/ld: Duplicate symbol "__default_alloc_template<false, 0>::heap_size" in files file0.o and file1
.o
/usr/ccs/bin/ld: Duplicate symbol "__malloc_alloc_template<0>::__malloc_alloc_oom_handler   " in files file0
.o and file1.o
/usr/ccs/bin/ld: Found 5 duplicate symbol(s)
collect2: ld returned 1 exit status

============ file0.cc ==============
#include <vector.h>

void foo(int);

int main()
{
   vector<int>  v;

   v.push_back(8);

   foo(4);

   return 0;
}
============ file1.cc ==============
#include <vector.h>

void foo(int i)
{
   vector<int> v;

   v.push_back(i);
}
====================================

The same code compiles fine with the egcs-1.0 release.
Both compilers were bootstrapped on the same computer with the
equivalent configure options:

../egcs-1.0/configure --prefix=/users/stefan/opt --enable-shared --enable-haifa --with-gnu-as

Please contact me if you need additional informations.

Stefan


=========================================================================
Stefan Meixner                     e-mail: stefan@physik.uni-wuerzburg.de
Institut fuer Theoretische Physik  Phone: ++49-931-888-5872
Universitaet Wuerzburg             FAX:   ++49-931-888-5141
Am Hubland
D-97074 Wuerzburg
=========================================================================



More information about the Gcc-bugs mailing list