lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aXDBxHyvrFK2XrMN@derry.ads.avm.de>
Date: Wed, 21 Jan 2026 13:08:36 +0100
From: Nicolas Schier <nsc@...nel.org>
To: Nathan Chancellor <nathan@...nel.org>
Cc: Thomas Weißschuh <linux@...ssschuh.net>,
	Nick Desaulniers <nick.desaulniers+lkml@...il.com>,
	Bill Wendling <morbo@...gle.com>,
	Justin Stitt <justinstitt@...gle.com>, linux-kbuild@...r.kernel.org,
	linux-kernel@...r.kernel.org, llvm@...ts.linux.dev
Subject: Re: [PATCH] kbuild: Reject unexpected values for LLVM=

On Mon, Jan 12, 2026 at 04:16:24PM -0700, Nathan Chancellor wrote:
> On Mon, Jan 12, 2026 at 07:43:52AM +0100, Thomas Weißschuh wrote:
> > 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.
> 
> Yeah, I do not think falling back to the system toolchain is great here.
> This would also catch misuse of LLVM=0, since that is treated as LLVM=1,
> rather than reverting to GCC + binutils.
> 
> > 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=)
> 
> If having a hard error is untenable (I am not sure that it is), we could
> just warn. Pointing to Documentation/kbuild/llvm.rst might be worthwhile
> in the message as well.

I second to have a hard error here with the documentation pointer to
prevent building with an unexpected toolchain, and as there is also no
fallback for gcc toolchains.

Kind regards,
Nicolas

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