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:Andreas Hindborg <a.hindborg@kernel.org> Signed-off-by:
Gary Guo <gary@garyguo.net> Signed-off-by:
Matthew Maurer <mmaurer@google.com>
Loading