Skip to content

Commit a03f108

Browse files
committed
mips32: require LLVM ABI to be explicitly set
1 parent 57fb5cf commit a03f108

12 files changed

Lines changed: 17 additions & 5 deletions

compiler/rustc_target/src/spec/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3404,9 +3404,7 @@ impl Target {
34043404
check!(self.rustc_abi.is_none(), "`rustc_abi` is unused on MIPS");
34053405
check_matches!(
34063406
(&*self.llvm_abiname, &self.cfg_abi),
3407-
// FIXME: we should force it to always be non-empty.
3408-
("o32", Abi::Unspecified | Abi::Other(_))
3409-
| ("", Abi::Unspecified | Abi::Other(_)),
3407+
("o32", Abi::Unspecified | Abi::Other(_)),
34103408
"invalid MIPS ABI name and `cfg(target_abi)` combination:\n\
34113409
ABI name: {}\n\
34123410
cfg(target_abi): {}",

compiler/rustc_target/src/spec/targets/mips_mti_none_elf.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ pub(crate) fn target() -> Target {
2424
endian: Endian::Big,
2525
cpu: "mips32r2".into(),
2626

27+
llvm_abiname: "o32".into(),
2728
max_atomic_width: Some(32),
2829

2930
features: "+mips32r2,+soft-float,+noabicalls".into(),

compiler/rustc_target/src/spec/targets/mips_unknown_linux_gnu.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ pub(crate) fn target() -> Target {
1818
endian: Endian::Big,
1919
cpu: "mips32r2".into(),
2020
features: "+mips32r2,+fpxx,+nooddspreg".into(),
21+
llvm_abiname: "o32".into(),
2122
max_atomic_width: Some(32),
2223
mcount: "_mcount".into(),
2324

compiler/rustc_target/src/spec/targets/mips_unknown_linux_musl.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ pub(crate) fn target() -> Target {
1818
pointer_width: 32,
1919
data_layout: "E-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".into(),
2020
arch: Arch::Mips,
21-
options: TargetOptions { endian: Endian::Big, mcount: "_mcount".into(), ..base },
21+
options: TargetOptions {
22+
endian: Endian::Big,
23+
llvm_abiname: "o32".into(),
24+
mcount: "_mcount".into(),
25+
..base
26+
},
2227
}
2328
}

compiler/rustc_target/src/spec/targets/mips_unknown_linux_uclibc.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ pub(crate) fn target() -> Target {
1818
endian: Endian::Big,
1919
cpu: "mips32r2".into(),
2020
features: "+mips32r2,+soft-float".into(),
21+
llvm_abiname: "o32".into(),
2122
max_atomic_width: Some(32),
2223
mcount: "_mcount".into(),
2324

compiler/rustc_target/src/spec/targets/mipsel_mti_none_elf.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ pub(crate) fn target() -> Target {
2424
endian: Endian::Little,
2525
cpu: "mips32r2".into(),
2626

27+
llvm_abiname: "o32".into(),
2728
max_atomic_width: Some(32),
2829

2930
features: "+mips32r2,+soft-float,+noabicalls".into(),

compiler/rustc_target/src/spec/targets/mipsel_sony_psp.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ pub(crate) fn target() -> Target {
3636

3737
// PSP does not support trap-on-condition instructions.
3838
llvm_args: cvs!["-mno-check-zero-division"],
39+
llvm_abiname: "o32".into(),
3940
pre_link_args,
4041
link_script: Some(LINKER_SCRIPT.into()),
4142
..Default::default()

compiler/rustc_target/src/spec/targets/mipsel_unknown_linux_gnu.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ pub(crate) fn target() -> Target {
1616
options: TargetOptions {
1717
cpu: "mips32r2".into(),
1818
features: "+mips32r2,+fpxx,+nooddspreg".into(),
19+
llvm_abiname: "o32".into(),
1920
max_atomic_width: Some(32),
2021
mcount: "_mcount".into(),
2122

compiler/rustc_target/src/spec/targets/mipsel_unknown_linux_musl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ pub(crate) fn target() -> Target {
1616
pointer_width: 32,
1717
data_layout: "e-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".into(),
1818
arch: Arch::Mips,
19-
options: TargetOptions { mcount: "_mcount".into(), ..base },
19+
options: TargetOptions { llvm_abiname: "o32".into(), mcount: "_mcount".into(), ..base },
2020
}
2121
}

compiler/rustc_target/src/spec/targets/mipsel_unknown_linux_uclibc.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ pub(crate) fn target() -> Target {
1616
options: TargetOptions {
1717
cpu: "mips32r2".into(),
1818
features: "+mips32r2,+soft-float".into(),
19+
llvm_abiname: "o32".into(),
1920
max_atomic_width: Some(32),
2021
mcount: "_mcount".into(),
2122

0 commit comments

Comments
 (0)