diff options
author | Miguel Ojeda <ojeda@kernel.org> | 2024-04-22 12:12:15 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-05-02 17:35:25 +0300 |
commit | 5f8bc8978b96f9a25daff2580988c0d846391d5e (patch) | |
tree | 866e0401f04c0369348d888a585439b29160cf4f /rust | |
parent | f94e59d1c3699bb3470e5e601cbe96411137e975 (diff) | |
download | linux-5f8bc8978b96f9a25daff2580988c0d846391d5e.tar.xz |
kbuild: rust: remove unneeded `@rustc_cfg` to avoid ICE
commit 50cfe93b01475ba36878b65d35d812e1bb48ac71 upstream.
When KUnit tests are enabled, under very big kernel configurations
(e.g. `allyesconfig`), we can trigger a `rustdoc` ICE [1]:
RUSTDOC TK rust/kernel/lib.rs
error: the compiler unexpectedly panicked. this is a bug.
The reason is that this build step has a duplicated `@rustc_cfg` argument,
which contains the kernel configuration, and thus a lot of arguments. The
factor 2 happens to be enough to reach the ICE.
Thus remove the unneeded `@rustc_cfg`. By doing so, we clean up the
command and workaround the ICE.
The ICE has been fixed in the upcoming Rust 1.79 [2].
Cc: stable@vger.kernel.org
Fixes: a66d733da801 ("rust: support running Rust documentation tests as KUnit ones")
Link: https://github.com/rust-lang/rust/issues/122722 [1]
Link: https://github.com/rust-lang/rust/pull/122840 [2]
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Link: https://lore.kernel.org/r/20240422091215.526688-1-ojeda@kernel.org
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'rust')
-rw-r--r-- | rust/Makefile | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/rust/Makefile b/rust/Makefile index 9d2a16cc91cb..cd9e5e3fcee8 100644 --- a/rust/Makefile +++ b/rust/Makefile @@ -175,7 +175,6 @@ quiet_cmd_rustdoc_test_kernel = RUSTDOC TK $< mkdir -p $(objtree)/$(obj)/test/doctests/kernel; \ OBJTREE=$(abspath $(objtree)) \ $(RUSTDOC) --test $(rust_flags) \ - @$(objtree)/include/generated/rustc_cfg \ -L$(objtree)/$(obj) --extern alloc --extern kernel \ --extern build_error --extern macros \ --extern bindings --extern uapi \ |