Re: [PATCH v3] rust: Kbuild: Skip -fmin-function-alignment in bindgen flags
From: Gary Guo
Date: Tue Aug 13 2024 - 13:02:41 EST
On Thu, 8 Aug 2024 17:07:51 +0200
Miguel Ojeda <miguel.ojeda.sandonis@xxxxxxxxx> wrote:
> On Wed, Aug 7, 2024 at 12:57 PM Gary Guo <gary@xxxxxxxxxxx> wrote:
> >
> > This patch itself looks fine to me, so
> >
> > Reviewed-by: Gary Guo <gary@xxxxxxxxxxx>
> >
> > We use -fmin-function-alignment for GCC and use -falign-functions for
> > clang. These options affect codegen only so it's fine to ignore them
> > for bindgen.
>
> Thanks Gary.
>
> > Although it appears to me that we currently don't set function
> > alignments for Rust codegen. Maybe that's worth considering adding?
>
> Yeah, agreed. I think currently there is no way for that in `rustc`
> (apart from `fn_align`) -- I have created an issue about it and a few
> others and linked them all at
> https://github.com/Rust-for-Linux/linux/issues/355.
I think `-Cllvm-args=-align-all-functions=foo` should work?
Best,
Gary