[uClibc] ld.so loading "false" libs

Stuart Hughes seh at zee2.com
Wed Sep 29 08:52:11 UTC 2004


Hi Mike,

I'm not sure this is the case.  When you are building software using
gcc/ld /etc/ld.so.conf is not used to search for additional libraries. 
The way this is normally resolved is by setting the LD_LIBRARY_PATH
environment (which should only really be done when building software or
testing, but never by default), or by using -rpath or -rpath-link. 
Although I don't like it LD_LIBRARY_PATH is often more practical to use,
as it can be hard to inject -rpaths into complex packages without
editing sources.

This behaviour is actually quite unfortunate.  Even when you have a
system that had X11 in /etc/ld.so.* you still have to let the linker
know this using one of the methods mentioned above.  You'd think that
there is no need these days when pkg-config is used by configure to work
out linking flags etc, but the case I run into most often is when a
library that is recognized by pkg-config has a dependency on other
libraries itself (like pango has on X11).

I'm no expert on this stuff, so maybe I missed something.

Regards, Stuart


Mike Frysinger wrote:
> 
> On Tuesday 28 September 2004 02:24 pm, Erik Andersen wrote:
> > it seems that these configuration files
> >  really ought to be given different names.
> 
> the other problem that would need to be handled is ld in binutils ...
> 
> ld utilizes /etc/ld.so.conf on a gnu system to find additional libraries; if
> we were to rename this file, we'd have to have a way for ld to know what the
> different location of it would be ... otherwise the cache option would be
> useful *only* for resolving runtime libraries; compile time linking would be
> broken again (and i just fixed it ! :D)
> 
> since the RUNTIME_PREFIX is exported via uclibc's header files, perhaps we
> could make the name a configurable option and have ld figure it out by
> including that file ... of course, this would mean a bigger patch than what i
> sent in a previous e-mail :)
> -mike
> _______________________________________________
> uClibc mailing list
> uClibc at uclibc.org
> http://uclibc.org/mailman/listinfo/uclibc



More information about the uClibc mailing list