gendwarfksyms Tool Added To Linux 6.14 To Help With Rust Push

The gendwarfksyms tool is going to be used for computing CRCs for export symbols based on the DWARF information.
Sami Tolvanen explained with the patch series for building out this "gendwarfksyms" tool:
"The main motivation is modversions support for Rust, which is important for distributions like Android that are about to ship Rust kernel modules. Per Luis' request, v2 dropped the Rust specific bits from the series and instead added the feature as an option for the entire kernel to make it easier to evaluate the benefits of this approach, and to get better test coverage. Matt is addressing Rust modversion_info compatibility issues in a separate patch set that depends on this series, and actually allows modversions to be enabled with Rust.
Short background: Unlike C, Rust source code doesn't have sufficient information about the final ABI, as the compiler has considerable freedom in adjusting structure layout, for example, which makes using a source code parser like genksyms a non-starter. Based on earlier feedback, this series uses DWARF debugging information for computing versions. DWARF is an established and a relatively stable format, which includes all the necessary ABI details, and adding a CONFIG_DEBUG_INFO dependency for Rust symbol versioning seems like a reasonable trade-off as most distributions already enable it."
This gendwarfksyms tool and CONFIG_MODVERSIONS enable for Rust along with a few other Kbuild updates have now been merged via this pull request.
With Rust code merged earlier this week for Linux 6.14, the kernel developers are approaching the stage of almost being able to write real drivers in Rust.
42 Comments