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

Tamir Duberstein
2025-01-09T14:56:14Z

Cc: Alessandro Decina <alessandro.d@gmail.com>
Cc: Michal Rostecki <vadorovsky@protonmail.com>
Cc: Dave Tucker <dave@dtucker.co.uk>

> > > On Thu, Jan 9, 2025 at 12:35 AM Matthew Maurer <mmaurer@google.com> 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