Re: FYI & question: Linux-PAM modules on Solaris

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

 



Theodore Tso wrote:
> 
[]
> I'm not a libtool expert, but I'm told that it doesn't really handle
> library dependencies correctly.  (i.e., adding explicit dependencies
> in a library so that when you dynamically link with the library, other
> libraries which are needed are automatically pulled in).
> 
> For example, apparently GNOME, which uses libtool, doesn't do any
> library dependencies at all, and applications simply link with all
> possible GNOME libraries.  This works mostly ok for applications
> (modulo namespace polution), but it's a complete disaster for
> libraries that need to be pulled in via dlopen(), since you don't have
> the luxury of simply declaring every single library under creation to
> the linker.
> 
> The person I was talking to claimed this was a fundamental limitation
> of libtool, that couldn't really be circumvented without extreme pain
> and sacrificing platform portability.

This isn't a libtool issue actually (unfortunately).  Libtool handles
deps just fine for executables and other libs.  But consider this:

 liba.so depends on libb.so, i.e. it was linked with
   gcc -shared -o liba.so obj1.o obj2.o -lb

 now, when you link executable e with -la, you'll find
 that it depends on b:
  gcc -o e e.o -la
  ldd e
    liba.so
    libb.so

That is bad -- runtime linker handles the issue just fine
without adding libb to e.  Bad is because if you, for
example, use some library x that calls e.g. libdb.so-3.0
internally, you'll get that libdb in executable deps.
But after installing new libdb.so-3.1 and just relinking x
you'll also need to relink application that does not use
libdb at all!

Once I was in trouble with similar case, and resolved that
by very ugly hack: I linked library x with static libdb,
then linked my app with -lx, and then relinked libx with
dynamic libdb.  That way, exe doesn't depend on libdb,
and runtime linker get all right when loading libx.so.

BTW, one of recent bugs in linux-pam -- with pam_lastlog
that depends on -lutil: you just add -lutil to linkline
of .so object, and dynamic linker (or dlopen) loads that
lib.

Regards,
 Michael.





[Index of Archives]     [Fedora Users]     [Kernel]     [Red Hat Install]     [Linux for the blind]     [Gimp]

  Powered by Linux