This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

egcs-1.0.3a on DEC Unix 4.0b: symbols multiply defined between libgcc.a/libstdc++.so


egcs-1.0.3a on DEC Unix 4.0b (alphaev56-dec-osf4.0b/egcs-2.90.29),
configured with --enable-shared

On linking a large C++ shared library (ACE, see
http://www.cs.wustl.edu/~schmidt/ACE.html), I got:

g++ -shared  -I. -I/usr3/kellogg/ACE_wrappers  -o libACE.so .shobj/Log_Msg.o .shobj/ACE.o .shobj/Activation_Queue.o .shobj/Addr.o
..shobj/ARGV.o .shobj/Arg_Shifter.o .shobj/Asynch_IO.o .shobj/Basic_Types.o .shobj/CORBA_Handler.o .shobj/CORBA_Ref.o .shobj/DEV.o
.shobj/DEV_Addr.o 
[...lots more object files...] -L/usr3/kellogg/ACE_wrappers/ace -L./ -lpthread -lmach -lexc -ltli -lrt 
/usr/bin/ld:
/usr/local/lib/gcc-lib/alphaev56-dec-osf4.0b/egcs-2.90.29/libgcc.a(tinfo2.o): __dynamic_cast: multiply defined
/usr/local/lib/gcc-lib/alphaev56-dec-osf4.0b/egcs-2.90.29/libgcc.a(tinfo.o): __rtti_class: multiply defined
/usr/local/lib/gcc-lib/alphaev56-dec-osf4.0b/egcs-2.90.29/libgcc.a(tinfo.o): __rtti_si: multiply defined
/usr/local/lib/gcc-lib/alphaev56-dec-osf4.0b/egcs-2.90.29/libgcc.a(tinfo.o): __rtti_user: multiply defined
collect2: ld returned 1 exit status
gmake[1]: *** [libACE.so] Error 1


I discovered that the object files tinfo.o and tinfo2.o are included
in both libgcc.a and libstdc++.a/.so. Assuming that RTTI stuff has no
business in libgcc, I then simply removed the two object files from
libgcc.a:

ar -d /usr/local/lib/gcc-lib/alphaev56-dec-osf4.0b/egcs-2.90.29/libgcc.a \
      tinfo.o tinfo2.o

and the linking went without a problem. I can't tell though whether this 
is the "right" solution... somebody more knowledgeable judge :-)

Oliver Kellogg
e-mail: Oliver.Kellogg@vs.dasa.de




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]