Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Mar 2025 06:53:28 +0100
From:      Matthias Apitz <guru@unixarea.de>
To:        "Herbert J. Skuhra" <herbert@gojira.at>
Cc:        freebsd-current@freebsd.org
Subject:   Re: make installworld fails due to missing libmd.so.6 or libmd.so.7
Message-ID:  <Z8_P2P_xMLehfe-f@c720-1400094>
In-Reply-To: <Z875THO7kkc1fx7Y@mail.bsd4all.net>
References:  <Z867lu3pXRn9Uo09@pureos> <Z87Xj8BjPVuFS0U8@mail.bsd4all.net> <Z87h5krSmmm0QccT@sh4-5.1blu.de> <Z875THO7kkc1fx7Y@mail.bsd4all.net>

next in thread | previous in thread | raw e-mail | index | archive | help
El día lunes, marzo 10, 2025 a las 03:38:04p. m. +0100, Herbert J. Skuhra escribió:

> On Mon, Mar 10, 2025 at 01:58:14PM +0100, Matthias Apitz wrote:
> > El día Montag, März 10, 2025 a las 01:14:07 +0100, Herbert J. Skuhra escribió:
> > 
> > > 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.
> > 
> > They're copied from /usr/sbin of the system where buildworld is done into
> > the /usr/obj/..../legacy/... tree.
> > 
> > The exact history of this is:
> > 
> > - I git cloned /usr/src on March 1
> > - I built kernel and world on the running system (an older 14.0-CURRENT)
> > - I installed kernel and world the usual way without any problem
> 
> This should install /lib/libmd.so.7 and /usr/bin/sort and /usr/sbin/mtree linked
> against it. e.g:
> 
> $ ldd /usr/bin/sort |grep md
>         libmd.so.7 => /lib/libmd.so.7 (0x2b71fa352000)
> $ ldd /usr/sbin/mtree |grep md
>         libmd.so.7 => /lib/libmd.so.7 (0x352bee83e000)
> 
> > ...

Yes. The installation 'make installworld' puts the new libmd.so.7 to
/lib/libmd.so.7, but in the /usr/obj/..../legacy/... are still 'sort'
and 'mtree' depending on the old shared lib libmd.so.6.

If one now runs the installation a second time, for example to create a
poudriere jail, the same /usr/src and /usr/obj are used and one of the
first steps of the 'make installworld' is this check for the legacy
tools which will faile, as I saw creating the jail.

When you run 'make buildworld' again, the new 'sort', 'mtree', ... are
copied to /usr/obj/..../legacy/... and they depend on libmd.so.7
That's why the creating of the poudriere jail worked. And one might
think: all is fine now.

But it isn't fine! If you now make tar archives of /usr/src and /usr/obj
to copy them over to a similar system as the just updated with
installworld and installkernel, to unpack these tar archives in /usr and
run 'make installworld' there, this must fail, because libmd.so.7 is not
there, but libmd.so.6, and the tools in /usr/obj/..../legacy/... are
looking for libmd.so.7.

That's all. Maybe while copying tools like 'sort', 'mtree', ... into 
/usr/obj/..../legacy/... also the shared libs they depend on should be
copied too.

	matthias

-- 
Matthias Apitz, ✉ guru@unixarea.de, http://www.unixarea.de/ +49-176-38902045
Public GnuPG key: http://www.unixarea.de/key.pub



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Z8_P2P_xMLehfe-f>