2019-09-18 15:38:02 +02:00
|
|
|
// Generic AArch64 target for bare-metal code - Floating point enabled
|
2018-08-09 22:04:55 +02:00
|
|
|
//
|
|
|
|
|
// Can be used in conjunction with the `target-feature` and
|
|
|
|
|
// `target-cpu` compiler flags to opt-in more hardware-specific
|
|
|
|
|
// features.
|
|
|
|
|
//
|
|
|
|
|
// For example, `-C target-cpu=cortex-a53`.
|
|
|
|
|
|
2022-11-21 21:29:00 -08:00
|
|
|
use super::{
|
|
|
|
|
Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, SanitizerSet, Target, TargetOptions,
|
|
|
|
|
};
|
2018-08-09 22:04:55 +02:00
|
|
|
|
2020-10-05 15:37:55 +03:00
|
|
|
pub fn target() -> Target {
|
2018-08-09 22:04:55 +02:00
|
|
|
let opts = TargetOptions {
|
2022-08-06 21:08:46 +03:00
|
|
|
linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
|
2022-03-22 11:43:05 +01:00
|
|
|
linker: Some("rust-lld".into()),
|
2023-02-01 12:52:06 -08:00
|
|
|
features: "+v8a,+strict-align,+neon,+fp-armv8".into(),
|
2022-09-11 19:36:19 -04:00
|
|
|
supported_sanitizers: SanitizerSet::KCFI | SanitizerSet::KERNELADDRESS,
|
2020-04-23 00:46:45 +03:00
|
|
|
relocation_model: RelocModel::Static,
|
2018-08-09 22:04:55 +02:00
|
|
|
disable_redzone: true,
|
|
|
|
|
max_atomic_width: Some(128),
|
|
|
|
|
panic_strategy: PanicStrategy::Abort,
|
|
|
|
|
..Default::default()
|
|
|
|
|
};
|
2020-10-05 15:37:55 +03:00
|
|
|
Target {
|
2022-03-22 11:43:05 +01:00
|
|
|
llvm_target: "aarch64-unknown-none".into(),
|
2020-10-14 18:08:12 +02:00
|
|
|
pointer_width: 64,
|
2022-03-22 11:43:05 +01:00
|
|
|
data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".into(),
|
|
|
|
|
arch: "aarch64".into(),
|
2018-08-09 22:04:55 +02:00
|
|
|
options: opts,
|
2020-10-05 15:37:55 +03:00
|
|
|
}
|
2018-08-09 22:04:55 +02:00
|
|
|
}
|