diff options
author | Sasha Levin <sashal@kernel.org> | 2024-05-07 18:58:54 -0400 |
---|---|---|
committer | Sasha Levin <sashal@kernel.org> | 2024-05-07 18:58:54 -0400 |
commit | 720057c0634039018a68fb8771810101cd7ccec3 (patch) | |
tree | 4bfd6e87a07ed4d286966d9943299fa1344d86f2 | |
parent | 0b842bca6ba16d696343db0947323a1c6f0a4673 (diff) | |
download | stable-queue-720057c0634039018a68fb8771810101cd7ccec3.tar.gz |
Drop kbuild-rust-force-alloc-extern-to-allow-empty-rust-f.patch
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | queue-6.1/kbuild-rust-force-alloc-extern-to-allow-empty-rust-f.patch | 72 | ||||
-rw-r--r-- | queue-6.1/series | 1 |
2 files changed, 0 insertions, 73 deletions
diff --git a/queue-6.1/kbuild-rust-force-alloc-extern-to-allow-empty-rust-f.patch b/queue-6.1/kbuild-rust-force-alloc-extern-to-allow-empty-rust-f.patch deleted file mode 100644 index a5c2c4fea8..0000000000 --- a/queue-6.1/kbuild-rust-force-alloc-extern-to-allow-empty-rust-f.patch +++ /dev/null @@ -1,72 +0,0 @@ -From 6f98bb1610157b1e6d70bf2beff2f68dd428b3eb Mon Sep 17 00:00:00 2001 -From: Sasha Levin <sashal@kernel.org> -Date: Mon, 22 Apr 2024 11:06:44 +0200 -Subject: kbuild: rust: force `alloc` extern to allow "empty" Rust files - -From: Miguel Ojeda <ojeda@kernel.org> - -[ Upstream commit ded103c7eb23753f22597afa500a7c1ad34116ba ] - -If one attempts to build an essentially empty file somewhere in the -kernel tree, it leads to a build error because the compiler does not -recognize the `new_uninit` unstable feature: - - error[E0635]: unknown feature `new_uninit` - --> <crate attribute>:1:9 - | - 1 | feature(new_uninit) - | ^^^^^^^^^^ - -The reason is that we pass `-Zcrate-attr='feature(new_uninit)'` (together -with `-Zallow-features=new_uninit`) to let non-`rust/` code use that -unstable feature. - -However, the compiler only recognizes the feature if the `alloc` crate -is resolved (the feature is an `alloc` one). `--extern alloc`, which we -pass, is not enough to resolve the crate. - -Introducing a reference like `use alloc;` or `extern crate alloc;` -solves the issue, thus this is not seen in normal files. For instance, -`use`ing the `kernel` prelude introduces such a reference, since `alloc` -is used inside. - -While normal use of the build system is not impacted by this, it can still -be fairly confusing for kernel developers [1], thus use the unstable -`force` option of `--extern` [2] (added in Rust 1.71 [3]) to force the -compiler to resolve `alloc`. - -This new unstable feature is only needed meanwhile we use the other -unstable feature, since then we will not need `-Zcrate-attr`. - -Cc: stable@vger.kernel.org # v6.6+ -Reported-by: Daniel Almeida <daniel.almeida@collabora.com> -Reported-by: Julian Stecklina <julian.stecklina@cyberus-technology.de> -Closes: https://rust-for-linux.zulipchat.com/#narrow/stream/288089-General/topic/x/near/424096982 [1] -Fixes: 2f7ab1267dc9 ("Kbuild: add Rust support") -Link: https://github.com/rust-lang/rust/issues/111302 [2] -Link: https://github.com/rust-lang/rust/pull/109421 [3] -Reviewed-by: Alice Ryhl <aliceryhl@google.com> -Reviewed-by: Gary Guo <gary@garyguo.net> -Link: https://lore.kernel.org/r/20240422090644.525520-1-ojeda@kernel.org -Signed-off-by: Miguel Ojeda <ojeda@kernel.org> -Signed-off-by: Sasha Levin <sashal@kernel.org> ---- - scripts/Makefile.build | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/scripts/Makefile.build b/scripts/Makefile.build -index 9ae02542b9389..6afc2af8f7e67 100644 ---- a/scripts/Makefile.build -+++ b/scripts/Makefile.build -@@ -282,7 +282,7 @@ rust_common_cmd = \ - -Zallow-features=$(rust_allowed_features) \ - -Zcrate-attr=no_std \ - -Zcrate-attr='feature($(rust_allowed_features))' \ -- --extern alloc --extern kernel \ -+ -Zunstable-options --extern force:alloc --extern kernel \ - --crate-type rlib -L $(objtree)/rust/ \ - --crate-name $(basename $(notdir $@)) \ - --emit=dep-info=$(depfile) --- -2.43.0 - diff --git a/queue-6.1/series b/queue-6.1/series index 73d0598ee1..cb6df035fc 100644 --- a/queue-6.1/series +++ b/queue-6.1/series @@ -18,7 +18,6 @@ mm-hugetlb_cgroup-convert-hugetlb_cgroup_uncharge_pa.patch mm-hugetlb-fix-missing-hugetlb_lock-for-resv-uncharg.patch kbuild-refactor-host-_flags.patch kbuild-specify-output-names-separately-for-each-emis.patch -kbuild-rust-force-alloc-extern-to-allow-empty-rust-f.patch cifs-use-the-least-loaded-channel-for-sending-reques.patch smb3-missing-lock-when-picking-channel.patch pinctrl-pinctrl-aspeed-g6-fix-register-offset-for-pi.patch |