]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
rust: kbuild: Add -fdiagnostics-show-context to bindgen_skip_c_flags
authorSiddhesh Poyarekar <siddhesh@gotplt.org>
Wed, 17 Dec 2025 22:40:50 +0000 (17:40 -0500)
committerMiguel Ojeda <ojeda@kernel.org>
Tue, 6 Jan 2026 19:51:21 +0000 (20:51 +0100)
This got added with:

  7454048db27d ("kbuild: Enable GCC diagnostic context for value-tracking warnings")

but clang does not have this option, so avoid passing it to bindgen.

[ Details about what the option does are in the commit above. Nathan
  also expands on this:

    Right, this does look correct, as this option is specific to GCC
    for the purpose of exposing more information from GCC internals to
    the user for understanding diagnostics better.

  I checked that in Compiler Explorer GCC 15.2 doesn't have it, but GCC
  trunk indeed has. - Miguel ]

Fixes: 7454048db27d ("kbuild: Enable GCC diagnostic context for value-tracking warnings")
Signed-off-by: Siddhesh Poyarekar <siddhesh@gotplt.org>
Link: https://patch.msgid.link/20251217224050.1186896-1-siddhesh@gotplt.org
[ Removed Cc: stable. Added title prefix. - Miguel ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
rust/Makefile

index 5d357dce1704d15e43effc528be8f5a4d74d3d8d..4dcc2eff51cb26984d7384f2d61224fd4b0dafd7 100644 (file)
@@ -383,6 +383,7 @@ bindgen_skip_c_flags := -mno-fp-ret-in-387 -mpreferred-stack-boundary=% \
        -fno-inline-functions-called-once -fsanitize=bounds-strict \
        -fstrict-flex-arrays=% -fmin-function-alignment=% \
        -fzero-init-padding-bits=% -mno-fdpic \
+       -fdiagnostics-show-context -fdiagnostics-show-context=% \
        --param=% --param asan-% -fno-isolate-erroneous-paths-dereference
 
 # Derived from `scripts/Makefile.clang`.