This is the mail archive of the
mailing list for the GCC project.
Re: The library interface again
- To: law at cygnus dot com, "H.J. Lu" <hjl at lucon dot org>
- Subject: Re: The library interface again
- From: Richard Henderson <rth at cygnus dot com>
- Date: Mon, 27 Jul 1998 02:10:50 -0700
- Cc: egcs-patches at cygnus dot com
- References: <m0yxHf8-000266C@ocean.lucon.org> <email@example.com>
- Reply-To: Richard Henderson <rth at cygnus dot com>
On Mon, Jul 27, 1998 at 12:03:45AM -0600, Jeffrey A Law wrote:
> Consider that the g++ driver just uses "-lstdc++" and folks that compile
> and link with gcc are used to using "-lstdc++". This no longer works
> as far as I can tell with your code.
No, you misunderstand how ELF shared libraries work. Take, for example,
the X11 libraries:
[twiddle:~] ls -l /usr/X11R6/lib/libX11*so*
lrwxrwxrwx .. 13 Jul 12 2018 /usr/X11R6/lib/libX11.so -> libX11.so.6.1*
lrwxrwxrwx .. 13 Jul 12 2018 /usr/X11R6/lib/libX11.so.6 -> libX11.so.6.1*
-rwxr-xr-x .. 1546379 Jun 8 21:38 /usr/X11R6/lib/libX11.so.6.1*
One always links with -lX11. This finds libX11.so, which finds
libX11.so.6.1. Now, libX11.so.6.1 has an soname of libX11.so.6;
this is the name under which the dynamic linker will search for
the library. Thus that second link for the benefit of ld.so.
It is, in effect, a major/minor numbering scheme, but without any
special number comparison logic -- everything is done with strings
and symbolic links.
What HJ is proposing, if I recall the patch properly (it has been
a week or more since I looked at it), is to arrange for more
specific minor numbering, so that we have better control over the
ABI of the library.
Correct me if I am wrong, HJ.
> For folks where this issue is indeed a problem, we should inform them
> about the option to place the library & include files in $libsubdir
> (and of course note the caveats for using that option).
This basically doesn't work with shared libraries.