Re: [PATCH v2] kbuild: expand inlining hints with -fdiagnostics-show-inlining-chain

From: Kees Cook

Date: Tue Mar 31 2026 - 01:27:12 EST


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 <justinstitt@xxxxxxxxxx>

Thanks!

Reviewed-by: Kees Cook <kees@xxxxxxxxxx>

--
Kees Cook