kbuild: rust: add `CONFIG_RUSTC_LLVM_VERSION`
authorGary Guo <gary@garyguo.net>
Fri, 11 Oct 2024 11:40:33 +0000 (12:40 +0100)
committerMiguel Ojeda <ojeda@kernel.org>
Sun, 13 Oct 2024 20:22:28 +0000 (22:22 +0200)
commitaf0121c2d303111d363c62e40413ffb39d5dc0f1
tree9f99fbc0e5e054de6a2670e6ca188397181382d7
parente72a076c620f692b405dd6c39e8a7c98c8a59ecc
kbuild: rust: add `CONFIG_RUSTC_LLVM_VERSION`

Each version of Rust supports a range of LLVM versions. There are cases where
we want to gate a config on the LLVM version instead of the Rust version.
Normalized cfi integer tags are one example [1].

The invocation of rustc-version is being moved from init/Kconfig to
scripts/Kconfig.include for consistency with cc-version.

Link: https://lore.kernel.org/all/20240925-cfi-norm-kasan-fix-v1-1-0328985cdf33@google.com/
Signed-off-by: Gary Guo <gary@garyguo.net>
Link: https://lore.kernel.org/r/20241011114040.3900487-1-gary@garyguo.net
[ Added missing `-llvm` to the Usage documentation. - Miguel ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
init/Kconfig
scripts/Kconfig.include
scripts/rustc-llvm-version.sh [new file with mode: 0755]