On Sat, Jan 4, 2025 at 5:45 AM Sami Tolvanen <samitolvanen@xxxxxxxxxx> wrote: > > Hi, > > Here's v8 of the DWARF modversions series. 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 [1], 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 [2] 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. > > The first 15 patches add gendwarfksyms, a tool for computing symbol > versions from DWARF. When passed a list of exported symbols and > object files, the tool generates an expanded type string for each > symbol and computes symbol versions. gendwarfksyms is written in C, > uses libdw to process DWARF, and zlib for CRC32. Patch 16 ensures > that debugging information is present where we need it, patch 17 > adds gendwarfksyms as an alternative to genksyms, and the last patch > adds documentation. > > v8 is based on 6.13-rc5, and for your convenience, the series is > also available here: > > https://github.com/samitolvanen/linux/commits/gendwarfksyms-v8 > > If you also want to test the series with actual Rust modules, this > branch adds v13 of Matt's modversion_info series: > > https://github.com/samitolvanen/linux/commits/rustmodversions-v8 > > Sami > > > [1] https://lore.kernel.org/lkml/ZnIZEtkkQWEIGf9n@xxxxxxxxxxxxxxxxxxxxxx/ > [2] https://lore.kernel.org/lkml/20250103-extended-modversions-v13-0-35d87c65ee04@xxxxxxxxxx/ > Applied to linux-kbuild. Thanks. -- Best Regards Masahiro Yamada