summaryrefslogtreecommitdiff
path: root/init
diff options
context:
space:
mode:
authorGary Guo <gary@garyguo.net>2024-10-11 14:40:33 +0300
committerMiguel Ojeda <ojeda@kernel.org>2024-10-13 23:22:28 +0300
commitaf0121c2d303111d363c62e40413ffb39d5dc0f1 (patch)
tree9f99fbc0e5e054de6a2670e6ca188397181382d7 /init
parente72a076c620f692b405dd6c39e8a7c98c8a59ecc (diff)
downloadlinux-af0121c2d303111d363c62e40413ffb39d5dc0f1.tar.xz
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>
Diffstat (limited to 'init')
-rw-r--r--init/Kconfig6
1 files changed, 5 insertions, 1 deletions
diff --git a/init/Kconfig b/init/Kconfig
index 530a382ee0fe..98cf859d58c2 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -62,7 +62,7 @@ config LLD_VERSION
config RUSTC_VERSION
int
- default $(shell,$(srctree)/scripts/rustc-version.sh $(RUSTC))
+ default $(rustc-version)
help
It does not depend on `RUST` since that one may need to use the version
in a `depends on`.
@@ -78,6 +78,10 @@ config RUST_IS_AVAILABLE
In particular, the Makefile target 'rustavailable' is useful to check
why the Rust toolchain is not being detected.
+config RUSTC_LLVM_VERSION
+ int
+ default $(rustc-llvm-version)
+
config CC_CAN_LINK
bool
default $(success,$(srctree)/scripts/cc-can-link.sh $(CC) $(CLANG_FLAGS) $(USERCFLAGS) $(USERLDFLAGS) $(m64-flag)) if 64BIT