Commit 9077fcbc authored by Gary Guo's avatar Gary Guo Committed by Matthew Maurer
Browse files

FROMLIST: kbuild: rust: add `CONFIG_RUSTC_CLANG_LLVM_COMPATIBLE`

This config detects if Rust and Clang have matching LLVM major version.
All IR or bitcode operations (e.g. LTO) rely on LLVM major version to be
matching, otherwise it may generate errors, or worse, miscompile silently
due to change of IR semantics.

It's usually suggested to use the exact same LLVM version, but this can
be difficult to guarantee. Rust's suggestion [1] is also major-version only,
so I think this check is sufficient for the kernel.

Bug: 454054050
Link: https://lore.kernel.org/all/20250319205141.3528424-2-gary@garyguo.net/
Change-Id: Id22819c8f7c0639ab6ad197e46d12781b6e40034
Link: https://doc.rust-lang.org/rustc/linker-plugin-lto.html

 [1]
Reviewed-by: default avatarAndreas Hindborg <a.hindborg@kernel.org>
Signed-off-by: default avatarGary Guo <gary@garyguo.net>
Signed-off-by: default avatarMatthew Maurer <mmaurer@google.com>
parent b92abfb1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment