From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Munagala V. S. Ramanath" To: Manfred.Hollstein@ks.sel.alcatel.de, law@cygnus.com, manfred@s-direktnet.de, ram@netcom.com Cc: egcs@cygnus.com Subject: Re: SunOS shared libs ? Date: Wed, 08 Jul 1998 07:59:00 -0000 Message-id: <199806101546.IAA05334@netcom13.netcom.com> X-SW-Source: 1998-07/msg00304.html > > 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: ----------- CUT HERE --------------------------- CUT HERE ------------- gcc -g -fPIC -Wl,-debug -shared -o ../../../lib/libtype1.so dosubr.o enc.o objects.o newpath.o regions.o scanfont.o spaces.o t1api.o t1io.o token.o type1.o util.o collect2 version egcs-2.90.27 980315 (egcs-1.0.2 release) (sparc) ld_file_name = /usr/bin/ld c_file_name = /d2a/exper/bin/gcc nm_file_name = /usr/bin/nm strip_file_name = /usr/bin/strip c_file = /usr/tmp/cca09472.c o_file = /usr/tmp/cca09472.o COLLECT_NAMES = /d2a/exper/lib/gcc-lib/sparc-sun-sunos4.1.2/egcs-2.90.27/ld COLLECT_GCC_OPTIONS = '-g' '-fPIC' '-shared' '-o' '../../../lib/libtype1.so' COLLECT_GCC = gcc COMPILER_PATH = /d2a/exper/lib/gcc-lib/sparc-sun-sunos4.1.2/egcs-2.90.27/:/d2a/exper/lib/gcc-lib/sparc-sun-sunos4.1.2/:/usr/lib/gcc/sparc-sun-sunos4.1.2/egcs-2.90.27/:/usr/lib/gcc/sparc-sun-sunos4.1.2/:/d2a/exper/sparc-sun-sunos4.1.2/bin/sparc-sun-sunos4.1.2/egcs-2.90.27/:/d2a/exper/sparc-sun-sunos4.1.2/bin/ LIBRARY_PATH = /d2a/exper/lib/gcc-lib/sparc-sun-sunos4.1.2/egcs-2.90.27/:/usr/lib/gcc/sparc-sun-sunos4.1.2/egcs-2.90.27/:/d2a/exper/sparc-sun-sunos4.1.2/lib/sparc-sun-sunos4.1.2/egcs-2.90.27/:/d2a/exper/sparc-sun-sunos4.1.2/lib/:/d2a/exper/lib/sparc-sun-sunos4.1.2/egcs-2.90.27/:/d2a/exper/lib/:/lib/sparc-sun-sunos4.1.2/egcs-2.90.27/:/lib/:/usr/lib/sparc-sun-sunos4.1.2/egcs-2.90.27/:/usr/lib/ /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 enc.o objects.o newpath.o regions.o scanfont.o spaces.o t1api.o t1io.o token.o type1.o util.o -lgcc -lgcc /usr/bin/nm -p ../../../lib/libtype1.so nm output with constructors/destructors. dynamic dependencies. 0 constructor(s) found 0 destructor(s) found [Leaving ../../../lib/libtype1.so] write_c_file - output name is ../../../lib/libtype1.so, prefix is libtype1_so ========== 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