summaryrefslogtreecommitdiff
path: root/init
diff options
context:
space:
mode:
authorMatthew Maurer <mmaurer@google.com>2025-01-08 23:35:08 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-03-22 12:50:48 -0700
commitb78467d3ba1c1350b2d8f86eaa694778d8af23ae (patch)
treedd1355462e1ea9bd006f84c10f6de0ec026abe14 /init
parentd026392e3f87c2505660665909d297e4c1003b6f (diff)
downloadlinux-b78467d3ba1c1350b2d8f86eaa694778d8af23ae.tar.gz
linux-b78467d3ba1c1350b2d8f86eaa694778d8af23ae.tar.bz2
linux-b78467d3ba1c1350b2d8f86eaa694778d8af23ae.zip
rust: Disallow BTF generation with Rust + LTO
commit 5daa0c35a1f0e7a6c3b8ba9cb721e7d1ace6e619 upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'init')
-rw-r--r--init/Kconfig2
1 files changed, 1 insertions, 1 deletions
diff --git a/init/Kconfig b/init/Kconfig
index 60ed7713b5ee..1105cb53f391 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -1908,7 +1908,7 @@ config RUST
depends on !GCC_PLUGINS
depends on !RANDSTRUCT
depends on !SHADOW_CALL_STACK
- depends on !DEBUG_INFO_BTF || PAHOLE_HAS_LANG_EXCLUDE
+ depends on !DEBUG_INFO_BTF || (PAHOLE_HAS_LANG_EXCLUDE && !LTO)
help
Enables Rust support in the kernel.