This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: shared libraries on Solaris (and other SVR4 systems?)
- To: papadopo at shfj dot cea dot fr (Dimitri PAPADOPOULOS-ORFANOS)
- Subject: Re: shared libraries on Solaris (and other SVR4 systems?)
- From: Alexandre Oliva <oliva at dcc dot unicamp dot br>
- Date: 22 Sep 1998 20:29:52 +-300
- Cc: egcs-bugs at cygnus dot com
- References: <199809221321.PAA15854@orcanie.shfj.cea.fr>
Dimitri PAPADOPOULOS-ORFANOS <papadopo@shfj.cea.fr> writes:
> Using egcs-1.0.2, the linker links with libfoo.so.1.0.
> Using egcs-1.1, the linker links with libfoo.so.
> Of course, the program should always link against libfoo.so.1.0.
Why? IMO, egcs should follow whatever standard the underlying OS
defines. If the standard linker looks for libfoo.so, so should egcs
and GNU binutils. If a library does not have a soname (-h), the
standard library name should be recorded in the program linked with
it.
Shared libraries are not as portable as you may think. The only way
to create libraries in a reasonably portable way is to use GNU
libtool.
> * in egcs-1.0.2 `ld' is called with option `-h libfoo.so.1.0'
> and option `-o libfoo.so.1.0'
> * in egcs-1.1 `collect2' is called with option `-o libfoo.so.1.0'
> only
IMO, egcs 1.0.2 is wrong, there's no reason to force the `-h' flag.
--
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil