[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: PW#5-7: Linking shared libraries with -lc



Christian Schwarz <schwarz@monet.m.isar.de> writes:

> One of the release goals for Debian 2.0 has been to link all shared
> libraries dynamically against each other. This can be done by using the
> `-lc' option when linking the library. With that, the library will contain
> valuable dependency information about which other libraries the library is
> linked against.

The intention is right, but the technical details are wrong.  Shared
libs linked without -lc are still dynamically linked against libc
(despite what ldd reports.)  They just don't have an explicit
dependency.  I suggest the following:

With the release of libc6, an explicit dependency on at least one of
libc, libm, or libdl is required so that the dynamic linker knows
which version of libc the library is using.  Add the `-lc' option when
linking the library.  If you do this correctly, `ldconfig -p' will
report your library as `ELF-libc5' or `ELF-libc6', and NOT as simply
`ELF'.


Guy


Reply to: