Problem (re)building graphics/drm-61-kmod via PORTS_MODULES+=

From: David Wolfskill <david_at_catwhisker.org>
Date: Thu, 24 Oct 2024 18:40:14 UTC
So... I've been tracking FreeBSD (generally, daily) on various machines
for a couple of decades or so.  And I learned long ago to rebuild kmods
from ports whenever I rebuilt the kernel, and that generally, the
simplest way to ensure that that is done is to augment /etc/src.conf
with (e.g.):

PORTS_MODULES+=graphics/drm-61-kmod

which (again, generally) works a treat. :-)

It even worked Just Fine yesterday (main-n273108-d1d839d0b593 ->
main-n273133-419249c1cacc).

This morning, however, after updating sources to
main-n273188-1c83996beda7, running:

g1-48(15.0-C)[12] uname -aUK
FreeBSD g1-48.catwhisker.org 15.0-CURRENT FreeBSD 15.0-CURRENT #110 main-n273133-419249c1cacc: Wed Oct 23 11:19:30 UTC 2024     root@g1-48.catwhisker.org:/common/S4/obj/usr/src/amd64.amd64/sys/CANARY amd64 1500025 1500025

the attempt to rebuild graphics/drm-61-kmod failed on my laptops, thus:

...
--- sync_file.o ---
cc  -O2 -pipe -fno-strict-aliasing -DLINUXKPI_VERSION=60100 '-DKBUILD_MODNAME="d
mabuf"' -DCONFIG_DRM_AMDGPU_CIK -DCONFIG_DRM_AMDGPU_SI -DCONFIG_DRM_AMD_DC -DCON
FIG_DRM_AMD_DC_SI -DCONFIG_AMD_PMC -DCONFIG_DRM_I915_FORCE_PROBE='"*"' -DCONFIG_DRM_I915_REQUEST_TIMEOUT=20000 -DCONFIG_DRM_I915_CAPTURE_ERROR -DCONFIG_DRM_I915_USERFAULT_AUTOSUSPEND=250 -DCONFIG_DRM_I915_STOP_TIMEOUT=100 -DCONFIG_DRM_I915_PREEMPT_TIMEOUT=640 -DCONFIG_DRM_I915_HEARTBEAT_INTERVAL=2500 -DCONFIG_DRM_I915_TIMESLICE_DURATION=1 -DCONFIG_DRM_I915_MAX_REQUEST_BUSYWAIT=8000 -DCONFIG_DRM_I915_FENCE_TIMEOUT=10000 -DCONFIG_DRM_MIPI_DSI -DCONFIG_DRM_PANEL_ORIENTATION_QUIRKS -DCONFIG_APERTURE_HELPERS -DCONFIG_DRM_FBDEV_EMULATION -DCONFIG_DRM_FBDEV_OVERALLOC=100 -DCONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG -DCONFIG_BACKLIGHT_CLASS_DEVICE -DCONFIG_DEBUG_FS -DCONFIG_DMI -DCONFIG_FB -DCONFIG_MTRR -DCONFIG_PCI -DCONFIG_PM -DCONFIG_PM_SLEEP -DCONFIG_SMP -DCONFIG_SUSPEND -DCONFIG_ACPI -DCONFIG_ACPI_SLEEP -DCONFIG_X86 -DCONFIG_X86_PAT -DCONFIG_64BIT -DCONFIG_AS_MOVNTDQA -DCONFIG_COMPAT -DCONFIG_X86_64 -DCONFIG_DRM_AMD_DC_DCN -DCONFIG_DRM_AMD_DC_DCN3_0 -DCONFIG_DRM_AMD_DC_DCN3_01 -DCONFIG_DRM_AMD_DC_DCN3_02 -DCONFIG_DRM_AMD_DC_DCN3_1  -Werror -D_KERNEL -DKLD_MODULE -nostdinc  -I/common/S4/obj/usr/src/amd64.amd64/sys/CANARY/common/ports/graphics/drm-61-kmod/work/drm-kmod-drm_v6.1.92_0/linuxkpi/gplv2/include -I/common/S4/obj/usr/src/amd64.amd64/sys/CANARY/common/ports/graphics/drm-61-kmod/work/drm-kmod-drm_v6.1.92_0/linuxkpi/bsd/include -I/usr/src/sys/compat/linuxkpi/common/include -I/common/S4/obj/usr/src/amd64.amd64/sys/CANARY/common/ports/graphics/drm-61-kmod/work/drm-kmod-drm_v6.1.92_0/linuxkpi/dummy/include -I/usr/src/sys/compat/linuxkpi/dummy/include -include /common/S4/obj/usr/src/amd64.amd64/sys/CANARY/common/ports/graphics/drm-61-kmod/work/drm-kmod-drm_v6.1.92_0/obj/common/S4/obj/usr/src/amd64.amd64/sys/CANARY/common/ports/graphics/drm-61-kmod/work/drm-kmod-drm_v6.1.92_0/dmabuf/opt_global.h -I. -I/usr/src/sys -I/usr/src/sys/contrib/ck/include -fno-common  -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fdebug-prefix-map=./machine=/usr/src/sys/amd64/include -fdebug-prefix-map=./x86=/usr/src/sys/x86/include -fdebug-prefix-map=./i386=/usr/src/sys/i386/include     -MD  -MF.depend.sync_file.o -MTsync_file.o -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float  -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wswitch -Wno-error=tautological-compare -Wno-error=empty-body -Wno-error=parentheses-equality -Wno-error=unused-function -Wno-error=pointer-sign -Wno-error=shift-negative-value -Wno-address-of-packed-member -Wno-format-zero-length   -mno-aes -mno-avx  -std=gnu99 -c /common/S4/obj/usr/src/amd64.amd64/sys/CANARY/common/ports/graphics/drm-61-kmod/work/drm-kmod-drm_v6.1.92_0/drivers/dma-buf/sync_file.c -o sync_file.o
--- dma-buf-kmod.o ---
cc: error: no such include directory: '/common/S4/obj/usr/src/amd64.amd64/sys/CANARY/common/ports/graphics/drm-61-kmod/work/drm-kmod-drm_v6.1.92_0/linuxkpi/dummy/include' [-Werror,-Wmissing-include-dirs]
--- dma-fence-array.o ---
cc: error: no such include directory: '/common/S4/obj/usr/src/amd64.amd64/sys/CANARY/common/ports/graphics/drm-61-kmod/work/drm-kmod-drm_v6.1.92_0/linuxkpi/dummy/include' [-Werror,-Wmissing-include-dirs]
--- dma-fence-unwrap.o ---
cc: error: no such include directory: '/common/S4/obj/usr/src/amd64.amd64/sys/CANARY/common/ports/graphics/drm-61-kmod/work/drm-kmod-drm_v6.1.92_0/linuxkpi/dummy/include' [-Werror,-Wmissing-include-dirs]
--- dma-fence.o ---
cc: error: no such include directory: '/common/S4/obj/usr/src/amd64.amd64/sys/CANARY/common/ports/graphics/drm-61-kmod/work/drm-kmod-drm_v6.1.92_0/linuxkpi/dummy/include' [-Werror,-Wmissing-include-dirs]
--- sync_file.o ---
cc: error: no such include directory: '/common/S4/obj/usr/src/amd64.amd64/sys/CANARY/common/ports/graphics/drm-61-kmod/work/drm-kmod-drm_v6.1.92_0/linuxkpi/dummy/include' [-Werror,-Wmissing-include-dirs]
--- dma-buf.o ---
cc: error: no such include directory: '/common/S4/obj/usr/src/amd64.amd64/sys/CANARY/common/ports/graphics/drm-61-kmod/work/drm-kmod-drm_v6.1.92_0/linuxkpi/dummy/include' [-Werror,-Wmissing-include-dirs]
--- dma-fence-chain.o ---
cc: error: no such include directory: '/common/S4/obj/usr/src/amd64.amd64/sys/CANARY/common/ports/graphics/drm-61-kmod/work/drm-kmod-drm_v6.1.92_0/linuxkpi/dummy/include' [-Werror,-Wmissing-include-dirs]
--- dma-resv.o ---
cc: error: no such include directory: '/common/S4/obj/usr/src/amd64.amd64/sys/CANARY/common/ports/graphics/drm-61-kmod/work/drm-kmod-drm_v6.1.92_0/linuxkpi/dummy/include' [-Werror,-Wmissing-include-dirs]
--- sync_file.o ---
*** [sync_file.o] Error code 1

