[Zlib-devel] [PATCH] Makefile.in: removed call to ldconfig
Török Edwin
edwintorok at gmail.com
Fri Jul 23 16:14:05 EDT 2010
On Fri, 23 Jul 2010 16:02:49 -0400
Mike Frysinger <vapier at gentoo.org> wrote:
> On Friday, July 23, 2010 15:28:08 Török Edwin wrote:
> > FWIW libtool runs ldconfig when installing the libraries, but does
> > so wrongly. It only works if you've installed the libraries in that
> > place before.
>
> eh ? previous installation status doesnt matter if it's just using
> ldconfig to generate appropate symlinks for the SONAMEs and such. i
> think that's the only usage in libtool not for cache management.
It matters for the cache.
Here is an example on a Debian unstable system:
With -n it still tells me it can't open it
$ sudo ldconfig -n /usr/local/lib
$ /usr/local/bin/y
/usr/local/bin/y: error while loading shared libraries: libx.so: cannot
open shared object file: No such file or directory
Without -n it works
$ sudo ldconfig
$ /usr/local/bin/y
$
I created the lib like this:
$ cat >y.c <<EOF
int main(){return foo();}
EOF
$ cat >x.c <<EOF
int foo() {}
EOF
$ gcc -fPIC -shared x.c -o libx.so
$ gcc y.c -Wl,-R,../lib libx.so -o y
$ sudo cp y /usr/local/bin
$ sudo cp libx.so /usr/local/lib
Problem is that when running with -n it doesn't update the cache, so
when the app looks for libx.so, it doesn't find it.
ldconfig -p doesn't find it either.
>
> > IMHO safest is to just run ldconfig with no params, zlib is doing
> > just that, so it is fine.
>
> the obnoxious thing is that on any sizable systems, ldconfig can chew
> through the disk
Yes, but only the first time:
time sudo ldconfig
real 0m7.730s
user 0m0.064s
sys 0m0.092s
time sudo ldconfig
real 0m7.730s
user 0m0.064s
sys 0m0.092s
Best regards,
--Edwin
More information about the Zlib-devel
mailing list