Skip to content

Commit 797487c

Browse files
committed
Auto merge of #112374 - chenx97:better-mips64r6, r=jackh726
add mips64r6 and mips32r6 as target_arch values This PR introduces `"mips32r6"` and `"mips64r6"` as valid `target_arch` values, and would be the arch value used by Tier-3 targets `mipsisa32r6-unknown-linux-gnu`, `mipsisa32r6el-unknown-linux-gnu`, `mipsisa64r6-unknown-linux-gnuabi64` and `mipsisa64r6el-unknown-linux-gnuabi64`. This PR was inspired by `rustix` attempting to link traditional mips64el objects with mips64r6el objects when building for mips64r6, even though `rustix` recently removed outline assembly support. This is because currently this target's `target_arch` is `"mips64"` and rustix has its respective assembly implementation as well as a pre-compiled little-endian static library prepared for mips64el, a tier-2 target with the same `target_arch`. After some [discussions on zulip](https://rust-lang.zulipchat.com/#narrow/stream/233931-t-compiler.2Fmajor-changes/topic/Add.20New.20Values.20To.20MIPS_ALLOWED_FEATURES.20compiler-team.23595), I decided to treat mips64r6 as an independent architecture from Rust's POV, since these two architectures are incompatible anyway. This PR is now waiting for `libc` to release a new version with [support](rust-lang/libc#3268) for these `target_arch` values. It is not expected to introduce changes to any other target, especially Tier-1 and Tier-2 targets. This PR has its corresponding [MCP](rust-lang/compiler-team#632) approved.
2 parents 206cf90 + aecdcad commit 797487c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/shims/foreign_items.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
4545
// List taken from `library/std/src/sys/common/alloc.rs`.
4646
// This list should be kept in sync with the one from libstd.
4747
let min_align = match this.tcx.sess.target.arch.as_ref() {
48-
"x86" | "arm" | "mips" | "powerpc" | "powerpc64" | "asmjs" | "wasm32" => 8,
49-
"x86_64" | "aarch64" | "mips64" | "s390x" | "sparc64" | "loongarch64" => 16,
48+
"x86" | "arm" | "mips" | "mips32r6" | "powerpc" | "powerpc64" | "asmjs" | "wasm32" => 8,
49+
"x86_64" | "aarch64" | "mips64" | "mips64r6" | "s390x" | "sparc64" | "loongarch64" =>
50+
16,
5051
arch => bug!("unsupported target architecture for malloc: `{}`", arch),
5152
};
5253
// Windows always aligns, even small allocations.

0 commit comments

Comments
 (0)