Merge tag 'powerpc-6.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc...
[linux-block.git] / init / Kconfig
index 94ce5a46a8023dbadf792ee0cca78ee26e387470..751ca3dd1d22442d7f5af3757dba4a8285f9d2dc 100644 (file)
@@ -60,6 +60,17 @@ config LLD_VERSION
        default $(ld-version) if LD_IS_LLD
        default 0
 
+config RUST_IS_AVAILABLE
+       def_bool $(success,$(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
@@ -147,7 +158,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 +1910,38 @@ 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 !RANDSTRUCT
+       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.