rustc_target/spec/targets/
armv6k_nintendo_3ds.rs

1use crate::spec::{Cc, FloatAbi, LinkerFlavor, Lld, RelocModel, Target, TargetOptions, cvs};
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
7pub(crate) 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        metadata: crate::spec::TargetMetadata {
16            description: Some("Armv6K Nintendo 3DS, Horizon (Requires devkitARM toolchain)".into()),
17            tier: Some(3),
18            host_tools: Some(false),
19            std: None, // ?
20        },
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            cpu: "mpcore".into(),
30            abi: "eabihf".into(),
31            llvm_floatabi: Some(FloatAbi::Hard),
32            families: cvs!["unix"],
33            linker: Some("arm-none-eabi-gcc".into()),
34            relocation_model: RelocModel::Static,
35            features: "+vfp2".into(),
36            pre_link_args,
37            exe_suffix: ".elf".into(),
38            no_default_libraries: false,
39            has_thread_local: true,
40            ..Default::default()
41        },
42    }
43}