libtool
[Top][All Lists]
Advanced

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

Re: dlopen on Solaris compared with IRIX/Tru64


From: Albert Chin-A-Young
Subject: Re: dlopen on Solaris compared with IRIX/Tru64
Date: Wed, 20 Dec 2000 13:54:04 -0600
User-agent: Mutt/1.1.12i

On Wed, Dec 20, 2000 at 02:01:17PM -0500, Tom Kacvinsky wrote:
> Huh?  My experience (on Solaris) has been that if foo.so has an
> embedded RPATH and the application bar uses foo.so and also has a
> RPATH, then the binary's RPATH is used for shared lib lookups.  If
> the RPATH of the binary does not include the paths in the shared
> lib's RPATH, then the shared lib's dependencies are not met. :( Or
> maybe I am consfusing myself.  Perhaps this is Tru64 UNIX's
> behavior.

BTW, I posted the same message to comp.unix.solaris and it turns out
there is a solution. In my code below, I dlopen libz.so and then
libpng.so. This fails. libpng.so has a hard-coded dependency on
libz.so.2. So, if I dlopen libz.so.2 and then libpng.so, everything
works! Now, I don't think libtool embeds enough information in the
*.la files to figure this out.

My libz.la file looks like:
  dlname=''
  library_names='libz.so.2.0.0 libz.so.2 libz.so'
  old_library='libz.a'
  dependency_libs=''

and libpng.la looks like:
  dlname=''
  library_names='libpng.so.1.0.0 libpng.so.1 libpng.so'
  old_library='libpng.a'
  dependency_libs=' -L/opt/TWWfsw/zlib11/lib /opt/TWWfsw/zlib11/lib/libz.la -lm'

So, how can we make lt_dlopen load libz.so.2 when we load libpng.la?

Ok, why is dlname empty? Turns out that if:
  dlname='libz.so.2'
then lt_dlopen("libpng.la") will work!

> Anyway, I guess I am talking about run-time linking, and not use of
> dlopen.  Or is the bahvior the same?

I don't think so.

> Tom
> 
> On Wed, 20 Dec 2000, Bjoern Fischer wrote:
> 
> > Hello Albert,
> >
> > > dependent on nothing:
> > >   $ ldd libpng.so
> > >   libz.so.2 =>     (file not found)
> >
> > This is your problem. Your libpng.so is not self-contained.
> > The run-time linker is not able to resolve all dependencies
> > of your libpng.so. You may set LD_LIBRARY_PATH, but you
> > definetly want to fix your libpng.so to contain an DT_RPATH
> > for libz.so.
> >
> > > This program works just fine on IRIX 6.5 and Compaq Tru64 UNIX 5.0.
> > > The failure above is on Solaris 2.5.1-8/SPARC.
> >
> > That's irony! The Platforms Tru64 and IRIX are more or less broken
> > with respect to run-time linking resp. dlopen():
> >
> > The creator of libpng.so really knows what other libraries png
> > depends on and where to find them. This knowledge should be
> > incorprated into libpng.so, so the run-time linker will be able
> > to find all libs and resolve all symbols. Solaris' run-time
> > linker only uses the RPATH found in libpng.so to find libs,
> > that png depends on. IRIX and True64 use a globalized RPATH
> > in the executable binary for all library searches, which is
> > wrong.
> >
> >   Bjoern
> >
> >
> 
> 
> _______________________________________________
> Libtool mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/libtool

-- 
albert chin (address@hidden)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]