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

From: Tamir Duberstein
Date: Thu Jan 09 2025 - 09:56:28 EST


Cc: Alessandro Decina <alessandro.d@xxxxxxxxx>
Cc: Michal Rostecki <vadorovsky@xxxxxxxxxxxxxx>
Cc: Dave Tucker <dave@xxxxxxxxxxxxx>

> > > On Thu, Jan 9, 2025 at 12:35 AM Matthew Maurer <mmaurer@xxxxxxxxxx> wrote:
> > > >
> > > > The kernel cannot currently self-parse BTF containing Rust debug
> > > > information. pahole uses the language of the CU to determine whether to
> > > > filter out debug information when generating the BTF.

In bpf-linker[0] we implemented "sanitization" to allow Rust DI to
produce functional BTF[1]. This is certainly outside the scope of this
change but: could pahole adopt a similar strategy rather than
employing such coarse heuristics?

[0] https://github.com/aya-rs/bpf-linker
[1] https://github.com/aya-rs/bpf-linker/blob/e4a9267b0fee69ecb2550058d3c8e5233f946ebe/src/llvm/di.rs