Skip to content

Commit 8078c4c

Browse files
committed
ARMv6K Nintendo 3DS Tier 3 target added
1 parent fe37929 commit 8078c4c

File tree

3 files changed

+48
-0
lines changed

3 files changed

+48
-0
lines changed
+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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+
}

Diff for: compiler/rustc_target/src/spec/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -941,6 +941,8 @@ supported_targets! {
941941

942942
("bpfeb-unknown-none", bpfeb_unknown_none),
943943
("bpfel-unknown-none", bpfel_unknown_none),
944+
945+
("armv6k-nintendo-3ds", armv6k_nintendo_3ds),
944946
}
945947

946948
/// Warnings encountered when parsing the target `json`.

Diff for: src/doc/rustc/src/platform-support.md

+1
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ target | std | host | notes
217217
`armv5te-unknown-linux-uclibceabi` | ? | | ARMv5TE Linux with uClibc
218218
`armv6-unknown-freebsd` | ✓ | ✓ | ARMv6 FreeBSD
219219
`armv6-unknown-netbsd-eabihf` | ? | |
220+
`armv6k-nintendo-3ds` | * | | ARMv6K Nintendo 3DS, Horizon (Requires devkitARM toolchain)
220221
`armv7-apple-ios` | ✓ | | ARMv7 iOS, Cortex-a8
221222
`armv7-unknown-freebsd` | ✓ | ✓ | ARMv7 FreeBSD
222223
`armv7-unknown-netbsd-eabihf` | ✓ | ✓ |

0 commit comments

Comments
 (0)