From 502678b88cb3b01908315bc2ba91557f4d2cf49a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Thomas=20Wei=C3=9Fschuh?= Date: Wed, 21 Jan 2026 14:42:39 +0100 Subject: [PATCH] kbuild: Reject unexpected values for LLVM= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The LLVM argument is documented to accept one of three forms: * a literal '1' to use the default 'clang', * a toolchain prefix path, ending in a trailing '/', * a version suffix. All other values are silently treated as '1'. If for example the user accidentally forgets the trailing '/' of a toolchain prefix, kbuild will unexpectedly and silently fall back to the system toolchain. Instead report an error if the user specified an invalid value for LLVM. Signed-off-by: Thomas Weißschuh Reviewed-by: Nicolas Schier Tested-by: Nicolas Schier Link: https://patch.msgid.link/20260121-kbuild-llvm-arg-v2-1-5e4d8dca4ad8@weissschuh.net Signed-off-by: Nathan Chancellor --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index 362df202fb8a8..93831019c17b9 100644 --- a/Makefile +++ b/Makefile @@ -447,6 +447,8 @@ ifneq ($(filter %/,$(LLVM)),) LLVM_PREFIX := $(LLVM) else ifneq ($(filter -%,$(LLVM)),) LLVM_SUFFIX := $(LLVM) +else ifneq ($(LLVM),1) +$(error Invalid value for LLVM, see Documentation/kbuild/llvm.rst) endif HOSTCC = $(LLVM_PREFIX)clang$(LLVM_SUFFIX) -- 2.47.3