Skip to content

Commit a12e6ad

Browse files
committed
Detect MIPS32 R6
1 parent 312fcad commit a12e6ad

File tree

19 files changed

+660
-27
lines changed

19 files changed

+660
-27
lines changed

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ once_cell = { version = "1.5.2", optional = true }
3535
# addition to the libc backend. The linux_raw backend is used by default. The
3636
# libc backend can be selected via adding `--cfg=rustix_use_libc` to
3737
# `RUSTFLAGS` or enabling the `use-libc` cargo feature.
38-
[target.'cfg(all(not(rustix_use_libc), not(miri), target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))'.dependencies]
38+
[target.'cfg(all(not(rustix_use_libc), not(miri), target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))'.dependencies]
3939
linux-raw-sys = { version = "0.4.3", default-features = false, features = ["general", "errno", "ioctl", "no_std"] }
4040
libc_errno = { package = "errno", version = "0.3.1", default-features = false, optional = true }
4141
libc = { version = "0.2.147", features = ["extra_traits"], optional = true }
@@ -44,15 +44,15 @@ libc = { version = "0.2.147", features = ["extra_traits"], optional = true }
4444
#
4545
# On all other Unix-family platforms, and under Miri, we always use the libc
4646
# backend, so enable its dependencies unconditionally.
47-
[target.'cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64")))))))'.dependencies]
47+
[target.'cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64")))))))'.dependencies]
4848
libc_errno = { package = "errno", version = "0.3.1", default-features = false }
4949
libc = { version = "0.2.147", features = ["extra_traits"] }
5050

5151
# Additional dependencies for Linux with the libc backend:
5252
#
5353
# Some syscalls do not have libc wrappers, such as in `io_uring`. For these,
5454
# the libc backend uses the linux-raw-sys ABI and `libc::syscall`.
55-
[target.'cfg(all(any(target_os = "android", target_os = "linux"), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64")))))))'.dependencies]
55+
[target.'cfg(all(any(target_os = "android", target_os = "linux"), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64")))))))'.dependencies]
5656
linux-raw-sys = { version = "0.4.3", default-features = false, features = ["general", "ioctl", "no_std"] }
5757

5858
# For the libc backend on Windows, use the Winsock2 API in windows-sys.

src/backend/libc/c.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ pub(crate) const ETH_P_MCTP: c_int = linux_raw_sys::if_ether::ETH_P_MCTP as _;
6262
linux_kernel,
6363
any(
6464
target_arch = "mips",
65+
target_arch = "mips32r6",
6566
target_arch = "mips64",
6667
target_arch = "mips64r6",
6768
target_arch = "sparc",

src/backend/libc/mm/types.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ bitflags! {
201201
target_os = "redox",
202202
all(
203203
linux_kernel,
204-
any(target_arch = "mips", target_arch = "mips64", target_arch = "mips64r6"),
204+
any(target_arch = "mips", target_arch = "mips32r6", target_arch = "mips64", target_arch = "mips64r6"),
205205
)
206206
)))]
207207
const SYNC = bitcast!(c::MAP_SYNC);
@@ -335,7 +335,12 @@ pub enum Advice {
335335
/// `MADV_SOFT_OFFLINE`
336336
#[cfg(all(
337337
linux_kernel,
338-
not(any(target_arch = "mips", target_arch = "mips64", target_arch = "mips64r6"))
338+
not(any(
339+
target_arch = "mips",
340+
target_arch = "mips32r6",
341+
target_arch = "mips64",
342+
target_arch = "mips64r6"
343+
))
339344
))]
340345
LinuxSoftOffline = bitcast!(c::MADV_SOFT_OFFLINE),
341346
/// `MADV_MERGEABLE`

src/backend/libc/termios/syscalls.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ pub(crate) fn tcsetattr(
117117
let request = TCSETS2
118118
+ if cfg!(any(
119119
target_arch = "mips",
120+
target_arch = "mips32r6",
120121
target_arch = "mips64",
121122
target_arch = "mips64r6"
122123
)) {

0 commit comments

Comments
 (0)