Re: make installworld fails due to missing libmd.so.6 or libmd.so.7
Date: Mon, 10 Mar 2025 12:14:07 UTC
On Mon, Mar 10, 2025 at 11:14:46AM +0100, Matthias Apitz wrote:
> This problem first came up a the thread:
>
> Creating poudriere jail fails with libmd.so.6 not found
>
> but it's unrelated to poudriere jails. With a recent CURRENT (March 1)
> I can reproduce this fine. I investigated it with an installation into
> DESTDIR to not damage my running system.
>
> Here are my findings:
>
> # make installworld DESTDIR=/home/guru/150.root
> make[1]: "/usr/obj/usr/src/amd64.amd64/toolchain-metadata.mk" line 1: Using cached toolchain metadata from build at jet on Mon Mar 3 09:03:29 CET 2025
> --------------------------------------------------------------
> >>> Install check world started on Mon Mar 10 08:16:20 CET 2025
> --------------------------------------------------------------
> mkdir -p /tmp/install.H59PpUrQ1d
> ...
> Required library libmd.so.7 not found.
> *** Error code 1
>
> Stop.
>
> I investigated the problem (that's why I used DESTDIR to not
> damage the system to be installed to).
>
> The problem is that two tools, 'sort' and 'mtree'
> require a shared lib libmd.so.7 which is not there in
> the moment of make installworld:
>
> /usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/sbin/sort
> libmd.so.7 => not found (0)
> libc.so.7 => /lib/libc.so.7 (0xe6e08064000)
> [vdso] (0xe6e06c75000)
>
> /usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/sbin/mtree
> libmd.so.7 => not found (0)
> libutil.so.9 => /lib/libutil.so.9 (0x10621f601000)
> libc.so.7 => /lib/libc.so.7 (0x106220ca7000)
> [vdso] (0x10621d82c000)
>
> # find /lib /usr/lib -name libmd.so.7
> (nothing)
>
> This shared libmd.so.7 lib will perhaps be istalled later by
> the 'make installworld', at least it is in the tree /usr/obj/...
>
> # find /usr/obj -name libmd.so.7
> /usr/obj/usr/src/amd64.amd64/tmp/usr/lib32/libmd.so.7
> /usr/obj/usr/src/amd64.amd64/tmp/lib/libmd.so.7
> /usr/obj/usr/src/amd64.amd64/lib/libmd/libmd.so.7
> /usr/obj/usr/src/amd64.amd64/obj-lib32/lib/libmd/libmd.so.7
>
>
> a workaround is before 'make installworld' to run::
>
> # cp -p /usr/obj/usr/src/amd64.amd64/tmp/lib/libmd.so.7 /lib
>
> With this the
>
> # make installworld DESTDIR=/home/guru/150.root
> ...
> >>> Installing everything completed on Mon Mar 10 08:34:13 CET 2025
> >>> Install world completed in 398 seconds, ncpu: 2
> --------------------------------------------------------------
> 397,72 real 219,14 user 162,06 sys
>
>
> runs fine.
Did you run buildworld and installworld on different versions (e.g: main
vs. stable, or main vs. main pre e7a629c851d7)? This is is the only way
I can reproduce this.
main built on stable/14:
$ ldd
/usr/obj/tmp/home/herbert/source/freebsd/head/src/amd64.amd64/tmp/legacy/bin/sort
/usr/obj/tmp/home/herbert/source/freebsd/head/src/amd64.amd64/tmp/legacy/bin/sort:
libmd.so.6 => /lib/libmd.so.6 (0x311068a44000)
libc.so.7 => /lib/libc.so.7 (0x311068df0000)
[vdso] (0x3110676f0000)
main built on main:
$ ldd
/usr/obj/home/herbert/source/freebsd/head/src/amd64.amd64/tmp/legacy/bin/sort
/usr/obj/home/herbert/source/freebsd/head/src/amd64.amd64/tmp/legacy/bin/sort:
libmd.so.7 => not found (0)
libc.so.7 => /lib/libc.so.7 (0x28eb0e6f000)
[vdso] (0x28eafac0000)
I think these files (sort, mtree, etc.) are copied from /usr/[s]bin.