This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: SunOS shared libs ?
- To: Manfred dot Hollstein at ks dot sel dot alcatel dot de, manfred at s-direktnet dot de, ram at netcom dot com
- Subject: Re: SunOS shared libs ?
- From: "Munagala V. S. Ramanath" <ram at netcom dot com>
- Date: Wed, 10 Jun 1998 07:35:59 -0700 (PDT)
- Cc: egcs at cygnus dot com
> 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.
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 ?
Anyway, thanks for the help.
Ram