Re: [PATCH] rust: kbuild: skip gendwarfksyms in `bindings.o` for Rust >= 1.91.0
From: Sami Tolvanen
Date: Fri Nov 07 2025 - 21:50:13 EST
On Fri, Nov 7, 2025 at 6:31 PM Miguel Ojeda
<miguel.ojeda.sandonis@xxxxxxxxx> wrote:
>
> On Sat, Nov 8, 2025 at 2:44 AM Miguel Ojeda <ojeda@xxxxxxxxxx> wrote:
> >
> > note that `CLIPPY=1` does not reproduce it
>
> And obviously this means we have to special case this one too...
>
> $(obj)/bindings.o: private skip_gendwarfksyms := $(if $(call
> rustc-min-version,109100),$(if $(KBUILD_CLIPPY),,1))
>
> There may be other cases that disable the optimization or similar,
> plus we may have other small crates in the future that could also
> suffer from this, so it may be best to simply force to generate the
> DWARF with a dummy symbol from that crate for the time being as the
> fix:
>
> #[expect(unused)]
> static DUMMY_SYMBOL_FOR_DWARF_DEBUGINFO_GENERATION_FOR_GENDWARFKSYMS:
> () = ();
This looks reasonable to me, and indeed seems to fix the problem.
> And then later do something in the `cmd` command itself or teaching
> `genkallksyms` to auto-skip in cases like this.
>
> What do you think?
Like I mentioned in the other thread, we ideally wouldn't silently
skip symbol versioning because the exported symbols won't be usable in
this case.
Sami