drm-61-kmod needs non-existing system source file?

I'm trying to build graphics/drm-61-kmod on a offline FreeBSD 15.0 RELEASE system but it has a problem with a missing system source file???
Start of the errors in the make output:

Code:
cc  -O2 -pipe -fno-strict-aliasing -DLINUXKPI_VERSION=60100 -include /usr/src/sys/compat/linuxkpi/common/include/linux/compiler_types.h '-DKBUILD_MODNAME="dmabuf"' -DCONFIG_DRM_AMDGPU_CIK -DCONFIG_DRM_AMDGPU_SI -DCONFIG_DRM_AMD_DC -DCONFIG_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/usr/ports/graphics/drm-61-kmod/work/drm-kmod-drm_v6.1.128_9/linuxkpi/gplv2/include -I/usr/ports/graphics/drm-61-kmod/work/drm-kmod-drm_v6.1.128_9/linuxkpi/bsd/include -I/usr/src/sys/compat/linuxkpi/common/include -I/usr/src/sys/compat/linuxkpi/dummy/include -include /usr/ports/graphics/drm-61-kmod/work/drm-kmod-drm_v6.1.128_9/obj/usr/ports/graphics/drm-61-kmod/work/drm-kmod-drm_v6.1.128_9/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 -ffile-prefix-map=/usr/src/sys=/usr/src/sys -ffile-prefix-map=/usr/ports/graphics/drm-61-kmod/work/drm-kmod-drm_v6.1.128_9/obj/usr/ports/graphics/drm-61-kmod/work/drm-kmod-drm_v6.1.128_9/dmabuf=/usr/obj/usr/src/amd64.amd64/sys/modules/dmabuf -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  -Wno-pointer-sign -Wno-format-zero-length   -mno-aes -mno-avx  -std=gnu17 -c /usr/ports/graphics/drm-61-kmod/work/drm-kmod-drm_v6.1.128_9/drivers/dma-buf/sync_file.c -o sync_file.o
--- dma-buf-kmod.o ---
<built-in>:1:10: fatal error: '/usr/src/sys/compat/linuxkpi/common/include/linux/compiler_types.h' file not found
--- dma-fence-array.o ---
<built-in>:1:10: fatal error: '/usr/src/sys/compat/linuxkpi/common/include/linux/compiler_types.h' file not found
--- dma-fence-unwrap.o ---
<built-in>:1:10: fatal error: '/usr/src/sys/compat/linuxkpi/common/include/linux/compiler_types.h' file not found
--- dma-resv.o ---
<built-in>:1:10: fatal error: '/usr/src/sys/compat/linuxkpi/common/include/linux/compiler_types.h' file not found
--- dma-buf.o ---
<built-in>:1:10: fatal error: '/usr/src/sys/compat/linuxkpi/common/include/linux/compiler_types.h' file not found
--- dma-fence-array.o ---
    1 | #include "/usr/src/sys/compat/linuxkpi/common/include/linux/compiler_types.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--- dma-fence-chain.o ---
<built-in>:1:10: fatal error: '/usr/src/sys/compat/linuxkpi/common/include/linux/compiler_types.h' file not found
--- dma-fence.o ---
<built-in>:1:10: fatal error: '/usr/src/sys/compat/linuxkpi/common/include/linux/compiler_types.h' file not found
--- dma-resv.o ---
    1 | #include "/usr/src/sys/compat/linuxkpi/common/include/linux/compiler_types.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--- sync_file.o ---
<built-in>:1:10: fatal error: '/usr/src/sys/compat/linuxkpi/common/include/linux/compiler_types.h' file not found
--- dma-buf-kmod.o ---
    1 | #include "/usr/src/sys/compat/linuxkpi/common/include/linux/compiler_types.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--- dma-fence-unwrap.o ---
    1 | #include "/usr/src/sys/compat/linuxkpi/common/include/linux/compiler_types.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--- dma-fence.o ---
    1 | #include "/usr/src/sys/compat/linuxkpi/common/include/linux/compiler_types.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--- dma-fence-chain.o ---
    1 | #include "/usr/src/sys/compat/linuxkpi/common/include/linux/compiler_types.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--- sync_file.o ---
    1 | #include "/usr/src/sys/compat/linuxkpi/common/include/linux/compiler_types.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--- dma-buf.o ---
    1 | #include "/usr/src/sys/compat/linuxkpi/common/include/linux/compiler_types.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--- dma-buf-kmod.o ---
1 error generated.
*** [dma-buf-kmod.o] Error code 1

make[1]: stopped making "all" in /usr/ports/graphics/drm-61-kmod/work/drm-kmod-drm_v6.1.128_9/dmabuf
--- dma-fence-array.o ---
1 error generated.
--- dma-fence-unwrap.o ---
1 error generated.
--- dma-fence-chain.o ---
1 error generated.
--- dma-fence-array.o ---
*** [dma-fence-array.o] Error code 1

make[1]: stopped making "all" in /usr/ports/graphics/drm-61-kmod/work/drm-kmod-drm_v6.1.128_9/dmabuf
--- dma-fence-unwrap.o ---
*** [dma-fence-unwrap.o] Error code 1

make[1]: stopped making "all" in /usr/ports/graphics/drm-61-kmod/work/drm-kmod-drm_v6.1.128_9/dmabuf
--- dma-fence-chain.o ---
*** [dma-fence-chain.o] Error code 1

