[PATCH 2/3] XXX: Enable asm_experimental_arch for PowerPC asm!()
Link Mauve
linkmauve at linkmauve.fr
Fri Apr 10 21:05:24 AEST 2026
This is needed to compile the kernel crate, otherwise this error
happens:
error[E0658]: inline assembly is not stable yet on this architecture
--> ../rust/kernel/sync/barrier.rs:19:14
|
19 | unsafe { core::arch::asm!("") };
| ^^^^^^^^^^^^^^^^^^^^
|
= note: see issue #93335 <https://github.com/rust-lang/rust/issues/93335> for more information
= help: add `#![feature(asm_experimental_arch)]` to the crate attributes to enable
= note: this compiler was built on 2026-03-25; consider upgrading it if it is out of date
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0658`.
---
rust/kernel/lib.rs | 3 +++
scripts/Makefile.build | 2 +-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/rust/kernel/lib.rs b/rust/kernel/lib.rs
index d93292d47420..92ccd47dc3ee 100644
--- a/rust/kernel/lib.rs
+++ b/rust/kernel/lib.rs
@@ -47,6 +47,9 @@
// To be determined.
#![feature(used_with_arg)]
//
+// Needed for PowerPC inline assembly.
+#![feature(asm_experimental_arch)]
+//
// `feature(derive_coerce_pointee)` is expected to become stable. Before Rust
// 1.84.0, it did not exist, so enable the predecessor features.
#![cfg_attr(CONFIG_RUSTC_HAS_COERCE_POINTEE, feature(derive_coerce_pointee))]
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 3652b85be545..c7cc21994c5a 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -321,7 +321,7 @@ $(obj)/%.lst: $(obj)/%.c FORCE
#
# Please see https://github.com/Rust-for-Linux/linux/issues/2 for details on
# the unstable features in use.
-rust_allowed_features := asm_const,asm_goto,arbitrary_self_types,lint_reasons,offset_of_nested,raw_ref_op,slice_ptr_len,strict_provenance,used_with_arg
+rust_allowed_features := asm_const,asm_goto,asm_experimental_arch,arbitrary_self_types,lint_reasons,offset_of_nested,raw_ref_op,slice_ptr_len,strict_provenance,used_with_arg
# `--out-dir` is required to avoid temporaries being created by `rustc` in the
# current working directory, which may be not accessible in the out-of-tree
--
2.54.0
--ngs4HrAymANbT/pl
Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment;
filename=0003-XXX-Workaround-for-__udivdi3-and-__umoddi3.patch
Content-Transfer-Encoding: 8bit
More information about the Linuxppc-dev
mailing list