Skip to content

Commit

Permalink
Require rust >= 1.26 and drop libc_int128 conditional
Browse files Browse the repository at this point in the history
[ resolve conflicts and add test skips that seem to be needed now -
  Trevor ]

(apply <rust-lang#4060> to `main`)
(cherry picked from commit 23a0d01)
  • Loading branch information
joshtriplett authored and tgross35 committed Nov 17, 2024
1 parent bf19e3e commit a618690
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 40 deletions.
9 changes: 8 additions & 1 deletion libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,9 @@ fn test_apple(target: &str) {
// FIXME: Requires the macOS 14.4 SDK.
"os_sync_wake_by_address_flags_t" | "os_sync_wait_on_address_flags_t" => true,

// FIXME: "'__uint128' undeclared" in C
"__uint128" => true,

_ => false,
}
});
Expand Down Expand Up @@ -1804,6 +1807,10 @@ fn test_android(target: &str) {
// These are intended to be opaque
"posix_spawn_file_actions_t" => true,
"posix_spawnattr_t" => true,

// FIXME: "'__uint128' undeclared" in C
"__uint128" => true,

_ => false,
}
});
Expand Down Expand Up @@ -3659,7 +3666,7 @@ fn test_linux(target: &str) {
"priority_t" if musl => true,
"name_t" if musl => true,

// FIXME: Somehow fails to test after removing cfg hacks:
// FIXME: "'__uint128' undeclared" in C
"__uint128" => true,

t => {
Expand Down
11 changes: 10 additions & 1 deletion src/fixed_width_ints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,16 @@ pub type uint32_t = u32;
pub type uint64_t = u64;

cfg_if! {
if #[cfg(all(target_arch = "aarch64", not(any(target_os = "windows", target_os = "macos", target_os = "ios", target_os = "tvos", target_os = "watchos"))))] {
if #[cfg(all(
target_arch = "aarch64",
not(any(
target_os = "windows",
target_os = "macos",
target_os = "ios",
target_os = "tvos",
target_os = "watchos",
))
))] {
// This introduces partial support for FFI with __int128 and
// equivalent types on platforms where Rust's definition is validated
// to match the standard C ABI of that platform.
Expand Down
7 changes: 0 additions & 7 deletions src/unix/linux_like/android/b64/aarch64/int128.rs

This file was deleted.

9 changes: 6 additions & 3 deletions src/unix/linux_like/android/b64/aarch64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ s! {
// auto-derive traits like Debug
__reserved: [[u64; 32]; 16],
}

pub struct user_fpsimd_struct {
pub vregs: [::__uint128_t; 32],
pub fpsr: u32,
pub fpcr: u32,
}
}

s_no_extra_traits! {
Expand Down Expand Up @@ -466,6 +472,3 @@ pub const PROT_MTE: ::c_int = 0x20;
// From NDK's asm/auxvec.h
pub const AT_SYSINFO_EHDR: ::c_ulong = 33;
pub const AT_VECTOR_SIZE_ARCH: ::c_ulong = 2;

mod int128;
pub use self::int128::*;
8 changes: 0 additions & 8 deletions src/unix/linux_like/linux/gnu/b64/aarch64/fallback.rs

This file was deleted.

7 changes: 0 additions & 7 deletions src/unix/linux_like/linux/gnu/b64/aarch64/int128.rs

This file was deleted.

9 changes: 6 additions & 3 deletions src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,12 @@ s! {
__reserved: [[u64; 32]; 16],
}
pub struct user_fpsimd_struct {
pub vregs: [::__uint128_t; 32],
pub fpsr: ::c_uint,
pub fpcr: ::c_uint,
}
#[repr(align(8))]
pub struct clone_args {
pub flags: ::c_ulonglong,
Expand Down Expand Up @@ -964,6 +970,3 @@ cfg_if! {
pub use self::lp64::*;
}
}

mod int128;
pub use self::int128::*;
7 changes: 0 additions & 7 deletions src/unix/linux_like/linux/musl/b64/aarch64/int128.rs

This file was deleted.

9 changes: 6 additions & 3 deletions src/unix/linux_like/linux/musl/b64/aarch64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@ s! {
pub set_tid_size: ::c_ulonglong,
pub cgroup: ::c_ulonglong,
}

pub struct user_fpsimd_struct {
pub vregs: [::__uint128_t; 32],
pub fpsr: u32,
pub fpcr: u32,
}
}

s_no_extra_traits! {
Expand Down Expand Up @@ -686,6 +692,3 @@ pub const VMIN: usize = 6;
pub const IEXTEN: ::tcflag_t = 0x00008000;
pub const TOSTOP: ::tcflag_t = 0x00000100;
pub const FLUSHO: ::tcflag_t = 0x00001000;

mod int128;
pub use self::int128::*;

0 comments on commit a618690

Please sign in to comment.