]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_target/src/spec/armv6k_nintendo_3ds.rs
Auto merge of #2680 - RalfJung:rustup, r=RalfJung
[rust.git] / compiler / rustc_target / src / spec / armv6k_nintendo_3ds.rs
1 use crate::spec::{cvs, Cc, LinkerFlavor, Lld, RelocModel, Target, TargetOptions};
2
3 /// A base target for Nintendo 3DS devices using the devkitARM toolchain.
4 ///
5 /// Requires the devkitARM toolchain for 3DS targets on the host system.
6
7 pub fn target() -> Target {
8     let pre_link_args = TargetOptions::link_args(
9         LinkerFlavor::Gnu(Cc::Yes, Lld::No),
10         &["-specs=3dsx.specs", "-mtune=mpcore", "-mfloat-abi=hard", "-mtp=soft"],
11     );
12
13     Target {
14         llvm_target: "armv6k-none-eabihf".into(),
15         pointer_width: 32,
16         data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
17         arch: "arm".into(),
18
19         options: TargetOptions {
20             os: "horizon".into(),
21             env: "newlib".into(),
22             vendor: "nintendo".into(),
23             abi: "eabihf".into(),
24             cpu: "mpcore".into(),
25             families: cvs!["unix"],
26             linker: Some("arm-none-eabi-gcc".into()),
27             relocation_model: RelocModel::Static,
28             features: "+vfp2".into(),
29             pre_link_args,
30             exe_suffix: ".elf".into(),
31             no_default_libraries: false,
32             // There are some issues in debug builds with this enabled in certain programs.
33             has_thread_local: false,
34             ..Default::default()
35         },
36     }
37 }