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

Kees Cook
2026-03-31T05:27:05Z

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@google.com>

Thanks!

Reviewed-by: Kees Cook <kees@kernel.org>

--
Kees Cook