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

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



On Thu, Jan 22, 1998 at 05:20:49PM +0100, Christian Schwarz wrote:
> * 7: Linking shared libraries with -lc
> approved
> - fix text to state that shared libs are always linked dynamically against
> each other, but dependency information is only included if `-lc' is used

Looking back through the archive, I noticed that my comment on this issue
did not make it to the list. As I consider this comment important, I'll
repeat it here.

On Tue, Jan 13, 1998 at 11:34:26PM +0100, Christian Schwarz wrote:
> [This mail is part of Debian Policy Weekly issue #5]
> 
> Topic 7: Linking shared libraries with -lc
> 
> STATE: APPROVAL
> 
> 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.
> 
> Unless someone objects, I'll change the policy manual to force this linker
> option for all shared libraries.

I sense a possible confusion here: `-l' is the option, and `c' a parameter
for it.
 
IMO, shared libraries should use `-lsomelib' for each library they directly
depend on, not just `-lc'. For example, the LessTif shared library depends
directly on Xt, Xext, X11 (and through them on other X libs). I have linked
it "-lXt -lXext -lX11 -lc".  Thus, ldd can show proper dependencies on all
libraries it depends on:
penguin ray 11:08 /tmp> ldd /usr/X11R6/lib/libXm.so.0.82
        libXt.so.6 => /usr/X11R6/lib/libXt.so.6 (0x400de000)
        libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x40126000)
        libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x40132000)
        libc.so.6 => /lib/libc.so.6 (0x401d5000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x00000000)
        libSM.so.6 => /usr/X11R6/lib/libSM.so.6 (0x40277000)
        libICE.so.6 => /usr/X11R6/lib/libICE.so.6 (0x40282000)

Please change the text to state that shared libraries should include
dependency information for all the libraries that they depend on, not only
libc.

Greetings,
Ray
-- 
POPULATION EXPLOSION  Unique in human experience, an event which happened 
yesterday but which everyone swears won't happen until tomorrow.  
- The Hipcrime Vocab by Chad C. Mulligan 


Reply to: