From b6f7264f2e7dc6b2141f817f0374d88cd679d89a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Date: Sun, 14 Jun 2026 20:05:29 +0200 Subject: [PATCH] Include from the compiler flags [FreeBSD] Like we did for , we also include from the compiler command line to replicate what is done in the Linux build system. This is required because some headers rely on the availability of the `IS_ENABLED()` macro very early, before has had a chance to be included through regular #include directives. We also preventively and conditionally include . linuxkpi doesn't have at the time of this commit. But once it does, this Makefile will be ready. The order of inclusion follows what Linux does. This fixes build errors with DRM drivers from Linux 6.13 and 6.14. Sponsored by: The FreeBSD Foundation --- compiler_flags.mk | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/compiler_flags.mk b/compiler_flags.mk index 056cb81d44c6..e31bdbca038e 100644 --- a/compiler_flags.mk +++ b/compiler_flags.mk @@ -7,6 +7,13 @@ CFLAGS+= -include ${SYSDIR}/compat/linuxkpi/common/include/linux/compiler_types.h .endif +# Other headers are always included. See the definition of `$(USERINCLUDE)` in +# the Makefile at the root of the Linux source tree. +.if exists(${SYSDIR}/compat/linuxkpi/common/include/linux/compiler-version.h) +CFLAGS+= -include ${SYSDIR}/compat/linuxkpi/common/include/linux/compiler-version.h +.endif +CFLAGS+= -include ${SYSDIR}/compat/linuxkpi/common/include/linux/kconfig.h + CWARNFLAGS+= -Wno-pointer-sign # Globally silence a new warning from Clang 21.