[uClibc]troubles with Busybox and latest uClibc CVS snapshot

Erik Andersen andersen at lineo.com
Thu May 31 21:13:27 UTC 2001


On Thu May 31, 2001 at 04:41:55PM -0400, 'Wayne Buckhanan' wrote:
> 
> I get the fact that busybox and tinylogin can't find the uClibc shared
> libs, I'm just surprised that you can't run the executables at all if
> the libs are not in /lib.  I've had other programs that were dynamically
> linked against libraries that were not installed on the system and as
> long as I set $LD_LIBRARY_PATH to include the dir that had those shared
> libs things worked.  Mind you I've never tried it with the C lib before
> so mebee that's the difference.

It is not the C library that is the problem.  It is the shared lib loader --
particularly the fact that it isn't where the compiler told the binary to
find it.  If you run 'readelf -a' on, say, busybox, you will see that the
INTERP field is set to /lib/ld-uclibc.so.0.  If you do not have a working
shared library loader sitting on your hard drive such that /lib/ld-uclibc.so.0
points to it, then ldd will not work.  

If you want ldd to work, but do not want to install uClibc, you can your your
system's shared lib loader to do the job.  As root you can do something like:
    $ cd /lib
    $ rm -f ld-uclibc.so.0
    $ ln -s ld-linux.so.2 ld-uclibc.so.0
    $ echo -e "/usr/i386-linux-uclibc/lib\n/usr/i386-linux-uclibc/usr/lib" >> /etc/ld.so.conf
    $ ldconfig

and then ldd (your system one from glibc) should work for uClibc stuff.  Or you
can do the simple thing and (again as root)
    $ cd /lib
    $ rm -f ld-uclibc.so.0
    $ ln -s /usr/i386-linux-uclibc/lib/ld-uclibc.so.0
and then ldd will work, and you can use the uClibc shared lib loader to load binaries.

> > 	Now, that being said, if you were to run ldd on the target machine,
> > you would get the expected results, hopefully.  (Un?)fortunately, BusyBox
> > does NOT have an LDD built in, so you're out of luck on this one.  Anyway, I
> > just wanted to let you know.
> 
> Thanks for the heads up.
> Are there any plans towards creating tools like ldd, readelf, etc that
> are based on uClibc or should it just be a matter of swiping the source
> from the glibc versions and compiling it against uClibc?

You might want to check out the staticly linked uClibc/ldso/util/ldd

 -Erik

--
Erik B. Andersen   email:  andersen at lineo.com
--This message was written using 73% post-consumer electrons--





More information about the uClibc mailing list