Followup1: gcc 2.95.2: libgcc.a: __throw multiply defined

From: Albrecht Gebhardt <albrecht.gebhardt_at_uni-klu.ac.at>
Date: Fri, 14 Jul 2000 20:00:47 +0200 (MET DST)

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_at_alpha4-stat[/tmp]# ar x libgcc.a _eh.o
> > root_at_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_at_uni-klu.ac.at |
| Villacher Str. 161 http://www-stat.uni-klu.ac.at/~agebhard |
| A-9020 Klagenfurt, Austria |
`--------------------------------------------------------------------'
Received on Fri Jul 14 2000 - 19:07:25 NZST

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:41 NZDT