In menuconfig, it says that CONFIG_RUST depends on a long list of things being present or absent. Among other things, it would seem that I can't have debug symbols and LTO, among other things. See "Depends on:" for CONFIG_RUST.Hu wrote: Tue May 12, 2026 8:28 pm Why do you think you cannot have them all? What error messages did you see when you tried? What document did you read that told you that this cannot work?
You want to enable the rust-src use flag for rust. The others may already be set by default:leyvi wrote: Tue May 12, 2026 9:01 pmIn menuconfig, it says that CONFIG_RUST depends on a long list of things being present or absent. Among other things, it would seem that I can't have debug symbols and LTO, among other things. See "Depends on:" for CONFIG_RUST.
Code: Select all
dev-lang/rust rust-src rustfmt clippyCode: Select all
make LLVM=1 rustavailableCode: Select all
(!DEBUG_INFO_BTF [=y] || PAHOLE_HAS_LANG_EXCLUDE [=y] && !LTO [=n])Code: Select all
author Matthew Maurer <mmaurer@google.com> Wed Jan 8 23:35:08 2025 +0000
committer Miguel Ojeda <ojeda@kernel.org> Tue Mar 11 20:11:09 2025 +0100
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 <mmaurer@google.com>
Cc: stable@vger.kernel.org
Fixes: c1177979af9c ("btf, scripts: Exclude Rust CUs with pahole")
Link: https://lore.kernel.org/r/20250108-rust-btf-lto-incompat-v1-1-60243ff6d820@google.com
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Ohh, no. I was mistaken.leyvi wrote: Wed May 13, 2026 4:22 pm Hang on; CONFIG_RUST depends on CONFIG_GENDWARFKSYMS (if CONFIG_MODVERSIONS is set, which is needed by CONFIG_RUST through CONFIG_EXTENDED_MODVERSIONS) which can't be enabled at the same time as CONFIG_LTO.
It also looks like DEBUG_INFO_BTF and CONFIG_LTO cannot both be enabled if CONFIG_RUST is enabled:So I can't have all 3.Code: Select all
(!DEBUG_INFO_BTF [=y] || PAHOLE_HAS_LANG_EXCLUDE [=y] && !LTO [=n])
This seems unintuitive to me; why isn't this possible? Am I mistaken?
Yes, thank you.Hu wrote: Wed May 13, 2026 4:55 pm git blame on the blocking depends on line leads me to commit 5daa0c35a1f0e7a6c3b8ba9cb721e7d1ace6e619:Does that log message answer your question?Code: Select all
author Matthew Maurer <mmaurer@google.com> Wed Jan 8 23:35:08 2025 +0000 committer Miguel Ojeda <ojeda@kernel.org> Tue Mar 11 20:11:09 2025 +0100 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 <mmaurer@google.com> Cc: stable@vger.kernel.org Fixes: c1177979af9c ("btf, scripts: Exclude Rust CUs with pahole") Link: https://lore.kernel.org/r/20250108-rust-btf-lto-incompat-v1-1-60243ff6d820@google.com Signed-off-by: Miguel Ojeda <ojeda@kernel.org>