Skip to content

Commit 91fcbfa

Browse files
committed
[mips64-openwrt-musl] Tier 3 tuple for Mips64 OpenWrt
This incorporates rust-lang into the OpenWrt build system for Mips64 targets. Signed-off-by: Donald Hoskins <grommish@gmail.com>
1 parent 08df8b8 commit 91fcbfa

File tree

4 files changed

+57
-0
lines changed

4 files changed

+57
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/// A target tuple for OpenWrt MIPS64 targets
2+
///
3+
use crate::abi::Endian;
4+
use crate::spec::{Target, TargetOptions};
5+
6+
pub fn target() -> Target {
7+
let mut base = super::linux_musl_base::opts();
8+
base.cpu = "mips64r2".to_string();
9+
base.features = "+mips64r2".to_string();
10+
base.max_atomic_width = Some(64);
11+
base.crt_static_default = false;
12+
13+
Target {
14+
// LLVM doesn't recognize "muslabi64" yet.
15+
llvm_target: "mips64-unknown-linux-musl".to_string(),
16+
pointer_width: 64,
17+
data_layout: "E-m:e-i8:8:32-i16:16:32-i64:64-n32:64-S128".to_string(),
18+
arch: "mips64".to_string(),
19+
options: TargetOptions {
20+
abi: "abi64".to_string(),
21+
endian: Endian::Big,
22+
mcount: "_mcount".to_string(),
23+
..base
24+
},
25+
}
26+
}

compiler/rustc_target/src/spec/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1016,6 +1016,8 @@ supported_targets! {
10161016
("armv7-unknown-linux-uclibceabihf", armv7_unknown_linux_uclibceabihf),
10171017

10181018
("x86_64-unknown-none", x86_64_unknown_none),
1019+
1020+
("mips64-openwrt-linux-musl", mips64_openwrt_linux_musl),
10191021
}
10201022

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

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

+1
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ target | std | host | notes
244244
`i686-wrs-vxworks` | ? | |
245245
`m68k-unknown-linux-gnu` | ? | | Motorola 680x0 Linux
246246
`mips-unknown-linux-uclibc` | ✓ | | MIPS Linux with uClibc
247+
`mips64-openwrt-linux-musl` | ? | | MIPS64 for OpenWrt Linux MUSL
247248
`mipsel-sony-psp` | * | | MIPS (LE) Sony PlayStation Portable (PSP)
248249
`mipsel-unknown-linux-uclibc` | ✓ | | MIPS (LE) Linux with uClibc
249250
`mipsel-unknown-none` | * | | Bare MIPS (LE) softfloat
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# `mips64-openwrt-linux-musl`
2+
**Tier: 3**
3+
4+
## Target maintainers
5+
- Donald Hoskins `grommish@gmail.com`, https://github.com/Itus-Shield
6+
7+
## Requirements
8+
This target is cross-compiled. There is no support for `std`. There is no
9+
default allocator, but it's possible to use `alloc` by supplying an allocator.
10+
11+
By default, Rust code generated for this target uses `-msoft-float` and is
12+
dynamically linked.
13+
14+
This target generated binaries in the ELF format.
15+
16+
## Building the target
17+
This target is built exclusively within the `OpenWrt` build system via
18+
the `rust-lang` HOST package
19+
20+
## Building Rust programs
21+
Rust does not yet ship pre-compiled artifacts for this target. To compile for
22+
this target, you will either need to build Rust with the target enabled (see
23+
"Building the target" above).
24+
25+
## Testing
26+
As `mips64-openwrt-linux-musl` supports a variety of different environments and does
27+
not support `std`, this target does not support running the Rust testsuite at this
28+
time.

0 commit comments

Comments
 (0)