make[1]: stopped making "all" in /common/S4/obj/usr/src/amd64.amd64/sys/CANARY/common/ports/graphics/drm-61-kmod/work/drm-kmod-drm_v6.1.92_0/dmabuf
--- dma-fence.o ---
*** [dma-fence.o] Error code 1
....


A bit of poking around showed that /common/S4/obj/usr/src/amd64.amd64/sys/CANARY/common/ports/graphics/drm-61-kmod/work/drm-kmod-drm_v6.1.92_0/linuxkpi
exists, but it does not contain a "dummy" subdirectory:

g1-70(14.2-P)[6] ls -laT /common/S4/obj/usr/src/amd64.amd64/sys/CANARY/common/ports/graphics/drm-61-kmod/work/drm-kmod-drm_v6.1.92_0/linuxkpi/
total 16
drwxr-xr-x   4 root wheel 512 Jun  4 04:09:58 2024 .
drwxr-xr-x  16 root wheel 512 Oct 24 08:09:48 2024 ..
drwxr-xr-x   3 root wheel 512 Jun  4 04:09:58 2024 bsd
drwxr-xr-x   3 root wheel 512 Jun  4 04:09:58 2024 gplv2
g1-70(14.2-P)[7]

As an experiment, I then ran "portmaster graphics/drm-61-kmod" on the
system in question; that succeeded.

I have copied typescripts for both the build and the portmaster invocation
to https://www.catwhisker.org/~david/FreeBSD/head/n273188/.

(My headless build machine -- which runs GENERIC and has no kmods
from ports -- had no issues (of course).)

I would appreciate being loaned a clue about what I might be doing wrong.

Thanks!

Peace,
david
-- 
David H. Wolfskill                              david@catwhisker.org
It has been said that history repeats itself. This is perhaps not quite
correct; it merely rhymes. -- Theodor Reik

See https://www.catwhisker.org/~david/publickey.gpg for my public key.