public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rust: Disallow BTF generation with Rust + LTO
@ 2025-01-08 23:35 Matthew Maurer
  2025-01-09 13:17 ` Miguel Ojeda
  2025-03-11 19:20 ` Miguel Ojeda
  0 siblings, 2 replies; 15+ messages in thread
From: Matthew Maurer @ 2025-01-08 23:35 UTC (permalink / raw)
  To: Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
	Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
	Trevor Gross
  Cc: linux-kernel, rust-for-linux, Matthias Maennich, Matthew Maurer

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>
---
 init/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/init/Kconfig b/init/Kconfig
index c1f9eb3d5f2e892e977ba1425599502dc830f552..eb1076be6242cf349c12ef0f447696cb3a9976fa 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -1962,7 +1962,7 @@ config RUST
 	depends on !MODVERSIONS
 	depends on !GCC_PLUGIN_RANDSTRUCT
 	depends on !RANDSTRUCT
-	depends on !DEBUG_INFO_BTF || PAHOLE_HAS_LANG_EXCLUDE
+	depends on !DEBUG_INFO_BTF || (PAHOLE_HAS_LANG_EXCLUDE && !LTO)
 	depends on !CFI_CLANG || HAVE_CFI_ICALL_NORMALIZE_INTEGERS_RUSTC
 	select CFI_ICALL_NORMALIZE_INTEGERS if CFI_CLANG
 	depends on !CALL_PADDING || RUSTC_VERSION >= 108100

---
base-commit: 4b90165c7d1173e0f65538d25aa718ec7ecdd5d6
change-id: 20250108-rust-btf-lto-incompat-0d258f1fb4eb

Best regards,
-- 
Matthew Maurer <mmaurer@google.com>


^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2025-03-11 19:20 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-08 23:35 [PATCH] rust: Disallow BTF generation with Rust + LTO Matthew Maurer
2025-01-09 13:17 ` Miguel Ojeda
2025-01-09 14:10   ` Neal Gompa
2025-01-09 14:15     ` Alice Ryhl
2025-01-09 14:55       ` Tamir Duberstein
2025-01-09 15:47         ` Arnaldo Carvalho de Melo
2025-01-09 15:49           ` Tamir Duberstein
2025-01-09 16:29             ` Arnaldo Carvalho de Melo
2025-01-09 16:37               ` Arnaldo Carvalho de Melo
2025-01-09 22:39               ` Arnaldo Carvalho de Melo
2025-01-09 22:41                 ` Matthew Maurer
2025-01-10 14:54                   ` Arnaldo Carvalho de Melo
2025-01-10 16:22                 ` Dave Tucker
2025-01-10 16:41                   ` vadorovsky
2025-03-11 19:20 ` Miguel Ojeda

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox