[uClibc] changing SHARED_LIB_LOADER_PATH="/lib"

Erik Andersen andersen at codepoet.org
Sun Aug 3 23:50:23 UTC 2003


On Sun Aug 03, 2003 at 04:11:49PM -0700, David Wuertele wrote:
> Using the uClibc-0.9.20 release, I tried to change the
> SHARED_LIB_LOADER_PATH variable in the .config file to include some
> other directories, like this:
> 
>   SHARED_LIB_LOADER_PATH="/lib:/usr/lib:/usr/local/lib"

Quoting the help text for SHARED_LIB_LOADER_PATH

	When using shared libraries, this path is the location
	where the shared library will be invoked.  This value
	will be compiled into every binary compiled with uClibc.
          
        BIG FAT WARNING:
	If you do not have a shared library loader with the
	correct name sitting in the directory this points to,
	your binaries will not run.

This must be a single directory, not a search path.  This single
directory will get embedded as the INTERP elf header (with the
name of the shared lib loader appended) into every binary you
compile.

> When I tried to build using buildroot, I found that the
> uclibc_toolchain.mk file overwrote my change.  So I edited
> uclibc_toolchain.mk (and uclibc.mk) to not overwrite my change.  Then
> I did "rm -rf build_mipsel toolchain_build_mipsel; make".  When the
> make was done and I had a complete cramfs, I verified that the uClibc
> .config file still had my new SHARED_LIB_LOADER_PATH.
> 
> But when I try to run libraries on the target, it doesn't look in
> /usr/local/lib, and complains:
> 
>  daves-prog: can't load library 'libDave.so'
> 
> Well, libDave.so is definitely in /usr/local/lib.
> 
> Is there some reason why changing SHARED_LIB_LOADER_PATH doesn't
> affect loading?

Generally speaking, when you encounted wierdness,
you should try to use strace on the offending program 
to see what it _is_ doing...

I bet in this case though, if you run 'readelf -e' on your
binaries and check the INTERP field, the problem will be
immediately apparent...

 -Erik

--
Erik B. Andersen             http://codepoet-consulting.com/
--This message was written using 73% post-consumer electrons--



More information about the uClibc mailing list