From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 39FC0280018; Wed, 21 Jan 2026 12:19:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768997992; cv=none; b=ejjM6fYKtL5h8B5693tyOF4FnghTwglS7SvHlbR7ccy18foDoQCsSfP02GnUR5FZspjM3hlvUFBUgIUpNcAdfydS++Ssktb1CjLLsOjzACoxVSi2wfNwrt7tzphLn650pfslve7C+OeY5xMzWh4fL6erMaWR6csvSlEsG4Q0wDc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768997992; c=relaxed/simple; bh=w/i8Z8C7rk6FPxJd4MOpnsDHwSjwDb0IiSKlIhqWLc0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=L/vC0jPqpC0PrJKoHl51GYysiCBRD8lU1ROfakmg7P50Pj2JhrFlMTa7oTBe64X3y3/djKHPM46j25fX+1Ri/fLxMvH1RY3CcZ+8MhJZDCRJc/U3Og6JpMaQ0OER5qy+OR3S3PefheNpKqY1EVmZv0T3YRTyc42R7JPwFX3I0qs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=m8oQbCz7; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="m8oQbCz7" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 005ACC116D0; Wed, 21 Jan 2026 12:19:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1768997989; bh=w/i8Z8C7rk6FPxJd4MOpnsDHwSjwDb0IiSKlIhqWLc0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=m8oQbCz7ENGqGjBcJajL6ZoW5YLFQqORg+xHcbsssytdohP12BOyWoB1X3DaAvVP2 AZlxNzfHJmYOjUEPURYy1KoqjB8jJ99rM+rgrgjG2r5naABBOIvsm9AvWzAquzHoM4 G0RBzvkobzzkyZThf6/uskHPDdS61cL2r9O9OpmJnvyhIE5NOoO3ihLkcDxFQlLFSq MzzUbEajYhGVis7bXBUP/kXEhzt4Nn8OsXltbgOosb1TM63Dn+nm1O8pa3Ob1psu7D pL/QHTtQ7VUNE+HYrnHUcI9HBVlA8pZKahTIfrBxUrkh+xIspO6TFNenGNVsGikcFN oM6ziuEMySDHA== Date: Wed, 21 Jan 2026 13:08:36 +0100 From: Nicolas Schier To: Nathan Chancellor Cc: Thomas =?iso-8859-1?Q?Wei=DFschuh?= , Nick Desaulniers , Bill Wendling , Justin Stitt , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: Re: [PATCH] kbuild: Reject unexpected values for LLVM= Message-ID: Mail-Followup-To: Nathan Chancellor , Thomas =?iso-8859-1?Q?Wei=DFschuh?= , Nick Desaulniers , Bill Wendling , Justin Stitt , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev References: <20260112-kbuild-llvm-arg-v1-1-8e9bbdae996f@weissschuh.net> <20260112231624.GA2272167@ax162> Precedence: bulk X-Mailing-List: llvm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20260112231624.GA2272167@ax162> 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 > > --- > > 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