[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20260112-kbuild-llvm-arg-v1-1-8e9bbdae996f@weissschuh.net>
Date: Mon, 12 Jan 2026 07:43:52 +0100
From: Thomas Weißschuh <linux@...ssschuh.net>
To: Nathan Chancellor <nathan@...nel.org>, Nicolas Schier <nsc@...nel.org>,
Nick Desaulniers <nick.desaulniers+lkml@...il.com>,
Bill Wendling <morbo@...gle.com>, Justin Stitt <justinstitt@...gle.com>
Cc: linux-kbuild@...r.kernel.org, linux-kernel@...r.kernel.org,
llvm@...ts.linux.dev,
Thomas Weißschuh <linux@...ssschuh.net>
Subject: [PATCH] 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 <linux@...ssschuh.net>
---
Makefile | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Makefile b/Makefile
index e404e4767944..2a085a1b6875 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=)
endif
HOSTCC = $(LLVM_PREFIX)clang$(LLVM_SUFFIX)
---
base-commit: 8f0b4cce4481fb22653697cced8d0d04027cb1e8
change-id: 20260111-kbuild-llvm-arg-c7346a4f2b3a
Best regards,
--
Thomas Weißschuh <linux@...ssschuh.net>
Powered by blists - more mailing lists