summaryrefslogtreecommitdiff
path: root/scripts/generate_rust_target.rs
diff options
context:
space:
mode:
authorJan Polensky <japo@linux.ibm.com>2026-06-01 19:46:25 +0200
committerAlexander Gordeev <agordeev@linux.ibm.com>2026-06-10 16:25:13 +0200
commit3f70ebe638581e73c8df6b3fa7eed9b45d90b083 (patch)
treee3455d39c612ace2ffa85b702a0e25682bdc7060 /scripts/generate_rust_target.rs
parenta423d94fa1167c709718f58913953f18b45a9904 (diff)
downloadlwn-3f70ebe638581e73c8df6b3fa7eed9b45d90b083.tar.gz
lwn-3f70ebe638581e73c8df6b3fa7eed9b45d90b083.zip
s390: Enable Rust support
Enable building Rust code on s390 by wiring the architecture into the kernel Rust infrastructure. Add s390 to the Rust arch support documentation, provide the s390 Rust target and required compiler flags, and set the bindgen target for arch/s390. Adjust the Rust target generation and minimum rustc version gating so the s390 setup is handled explicitly. The Rust toolchain uses the "s390x" triple naming for the 64 bit target. Rust support is currently incompatible with CONFIG_EXPOLINE, which relies on compiler support for the -mindirect-branch= and -mfunction_return= options. Therefore, select HAVE_RUST only when EXPOLINE is disabled. Acked-by: Miguel Ojeda <ojeda@kernel.org> Acked-by: Gary Guo <gary@garyguo.net> Acked-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Jan Polensky <japo@linux.ibm.com> Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
Diffstat (limited to 'scripts/generate_rust_target.rs')
-rw-r--r--scripts/generate_rust_target.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/scripts/generate_rust_target.rs b/scripts/generate_rust_target.rs
index 38b3416bb979..8f1df6819d0b 100644
--- a/scripts/generate_rust_target.rs
+++ b/scripts/generate_rust_target.rs
@@ -256,6 +256,8 @@ fn main() {
}
} else if cfg.has("LOONGARCH") {
panic!("loongarch uses the builtin rustc loongarch64-unknown-none-softfloat target");
+ } else if cfg.has("S390") {
+ panic!("s390 uses the builtin rustc s390x-unknown-none-softfloat target");
} else {
panic!("Unsupported architecture");
}