This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: The library interface again


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.


r~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]