aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/generate_rust_target.rs
diff options
context:
space:
mode:
authorChristian Schrrefl <[email protected]>2025-01-30 23:03:45 +0000
committerRussell King (Oracle) <[email protected]>2025-03-26 13:31:16 +0000
commitccb8ce526807fcbd4578d6619100d8ec48769ea8 (patch)
treeed5866eb6449aa0faca7adaef095eebcf46ae051 /scripts/generate_rust_target.rs
parentARM: 9439/1: arm32: simplify ARM_MMU_KEEP usage (diff)
downloadkernel-ccb8ce526807fcbd4578d6619100d8ec48769ea8.tar.gz
kernel-ccb8ce526807fcbd4578d6619100d8ec48769ea8.zip
ARM: 9441/1: rust: Enable Rust support for ARMv7
This commit allows building ARMv7 kernels with Rust support. The rust core library expects some __eabi_... functions that are not implemented in the kernel. Those functions are some float operations and __aeabi_uldivmod. For now those are implemented with define_panicking_intrinsics!. This is based on the code by Sven Van Asbroeck from the original rust branch and inspired by the AArch version by Jamie Cunliffe. I have tested the rust samples and a custom simple MMIO module on hardware (De1SoC FPGA + Arm A9 CPU). Tested-by: Rudraksha Gupta <[email protected]> Reviewed-by: Alice Ryhl <[email protected]> Acked-by: Miguel Ojeda <[email protected]> Tested-by: Miguel Ojeda <[email protected]> Acked-by: Ard Biesheuvel <[email protected]> Signed-off-by: Christian Schrefl <[email protected]> Signed-off-by: Russell King (Oracle) <[email protected]>
Diffstat (limited to 'scripts/generate_rust_target.rs')
-rw-r--r--scripts/generate_rust_target.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/scripts/generate_rust_target.rs b/scripts/generate_rust_target.rs
index 0d00ac3723b5..f8e7fb38bf16 100644
--- a/scripts/generate_rust_target.rs
+++ b/scripts/generate_rust_target.rs
@@ -172,7 +172,9 @@ fn main() {
let mut ts = TargetSpec::new();
// `llvm-target`s are taken from `scripts/Makefile.clang`.
- if cfg.has("ARM64") {
+ if cfg.has("ARM") {
+ panic!("arm uses the builtin rustc target");
+ } else if cfg.has("ARM64") {
panic!("arm64 uses the builtin rustc aarch64-unknown-none target");
} else if cfg.has("RISCV") {
if cfg.has("64BIT") {