Re: [PATCH] rust: Disallow BTF generation with Rust + LTO

Tamir Duberstein
2025-01-09T15:50:27Z

On Thu, Jan 9, 2025 at 10:47 AM Arnaldo Carvalho de Melo
<acme@kernel.org> wrote:
>
> I was thinking about it after reading this thread yesterday, i.e. we
> could encode constructs from Rust that can be represented in BTF and
> skip the ones that can't, pruning types that depend on non BTF
> representable types, etc.

Yep, this is what bpf-linker does, along with some other things[0]. I
highly recommend reading the code I linked to avoid re-discovering
these things.

[0] https://github.com/aya-rs/bpf-linker/commit/1007ec7fed03562eb7d08f3e7521094a7e698b95