Skip to content

Commit 1cb137b

Browse files
authored
Rollup merge of #78676 - kiffie:embedded-bare-mipsr2, r=jonas-schievink
add mipsel-unknown-none target This adds a target for bare MIPS32r2, little endian, softfloat. This target can be used for PIC32 microcontrollers (or possibly for other devices that have a MIPS MCU core such as the M4K core). Tried to find a name for the target that is in line with the naming scheme apparently used for the other MIPS targets. r? `@jonas-schievink`
2 parents cf06217 + 5130f2e commit 1cb137b

File tree

3 files changed

+44
-0
lines changed

3 files changed

+44
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
//! Bare MIPS32r2, little endian, softfloat, O32 calling convention
2+
//!
3+
//! Can be used for MIPS M4K core (e.g. on PIC32MX devices)
4+
5+
use crate::spec::abi::Abi;
6+
use crate::spec::{LinkerFlavor, LldFlavor, RelocModel};
7+
use crate::spec::{PanicStrategy, Target, TargetOptions};
8+
9+
pub fn target() -> Target {
10+
Target {
11+
llvm_target: "mipsel-unknown-none".to_string(),
12+
target_endian: "little".to_string(),
13+
pointer_width: 32,
14+
target_c_int_width: "32".to_string(),
15+
data_layout: "e-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".to_string(),
16+
arch: "mips".to_string(),
17+
target_os: "none".to_string(),
18+
target_env: String::new(),
19+
target_vendor: String::new(),
20+
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
21+
22+
options: TargetOptions {
23+
cpu: "mips32r2".to_string(),
24+
features: "+mips32r2,+soft-float,+noabicalls".to_string(),
25+
max_atomic_width: Some(32),
26+
executables: true,
27+
linker: Some("rust-lld".to_owned()),
28+
panic_strategy: PanicStrategy::Abort,
29+
relocation_model: RelocModel::Static,
30+
unsupported_abis: vec![
31+
Abi::Stdcall,
32+
Abi::Fastcall,
33+
Abi::Vectorcall,
34+
Abi::Thiscall,
35+
Abi::Win64,
36+
Abi::SysV64,
37+
],
38+
emit_debug_gdb_scripts: false,
39+
..Default::default()
40+
},
41+
}
42+
}

compiler/rustc_target/src/spec/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -653,6 +653,7 @@ supported_targets! {
653653
("powerpc64-wrs-vxworks", powerpc64_wrs_vxworks),
654654

655655
("mipsel-sony-psp", mipsel_sony_psp),
656+
("mipsel-unknown-none", mipsel_unknown_none),
656657
("thumbv4t-none-eabi", thumbv4t_none_eabi),
657658
}
658659

src/doc/rustc/src/platform-support.md

+1
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ target | std | host | notes
180180
`i686-wrs-vxworks` | ? | |
181181
`mips-unknown-linux-uclibc` | ✓ | | MIPS Linux with uClibc
182182
`mipsel-unknown-linux-uclibc` | ✓ | | MIPS (LE) Linux with uClibc
183+
`mipsel-unknown-none` | * | | Bare MIPS (LE) softfloat
183184
`mipsel-sony-psp` | * | | MIPS (LE) Sony PlayStation Portable (PSP)
184185
`mipsisa32r6-unknown-linux-gnu` | ? | |
185186
`mipsisa32r6el-unknown-linux-gnu` | ? | |

0 commit comments

Comments
 (0)