From: Thomas Weißschuh Date: Wed, 21 Jan 2026 13:42:39 +0000 (+0100) Subject: kbuild: Reject unexpected values for LLVM= X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=502678b88cb3b01908315bc2ba91557f4d2cf49a;p=thirdparty%2Fkernel%2Flinux.git kbuild: Reject unexpected values for LLVM= 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 --- 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)