summaryrefslogtreecommitdiff
path: root/init
diff options
context:
space:
mode:
authorSami Tolvanen <samitolvanen@google.com>2025-01-03 17:37:05 +0000
committerMasahiro Yamada <masahiroy@kernel.org>2025-01-18 08:51:48 +0900
commitac61506bf2d1a6766d98b7d94b0c7b2134a0806a (patch)
tree2075c9bd881f8f8bff7aa1186775744fefe1b314 /init
parent272f8a6d625a0cf7fba9c5af5202edc84dee326c (diff)
rust: Use gendwarfksyms + extended modversions for CONFIG_MODVERSIONS
Previously, two things stopped Rust from using MODVERSIONS: 1. Rust symbols are occasionally too long to be represented in the original versions table 2. Rust types cannot be properly hashed by the existing genksyms approach because: * Looking up type definitions in Rust is more complex than C * Type layout is potentially dependent on the compiler in Rust, not just the source type declaration. CONFIG_EXTENDED_MODVERSIONS addresses the first point, and CONFIG_GENDWARFKSYMS the second. If Rust wants to use MODVERSIONS, allow it to do so by selecting both features. Signed-off-by: Sami Tolvanen <samitolvanen@google.com> Co-developed-by: Matthew Maurer <mmaurer@google.com> Signed-off-by: Matthew Maurer <mmaurer@google.com> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Diffstat (limited to 'init')
-rw-r--r--init/Kconfig3
1 files changed, 2 insertions, 1 deletions
diff --git a/init/Kconfig b/init/Kconfig
index a20e6efd3f0f..2cfbefe0933e 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -1956,7 +1956,8 @@ config RUST
bool "Rust support"
depends on HAVE_RUST
depends on RUST_IS_AVAILABLE
- depends on !MODVERSIONS
+ select EXTENDED_MODVERSIONS if MODVERSIONS
+ depends on !MODVERSIONS || GENDWARFKSYMS
depends on !GCC_PLUGIN_RANDSTRUCT
depends on !RANDSTRUCT
depends on !DEBUG_INFO_BTF || PAHOLE_HAS_LANG_EXCLUDE