Rust for Linux List
 help / color / mirror / Atom feed
* [PATCH] Add -fzero-init-padding-bits to bindgen_skip_cflags
@ 2025-01-29 21:50 Justin M. Forbes
  2025-02-05 23:18 ` Miguel Ojeda
  2025-02-06 15:45 ` Kees Cook
  0 siblings, 2 replies; 6+ messages in thread
From: Justin M. Forbes @ 2025-01-29 21:50 UTC (permalink / raw)
  To: Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
	Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
	Trevor Gross, rust-for-linux, linux-kernel
  Cc: Justin M. Forbes

This seems to break the build when building with gcc15.

Unable to generate bindings: ClangDiagnostic("error: unknown argument: '-fzero-init-padding-bits=all'\n")

Signed-off-by: Justin M. Forbes <jforbes@fedoraproject.org>
---
 rust/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/rust/Makefile b/rust/Makefile
index 71a05a3c895a..3c3da7faebb3 100644
--- a/rust/Makefile
+++ b/rust/Makefile
@@ -240,6 +240,7 @@ bindgen_skip_c_flags := -mno-fp-ret-in-387 -mpreferred-stack-boundary=% \
 	-fzero-call-used-regs=% -fno-stack-clash-protection \
 	-fno-inline-functions-called-once -fsanitize=bounds-strict \
 	-fstrict-flex-arrays=% -fmin-function-alignment=% \
+	-fzero-init-padding-bits=% \
 	--param=% --param asan-%
 
 # Derived from `scripts/Makefile.clang`.
-- 
2.47.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] Add -fzero-init-padding-bits to bindgen_skip_cflags
  2025-01-29 21:50 [PATCH] Add -fzero-init-padding-bits to bindgen_skip_cflags Justin M. Forbes
@ 2025-02-05 23:18 ` Miguel Ojeda
  2025-02-06 15:45 ` Kees Cook
  1 sibling, 0 replies; 6+ messages in thread
From: Miguel Ojeda @ 2025-02-05 23:18 UTC (permalink / raw)
  To: Justin M. Forbes
  Cc: Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
	Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
	Trevor Gross, rust-for-linux, linux-kernel

On Wed, Jan 29, 2025 at 10:50 PM Justin M. Forbes
<jforbes@fedoraproject.org> wrote:
>
> This seems to break the build when building with gcc15.
>
> Unable to generate bindings: ClangDiagnostic("error: unknown argument: '-fzero-init-padding-bits=all'\n")
>
> Signed-off-by: Justin M. Forbes <jforbes@fedoraproject.org>

Applied to `rust-fixes` -- thanks!

Fixes: dce4aab8441d ("kbuild: Use -fzero-init-padding-bits=all")

[ Slightly reworded commit. - Miguel ]

Cheers,
Miguel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Add -fzero-init-padding-bits to bindgen_skip_cflags
  2025-01-29 21:50 [PATCH] Add -fzero-init-padding-bits to bindgen_skip_cflags Justin M. Forbes
  2025-02-05 23:18 ` Miguel Ojeda
@ 2025-02-06 15:45 ` Kees Cook
  2025-02-06 15:55   ` Miguel Ojeda
  1 sibling, 1 reply; 6+ messages in thread
From: Kees Cook @ 2025-02-06 15:45 UTC (permalink / raw)
  To: Justin M. Forbes
  Cc: Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
	Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
	Trevor Gross, rust-for-linux, linux-kernel

On Wed, Jan 29, 2025 at 02:50:02PM -0700, Justin M. Forbes wrote:
> This seems to break the build when building with gcc15.
> 
> Unable to generate bindings: ClangDiagnostic("error: unknown argument: '-fzero-init-padding-bits=all'\n")
> 
> Signed-off-by: Justin M. Forbes <jforbes@fedoraproject.org>

Thanks for this! I keep forgetting to keep flags in sync. I wonder if
there is a way to automate some kind of warning for this (even when
CONFIG_RUST=n)?

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

Miguel, I see you took this already -- is it planned to land for -rc2?

Thanks!

-Kees

-- 
Kees Cook

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Add -fzero-init-padding-bits to bindgen_skip_cflags
  2025-02-06 15:45 ` Kees Cook
