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

From: Tamir Duberstein
Date: Thu Jan 09 2025 - 10:50:41 EST


On Thu, Jan 9, 2025 at 10:47 AM Arnaldo Carvalho de Melo
<acme@xxxxxxxxxx> 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