Skip to content

Commit

Permalink
add mips64r6 target_arch detection
Browse files Browse the repository at this point in the history
  • Loading branch information
chenx97 committed Jun 7, 2023
1 parent f171596 commit 1ad5a79
Show file tree
Hide file tree
Showing 12 changed files with 25 additions and 13 deletions.
2 changes: 1 addition & 1 deletion build.rs
Expand Up @@ -34,7 +34,7 @@ const ALLOWED_CFGS: &'static [&'static str] = &[
const CHECK_CFG_EXTRA: &'static [(&'static str, &'static [&'static str])] = &[
("target_os", &["switch", "aix", "ohos"]),
("target_env", &["illumos", "wasi", "aix", "ohos"]),
("target_arch", &["loongarch64"]),
("target_arch", &["loongarch64", "mips64r6"]),
];

fn main() {
Expand Down
2 changes: 1 addition & 1 deletion src/unix/bsd/netbsdlike/openbsd/mod.rs
Expand Up @@ -1961,7 +1961,7 @@ cfg_if! {
} else if #[cfg(target_arch = "arm")] {
mod arm;
pub use self::arm::*;
} else if #[cfg(target_arch = "mips64")] {
} else if #[cfg(any(target_arch = "mips64", target_arch = "mips64r6"))] {
mod mips64;
pub use self::mips64::*;
} else if #[cfg(target_arch = "powerpc")] {
Expand Down
2 changes: 2 additions & 0 deletions src/unix/linux_like/linux/align.rs
Expand Up @@ -5,6 +5,7 @@ macro_rules! expand_align {
target_arch = "x86_64",
target_arch = "powerpc64",
target_arch = "mips64",
target_arch = "mips64r6",
target_arch = "s390x",
target_arch = "sparc64",
target_arch = "aarch64",
Expand All @@ -16,6 +17,7 @@ macro_rules! expand_align {
target_arch = "x86_64",
target_arch = "powerpc64",
target_arch = "mips64",
target_arch = "mips64r6",
target_arch = "s390x",
target_arch = "sparc64",
target_arch = "aarch64",
Expand Down
2 changes: 1 addition & 1 deletion src/unix/linux_like/linux/arch/mips/mod.rs
Expand Up @@ -272,7 +272,7 @@ cfg_if! {
}

cfg_if! {
if #[cfg(target_arch = "mips64",
if #[cfg(any(target_arch = "mips64", target_arch = "mips64r6"),
any(target_env = "gnu",
target_env = "uclibc"))] {
pub const RLIM_INFINITY: ::rlim_t = !0;
Expand Down
2 changes: 1 addition & 1 deletion src/unix/linux_like/linux/arch/mod.rs
@@ -1,5 +1,5 @@
cfg_if! {
if #[cfg(any(target_arch = "mips", target_arch = "mips64"))] {
if #[cfg(any(target_arch = "mips", target_arch = "mips64", target_arch = "mips64r6"))] {
mod mips;
pub use self::mips::*;
} else if #[cfg(any(target_arch = "powerpc", target_arch = "powerpc64"))] {
Expand Down
4 changes: 3 additions & 1 deletion src/unix/linux_like/linux/gnu/b64/mod.rs
Expand Up @@ -72,6 +72,7 @@ s! {
target_arch = "aarch64",
target_arch = "loongarch64",
target_arch = "mips64",
target_arch = "mips64r6",
target_arch = "powerpc64",
target_arch = "riscv64",
target_arch = "sparc64")))]
Expand All @@ -81,6 +82,7 @@ s! {
target_arch = "aarch64",
target_arch = "loongarch64",
target_arch = "mips64",
target_arch = "mips64r6",
target_arch = "powerpc64",
target_arch = "riscv64",
target_arch = "sparc64")))]
Expand All @@ -105,7 +107,7 @@ cfg_if! {
} else if #[cfg(any(target_arch = "sparc64"))] {
mod sparc64;
pub use self::sparc64::*;
} else if #[cfg(any(target_arch = "mips64"))] {
} else if #[cfg(any(target_arch = "mips64", target_arch = "mips64r6"))] {
mod mips64;
pub use self::mips64::*;
} else if #[cfg(any(target_arch = "s390x"))] {
Expand Down
9 changes: 6 additions & 3 deletions src/unix/linux_like/linux/gnu/mod.rs
Expand Up @@ -116,13 +116,15 @@ s! {
target_arch = "sparc",
target_arch = "sparc64",
target_arch = "mips",
target_arch = "mips64")))]
target_arch = "mips64",
target_arch = "mips64r6")))]
pub c_ispeed: ::speed_t,
#[cfg(not(any(
target_arch = "sparc",
target_arch = "sparc64",
target_arch = "mips",
target_arch = "mips64")))]
target_arch = "mips64",
target_arch = "mips64r6")))]
pub c_ospeed: ::speed_t,
}

