summaryrefslogtreecommitdiff
path: root/init
diff options
context:
space:
mode:
authorStephen Rothwell <sfr@canb.auug.org.au>2022-06-28 15:41:14 +1000
committerStephen Rothwell <sfr@canb.auug.org.au>2022-06-28 15:41:14 +1000
commit6d2c4faac6e3168b1ad7f77a8ac59dd8311cdb24 (patch)
treea9254de014e20fa320e071862f7d80756ae641bb /init
parentadc3aa587669e26f1e3b88226f58da89c3a0fe4e (diff)
parent9a5fe747d99e1d562dde1f39259bbe2d098262ae (diff)
downloadlinux-next-6d2c4faac6e3168b1ad7f77a8ac59dd8311cdb24.tar.gz
Merge branch 'rust-next' of https://github.com/Rust-for-Linux/linux.git
# Conflicts: # Makefile # include/uapi/linux/android/binder.h
Diffstat (limited to 'init')
-rw-r--r--init/Kconfig51
1 files changed, 50 insertions, 1 deletions
diff --git a/init/Kconfig b/init/Kconfig
index 06454d19e2f0..ac8088850bdd 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -60,6 +60,23 @@ config LLD_VERSION
default $(ld-version) if LD_IS_LLD
default 0
+config RUST_IS_AVAILABLE
+ # Because some common tools like 'diff' don't support permissions of
+ # the files, 'rust-is-available.sh' in some trees that managed with such
+ # tools result in having no execution permission. As a temporal work
+ # around, we specify the interpreter ('/bin/sh'). It will be unneeded
+ # once 'rust-is-available.sh' is merged in the mainline with its execution
+ # permission.
+ def_bool $(success,/bin/sh $(srctree)/scripts/rust-is-available.sh)
+ help
+ This shows whether a suitable Rust toolchain is available (found).
+
+ Please see Documentation/rust/quick-start.rst for instructions on how
+ to satify the build requirements of Rust support.
+
+ In particular, the Makefile target 'rustavailable' is useful to check
+ why the Rust toolchain is not being detected.
+
config CC_CAN_LINK
bool
default $(success,$(srctree)/scripts/cc-can-link.sh $(CC) $(CLANG_FLAGS) $(USERCFLAGS) $(USERLDFLAGS) $(m64-flag)) if 64BIT
@@ -151,7 +168,8 @@ config WERROR
default COMPILE_TEST
help
A kernel build should not cause any compiler warnings, and this
- enables the '-Werror' flag to enforce that rule by default.
+ enables the '-Werror' (for C) and '-Dwarnings' (for Rust) flags
+ to enforce that rule by default.
However, if you have a new (or very old) compiler with odd and
unusual warnings, or you have some architecture with problems,
@@ -1898,6 +1916,37 @@ config PROFILING
Say Y here to enable the extended profiling support mechanisms used
by profilers.
+config RUST
+ bool "Rust support"
+ depends on HAVE_RUST
+ depends on RUST_IS_AVAILABLE
+ depends on !MODVERSIONS
+ depends on !GCC_PLUGINS
+ depends on !DEBUG_INFO_BTF
+ select CONSTRUCTORS
+ help
+ Enables Rust support in the kernel.
+
+ This allows other Rust-related options, like drivers written in Rust,
+ to be selected.
+
+ It is also required to be able to load external kernel modules
+ written in Rust.
+
+ See Documentation/rust/ for more information.
+
+ If unsure, say N.
+
+config RUSTC_VERSION_TEXT
+ string
+ depends on RUST
+ default $(shell,command -v $(RUSTC) >/dev/null 2>&1 && $(RUSTC) --version || echo n)
+
+config BINDGEN_VERSION_TEXT
+ string
+ depends on RUST
+ default $(shell,command -v $(BINDGEN) >/dev/null 2>&1 && $(BINDGEN) --version || echo n)
+
#
# Place an empty function call at each tracepoint site. Can be
# dynamically changed for a probe function.