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/ [1] 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>
This commit is contained in:
@@ -65,6 +65,9 @@ cc-option-bit = $(if-success,$(CC) -Werror $(1) -E -x c /dev/null -o /dev/null,$
|
||||
m32-flag := $(cc-option-bit,-m32)
|
||||
m64-flag := $(cc-option-bit,-m64)
|
||||
|
||||
rustc-version := $(shell,$(srctree)/scripts/rustc-version.sh $(RUSTC))
|
||||
rustc-llvm-version := $(shell,$(srctree)/scripts/rustc-llvm-version.sh $(RUSTC))
|
||||
|
||||
# $(rustc-option,<flag>)
|
||||
# Return y if the Rust compiler supports <flag>, n otherwise
|
||||
# Calls to this should be guarded so that they are not evaluated if
|
||||
|
||||
Reference in New Issue
Block a user