]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_target/src/spec/armv6k_nintendo_3ds.rs
Rollup merge of #95446 - notseanray:master, r=Mark-Simulacrum
[rust.git] / compiler / rustc_target / src / spec / armv6k_nintendo_3ds.rs
1 use crate::spec::{cvs, LinkArgs, LinkerFlavor, 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 mut pre_link_args = LinkArgs::new();
9     pre_link_args.insert(
10         LinkerFlavor::Gcc,
11         vec![
12             "-specs=3dsx.specs".into(),
13             "-mtune=mpcore".into(),
14             "-mfloat-abi=hard".into(),
15             "-mtp=soft".into(),
16         ],
17     );
18
19     Target {
20         llvm_target: "armv6k-none-eabihf".into(),
21         pointer_width: 32,
22         data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
23         arch: "arm".into(),
24
25         options: TargetOptions {
26             os: "horizon".into(),
27             env: "newlib".into(),
28             vendor: "nintendo".into(),
29             abi: "eabihf".into(),
30             linker_flavor: LinkerFlavor::Gcc,
31             cpu: "mpcore".into(),
32             executables: true,
33             families: cvs!["unix"],
34             linker: Some("arm-none-eabi-gcc".into()),
35             relocation_model: RelocModel::Static,
36             features: "+vfp2".into(),
37             pre_link_args,
38             exe_suffix: ".elf".into(),
39             no_default_libraries: false,
40             // There are some issues in debug builds with this enabled in certain programs.
41             has_thread_local: false,
42             ..Default::default()
43         },
44     }
45 }