gendwarfksyms Tool Added To Linux 6.14 To Help With Rust Push

Written by Michael Larabel in Linux Kernel on 1 February 2025 at 09:11 AM EST. 42 Comments
LINUX KERNEL
Merged on Friday to the Linux 6.14 kernel were the Kbuild feature changes for this cycle. Most notable with these kernel build changes is the introduction of the gendwarfksyms tool that is used as part of the ongoing Rust programming language push within the Linux kernel.

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.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week