Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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@weissschuh.net>
Reviewed-by: Nicolas Schier <nsc@kernel.org>
Tested-by: Nicolas Schier <nsc@kernel.org>
Link: https://patch.msgid.link/20260121-kbuild-llvm-arg-v2-1-5e4d8dca4ad8@weissschuh.net
Signed-off-by: Nathan Chancellor <nathan@kernel.org>

authored by

Thomas Weißschuh and committed by
Nathan Chancellor
502678b8 301a02d4

+2
+2
Makefile
··· 447 447 LLVM_PREFIX := $(LLVM) 448 448 else ifneq ($(filter -%,$(LLVM)),) 449 449 LLVM_SUFFIX := $(LLVM) 450 + else ifneq ($(LLVM),1) 451 + $(error Invalid value for LLVM, see Documentation/kbuild/llvm.rst) 450 452 endif 451 453 452 454 HOSTCC = $(LLVM_PREFIX)clang$(LLVM_SUFFIX)