This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: SunOS shared libs ?
- To: ram at netcom dot com, law at cygnus dot com
- Subject: Re: SunOS shared libs ?
- From: Manfred dot Hollstein at ks dot sel dot alcatel dot de
- Date: Wed, 10 Jun 1998 16:42:26 +0200 (MET DST)
- Cc: egcs at cygnus dot com
- References: <199806101435.HAA20756@netcom13.netcom.com>
- Reply-To: manfred at s-direktnet dot de, Manfred dot Hollstein at ks dot sel dot alcatel dot de
On Wed, 10 June 1998, 07:35:59, ram@netcom.com wrote:
> > You need to add "-fPIC" to the linker command line as well. If any of
> > your *.o files contain static CTOR/DTORs, a small .c file will be
> > generated by the collect2 program which in turn will be compiled and
> > linked into your shared lib. Since you didn't specify "-fPIC" when
> > linking, bloody StunOS ld starts complaining... Of course, using GNU
> > ld (e.g. from binutils-2.9.1) would cure this; the current mainline
> > sources (the snapshots) address this differently, i.e. you can
> > continue using SunOS ld.
>
> Ok, thanks that seems to have fixed the problem. I'd strongly
> suggest adding this to the FAQ.
Jeff Law, do you think it's worthwhile?
>
> I still don't understand a couple of items:
> -- My files are all C (no C++) so there is CTOR/DTOR issue at all;
> how come I still need the -fPIC linker option ?
> -- How come I did not need -fPIC linker option with gcc-2.7.2 ?
Looks like your pulling in some C++ related stuff, e.g. via libgcc.a?
Try adding `-Wl,-debug' to your linker command; it'll tell you lots of
information about which CTOR/DTORs have been found and the like.
>
> Anyway, thanks for the help.
>
> Ram
manfred