[uClibc]problems linking libz

Tom Grennan tgrennan at ayrnetworks.com
Thu May 23 01:18:27 UTC 2002


Tom Grennan wrote on Wed, May 22, 2002 at 04:55:39PM -0700:
>Tom Grennan wrote on Mon, May 20, 2002 at 04:45:05PM -0700:
>>Erik Andersen wrote on Fri, May 10, 2002 at 11:51:33PM -0600:
>>>On Fri May 10, 2002 at 08:05:01PM -0700, Todd Sundsted wrote:
>>>> I have been fighting with this problem for the last several days.  I am trying
>>>> to link a simple program with a version of libz.so that I built with uClibc but
>>>> I can't get the linker to pick up my version of libz.so -- it insists on
>>>> picking up the version installed in /lib.
>>>
>>>Hmm.  You might want to take a look at how I compile things
>>>with buildroot.  I just added a makefile for building zlib 
>>>vs uClibc for you
>>>    http://www.uclibc.org/cgi-bin/cvsweb/buildroot/
>>>
>>> -Erik
>>
>>I could't get uClibc to build and link with libz.so correctly using the
>>above guide.  The following is with uClibc-0.9.11.tar.bz2 and
>>zlib-1.1.4.tar.gz compiled/running on RH7.1.
>>

...

>PS I still don't have the zlib shared library working with uclibc.
>   Anyone resolve this yet?

Geez, I can be pretty dense sometimes.  Once I moved my uclibc compiled
libz.so* to $(DEVEL_PREFIX)/lib or set LD_LIBRARY_PATH, the example
program found the right library and worked as expected:

        $ unset LD_LIBRARY_PATH
        $ ./example
        ./example: linked against GNU libc!
        $ export LD_LIBRARY_PATH=$PWD
        $ ./example
        uncompress(): hello, hello!
        gzread(): hello, hello!
        gzgets() after gzseek: hello!
        inflate(): hello, hello!
        large_inflate(): OK
        after inflateSync(): hello, hello!
        inflate with dictionary: hello, hello!

Sorry for the noise.

-- 
TomG




More information about the uClibc mailing list