Re: Odd whine during "make installworld"

From: Warner Losh <imp_at_bsdimp.com>
Date: Tue, 04 Aug 2026 13:03:18 UTC
On Tue, Aug 4, 2026 at 6:51 AM David Wolfskill <david@catwhisker.org> wrote:

> System was running;
>
> FreeBSD 16.0-CURRENT #652 main-n287884-16e47f317c4c: Sun Aug  2 13:47:23
> UTC 2026     root@freebeast.catwhisker.org:/common/S4/obj/usr/src/amd64.amd64/sys/GENERIC
> amd64 1600019 1600019
>
> I then updated sources to main-n287899-1c91c3ae1ec6, and performed the
> usual in-place source-based update.  During the "make installworld"
> phase, I happened to note:
>
> ...
> ===> share/man/man3lua (install)
> install   -o root -g wheel -m 444 intro.3lua.gz  /usr/share/man/man3lua/
> ===> share/man/man4 (install)
> ld-elf.so.1: /bin/ls: Undefined symbol "fts_open@FBSD_1.9"
> make[6]: /usr/src/share/man/man4/Makefile:1009: warning: Command "/bin/sh
> -c "/bin/ls -d /usr/src/share/man/man4/man4.*"" exited with status 1
> install   -o root -g wheel -m 444 atf-test-case.4.gz  /usr/share/man/man4/
> install   -o root -g wheel -m 444 aac.4.gz  /usr/share/man/man4/
> ....
>

Looks like ls needs to be an install tool. But it really shouldn't be, more
below

TOOLS= [ awk cap_mkdb cat chflags chmod chown cmp cp \
        date echo egrep find grep id install \
        ln make mkdir mtree mv pwd_mkdb \
        rm sed services_mkdb sh sort strip ${_sysctl} test time true uname
wc

Also, why is ls used in this way:

.if empty(MAN_ARCH) || ${MAN_ARCH} == "all"
__arches=       ${:!/bin/sh -c "/bin/ls -d ${.CURDIR}/man4.*"!:E}
.else
__arches=       ${MAN_ARCH}
.endif
.for __arch in ${__arches:O:u}
.if exists(${.CURDIR}/man4.${__arch})
SUBDIR+=        man4.${__arch}
.endif
.endfor

Why can't we just 'echo' and be done with it? Usually in the tree, though,
we list things
explicitly. Putting that aside, does the following fix the installworld
whine?

diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile
index 80b9ac16ce87..cc20a3058b38 100644
--- a/share/man/man4/Makefile
+++ b/share/man/man4/Makefile
@@ -999,7 +999,7 @@ MLINKS+=cgem.4 if_cgem.4
 .endif

 .if empty(MAN_ARCH) || ${MAN_ARCH} == "all"
-__arches=      ${:!/bin/sh -c "/bin/ls -d ${.CURDIR}/man4.*"!:E}
+__arches=      ${:!/bin/sh -c "echo ${.CURDIR}/man4.*"!:E}
 .else
 __arches=      ${MAN_ARCH}
 .endif

Warner