]> git.lizzy.rs Git - rust.git/blob - src/librustc_target/spec/armv7a_none_eabihf.rs
Rollup merge of #71627 - ldm0:autoderefarg, r=Dylan-DPC
[rust.git] / src / librustc_target / spec / armv7a_none_eabihf.rs
1 // Generic ARMv7-A target for bare-metal code - floating point enabled (assumes
2 // FPU is present and emits FPU instructions)
3 //
4 // This is basically the `armv7-unknown-linux-gnueabihf` target with some
5 // changes (list in `armv7a_none_eabi.rs`) to bring it closer to the bare-metal
6 // `thumb` & `aarch64` targets.
7
8 use super::{LinkerFlavor, LldFlavor, PanicStrategy, RelocModel, Target, TargetOptions};
9
10 pub fn target() -> Result<Target, String> {
11     let opts = TargetOptions {
12         linker: Some("rust-lld".to_owned()),
13         features: "+v7,+vfp3,-d32,+thumb2,-neon,+strict-align".to_string(),
14         executables: true,
15         relocation_model: RelocModel::Static,
16         disable_redzone: true,
17         max_atomic_width: Some(64),
18         panic_strategy: PanicStrategy::Abort,
19         abi_blacklist: super::arm_base::abi_blacklist(),
20         emit_debug_gdb_scripts: false,
21         ..Default::default()
22     };
23     Ok(Target {
24         llvm_target: "armv7a-none-eabihf".to_string(),
25         target_endian: "little".to_string(),
26         target_pointer_width: "32".to_string(),
27         target_c_int_width: "32".to_string(),
28         target_os: "none".to_string(),
29         target_env: String::new(),
30         target_vendor: String::new(),
31         data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
32         arch: "arm".to_string(),
33         linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
34         options: opts,
35     })
36 }