rustc_target/spec/targets/
armv6k_nintendo_3ds.rs

1use crate::spec::{
2    Cc, FloatAbi, LinkerFlavor, Lld, RelocModel, Target, TargetMetadata, TargetOptions, cvs,
3};
4
5/// A base target for Nintendo 3DS devices using the devkitARM toolchain.
6///
7/// Requires the devkitARM toolchain for 3DS targets on the host system.
8
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: "arm".into(),
26
27        options: TargetOptions {
28            os: "horizon".into(),
29            env: "newlib".into(),
30            vendor: "nintendo".into(),
31            cpu: "mpcore".into(),
32            abi: "eabihf".into(),
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}