diff --git a/build.rs b/build.rs index b208a9a1c6fb0..25342e58c0f14 100644 --- a/build.rs +++ b/build.rs @@ -19,7 +19,6 @@ const ALLOWED_CFGS: &'static [&'static str] = &[ "libc_const_extern_fn_unstable", "libc_core_cvoid", "libc_deny_warnings", - "libc_int128", "libc_long_array", "libc_non_exhaustive", "libc_packedN", @@ -87,11 +86,6 @@ fn main() { set_cfg("libc_deny_warnings"); } - // Rust >= 1.26 supports i128 and u128: - if rustc_minor_ver >= 26 || rustc_dep_of_std { - set_cfg("libc_int128"); - } - // Rust >= 1.30 supports `core::ffi::c_void`, so libc can just re-export it. // Otherwise, it defines an incompatible type to retaining // backwards-compatibility. diff --git a/libc-test/build.rs b/libc-test/build.rs index 01907dff90652..b60c4ac03a5e1 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -327,6 +327,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, } }); @@ -1858,6 +1861,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, } }); @@ -3702,6 +3709,9 @@ fn test_linux(target: &str) { "priority_t" if musl => true, "name_t" if musl => true, + // FIXME: "'__uint128' undeclared" in C + "__uint128" => true, + t => { if musl { // LFS64 types have been removed in musl 1.2.4+ diff --git a/src/fixed_width_ints.rs b/src/fixed_width_ints.rs index 999de8f54f194..980ff61ecdaf3 100644 --- a/src/fixed_width_ints.rs +++ b/src/fixed_width_ints.rs @@ -20,7 +20,7 @@ pub type uint32_t = u32; pub type uint64_t = u64; cfg_if! { - if #[cfg(all(libc_int128, target_arch = "aarch64", not(target_os = "windows")))] { + if #[cfg(all(target_arch = "aarch64", not(target_os = "windows")))] { // 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. diff --git a/src/unix/bsd/apple/b64/aarch64/mod.rs b/src/unix/bsd/apple/b64/aarch64/mod.rs index 1d4a5590fbf36..dd22fcb2507b1 100644 --- a/src/unix/bsd/apple/b64/aarch64/mod.rs +++ b/src/unix/bsd/apple/b64/aarch64/mod.rs @@ -37,16 +37,8 @@ s! { pub __pad: u32, } - // This type natively uses a uint128, but for a while we hacked - // it in with repr(align) and `[u64; 2]`. uint128 isn't available - // all the way back to our earliest supported versions so we - // preserver the old shim. - #[cfg_attr(not(libc_int128), repr(align(16)))] pub struct __darwin_arm_neon_state64 { - #[cfg(libc_int128)] pub __v: [::__uint128_t; 32], - #[cfg(not(libc_int128))] - pub __v: [[u64; 2]; 32], pub __fpsr: u32, pub __fpcr: u32, } diff --git a/src/unix/linux_like/android/b64/aarch64/int128.rs b/src/unix/linux_like/android/b64/aarch64/int128.rs deleted file mode 100644 index 4535e73eeddf1..0000000000000 --- a/src/unix/linux_like/android/b64/aarch64/int128.rs +++ /dev/null @@ -1,7 +0,0 @@ -s! { - pub struct user_fpsimd_struct { - pub vregs: [::__uint128_t; 32], - pub fpsr: u32, - pub fpcr: u32, - } -} diff --git a/src/unix/linux_like/android/b64/aarch64/mod.rs b/src/unix/linux_like/android/b64/aarch64/mod.rs index d063c022bfb7e..49b990fd8f1ac 100644 --- a/src/unix/linux_like/android/b64/aarch64/mod.rs +++ b/src/unix/linux_like/android/b64/aarch64/mod.rs @@ -75,6 +75,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! { @@ -448,10 +454,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; - -cfg_if! { - if #[cfg(libc_int128)] { - mod int128; - pub use self::int128::*; - } -} diff --git a/src/unix/linux_like/linux/gnu/b64/aarch64/fallback.rs b/src/unix/linux_like/linux/gnu/b64/aarch64/fallback.rs deleted file mode 100644 index 398fbb53755c8..0000000000000 --- a/src/unix/linux_like/linux/gnu/b64/aarch64/fallback.rs +++ /dev/null @@ -1,8 +0,0 @@ -s! { - #[repr(align(16))] - pub struct user_fpsimd_struct { - pub vregs: [[u64; 2]; 32], - pub fpsr: ::c_uint, - pub fpcr: ::c_uint, - } -} diff --git a/src/unix/linux_like/linux/gnu/b64/aarch64/int128.rs b/src/unix/linux_like/linux/gnu/b64/aarch64/int128.rs deleted file mode 100644 index 4535e73eeddf1..0000000000000 --- a/src/unix/linux_like/linux/gnu/b64/aarch64/int128.rs +++ /dev/null @@ -1,7 +0,0 @@ -s! { - pub struct user_fpsimd_struct { - pub vregs: [::__uint128_t; 32], - pub fpsr: u32, - pub fpcr: u32, - } -} diff --git a/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs b/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs index 783200a6d6e9c..5ee559190a8a2 100644 --- a/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs +++ b/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs @@ -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, @@ -964,13 +970,3 @@ cfg_if! { pub use self::lp64::*; } } - -cfg_if! { - if #[cfg(libc_int128)] { - mod int128; - pub use self::int128::*; - } else { - mod fallback; - pub use self::fallback::*; - } -} diff --git a/src/unix/linux_like/linux/musl/b64/aarch64/int128.rs b/src/unix/linux_like/linux/musl/b64/aarch64/int128.rs deleted file mode 100644 index 4535e73eeddf1..0000000000000 --- a/src/unix/linux_like/linux/musl/b64/aarch64/int128.rs +++ /dev/null @@ -1,7 +0,0 @@ -s! { - pub struct user_fpsimd_struct { - pub vregs: [::__uint128_t; 32], - pub fpsr: u32, - pub fpcr: u32, - } -} diff --git a/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs b/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs index 7582676c3bfa6..f71d47effe85c 100644 --- a/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs +++ b/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs @@ -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! { @@ -684,10 +690,3 @@ pub const VMIN: usize = 6; pub const IEXTEN: ::tcflag_t = 0x00008000; pub const TOSTOP: ::tcflag_t = 0x00000100; pub const FLUSHO: ::tcflag_t = 0x00001000; - -cfg_if! { - if #[cfg(libc_int128)] { - mod int128; - pub use self::int128::*; - } -}