|
| 1 | +// Generic AArch64 target for NuttX OS |
| 2 | +// |
| 3 | +// Can be used in conjunction with the `target-feature` and |
| 4 | +// `target-cpu` compiler flags to opt-in more hardware-specific |
| 5 | +// features. |
| 6 | +// |
| 7 | +// For example, `-C target-cpu=cortex-a53`. |
| 8 | + |
| 9 | +use crate::spec::{ |
| 10 | + Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, SanitizerSet, StackProbeType, Target, |
| 11 | + TargetOptions, cvs, |
| 12 | +}; |
| 13 | + |
| 14 | +pub(crate) fn target() -> Target { |
| 15 | + let opts = TargetOptions { |
| 16 | + linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes), |
| 17 | + linker: Some("rust-lld".into()), |
| 18 | + // Enable the Cortex-A53 errata 843419 mitigation by default |
| 19 | + pre_link_args: TargetOptions::link_args(LinkerFlavor::Gnu(Cc::No, Lld::No), &[ |
| 20 | + "--fix-cortex-a53-843419", |
| 21 | + ]), |
| 22 | + features: "+v8a,+strict-align,+neon,+fp-armv8".into(), |
| 23 | + supported_sanitizers: SanitizerSet::KCFI | SanitizerSet::KERNELADDRESS, |
| 24 | + relocation_model: RelocModel::Static, |
| 25 | + disable_redzone: true, |
| 26 | + max_atomic_width: Some(128), |
| 27 | + stack_probes: StackProbeType::Inline, |
| 28 | + panic_strategy: PanicStrategy::Abort, |
| 29 | + families: cvs!["unix"], |
| 30 | + os: "nuttx".into(), |
| 31 | + ..Default::default() |
| 32 | + }; |
| 33 | + Target { |
| 34 | + llvm_target: "aarch64-unknown-none".into(), |
| 35 | + metadata: crate::spec::TargetMetadata { |
| 36 | + description: Some("AArch64 NuttX".into()), |
| 37 | + tier: Some(3), |
| 38 | + host_tools: Some(false), |
| 39 | + std: Some(false), |
| 40 | + }, |
| 41 | + pointer_width: 64, |
| 42 | + data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(), |
| 43 | + arch: "aarch64".into(), |
| 44 | + options: opts, |
| 45 | + } |
| 46 | +} |
0 commit comments