rustc_target/spec/targets/
armv6k_nintendo_3ds.rs

1use crate::spec::{
2    Abi, Arch, Cc, Env, FloatAbi, LinkerFlavor, Lld, Os, RelocModel, Target, TargetMetadata,
3    TargetOptions, cvs,
4};
5
6/// A base target for Nintendo 3DS devices using the devkitARM toolchain.
7///
8/// Requires the devkitARM toolchain for 3DS targets on the host system.
9pub(crate) fn target() -> Target {
10    let pre_link_args = TargetOptions::link_args(
11        LinkerFlavor::Gnu(Cc::Yes, Lld::No),
12        &["-specs=3dsx.specs", "-mtune=mpcore", "-mfloat-abi=hard", "-mtp=soft"],
13    );
14
15    Target {
16        llvm_target: "armv6k-none-eabihf".into(),
17        metadata: TargetMetadata {
18            description: Some("Armv6K Nintendo 3DS, Horizon (Requires devkitARM toolchain)".into()),
19            tier: Some(3),
20            host_tools: Some(false),
21            std: None, // ?
22        },
23        pointer_width: 32,
24        data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
25        arch: Arch::Arm,
26
27        options: TargetOptions {
28            os: Os::Horizon,
29            env: Env::Newlib,
30            vendor: "nintendo".into(),
31            cpu: "mpcore".into(),
32            abi: Abi::EabiHf,
33            llvm_floatabi: Some(FloatAbi::Hard),
34            families: cvs!["unix"],
35            linker: Some("arm-none-eabi-gcc".into()),
36            relocation_model: RelocModel::Static,
37            features: "+vfp2".into(),
38            pre_link_args,
39            exe_suffix: ".elf".into(),
40            no_default_libraries: false,
41            has_thread_local: true,
42            ..Default::default()
43        },
44    }
45}