Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Feb 1996 07:31:22 -0500 (EST)
From:      Peter Dufault <dufault@hda.com>
To:        hackers@freebsd.org
Subject:   g++ 2.7.2 / libg++ 2.7.1 and ld
Message-ID:  <199602121231.HAA16076@hda.com>

next in thread | raw e-mail | index | archive | help
I've been down the dead end that apparently several others have in
trying to get g++ 2.7.2 / libg++ 2.7.1  fully working on FreeBSD.
I believe the final stumbling block is our linker.

Quick summary:

1. Start with pgcc in -ports;
2. (Now you need -lstdc++) Use libg++-2.7.1 from prep;
3. (Now you need weak symbol support in assembler) Use "as" from 
binutils-2.6
4. (Now you need weak symbol support in linker?) Reach
a dead end without work on ld.

As suggested in the list archives, I tried adding "#define
SUPPORTS_WEAK 0" to config/xm-freebsd.h in the compiler, however,
it still generates weak symbols.  The current problem is that the
g++ compiler is generating weak symbols with colliding names that
I assume the linker is supposed to uniquely resolve - at least that
is my guess.  For example, two separate .cc files are generating
this symbol:

> rt# ./foo
> 0000086a ? ___15CG56XCSynchCommRC15CG56XCSynchComm
> 00000832 ? ___15CG56XCSynchCommRC15CG56XCSynchComm

and an examination of the associated .s shows it is weak.

The distributed gnu binutils linker fall down on FreeBSD.  If you
configure it as any of our formerly close relatives (bsd, bsdi, or
netbsd) it won't work:

> rt# ./configure i386-unknown-bsd
> rt# make all-ld
(...)
> rt# gcc -o foo foo.c
> /usr/lib/crt0.o: file not recognized: File format not recognized

If you configure it as just plain a.out it also falls down:

> rt# ./configure i386-unknown-aout
(...)
> rt# gcc -o foo foo.c
> ld:/usr/local/lib/gcc-lib/pentium-unknown-freebsd/2.7.2p/libgcc.a: file format not recognized; treating as linker script
> ld:/usr/local/lib/gcc-lib/pentium-unknown-freebsd/2.7.2p/libgcc.a:1: parse error

I'm surprised at this.  I've promised to do the ptolemy pre release
testing by Friday and I didn't think the biggest problem would be
getting the tool chain up and running.  I have to leave for a week
this Friday and don't have time to chase down this linker issue as
well as everything else I have to finish up.

I will be endebted to whomever can get this tool chain working
properly by about Wednesday.  Please let me know if you can do it.

I'm also interested in why we had to go off in left field with our
linker.  Is it something with our shared library support?  Can I
perhaps generate static only programs with the gnu tools?

-- 
Peter Dufault               Real-Time Machine Control and Simulation
HD Associates, Inc.         Voice: 508 433 6936
dufault@hda.com             Fax:   508 433 5267



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199602121231.HAA16076>