[uClibc] ld.so loading "false" libs

Joakim Tjernlund Joakim.Tjernlund at lumentis.se
Sun Sep 26 13:49:47 UTC 2004


> Hello!
> 
> In a native uclibc env I wanted to build an app, that needs itself to be 
> bootstrapped. This app as binary is only present as glibc version so I 
> have added all the required glibc libs to /usr/X11R6/lib including 
> libc.so.6, ld-linux.so.2 and made a link to /lib/ld-linux.so.2 (I haven't 
> copied any libc.so libm.so files, so at link time it should only find the 
> uclibc versions). I have built alsa-libs and ended up w/ dependency on 
> libc.so.6, although as I said libc.so points to libc.so.0 (uclibc)
> I have also tried to enable ld.so.cache, and put these libs into 
> /usr/X11R6/lib6 adding this path to /etc/ld.so.conf, the same result. 
> 
> Could it be that ld.so (from uClibc) looks for some functions, and if they 
> are found twice, it could get using the false one?
> Could this be related to the fact that running ldd it shows all the time 
> (0x00000000) after the used lib (as opposed to glibc's ldd, where there 
> are different values, I think telling us which lib is used (some 
> kind of versioning)?
> The hardcoded order of libs is /lib:/usr/lib:/usr/X11R6/lib, which has 
> preference? Is this order ok, if a function is found twice, which one is 
> relevant at run-time, the first or the last?
> 
> How does the order in ld.so.conf influence this (if ld.so.cache is 
> enabled). if cache is enabled ldconfig show inverse order: first what is 
> in /etc/ld.so.conf, after that the hardcoded /usr/X11R6/lib:/usr/lib:/lib,
> if ld.so.conf includes one of the hardcoded paths, it will be duplicated 
> in ldconfig -v.
> glibc's ldconfig show /lib:/usr/lib (hardcoded) + what is in ld.so.conf in 
> order (no duplication)

Looking in glibc I think the hardcoded path /usr/X11R6/lib should be removed
in uClibc. If this path is needed you should enable ldso cache support in uClibc
and add /usr/X11R6/lib in /etc/ld.so.conf. Comments?

 Jocke



More information about the uClibc mailing list