From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <96360157620442.tru64-unix-managers.marc@archive.invalid> From: Albrecht Gebhardt Date: Fri, 14 Jul 2000 18:00:47 +0000 To: tru64-unix-managers Subject: Followup1: gcc 2.95.2: libgcc.a: __throw multiply defined X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=96360157620442 My problem was: > > > > when compiling different C++ packages (this was TeXmacs, see > > ftp://ftp.dante.de/tex-archive/systems/unix/TeXmacs/) with c++ from gcc > > 2.95.2 I get during the linking step: > > > > c++ ...final-linking-arguments... > > /usr/bin/ld: > > /usr/local/lib/gcc-lib/alpha-dec-osf4.0/2.95.2/libgcc.a(_eh.o): __throw: > > multiply defined > > collect2: ld returned 1 exit status > > ... > > > > examining libgcc.a yields: > > > > root@alpha4-stat[/tmp]# ar x libgcc.a _eh.o > > root@alpha4-stat[/tmp]# nm _eh.o | grep __throw > > $__throw..ng | 0000000000000000 | N | 0000000000000000 > > $__throw_type_match..ng | 0000000000000000 | N | 0000000000000000 > > __throw | 0000000000003520 | T | 0000000000000008 > > __throw_type_match | 0000000000000096 | T | 0000000000000008 > > > > so I don't know where the second reference to "__throw" comes from. > > > > Has anyone the same problem and a solution? > > > I got no solution via mail, only a "me too", so I decided to investigate it further. No final solution yet: For my special application (TeXmacs) compilation stopped with: c++ -shared -L/usr/local/src/redhat.local/BUILD/TeXmacs-0.2.5-8/TeXmacs-0.2.5-8-src/TeXmacs-0.2.5-8/lib Objects/basic.o Objects/hashmaps.o Objects/misc.o -o /usr/local/src/redhat.local/BUILD/TeXmacs-0.2.5-8/TeXmacs-0.2.5-8-src/TeXmacs-0.2.5-8/lib/libbasic.so /usr/bin/ld: /usr/local/lib/gcc-lib/alpha-dec-osf4.0/2.95.2/libgcc.a(_eh.o): __throw: multiply defined collect2: ld returned 1 exit status now turning on verbosity yields: c++ --verbose -shared -L/usr/local/src/redhat.local/BUILD/TeXmacs-0.2.5-8/TeXmacs-0.2.5-8-src/TeXmacs-0.2.5-8/lib Objects/basic.o Objects/hashmaps.o Objects/misc.o -o /usr/local/src/redhat.local/BUILD/TeXmacs-0.2.5-8/TeXmacs-0.2.5-8-src/TeXmacs-0.2.5-8/lib/libbasic.so Reading specs from /usr/local/lib/gcc-lib/alpha-dec-osf4.0/2.95.2/specs gcc version 2.95.2 19991024 (release) /usr/local/lib/gcc-lib/alpha-dec-osf4.0/2.95.2/collect2 -G 8 -O1 -shared -o /usr/local/src/redhat.local/BUILD/TeXmacs-0.2.5-8/TeXmacs-0.2.5-8-src/TeXmacs-0.2.5-8/lib/libbasic.so -L/usr/local/src/redhat.local/BUILD/TeXmacs-0.2.5-8/TeXmacs-0.2.5-8-src/TeXmacs-0.2.5-8/lib -L/usr/local/lib/gcc-lib/alpha-dec-osf4.0/2.95.2 -L/usr/lib/cmplrs/cc -L/usr/local/lib Objects/basic.o Objects/hashmaps.o Objects/misc.o -lstdc++ -lm -lgcc -lc -lgcc /usr/bin/ld: /usr/local/lib/gcc-lib/alpha-dec-osf4.0/2.95.2/libgcc.a(_eh.o): __throw: multiply defined collect2: ld returned 1 exit status if I now call "collect2" from above with "-lstdc++ -lm -lgcc -lc -lgcc" changed to "-lm -lgcc -lc -lstdc++" the linking step works, so it seems to be a linking order problem. I guess I could hardcode this change somewhere in gcc's specs file, but currently I have no idea how to do this. In this special case the resulting binary (texmacs) still crashes, but this could be due to the experimental status of the TeXmacs project. I have to look for a simpler test example. I hope I can add a "SUMMARY" soon ... Albrecht Gebhardt ...................................................................... | Albrecht Gebhardt Tel.: (++43 463) 2700/832 | | Institut fuer Mathematik Fax : (++43 463) 2700/834 | | Universitaet Klagenfurt mailto:albrecht.gebhardt@uni-klu.ac.at | | Villacher Str. 161 http://www-stat.uni-klu.ac.at/~agebhard | | A-9020 Klagenfurt, Austria | `--------------------------------------------------------------------'