|
| 1 | +use crate::spec::{LinkArgs, LinkerFlavor, PanicStrategy, 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".to_string(), |
| 13 | + "-g".to_string(), |
| 14 | + "-march=armv6k".to_string(), |
| 15 | + "-mtune=mpcore".to_string(), |
| 16 | + "-mfloat-abi=hard".to_string(), |
| 17 | + "-mtp=soft".to_string(), |
| 18 | + ], |
| 19 | + ); |
| 20 | + |
| 21 | + Target { |
| 22 | + llvm_target: "arm-none-eabihf".to_string(), |
| 23 | + pointer_width: 32, |
| 24 | + data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), |
| 25 | + arch: "arm".to_string(), |
| 26 | + |
| 27 | + options: TargetOptions { |
| 28 | + os: "horizon".to_string(), |
| 29 | + env: "newlib".to_string(), |
| 30 | + vendor: "nintendo".to_string(), |
| 31 | + abi: "eabihf".to_string(), |
| 32 | + linker_flavor: LinkerFlavor::Gcc, |
| 33 | + cpu: "mpcore".to_string(), |
| 34 | + executables: true, |
| 35 | + families: vec!["unix".to_string()], |
| 36 | + linker: Some("arm-none-eabi-gcc".to_string()), |
| 37 | + relocation_model: RelocModel::Static, |
| 38 | + features: "+vfp2".to_string(), |
| 39 | + pre_link_args, |
| 40 | + exe_suffix: ".elf".to_string(), |
| 41 | + panic_strategy: PanicStrategy::Abort, |
| 42 | + ..Default::default() |
| 43 | + }, |
| 44 | + } |
| 45 | +} |
0 commit comments