Skip to content

Commit b15a07f

Browse files
authored
Rollup merge of rust-lang#63165 - xen0n:mips64-musl-targets, r=alexcrichton
Add builtin targets for mips64(el)-unknown-linux-muslabi64 This is prerequisite for rust-lang/libc#1449. Tested locally to produce working static and dynamic binaries, ~~but CI config is untested for now~~ CI is to be added in a follow-up PR. *edit: dynamic binaries also confirmed working!* *edit 2: changed triples to include ABI, and removed stray `crt_static_default = false` declarations to be consistent with other musl targets`
2 parents c01be67 + 30fcd50 commit b15a07f

File tree

3 files changed

+52
-0
lines changed

3 files changed

+52
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
2+
3+
pub fn target() -> TargetResult {
4+
let mut base = super::linux_musl_base::opts();
5+
base.cpu = "mips64r2".to_string();
6+
base.features = "+mips64r2".to_string();
7+
base.max_atomic_width = Some(64);
8+
Ok(Target {
9+
// LLVM doesn't recognize "muslabi64" yet.
10+
llvm_target: "mips64-unknown-linux-musl".to_string(),
11+
target_endian: "big".to_string(),
12+
target_pointer_width: "64".to_string(),
13+
target_c_int_width: "32".to_string(),
14+
data_layout: "E-m:e-i8:8:32-i16:16:32-i64:64-n32:64-S128".to_string(),
15+
arch: "mips64".to_string(),
16+
target_os: "linux".to_string(),
17+
target_env: "musl".to_string(),
18+
target_vendor: "unknown".to_string(),
19+
linker_flavor: LinkerFlavor::Gcc,
20+
options: TargetOptions {
21+
target_mcount: "_mcount".to_string(),
22+
.. base
23+
},
24+
})
25+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
2+
3+
pub fn target() -> TargetResult {
4+
let mut base = super::linux_musl_base::opts();
5+
base.cpu = "mips64r2".to_string();
6+
base.features = "+mips64r2".to_string();
7+
base.max_atomic_width = Some(64);
8+
Ok(Target {
9+
// LLVM doesn't recognize "muslabi64" yet.
10+
llvm_target: "mips64el-unknown-linux-musl".to_string(),
11+
target_endian: "little".to_string(),
12+
target_pointer_width: "64".to_string(),
13+
target_c_int_width: "32".to_string(),
14+
data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-n32:64-S128".to_string(),
15+
arch: "mips64".to_string(),
16+
target_os: "linux".to_string(),
17+
target_env: "musl".to_string(),
18+
target_vendor: "unknown".to_string(),
19+
linker_flavor: LinkerFlavor::Gcc,
20+
options: TargetOptions {
21+
target_mcount: "_mcount".to_string(),
22+
.. base
23+
},
24+
})
25+
}

src/librustc_target/spec/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,8 @@ supported_targets! {
371371
("i586-unknown-linux-musl", i586_unknown_linux_musl),
372372
("mips-unknown-linux-musl", mips_unknown_linux_musl),
373373
("mipsel-unknown-linux-musl", mipsel_unknown_linux_musl),
374+
("mips64-unknown-linux-muslabi64", mips64_unknown_linux_muslabi64),
375+
("mips64el-unknown-linux-muslabi64", mips64el_unknown_linux_muslabi64),
374376
("hexagon-unknown-linux-musl", hexagon_unknown_linux_musl),
375377

376378
("mips-unknown-linux-uclibc", mips_unknown_linux_uclibc),

0 commit comments

Comments
 (0)