summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2026-01-05 01:19:34 +0100
committerDimitry Andric <dim@FreeBSD.org>2026-01-14 20:04:18 +0100
commit6ab5fcd46c68322837520afa04f91922836ad6ff (patch)
tree7b23c5cc427481ffc9a9392f35f3e659523d1f11
parent26b978c64c9d32be6e74d02873e6c2a2d0cd6565 (diff)
graphics/drm-66-kmod: fix build with clang 21
With clang 21 graphics/drm-66-kmod fails to compile, with errors similar to: In file included from /wrkdirs/usr/ports/graphics/drm-66-kmod/work/drm-kmod-drm_v6.6.25_9/drivers/gpu/drm/i915/i915_active.c:12: /wrkdirs/usr/ports/graphics/drm-66-kmod/work/drm-kmod-drm_v6.6.25_9/drivers/gpu/drm/i915/gt/intel_ring.h:63:2: error: default initialization of an object of type 'typeof (ring->size)' (aka 'const unsigned int') leaves the object uninitialized [-Werror,-Wdefault-const-init-var-unsafe] 63 | typecheck(typeof(ring->size), next); | ^ /usr/src/sys/compat/linuxkpi/common/include/linux/typecheck.h:31:9: note: expanded from macro 'typecheck' 31 | ({ type __var1; \ | ^ The thread at https://lkml.org/lkml/2025/5/6/1681 appears to imply that it is safe to suppress the new -Wdefault-const-init-var-unsafe warning. PR: 292192 Approved by: emaste (maintainer) MFH: 2026Q1 (cherry picked from commit 2b49118158d0aa7cb20d98e470ee080ee0fdc931)
-rw-r--r--graphics/drm-66-kmod/Makefile8
1 files changed, 7 insertions, 1 deletions
diff --git a/graphics/drm-66-kmod/Makefile b/graphics/drm-66-kmod/Makefile
index db1e64b0f5ea..17fcea735cd2 100644
--- a/graphics/drm-66-kmod/Makefile
+++ b/graphics/drm-66-kmod/Makefile
@@ -54,8 +54,14 @@ PLIST_SUB+= I915="@comment "
MAKE_ENV+= MAKEOBJDIRPREFIX=${WRKSRC}/obj
+.include <bsd.port.pre.mk>
+
+.if ${COMPILER_TYPE} == clang && ${COMPILER_VERSION} >= 211
+CFLAGS+= -Wno-default-const-init-var-unsafe
+.endif
+
pre-build:
${MKDIR} ${WRKSRC}/obj
(cd ${WRKSRC} ; ${SETENV} ${MAKE_ENV} ${MAKE_CMD} obj)
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>