From: Sami Tolvanen samitolvanen@google.com
Starting with Rust 1.91.0 (released 2025-10-30), in upstream commit ab91a63d403b ("Ignore intrinsic calls in cross-crate-inlining cost model") [1][2], `bindings.o` stops containing DWARF debug information because the `Default` implementations contained `write_bytes()` calls which are now ignored in that cost model (note that `CLIPPY=1` does not reproduce it).
This means `gendwarfksyms` complains:
RUSTC L rust/bindings.o error: gendwarfksyms: process_module: dwarf_get_units failed: no debugging information?
There are several alternatives that would work here: conditionally skipping in the cases needed (but that is subtle and brittle), forcing DWARF generation with e.g. a dummy `static` (ugly and we may need to do it in several crates), skipping the call to the tool in the Kbuild command when there are no exports (fine) or teaching the tool to do so itself (simple and clean).
Thus do the last one: don't attempt to process files if we have no symbol versions to calculate.
[ I used the commit log of my patch linked below since it explained the root issue and expanded it a bit more to summarize the alternatives.
- Miguel ]
Cc: stable@vger.kernel.org # Needed in 6.12.y and later (Rust is pinned in older LTSs). Reported-by: Haiyue Wang haiyuewa@163.com Closes: https://lore.kernel.org/rust-for-linux/b8c1c73d-bf8b-4bf2-beb1-84ffdcd60547@... Suggested-by: Miguel Ojeda ojeda@kernel.org Link: https://lore.kernel.org/rust-for-linux/CANiq72nKC5r24VHAp9oUPR1HVPqT+=0ab9N0... Link: https://github.com/rust-lang/rust/commit/ab91a63d403b0105cacd72809cd292a7298... [1] Link: https://github.com/rust-lang/rust/pull/145910 [2] Signed-off-by: Sami Tolvanen samitolvanen@google.com Signed-off-by: Miguel Ojeda ojeda@kernel.org --- scripts/gendwarfksyms/gendwarfksyms.c | 3 ++- scripts/gendwarfksyms/gendwarfksyms.h | 2 +- scripts/gendwarfksyms/symbols.c | 4 +++- 3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/scripts/gendwarfksyms/gendwarfksyms.c b/scripts/gendwarfksyms/gendwarfksyms.c index 08ae61eb327e..f5203d1640ee 100644 --- a/scripts/gendwarfksyms/gendwarfksyms.c +++ b/scripts/gendwarfksyms/gendwarfksyms.c @@ -138,7 +138,8 @@ int main(int argc, char **argv) error("no input files?"); }
- symbol_read_exports(stdin); + if (!symbol_read_exports(stdin)) + return 0;
if (symtypes_file) { symfile = fopen(symtypes_file, "w"); diff --git a/scripts/gendwarfksyms/gendwarfksyms.h b/scripts/gendwarfksyms/gendwarfksyms.h index d9c06d2cb1df..32cec8f7695a 100644 --- a/scripts/gendwarfksyms/gendwarfksyms.h +++ b/scripts/gendwarfksyms/gendwarfksyms.h @@ -123,7 +123,7 @@ struct symbol { typedef void (*symbol_callback_t)(struct symbol *, void *arg);
bool is_symbol_ptr(const char *name); -void symbol_read_exports(FILE *file); +int symbol_read_exports(FILE *file); void symbol_read_symtab(int fd); struct symbol *symbol_get(const char *name); void symbol_set_ptr(struct symbol *sym, Dwarf_Die *ptr); diff --git a/scripts/gendwarfksyms/symbols.c b/scripts/gendwarfksyms/symbols.c index 35ed594f0749..ecddcb5ffcdf 100644 --- a/scripts/gendwarfksyms/symbols.c +++ b/scripts/gendwarfksyms/symbols.c @@ -128,7 +128,7 @@ static bool is_exported(const char *name) return for_each(name, NULL, NULL) > 0; }
-void symbol_read_exports(FILE *file) +int symbol_read_exports(FILE *file) { struct symbol *sym; char *line = NULL; @@ -159,6 +159,8 @@ void symbol_read_exports(FILE *file)
free(line); debug("%d exported symbols", nsym); + + return nsym; }
static void get_symbol(struct symbol *sym, void *arg)
base-commit: e9a6fb0bcdd7609be6969112f3fbfcce3b1d4a7c -- 2.51.2
On 11/10/2025 9:19 PM, Miguel Ojeda wrote:
From: Sami Tolvanen samitolvanen@google.com
Starting with Rust 1.91.0 (released 2025-10-30), in upstream commit ab91a63d403b ("Ignore intrinsic calls in cross-crate-inlining cost model") [1][2], `bindings.o` stops containing DWARF debug information because the `Default` implementations contained `write_bytes()` calls which are now ignored in that cost model (note that `CLIPPY=1` does not reproduce it).
This means `gendwarfksyms` complains:
RUSTC L rust/bindings.o error: gendwarfksyms: process_module: dwarf_get_units failed: no debugging information?There are several alternatives that would work here: conditionally skipping in the cases needed (but that is subtle and brittle), forcing DWARF generation with e.g. a dummy `static` (ugly and we may need to do it in several crates), skipping the call to the tool in the Kbuild command when there are no exports (fine) or teaching the tool to do so itself (simple and clean).
Thus do the last one: don't attempt to process files if we have no symbol versions to calculate.
[ I used the commit log of my patch linked below since it explained the root issue and expanded it a bit more to summarize the alternatives.
- Miguel ]Cc: stable@vger.kernel.org # Needed in 6.12.y and later (Rust is pinned in older LTSs). Reported-by: Haiyue Wang haiyuewa@163.com Closes: https://lore.kernel.org/rust-for-linux/b8c1c73d-bf8b-4bf2-beb1-84ffdcd60547@... Suggested-by: Miguel Ojeda ojeda@kernel.org Link: https://lore.kernel.org/rust-for-linux/CANiq72nKC5r24VHAp9oUPR1HVPqT+=0ab9N0... Link: https://github.com/rust-lang/rust/commit/ab91a63d403b0105cacd72809cd292a7298... [1] Link: https://github.com/rust-lang/rust/pull/145910 [2] Signed-off-by: Sami Tolvanen samitolvanen@google.com Signed-off-by: Miguel Ojeda ojeda@kernel.org
scripts/gendwarfksyms/gendwarfksyms.c | 3 ++- scripts/gendwarfksyms/gendwarfksyms.h | 2 +- scripts/gendwarfksyms/symbols.c | 4 +++- 3 files changed, 6 insertions(+), 3 deletions(-)
Tested-by: Haiyue Wang haiyuewa@163.com
On Mon, Nov 10, 2025 at 02:19:13PM +0100, Miguel Ojeda wrote:
Cc: stable@vger.kernel.org # Needed in 6.12.y and later (Rust is pinned in older LTSs).
Is gendwarfksyms actually present in 6.12 upstream? I know we have it in Android's 6.12 branch, but I thought we backported for Android only.
Alice
On Mon, Nov 10, 2025 at 3:57 PM Alice Ryhl aliceryhl@google.com wrote:
Is gendwarfksyms actually present in 6.12 upstream? I know we have it in Android's 6.12 branch, but I thought we backported for Android only.
No, you are right, this is just me being overeager. It should be:
Cc: stable@vger.kernel.org # Needed in 6.17.y.
It would only be needed in 6.12.y if someone actually backports the feature (which does rarely happen, so I guess someone could have found it useful since there is no Fixes tag, but hopefully people would grep the log in that case...).
Thanks!
Cheers, Miguel
On Mon, Nov 10, 2025 at 05:48:51PM +0100, Miguel Ojeda wrote:
On Mon, Nov 10, 2025 at 3:57 PM Alice Ryhl aliceryhl@google.com wrote:
Is gendwarfksyms actually present in 6.12 upstream? I know we have it in Android's 6.12 branch, but I thought we backported for Android only.
No, you are right, this is just me being overeager. It should be:
Cc: stable@vger.kernel.org # Needed in 6.17.y.
It would only be needed in 6.12.y if someone actually backports the feature (which does rarely happen, so I guess someone could have found it useful since there is no Fixes tag, but hopefully people would grep the log in that case...).
Reviewed-by: Alice Ryhl aliceryhl@google.com
On Mon, Nov 10, 2025 at 2:19 PM Miguel Ojeda ojeda@kernel.org wrote:
From: Sami Tolvanen samitolvanen@google.com
Starting with Rust 1.91.0 (released 2025-10-30), in upstream commit ab91a63d403b ("Ignore intrinsic calls in cross-crate-inlining cost model") [1][2], `bindings.o` stops containing DWARF debug information because the `Default` implementations contained `write_bytes()` calls which are now ignored in that cost model (note that `CLIPPY=1` does not reproduce it).
This means `gendwarfksyms` complains:
RUSTC L rust/bindings.o error: gendwarfksyms: process_module: dwarf_get_units failed: no debugging information?There are several alternatives that would work here: conditionally skipping in the cases needed (but that is subtle and brittle), forcing DWARF generation with e.g. a dummy `static` (ugly and we may need to do it in several crates), skipping the call to the tool in the Kbuild command when there are no exports (fine) or teaching the tool to do so itself (simple and clean).
Thus do the last one: don't attempt to process files if we have no symbol versions to calculate.
[ I used the commit log of my patch linked below since it explained the root issue and expanded it a bit more to summarize the alternatives.
- Miguel ]Cc: stable@vger.kernel.org # Needed in 6.12.y and later (Rust is pinned in older LTSs). Reported-by: Haiyue Wang haiyuewa@163.com Closes: https://lore.kernel.org/rust-for-linux/b8c1c73d-bf8b-4bf2-beb1-84ffdcd60547@... Suggested-by: Miguel Ojeda ojeda@kernel.org Link: https://lore.kernel.org/rust-for-linux/CANiq72nKC5r24VHAp9oUPR1HVPqT+=0ab9N0... Link: https://github.com/rust-lang/rust/commit/ab91a63d403b0105cacd72809cd292a7298... [1] Link: https://github.com/rust-lang/rust/pull/145910 [2] Signed-off-by: Sami Tolvanen samitolvanen@google.com Signed-off-by: Miguel Ojeda ojeda@kernel.org
I will send a couple other fixes to Linus this week, so if nobody shouts, I will be picking this one.
Thanks!
Cheers, Miguel
On Tue, Nov 11, 2025 at 2:54 PM Miguel Ojeda miguel.ojeda.sandonis@gmail.com wrote:
I will send a couple other fixes to Linus this week, so if nobody shouts, I will be picking this one.
Of course, if someone else (thanks Haiyue!) wants to give tag or two, I can still pick those up, and that would be very welcome.
Cheers, Miguel
On Tue, Nov 11, 2025 at 2:58 PM Miguel Ojeda miguel.ojeda.sandonis@gmail.com wrote: ...
I will send a couple other fixes to Linus this week, so if nobody shouts, I will be picking this one.
Hi Miguel, Hi Sami,
I switched over to gendwarfksyms in the very early testing days. Faster builds. DWARFv5 fan.
And was using v5 of Sami's patchset against Linux v6.12 as it cleanly applied.
Last week, I jumped over to Linux v6.17.6 and the next testing will be Linux v6.18-rc5+ (upcoming next LTS kernel-version).
I will try this patch - might be you will get a Tested-by.
Best regards, -Sedat-
On Tue, Nov 11, 2025 at 4:25 PM Sedat Dilek sedat.dilek@gmail.com wrote:
I switched over to gendwarfksyms in the very early testing days. Faster builds. DWARFv5 fan.
And was using v5 of Sami's patchset against Linux v6.12 as it cleanly applied.
Last week, I jumped over to Linux v6.17.6 and the next testing will be Linux v6.18-rc5+ (upcoming next LTS kernel-version).
I will try this patch - might be you will get a Tested-by.
Sound good -- I have applied it to start getting testing, but if you have a tag in the next day or so, I can add it.
Thanks!
Cheers, Miguel
On Mon, Nov 10, 2025 at 2:19 PM Miguel Ojeda ojeda@kernel.org wrote:
From: Sami Tolvanen samitolvanen@google.com
Starting with Rust 1.91.0 (released 2025-10-30), in upstream commit ab91a63d403b ("Ignore intrinsic calls in cross-crate-inlining cost model") [1][2], `bindings.o` stops containing DWARF debug information because the `Default` implementations contained `write_bytes()` calls which are now ignored in that cost model (note that `CLIPPY=1` does not reproduce it).
This means `gendwarfksyms` complains:
RUSTC L rust/bindings.o error: gendwarfksyms: process_module: dwarf_get_units failed: no debugging information?There are several alternatives that would work here: conditionally skipping in the cases needed (but that is subtle and brittle), forcing DWARF generation with e.g. a dummy `static` (ugly and we may need to do it in several crates), skipping the call to the tool in the Kbuild command when there are no exports (fine) or teaching the tool to do so itself (simple and clean).
Thus do the last one: don't attempt to process files if we have no symbol versions to calculate.
[ I used the commit log of my patch linked below since it explained the root issue and expanded it a bit more to summarize the alternatives.
- Miguel ]Cc: stable@vger.kernel.org # Needed in 6.12.y and later (Rust is pinned in older LTSs). Reported-by: Haiyue Wang haiyuewa@163.com Closes: https://lore.kernel.org/rust-for-linux/b8c1c73d-bf8b-4bf2-beb1-84ffdcd60547@... Suggested-by: Miguel Ojeda ojeda@kernel.org Link: https://lore.kernel.org/rust-for-linux/CANiq72nKC5r24VHAp9oUPR1HVPqT+=0ab9N0... Link: https://github.com/rust-lang/rust/commit/ab91a63d403b0105cacd72809cd292a7298... [1] Link: https://github.com/rust-lang/rust/pull/145910 [2] Signed-off-by: Sami Tolvanen samitolvanen@google.com Signed-off-by: Miguel Ojeda ojeda@kernel.org
Applied to `rust-fixes` to start getting some testing.
If someone doesn't want it, then please let me know.
Cheers, Miguel
linux-stable-mirror@lists.linaro.org