* [PATCH] rust: Add -fdiagnostics-show-context to bindgen_skip_c_flags
@ 2025-12-17 15:00 Siddhesh Poyarekar
2025-12-17 20:46 ` Alice Ryhl
2025-12-17 22:40 ` [PATCH v2] " Siddhesh Poyarekar
0 siblings, 2 replies; 8+ messages in thread
From: Siddhesh Poyarekar @ 2025-12-17 15:00 UTC (permalink / raw)
To: rust-for-linux; +Cc: Kees Cook, Miguel Ojeda, Boqun Feng, Gary Guo
This got added with:
7454048db27d6 ("kbuild: Enable GCC diagnostic context for value-tracking warnings")
but clang does not have this option, so avoid passing it to bindgen.
Signed-off-by: Siddhesh Poyarekar <siddhesh@gotplt.org>
---
rust/Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/rust/Makefile b/rust/Makefile
index 5d357dce1704..4dcc2eff51cb 100644
--- a/rust/Makefile
+++ b/rust/Makefile
@@ -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`.
--
2.52.0
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [PATCH] rust: Add -fdiagnostics-show-context to bindgen_skip_c_flags 2025-12-17 15:00 [PATCH] rust: Add -fdiagnostics-show-context to bindgen_skip_c_flags Siddhesh Poyarekar @ 2025-12-17 20:46 ` Alice Ryhl 2025-12-17 22:41 ` Siddhesh Poyarekar 2025-12-17 22:40 ` [PATCH v2] " Siddhesh Poyarekar 1 sibling, 1 reply; 8+ messages in thread From: Alice Ryhl @ 2025-12-17 20:46 UTC (permalink / raw) To: Siddhesh Poyarekar Cc: rust-for-linux, Kees Cook, Miguel Ojeda, Boqun Feng, Gary Guo On Wed, Dec 17, 2025 at 10:00:10AM -0500, Siddhesh Poyarekar wrote: > This got added with: > > 7454048db27d6 ("kbuild: Enable GCC diagnostic context for value-tracking warnings") > > but clang does not have this option, so avoid passing it to bindgen. > > Signed-off-by: Siddhesh Poyarekar <siddhesh@gotplt.org> Seems like this should have a fixes tag for the offending commit, and cc stable? Alice > rust/Makefile | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/rust/Makefile b/rust/Makefile > index 5d357dce1704..4dcc2eff51cb 100644 > --- a/rust/Makefile > +++ b/rust/Makefile > @@ -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`. > -- > 2.52.0 > ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] rust: Add -fdiagnostics-show-context to bindgen_skip_c_flags 2025-12-17 20:46 ` Alice Ryhl @ 2025-12-17 22:41 ` Siddhesh Poyarekar 0 siblings, 0 replies; 8+ messages in thread From: Siddhesh Poyarekar @ 2025-12-17 22:41 UTC (permalink / raw) To: Alice Ryhl; +Cc: rust-for-linux, Kees Cook, Miguel Ojeda, Boqun Feng, Gary Guo On 2025-12-17 15:46, Alice Ryhl wrote: > On Wed, Dec 17, 2025 at 10:00:10AM -0500, Siddhesh Poyarekar wrote: >> This got added with: >> >> 7454048db27d6 ("kbuild: Enable GCC diagnostic context for value-tracking warnings") >> >> but clang does not have this option, so avoid passing it to bindgen. >> >> Signed-off-by: Siddhesh Poyarekar <siddhesh@gotplt.org> > > Seems like this should have a fixes tag for the offending commit, and cc > stable? > Ack, sent v2. Thanks, Sid ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2] rust: Add -fdiagnostics-show-context to bindgen_skip_c_flags 2025-12-17 15:00 [PATCH] rust: Add -fdiagnostics-show-context to bindgen_skip_c_flags Siddhesh Poyarekar 2025-12-17 20:46 ` Alice Ryhl @ 2025-12-17 22:40 ` Siddhesh Poyarekar 2026-01-04 20:53 ` Miguel Ojeda 2026-01-06 20:01 ` Miguel Ojeda 1 sibling, 2 replies; 8+ messages in thread From: Siddhesh Poyarekar @ 2025-12-17 22:40 UTC (permalink / raw) To: rust-for-linux Cc: Kees Cook, Alice Ryhl, Miguel Ojeda, Boqun Feng, Gary Guo, stable This got added with: 7454048db27d6 ("kbuild: Enable GCC diagnostic context for value-tracking warnings") but clang does not have this option, so avoid passing it to bindgen. Cc: stable@vger.kernel.org Fixes: 7454048db27d6 ("kbuild: Enable GCC diagnostic context for value-tracking warnings") Signed-off-by: Siddhesh Poyarekar <siddhesh@gotplt.org> --- rust/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/rust/Makefile b/rust/Makefile index 5d357dce1704..4dcc2eff51cb 100644 --- a/rust/Makefile +++ b/rust/Makefile @@ -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`. -- 2.52.0 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v2] rust: Add -fdiagnostics-show-context to bindgen_skip_c_flags 2025-12-17 22:40 ` [PATCH v2] " Siddhesh Poyarekar @ 2026-01-04 20:53 ` Miguel Ojeda 2026-01-05 10:58 ` Siddhesh Poyarekar 2026-01-05 23:03 ` Nathan Chancellor 2026-01-06 20:01 ` Miguel Ojeda 1 sibling, 2 replies; 8+ messages in thread From: Miguel Ojeda @ 2026-01-04 20:53 UTC (permalink / raw) To: Siddhesh Poyarekar, Nathan Chancellor, Nicolas Schier, Nick Desaulniers, Bill Wendling, Justin Stitt Cc: rust-for-linux, Kees Cook, Alice Ryhl, Miguel Ojeda, Boqun Feng, Gary Guo, stable, Linux Kbuild mailing list, clang-built-linux On Wed, Dec 17, 2025 at 11:41 PM Siddhesh Poyarekar <siddhesh@gotplt.org> wrote: > > but clang does not have this option, so avoid passing it to bindgen. This looks indeed correct, although it is not yet in a released GCC (testing quickly in Compiler Explorer, GCC 15.2 doesn't have it, but GCC trunk has). I will apply it -- Cc'ing ClangBuiltLinux and Kbuild so that they are aware. Thanks! Cheers, Miguel ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2] rust: Add -fdiagnostics-show-context to bindgen_skip_c_flags 2026-01-04 20:53 ` Miguel Ojeda @ 2026-01-05 10:58 ` Siddhesh Poyarekar 2026-01-05 23:03 ` Nathan Chancellor 1 sibling, 0 replies; 8+ messages in thread From: Siddhesh Poyarekar @ 2026-01-05 10:58 UTC (permalink / raw) To: Miguel Ojeda, Nathan Chancellor, Nicolas Schier, Nick Desaulniers, Bill Wendling, Justin Stitt Cc: rust-for-linux, Kees Cook, Alice Ryhl, Miguel Ojeda, Boqun Feng, Gary Guo, stable, Linux Kbuild mailing list, clang-built-linux On 2026-01-04 15:53, Miguel Ojeda wrote: > On Wed, Dec 17, 2025 at 11:41 PM Siddhesh Poyarekar <siddhesh@gotplt.org> wrote: >> >> but clang does not have this option, so avoid passing it to bindgen. > > This looks indeed correct, although it is not yet in a released GCC > (testing quickly in Compiler Explorer, GCC 15.2 doesn't have it, but > GCC trunk has). Yes, sorry I didn't mention that in my commit message; it's mentioned in Kees' commit message (7454048db27d6). > I will apply it -- Cc'ing ClangBuiltLinux and Kbuild so that they are aware. Thank you! Sid ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2] rust: Add -fdiagnostics-show-context to bindgen_skip_c_flags 2026-01-04 20:53 ` Miguel Ojeda 2026-01-05 10:58 ` Siddhesh Poyarekar @ 2026-01-05 23:03 ` Nathan Chancellor 1 sibling, 0 replies; 8+ messages in thread From: Nathan Chancellor @ 2026-01-05 23:03 UTC (permalink / raw) To: Miguel Ojeda Cc: Siddhesh Poyarekar, Nicolas Schier, Nick Desaulniers, Bill Wendling, Justin Stitt, rust-for-linux, Kees Cook, Alice Ryhl, Miguel Ojeda, Boqun Feng, Gary Guo, stable, Linux Kbuild mailing list, clang-built-linux On Sun, Jan 04, 2026 at 09:53:25PM +0100, Miguel Ojeda wrote: > On Wed, Dec 17, 2025 at 11:41 PM Siddhesh Poyarekar <siddhesh@gotplt.org> wrote: > > > > but clang does not have this option, so avoid passing it to bindgen. > > This looks indeed correct, although it is not yet in a released GCC > (testing quickly in Compiler Explorer, GCC 15.2 doesn't have it, but > GCC trunk has). > > I will apply it -- Cc'ing ClangBuiltLinux and Kbuild so that they are aware. 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 will say if this makes 6.19, the stable tag is not necessary since 7454048db27d6 landed in 6.19-rc1 and I would not expect it to get backported (but even if it did via AUTOSEL or something, the Fixes tag should ensure it gets included). Cheers, Nathan ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2] rust: Add -fdiagnostics-show-context to bindgen_skip_c_flags 2025-12-17 22:40 ` [PATCH v2] " Siddhesh Poyarekar 2026-01-04 20:53 ` Miguel Ojeda @ 2026-01-06 20:01 ` Miguel Ojeda 1 sibling, 0 replies; 8+ messages in thread From: Miguel Ojeda @ 2026-01-06 20:01 UTC (permalink / raw) To: Siddhesh Poyarekar Cc: rust-for-linux, Kees Cook, Alice Ryhl, Miguel Ojeda, Boqun Feng, Gary Guo, stable On Wed, Dec 17, 2025 at 11:41 PM Siddhesh Poyarekar <siddhesh@gotplt.org> wrote: > > This got added with: > > 7454048db27d6 ("kbuild: Enable GCC diagnostic context for value-tracking warnings") > > but clang does not have this option, so avoid passing it to bindgen. > > Cc: stable@vger.kernel.org > Fixes: 7454048db27d6 ("kbuild: Enable GCC diagnostic context for value-tracking warnings") > Signed-off-by: Siddhesh Poyarekar <siddhesh@gotplt.org> Applied to `rust-fixes` -- thanks everyone! [ 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 ] [ Removed Cc: stable. Added title prefix. - Miguel ] Cheers, Miguel ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2026-01-06 20:01 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2025-12-17 15:00 [PATCH] rust: Add -fdiagnostics-show-context to bindgen_skip_c_flags Siddhesh Poyarekar 2025-12-17 20:46 ` Alice Ryhl 2025-12-17 22:41 ` Siddhesh Poyarekar 2025-12-17 22:40 ` [PATCH v2] " Siddhesh Poyarekar 2026-01-04 20:53 ` Miguel Ojeda 2026-01-05 10:58 ` Siddhesh Poyarekar 2026-01-05 23:03 ` Nathan Chancellor 2026-01-06 20:01 ` Miguel Ojeda
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox