Skip to content

Commit 5daa0c3

Browse files
maurerojeda
authored andcommitted
rust: Disallow BTF generation with Rust + LTO
The kernel cannot currently self-parse BTF containing Rust debug information. pahole uses the language of the CU to determine whether to filter out debug information when generating the BTF. When LTO is enabled, Rust code can cross CU boundaries, resulting in Rust debug information in CUs labeled as C. This results in a system which cannot parse its own BTF. Signed-off-by: Matthew Maurer <[email protected]> Cc: [email protected] Fixes: c117797 ("btf, scripts: Exclude Rust CUs with pahole") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Miguel Ojeda <[email protected]>
1 parent 6fbafe1 commit 5daa0c3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

init/Kconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -1973,7 +1973,7 @@ config RUST
19731973
depends on !MODVERSIONS || GENDWARFKSYMS
19741974
depends on !GCC_PLUGIN_RANDSTRUCT
19751975
depends on !RANDSTRUCT
1976-
depends on !DEBUG_INFO_BTF || PAHOLE_HAS_LANG_EXCLUDE
1976+
depends on !DEBUG_INFO_BTF || (PAHOLE_HAS_LANG_EXCLUDE && !LTO)
19771977
depends on !CFI_CLANG || HAVE_CFI_ICALL_NORMALIZE_INTEGERS_RUSTC
19781978
select CFI_ICALL_NORMALIZE_INTEGERS if CFI_CLANG
19791979
depends on !CALL_PADDING || RUSTC_VERSION >= 108100

0 commit comments

Comments
 (0)