From b7bc3a770db31028bc8276df75aec80fee105e8f Mon Sep 17 00:00:00 2001 From: Igor Velkov <325961+iav@users.noreply.github.com> Date: Wed, 28 Jan 2026 23:49:56 +0200 Subject: [PATCH] clang: enable colored diagnostic output for kernel compilation When building kernels with KERNEL_COMPILER=clang, compiler warnings were displayed without color despite -fdiagnostics-color=always being set in KCFLAGS. This GCC-native flag is not reliably honored by clang when invoked through ccache and the kernel build system with LLVM=1. Add -fcolor-diagnostics (clang's native flag) to the clang-specific extra_warnings to ensure colored warning output. Co-Authored-By: Claude Opus 4.5 --- lib/functions/compilation/kernel-make.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/functions/compilation/kernel-make.sh b/lib/functions/compilation/kernel-make.sh index 6063d58a67..5f0ca10d2b 100644 --- a/lib/functions/compilation/kernel-make.sh +++ b/lib/functions/compilation/kernel-make.sh @@ -44,7 +44,7 @@ function run_kernel_make_internal() { # Do NOT add -Wno-error=unknown-warning-option here - it breaks cc-option detection # in kernel Makefiles (btrfs, drm, coresight) causing GCC-specific flags to be # incorrectly added when building with clang - extra_warnings="-Wno-error=unused-command-line-argument" + extra_warnings="-fcolor-diagnostics -Wno-error=unused-command-line-argument" else cc_name="CROSS_COMPILE" extra_warnings=""