Subject: Shared libraries and libgcc
To: None <tech-toolchain@netbsd.org>
From: Nick Hudson <nick@nthcliff.demon.co.uk>
List: tech-toolchain
Date: 09/13/2000 23:02:21
I'm trying to fathom out if shared libraries need libgcc or not. I've
collected the following information:
i) libgcc isn't available in pic/PIC format
ii) bsd.lib.mk doesn't include libgcc when linking
iii) gcc.info has the comment
`LIBGCC_SPEC'
Another C string constant that tells the GNU CC driver program how
and when to place a reference to `libgcc.a' into the linker
command line. This constant is placed both before and after the
value of `LIB_SPEC'.
If this macro is not defined, the GNU CC driver provides a default
that passes the string `-lgcc' to the linker unless the `-shared'
option is specified.
iv) gcc -v -shared file.o produced the following
$ gcc -v -shared file.o
Using builtin specs.
gcc version egcs-2.91.66 19990314 (egcs-1.1.2 release)
/usr/libexec/collect2 -m elf_i386 -shared /usr/lib/crtbeginS.o
-L/usr/libexec file.o -lgcc -lc -lgcc /usr/lib/crtendS.o
v) http://gcc.gnu.org/gcc-3.0/libgcc.html suggests that shared libraries
need libgcc.
Basically I'm confused - can anyone help?
Thanks,
Nick