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

From: Arnaldo Carvalho de Melo
Date: Thu Jan 09 2025 - 11:29:59 EST


On Thu, Jan 09, 2025 at 10:49:49AM -0500, Tamir Duberstein wrote:
> 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.

Sure, thanks for pointing it out and suggest I read it while
experimenting with having the same concept in pahole, I'll try a quick
hack and then look at it to see how close I got to what you guys came up
with :-)

- Arnaldo

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