From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Munagala V. S. Ramanath" To: Manfred.Hollstein@ks.sel.alcatel.de, manfred@s-direktnet.de, ram@netcom.com Cc: egcs@cygnus.com Subject: Re: SunOS shared libs ? Date: Wed, 10 Jun 1998 07:36:00 -0000 Message-id: <199806101435.HAA20756@netcom13.netcom.com> X-SW-Source: 1998-06/msg00384.html > 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