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 151A83E1D15; Tue, 31 Mar 2026 15:55:35 +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=1774972536; cv=none; b=uzRH6/Zsgy2765itq3WzhZB6ZgpfNW3Se1vr7vfwepu16w8yCIbYEk3NEIN1v5tN/Cjc+5fOhVL6OENAkZlE/1AazhZVojpRuWmOIsKzFGowTzlUx9p1u3JpbdSmTghMzNw91J3uJep+rULPkMtEIlrrCp0ALdis5nRRkYmEDtA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774972536; c=relaxed/simple; bh=YAVCqs+iKM3va+HanHaYLnT7coslqWkOv6oKzf+5HG8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=FySc/YNtbDIRJyA27aTrBcIRjjBePdkQ6vyTIIvFspeX1bUZlwC8Go28APaJKz/XX3zwo6b/FQQ01tDraNlXSuPb8kX4uL9l3OZpMYl64EBF1dGL7+IwuRt0Zpxe/IzT2/AdqybGof1ipbULTs9qtKXmdUa9dvFSn952pAtT/Bw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=E86X1NAi; 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="E86X1NAi" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 05042C19423; Tue, 31 Mar 2026 15:55:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1774972535; bh=YAVCqs+iKM3va+HanHaYLnT7coslqWkOv6oKzf+5HG8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=E86X1NAifKBcMbNzdSCMD+R/Ghrw22Vz2KNxf2jHlvnOPvGCYDvGtYTaqnefDWqy/ 1ecFvlznfWzETGtepJJj/MEqgw2OcV6sF2x8SlrO+EZC660E99ZT9Yh3hDRtQyw5lD MOI4srx70Hu2KGwD44yeExVARPkInyJlf3b08ODqLZIq3fIuXnOWjVaD0Qoe9bBuu0 RZvNheA96OtCUWk1wjHvXzS7JC4ik6l4no0TrMQ27shY3MQQnizY9M4l9MmM1AGSif B7VNb7CS6O6510kfpOuSATc8LFdd99lV8nYEt9M/6QjFCAekbTyna+PaqIluEWcFlj cNxlpXx89GBjQ== Date: Tue, 31 Mar 2026 17:55:31 +0200 From: Nathan Chancellor To: Justin Stitt Cc: Nicolas Schier , Nick Desaulniers , Bill Wendling , Kees Cook , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: Re: [PATCH v2] kbuild: expand inlining hints with -fdiagnostics-show-inlining-chain Message-ID: <20260331155531.GA2004441@ax162> References: <20260330-kbuild-show-inlining-v2-1-c0c481a4ea7b@google.com> Precedence: bulk X-Mailing-List: llvm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260330-kbuild-show-inlining-v2-1-c0c481a4ea7b@google.com> On Mon, Mar 30, 2026 at 05:09:08PM -0700, Justin Stitt wrote: > Clang recently added -fdiagnostics-show-inlining-chain [1] to improve > the visibility of inlining chains in diagnostics. This is particularly > useful for CONFIG_FORTIFY_SOURCE where detections can happen deep in > inlined functions. > > Add this flag to KBUILD_CFLAGS under a cc-option so it is enabled if the > compiler supports it. Note that GCC does not have an equivalent flag as > it supports a similar diagnostic structure unconditionally. > > Link: https://github.com/llvm/llvm-project/pull/174892 [1] > Link: https://github.com/ClangBuiltLinux/linux/issues/1571 > Signed-off-by: Justin Stitt Reviewed-by: Nathan Chancellor > --- > Changes in v2: > - Move to always enable option if compiler supports it (thanks Nathan, > Kees) > - Change commit title and message > - Link to v1: https://lore.kernel.org/r/20260327-kbuild-show-inlining-v1-1-730ac2cae571@google.com > --- > Makefile | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/Makefile b/Makefile > index e1279c4d5b24..4972b23fb77f 100644 > --- a/Makefile > +++ b/Makefile > @@ -973,6 +973,10 @@ KBUILD_CFLAGS += $(call cc-option, -fno-stack-clash-protection) > # Get details on warnings generated due to GCC value tracking. > KBUILD_CFLAGS += $(call cc-option, -fdiagnostics-show-context=2) > > +# Show inlining notes for __attribute__((warning/error)) call chains. > +# GCC supports this unconditionally while Clang 23+ provides a flag. > +KBUILD_CFLAGS += $(call cc-option, -fdiagnostics-show-inlining-chain) > + > # Clear used registers at func exit (to reduce data lifetime and ROP gadgets). > ifdef CONFIG_ZERO_CALL_USED_REGS > KBUILD_CFLAGS += -fzero-call-used-regs=used-gpr > > --- > base-commit: 7df48e36313029e4c0907b2023905dd7213fd678 > change-id: 20260327-kbuild-show-inlining-557d31d2293a > > Best regards, > -- > Justin Stitt > >