diff options
| author | Jamie Cunliffe <[email protected]> | 2023-10-20 15:50:56 +0000 |
|---|---|---|
| committer | Catalin Marinas <[email protected]> | 2024-02-09 16:12:36 +0000 |
| commit | 724a75ac9542fe1f8aaa587da4d3863d8ea292fc (patch) | |
| tree | 11847accd037de841ea5c58b62efcf7290ebae36 /scripts/generate_rust_target.rs | |
| parent | rust: Refactor the build target to allow the use of builtin targets (diff) | |
| download | kernel-724a75ac9542fe1f8aaa587da4d3863d8ea292fc.tar.gz kernel-724a75ac9542fe1f8aaa587da4d3863d8ea292fc.zip | |
arm64: rust: Enable Rust support for AArch64
This commit provides the build flags for Rust for AArch64. The core Rust
support already in the kernel does the rest. This enables the PAC ret
and BTI options in the Rust build flags to match the options that are
used when building C.
The Rust samples have been tested with this commit.
Signed-off-by: Jamie Cunliffe <[email protected]>
Acked-by: Will Deacon <[email protected]>
Tested-by: Dirk Behme <[email protected]>
Tested-by: Boqun Feng <[email protected]>
Acked-by: Miguel Ojeda <[email protected]>
Acked-by: Catalin Marinas <[email protected]>
Tested-by: Alice Ryhl <[email protected]>
Tested-by: Fabien Parent <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Catalin Marinas <[email protected]>
Diffstat (limited to 'scripts/generate_rust_target.rs')
| -rw-r--r-- | scripts/generate_rust_target.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/scripts/generate_rust_target.rs b/scripts/generate_rust_target.rs index 0da52b548ba5..9e117957ea7b 100644 --- a/scripts/generate_rust_target.rs +++ b/scripts/generate_rust_target.rs @@ -148,7 +148,9 @@ fn main() { let mut ts = TargetSpec::new(); // `llvm-target`s are taken from `scripts/Makefile.clang`. - if cfg.has("X86_64") { + if cfg.has("ARM64") { + panic!("arm64 uses the builtin rustc aarch64-unknown-none target"); + } else if cfg.has("X86_64") { ts.push("arch", "x86_64"); ts.push( "data-layout", |