@ 2025-02-06 15:55   ` Miguel Ojeda
  2025-02-06 18:48     ` Kees Cook
  0 siblings, 1 reply; 6+ messages in thread
From: Miguel Ojeda @ 2025-02-06 15:55 UTC (permalink / raw)
  To: Kees Cook
  Cc: Justin M. Forbes, Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
	Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
	Trevor Gross, rust-for-linux, linux-kernel

On Thu, Feb 6, 2025 at 4:45 PM Kees Cook <kees@kernel.org> wrote:
>
> Thanks for this! I keep forgetting to keep flags in sync. I wonder if
> there is a way to automate some kind of warning for this (even when
> CONFIG_RUST=n)?

You mean at editing time?

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

Thanks! I will add it.

> Miguel, I see you took this already -- is it planned to land for -rc2?

Possibly, depends on how it goes; otherwise -rc3 -- why?

Cheers,
Miguel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Add -fzero-init-padding-bits to bindgen_skip_cflags
  2025-02-06 15:55   ` Miguel Ojeda
@ 2025-02-06 18:48     ` Kees Cook
  2025-02-06 18:58       ` Miguel Ojeda
  0 siblings, 1 reply; 6+ messages in thread
From: Kees Cook @ 2025-02-06 18:48 UTC (permalink / raw)
  To: Miguel Ojeda
  Cc: Justin M. Forbes, Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
	Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
	Trevor Gross, rust-for-linux, linux-kernel

On Thu, Feb 06, 2025 at 04:55:21PM +0100, Miguel Ojeda wrote:
> On Thu, Feb 6, 2025 at 4:45 PM Kees Cook <kees@kernel.org> wrote:
> >
> > Thanks for this! I keep forgetting to keep flags in sync. I wonder if
> > there is a way to automate some kind of warning for this (even when
> > CONFIG_RUST=n)?
> 
> You mean at editing time?
> 
> > Reviewed-by: Kees Cook <kees@kernel.org>
> 
> Thanks! I will add it.
> 
> > Miguel, I see you took this already -- is it planned to land for -rc2?
> 
> Possibly, depends on how it goes; otherwise -rc3 -- why?

Many subsystems base their trees on -rc2, so if it missed rc2, Rust builds
in a given subsystem will be broken under gcc 15 (but fine in -next).
But perhaps that's enough of a corner case that it doesn't matter? I
have other fixes I'm sending to Linus tomorrow, if you'd rather it go in
sooner? I'm fine either way. :)

-- 
Kees Cook

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Add -fzero-init-padding-bits to bindgen_skip_cflags
  2025-02-06 18:48     ` Kees Cook
@ 2025-02-06 18:58       ` Miguel Ojeda
  0 siblings, 0 replies; 6+ messages in thread
From: Miguel Ojeda @ 2025-02-06 18:58 UTC (permalink / raw)
  To: Kees Cook
  Cc: Justin M. Forbes, Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
	Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
	Trevor Gross, rust-for-linux, linux-kernel

On Thu, Feb 6, 2025 at 7:48 PM Kees Cook <kees@kernel.org> wrote:
>
> Many subsystems base their trees on -rc2, so if it missed rc2, Rust builds
> in a given subsystem will be broken under gcc 15 (but fine in -next).
> But perhaps that's enough of a corner case that it doesn't matter? I
> have other fixes I'm sending to Linus tomorrow, if you'd rather it go in
> sooner? I'm fine either way. :)

Ah, I see.

The Rust-enabled-mixed-GCC/Clang builds are best-effort at the moment
(this should not affect the normal Clang ones) and GCC 15 is still at
least a couple months away as far as I understand, right?

In any case, I can send what I have for -rc2, since I think I will
have others for -rc3 anyway.

Cheers,
Miguel

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-02-06 18:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-29 21:50 [PATCH] Add -fzero-init-padding-bits to bindgen_skip_cflags Justin M. Forbes
2025-02-05 23:18 ` Miguel Ojeda
2025-02-06 15:45 ` Kees Cook
2025-02-06 15:55   ` Miguel Ojeda
2025-02-06 18:48     ` Kees Cook
2025-02-06 18:58       ` Miguel Ojeda

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox