]> git.lizzy.rs Git - rust.git/blob - src/librustc_target/spec/thumbv7em_none_eabi.rs
change the default linker of the ARM Cortex-M targets
[rust.git] / src / librustc_target / spec / thumbv7em_none_eabi.rs
1 // Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 // Targets the Cortex-M4 and Cortex-M7 processors (ARMv7E-M)
12 //
13 // This target assumes that the device doesn't have a FPU (Floating Point Unit) and lowers all the
14 // floating point operations to software routines (intrinsics).
15 //
16 // As such, this target uses the "soft" calling convention (ABI) where floating point values are
17 // passed to/from subroutines via general purpose registers (R0, R1, etc.).
18 //
19 // To opt-in to hardware accelerated floating point operations, you can use, for example,
20 // `-C target-feature=+vfp4` or `-C target-cpu=cortex-m4`.
21
22 use spec::{LinkerFlavor, LldFlavor, Target, TargetOptions, TargetResult};
23
24 pub fn target() -> TargetResult {
25     Ok(Target {
26         llvm_target: "thumbv7em-none-eabi".to_string(),
27         target_endian: "little".to_string(),
28         target_pointer_width: "32".to_string(),
29         target_c_int_width: "32".to_string(),
30         data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
31         arch: "arm".to_string(),
32         target_os: "none".to_string(),
33         target_env: String::new(),
34         target_vendor: String::new(),
35         linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
36
37         options: TargetOptions {
38             max_atomic_width: Some(32),
39             .. super::thumb_base::opts()
40         },
41     })
42 }