Bruce Dubbs wrote: > Randy McMurchy wrote: >> r...@rmlinux: /home/randy > ldconfig -v |grep libz >> libz.so.1 -> libz.so.1.2.3 > > If libz is needed by a program in /bin, the dynamic linker will not find > it if /usr is not mounted.
If libz.so is needed by a program in /bin, then you're right.
But programs that link against zlib don't ask for libz.so. They ask for
libz.so.1 instead:
$ ldd /sbin/mkfs.cramfs | grep libz
libz.so.1 => /lib64/libz.so.1 (0x00007f34c1ff3000)
(The reason for this is because at compile time, libz.so was found by
the linker, and it read the soname out of the target file to build into
the executable's DT_NEEDED section. That soname is libz.so.1 for zlib,
since all zlib libraries will be ABI-compatible with libz.so.1.2.3 (or
whatever version). If/when binary compatibility is broken, zlib devs
will switch to libz.so.2 for this symlink.)
>> .so files and .a files do not belong in /lib. They are only used at
>> compile time. And one shouldn't be compiling programs if /usr is
>> not mounted.
>
> .a files are only used at build time and I agree with that part. .so
> files are definitely used at run time.
.so.* files, yes. Just plain .so, not so much. :-)
> I *know* that libc.so.6 needs to be in /lib.
Right. But that's not libc.so (what you get when you tell the compiler
to link against -lc). See /usr/lib/libc.so (though note that it's a
linker script, not a symlink).
> I do have rpm installed in /bin and that has:
>
> libz.so.1 => /lib/libz.so.1 (0x00007f1355a45000)
Yep, libz.so.1. :-)
> From a review, none of the lfs programs installed in /bin need it
I found a couple in /sbin, fwiw, but that might just be my own system?
See mkfs.cramfs above.
signature.asc
Description: OpenPGP digital signature
-- http://linuxfromscratch.org/mailman/listinfo/lfs-book FAQ: http://www.linuxfromscratch.org/lfs/faq.html Unsubscribe: See the above information page