Expand Down Expand Up @@ -954,7 +956,7 @@ pub const KEYCTL_SUPPORTS_DECRYPT: u32 = 0x02;
pub const KEYCTL_SUPPORTS_SIGN: u32 = 0x04;
pub const KEYCTL_SUPPORTS_VERIFY: u32 = 0x08;
cfg_if! {
if #[cfg(not(any(target_arch="mips", target_arch="mips64")))] {
if #[cfg(not(any(target_arch="mips", target_arch="mips64", target_arch = "mips64r6")))] {
pub const KEYCTL_MOVE: u32 = 30;
pub const KEYCTL_CAPABILITIES: u32 = 31;

Expand Down Expand Up @@ -1388,6 +1390,7 @@ cfg_if! {
target_arch = "aarch64",
target_arch = "powerpc64",
target_arch = "mips64",
target_arch = "mips64r6",
target_arch = "s390x",
target_arch = "sparc64",
target_arch = "riscv64",
Expand Down
1 change: 1 addition & 0 deletions src/unix/linux_like/linux/musl/mod.rs
Expand Up @@ -789,6 +789,7 @@ cfg_if! {
if #[cfg(any(target_arch = "x86_64",
target_arch = "aarch64",
target_arch = "mips64",
target_arch = "mips64r6",
target_arch = "powerpc64",
target_arch = "s390x",
target_arch = "riscv64"))] {
Expand Down
2 changes: 2 additions & 0 deletions src/unix/linux_like/linux/no_align.rs
Expand Up @@ -5,6 +5,7 @@ macro_rules! expand_align {
#[cfg(any(target_arch = "x86_64",
target_arch = "powerpc64",
target_arch = "mips64",
target_arch = "mips64r6",
target_arch = "s390x",
target_arch = "sparc64",
target_arch = "riscv64",
Expand All @@ -16,6 +17,7 @@ macro_rules! expand_align {
#[cfg(not(any(target_arch = "x86_64",
target_arch = "powerpc64",
target_arch = "mips64",
target_arch = "mips64r6",
target_arch = "s390x",
target_arch = "sparc64",
target_arch = "riscv64",
Expand Down
2 changes: 2 additions & 0 deletions src/unix/linux_like/linux/uclibc/align.rs
Expand Up @@ -5,13 +5,15 @@ macro_rules! expand_align {
target_arch = "x86_64",
target_arch = "powerpc64",
target_arch = "mips64",
target_arch = "mips64r6",
target_arch = "s390x",
target_arch = "sparc64"),
repr(align(4)))]
#[cfg_attr(not(any(target_pointer_width = "32",
target_arch = "x86_64",
target_arch = "powerpc64",
target_arch = "mips64",
target_arch = "mips64r6",
target_arch = "s390x",
target_arch = "sparc64")),
repr(align(8)))]
Expand Down
2 changes: 1 addition & 1 deletion src/unix/linux_like/linux/uclibc/mips/mod.rs
Expand Up @@ -301,7 +301,7 @@ cfg_if! {
if #[cfg(target_arch = "mips")] {
mod mips32;
pub use self::mips32::*;
} else if #[cfg(target_arch = "mips64")] {
} else if #[cfg(any(target_arch = "mips64", target_arch = "mips64r6"))] {
mod mips64;
pub use self::mips64::*;
} else {
Expand Down
8 changes: 4 additions & 4 deletions src/unix/newlib/no_align.rs
Expand Up @@ -27,12 +27,12 @@ macro_rules! expand_align {

pub struct pthread_mutexattr_t { // Unverified
#[cfg(any(target_arch = "x86_64", target_arch = "powerpc64",
target_arch = "mips64", target_arch = "s390x",
target_arch = "sparc64"))]
target_arch = "mips64", target_arch = "mips64r6",
target_arch = "s390x", target_arch = "sparc64"))]
__align: [::c_int; 0],
#[cfg(not(any(target_arch = "x86_64", target_arch = "powerpc64",
target_arch = "mips64", target_arch = "s390x",
target_arch = "sparc64")))]
target_arch = "mips64", target_arch = "mips64r6",
target_arch = "s390x", target_arch = "sparc64")))]
__align: [::c_long; 0],
size: [u8; ::__SIZEOF_PTHREAD_MUTEXATTR_T],
}
Expand Down

0 comments on commit 1ad5a79

Please sign in to comment.