Re: [PATCH v4 00/11] rust: bindings: Auto-generate inline static functions

From: Alistair Francis
Date: Thu Dec 19 2024 - 21:55:52 EST


On Wed, Dec 18, 2024 at 7:45 PM Andreas Hindborg <a.hindborg@xxxxxxxxxx> wrote:
>
> "Alistair Francis" <alistair23@xxxxxxxxx> writes:
>
> > On Wed, Dec 4, 2024 at 11:14 PM Andreas Hindborg <a.hindborg@xxxxxxxxxx> wrote:
> >>
> >>
> >> Hi Alistair,
> >>
> >> "Alistair Francis" <alistair@xxxxxxxxxxxxx> writes:
> >> >
> >> > This series adds support for bindgen generating wrappers for inline statics and
> >> > then converts the existing helper functions to this new method. This doesn't
> >> > work for C macros, so we can't reamove all of the helper functions, but we
> >> > can remove most.
> >>
> >> Are you aware of the helper LTO patches by Gary [1]? Can you tell if
> >
> > I was not, but that's exciting to see
> >
> >> this series will compose with the LTO patches?
> >
> > I think it will still work, although it might take some extra effort.
> >
> > I assume my series isn't going to be accepted though, so I'm not going
> > to try and get the LTO series to work on top of it. It's a lot of work
> > to rebase this series as every new binding causes a conflict and it
> > seems to have stalled
>
> I would assume that it _will_ be merged in some form. Why not? It's just
> a matter of getting it reviewed and making sure that it is going to work
> with the LTO inlining.

Ah, I just haven't heard a lot of feedback, which seems like there
isn't interest in this.

I tried to apply the LTO patches, but I do see build failures, I get
errors like this:

ld.lld: error: duplicate symbol: RUST_CONST_HELPER_ARCH_SLAB_MINALIGN
>>> defined at llvm-link
>>> rust/kernel.o:(RUST_CONST_HELPER_ARCH_SLAB_MINALIGN) in archive vmlinux.a
>>> defined at llvm-link
>>> drivers/b

It seems like all of the const's in rust/bindings/bindings_helper.h
are failing to link, but I'm not sure why

Alistair

>
> The less boiler plate code we have to write by hand, the better!
>
>
> Best regards,
> Andreas Hindborg
>
>
>