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
- Subject: Re: SunOS shared libs ?
- From: Manfred Hollstein <manfred at s-direktnet dot de>
- Date: Thu, 11 Jun 1998 12:18:38 +0200 (MEST)
- Cc: egcs at cygnus dot com
- References: <199806101546.IAA05334@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, 08:46:18, ram@netcom.com wrote:
> > > 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.
>
> Ok, here is the entirety of the output from the linker with the
> "-Wl,-debug" option added; as you can see, it reports no CTOR/DTOR
> found:
You're right, there are no CTOR/DTORs around; but as you can see, it
still generates a .c file, which is compiled using the flags you've
specified on the command line. If those don't include any particular
PIC flag, you'll end up with the error message.
[snip]
> ========== output_file = ../../../lib/libtype1.so, c_file = /usr/tmp/cca09472.c
> #ifdef __cplusplus
> extern "C" {
> #endif
>
> write_c_file - output name is ../../../lib/libtype1.so, prefix is libtype1_so
> static int count;
> typedef void entry_pt();
> void _GLOBAL__FI_libtype1_so() {
> ++count;
> }
> void _GLOBAL__FD_libtype1_so() {
> }
> void _GLOBAL__DI() {
> _GLOBAL__FI_libtype1_so();
> }
> void _GLOBAL__DD() {
> _GLOBAL__FD_libtype1_so();
> }
> #ifdef __cplusplus
> }
> #endif
> ========== end of c_file
>
> /d2a/exper/bin/gcc -c -o /usr/tmp/cca09472.o -fPIC -fno-exceptions /usr/tmp/cca09472.c
> /usr/bin/ld -assert pure-text -o ../../../lib/libtype1.so -L/d2a/exper/lib/gcc-lib/sparc-sun-sunos4.1.2/egcs-2.90.27/ucpic -L/d2a/exper/lib/gcc-lib/sparc-sun-sunos4.1.2/egcs-2.90.27 -L/d2a/exper/sparc-sun-sunos4.1.2/lib/ucpic -L/d2a/exper/sparc-sun-sunos4.1.2/lib -L/d2a/exper/lib/ucpic -L/d2a/exper/lib dosubr.o /usr/tmp/cca09472.o enc.o objects.o newpath.o regions.o scanfont.o spaces.o t1api.o t1io.o token.o type1.o util.o -lgcc -lgcc
> [Leaving /usr/tmp/cca09472.c]
> [Leaving /usr/tmp/cca09472.o]
> ----------- CUT HERE --------------------------- CUT HERE -------------
>
> Ram
manfred