Since commit 502678b88cb3 ("kbuild: Reject unexpected values for LLVM=")
the regular kbuild rejects unexpected values of LLVM=1 instead of
silently treating them as LLVM=1.
Align the tools build to kbuild.
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
There is no formal maintainer for this file.
IMO this change should go through kbuild.
---
tools/scripts/Makefile.include | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tools/scripts/Makefile.include b/tools/scripts/Makefile.include
index b5ecf137febc..41971a68972d 100644
--- a/tools/scripts/Makefile.include
+++ b/tools/scripts/Makefile.include
@@ -56,6 +56,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
$(call allow-override,CC,$(LLVM_PREFIX)clang$(LLVM_SUFFIX))
--
2.53.0
On Thu, Feb 26, 2026 at 10:23:58PM +0100, Thomas Weißschuh wrote:
> Since commit 502678b88cb3 ("kbuild: Reject unexpected values for LLVM=")
> the regular kbuild rejects unexpected values of LLVM=1 instead of
> silently treating them as LLVM=1.
>
> Align the tools build to kbuild.
>
> Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
>
> ---
> There is no formal maintainer for this file.
> IMO this change should go through kbuild.
Ironically I just rejected a tools/ patch going through Kbuild:
https://lore.kernel.org/20260225192505.GC2755225@ax162/
but since there is no formal maintainer, it is the same change done in
Kbuild, and the risk of fallout is much less than that change, I think
we can make an exception and take it.
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
> ---
> tools/scripts/Makefile.include | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/tools/scripts/Makefile.include b/tools/scripts/Makefile.include
> index b5ecf137febc..41971a68972d 100644
> --- a/tools/scripts/Makefile.include
> +++ b/tools/scripts/Makefile.include
> @@ -56,6 +56,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
>
> $(call allow-override,CC,$(LLVM_PREFIX)clang$(LLVM_SUFFIX))
>
> --
> 2.53.0
>
On Thu, Feb 26, 2026 at 02:45:58PM -0700, Nathan Chancellor wrote:
> On Thu, Feb 26, 2026 at 10:23:58PM +0100, Thomas Weißschuh wrote:
> > Since commit 502678b88cb3 ("kbuild: Reject unexpected values for LLVM=")
> > the regular kbuild rejects unexpected values of LLVM=1 instead of
> > silently treating them as LLVM=1.
> >
> > Align the tools build to kbuild.
> >
> > Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
> >
> > ---
> > There is no formal maintainer for this file.
> > IMO this change should go through kbuild.
>
> Ironically I just rejected a tools/ patch going through Kbuild:
>
> https://lore.kernel.org/20260225192505.GC2755225@ax162/
>
> but since there is no formal maintainer, it is the same change done in
> Kbuild, and the risk of fallout is much less than that change, I think
> we can make an exception and take it.
+1
> Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Nicolas Schier <nsc@kernel.org>
--
Nicolas
© 2016 - 2026 Red Hat, Inc.