make[1]: stopped making "all" in /usr/ports/graphics/drm-61-kmod/work/drm-kmod-drm_v6.1.128_9/dmabuf
--- sync_file.o ---
1 error generated.
--- dma-fence.o ---
1 error generated.
--- dma-resv.o ---
1 error generated.
--- sync_file.o ---
*** [sync_file.o] Error code 1

make[1]: stopped making "all" in /usr/ports/graphics/drm-61-kmod/work/drm-kmod-drm_v6.1.128_9/dmabuf
--- dma-fence.o ---
*** [dma-fence.o] Error code 1

make[1]: stopped making "all" in /usr/ports/graphics/drm-61-kmod/work/drm-kmod-drm_v6.1.128_9/dmabuf
--- dma-resv.o ---
*** [dma-resv.o] Error code 1

make[1]: stopped making "all" in /usr/ports/graphics/drm-61-kmod/work/drm-kmod-drm_v6.1.128_9/dmabuf
--- dma-buf.o ---
1 error generated.
*** [dma-buf.o] Error code 1

make[1]: stopped making "all" in /usr/ports/graphics/drm-61-kmod/work/drm-kmod-drm_v6.1.128_9/dmabuf
make[1]: 8 errors

make[1]: stopped making "all" in /usr/ports/graphics/drm-61-kmod/work/drm-kmod-drm_v6.1.128_9/dmabuf

make: stopped making "all" in /usr/ports/graphics/drm-61-kmod/work/drm-kmod-drm_v6.1.128_9
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make: stopped making "all" in /usr/ports/graphics/drm-61-kmod

I'm missing the file /usr/src/sys/compat/linuxkpi/common/include/linux/compiler_types.h.
This is system source. It's also part of several ports. Drm-61-kmod has no dependencies. Do I need a special addition to the system source? Never heard of it. The system that runs the make command is made of a 15.0 src.tar.gz and nothing else. The build happens in a chroot dir with all required files and devices accessible. This problem appeared after a portstree update.

Make flavor: skylake
Loaded kernel modules: linux, dmabuf, drm, ttm, i915kms. I think only linux is required to complete the build.
The make happens without the skylake hardware, on a Ryzen 7 3800X system. This shouldn't be a problem as far as I know.
The file compiler.h exists on this location but using that leads to deep pointer errors, so that's not supposed be done.
 
Your ports tree is latest (aka main) branch older than commit 298bede9dc94, right?

Actually, your issue was fixed at commit 775a541a95fb but if you stay here, you would be bitten by another bug fixed by following commit 298bede9dc94, so you need to be at this commit or later.

This is a known and fixed issue. See PR 294870, PR 294878 and PR 294914 for details.

It's the freebsd.org ftp ports archive from about 4 days ago. Do I need a more recent 1? (Never really cared about following bug reports. That takes too much time without result for solo system release maintainers)
 
It's the freebsd.org ftp ports archive from about 4 days ago. Do I need a more recent 1? (Never really cared about following bug reports. That takes too much time without result for solo system release maintainers)
Visited ftp.freebsd.org/ports/ports/ and see it currently has tarballs dated 2026-May-16 01:00.
screenshot_2026-05-17_ftp_freebsd_org.png

And I'm not sure how often it's updated, thus, don't know yours is new enough. But the latest one included the fix (downloaded and see the patch is fixed / added or not).
 
It's a few weeks off. I just figured out gitup ports. Trying with up-to-date portstree. Still, I wonder how a "official" portstree can refer to non-existing system header files. They did a build before publication, right? Did the kmod port developer miss changed base source filenames in the port source?
 
It's a few weeks off. I just figured out gitup ports. Trying with up-to-date portstree. Still, I wonder how a "official" portstree can refer to non-existing system header files. They did a build before publication, right?
My understanding is that the tests are done on main (aka CURRENT) branch of base only.

Don't forget that maintainers / developers / committers are basically volunteers (with quite limited exceptions) and usually don't have all combinations of branches, architectures and dGPUs (and all other hardwares!) in hand.

In my case (as one of the group maintainers of NVIDIA GPU driver ports), what I can (and doing) test is to build / package for all to-be-updated ports on stable/15, amd64 (and main, amd64 if I have sufficient time to do) and install / run on stable/15, amd64 with Intel Core i9-12900H and NVIDIA RTX A400 for below:
  • x11/nvidia-kmod-devel
  • x11/nvidia-driver-devel
  • graphics/nvidia-drm-66-kmod-devel
  • graphics/nvidia-drm-kmod-devel
  • x11/linux-nvidia-libs-devel
  • x11/nvidia-settings
  • x11/nvidia-xconfig
For updates only for non-devel Production Branch (PB) of drivers, testing by overriding versions. But testing legacy branches other than -580 is impossible for me.

Ports having hundreds (or more) of dependants (that depends on the to-be-updated port) and infrastructural changes (i.e., modifying anything under /usr/ports/Mk/) are required to proceed exp-run before commit, but the resource for it is limited and impossible to do for all updates.
 
  • Like
Reactions: MG
It seems there was a period that drm-61-kmod didn't refer to the correct FreeBSD 15 linuxkpi compat layer source files without the developer(s) knowing it. Can't expect them to test it on any OS major kernel upgrade.
 
Back
Top