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`.
|
|
|
|
|
|
2020-04-23 00:46:45 +03:00
|
|
|
use super::{LinkerFlavor, LldFlavor, PanicStrategy, RelocModel, 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 {
|
|
|
|
|
linker: Some("rust-lld".to_owned()),
|
2019-09-18 15:38:02 +02:00
|
|
|
features: "+strict-align,+neon,+fp-armv8".to_string(),
|
2018-08-09 22:04:55 +02:00
|
|
|
executables: true,
|
2020-04-23 00:46:45 +03:00
|
|
|
relocation_model: RelocModel::Static,
|
2018-08-09 22:04:55 +02:00
|
|
|
disable_redzone: true,
|
|
|
|
|
linker_is_gnu: true,
|
|
|
|
|
max_atomic_width: Some(128),
|
|
|
|
|
panic_strategy: PanicStrategy::Abort,
|
2020-07-08 09:36:52 -04:00
|
|
|
unsupported_abis: super::arm_base::unsupported_abis(),
|
2019-12-22 17:42:04 -05:00
|
|
|
..Default::default()
|
2018-08-09 22:04:55 +02:00
|
|
|
};
|
2020-10-05 15:37:55 +03:00
|
|
|
Target {
|
2018-08-09 22:04:55 +02:00
|
|
|
llvm_target: "aarch64-unknown-none".to_string(),
|
|
|
|
|
target_endian: "little".to_string(),
|
|
|
|
|
target_pointer_width: "64".to_string(),
|
|
|
|
|
target_c_int_width: "32".to_string(),
|
|
|
|
|
target_os: "none".to_string(),
|
2018-08-23 10:14:52 +02:00
|
|
|
target_env: String::new(),
|
|
|
|
|
target_vendor: String::new(),
|
2018-08-09 22:04:55 +02:00
|
|
|
data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".to_string(),
|
|
|
|
|
arch: "aarch64".to_string(),
|
|
|
|
|
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
|
|
|
|
|
options: opts,
|
2020-10-05 15:37:55 +03:00
|
|
|
}
|
2018-08-09 22:04:55 +02:00
|
|
|
}
|