Skip to content

Commit 851ca51

Browse files
joshtripletttgross35
authored andcommittedNov 16, 2024
Require rust >= 1.26 and drop libc_int128 conditional
[ resolve conflicts - Trevor ]
1 parent 3aaf882 commit 851ca51

File tree

11 files changed

+22
-69
lines changed

11 files changed

+22
-69
lines changed
 

‎build.rs

-6
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ const ALLOWED_CFGS: &'static [&'static str] = &[
1919
"libc_const_extern_fn_unstable",
2020
"libc_core_cvoid",
2121
"libc_deny_warnings",
22-
"libc_int128",
2322
"libc_long_array",
2423
"libc_non_exhaustive",
2524
"libc_packedN",
@@ -87,11 +86,6 @@ fn main() {
8786
set_cfg("libc_deny_warnings");
8887
}
8988

90-
// Rust >= 1.26 supports i128 and u128:
91-
if rustc_minor_ver >= 26 || rustc_dep_of_std {
92-
set_cfg("libc_int128");
93-
}
94-
9589
// Rust >= 1.30 supports `core::ffi::c_void`, so libc can just re-export it.
9690
// Otherwise, it defines an incompatible type to retaining
9791
// backwards-compatibility.

‎libc-test/build.rs

+3
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,9 @@ fn test_apple(target: &str) {
327327
// FIXME: Requires the macOS 14.4 SDK.
328328
"os_sync_wake_by_address_flags_t" | "os_sync_wait_on_address_flags_t" => true,
329329

330+
// FIXME: "unknown type name" in C
331+
"__uint128" => true,
332+
330333
_ => false,
331334
}
332335
});

‎src/fixed_width_ints.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pub type uint32_t = u32;
2020
pub type uint64_t = u64;
2121

2222
cfg_if! {
23-
if #[cfg(all(libc_int128, target_arch = "aarch64", not(target_os = "windows")))] {
23+
if #[cfg(all(target_arch = "aarch64", not(target_os = "windows")))] {
2424
// This introduces partial support for FFI with __int128 and
2525
// equivalent types on platforms where Rust's definition is validated
2626
// to match the standard C ABI of that platform.

‎src/unix/bsd/apple/b64/aarch64/mod.rs

-8
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,8 @@ s! {
3737
pub __pad: u32,
3838
}
3939

40-
// This type natively uses a uint128, but for a while we hacked
41-
// it in with repr(align) and `[u64; 2]`. uint128 isn't available
42-
// all the way back to our earliest supported versions so we
43-
// preserver the old shim.
44-
#[cfg_attr(not(libc_int128), repr(align(16)))]
4540
pub struct __darwin_arm_neon_state64 {
46-
#[cfg(libc_int128)]
4741
pub __v: [::__uint128_t; 32],
48-
#[cfg(not(libc_int128))]
49-
pub __v: [[u64; 2]; 32],
5042
pub __fpsr: u32,
5143
pub __fpcr: u32,
5244
}

‎src/unix/linux_like/android/b64/aarch64/int128.rs

-7
This file was deleted.

‎src/unix/linux_like/android/b64/aarch64/mod.rs

+6-8
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,12 @@ s! {
7575
// auto-derive traits like Debug
7676
__reserved: [[u64; 32]; 16],
7777
}
78+
79+
pub struct user_fpsimd_struct {
80+
pub vregs: [::__uint128_t; 32],
81+
pub fpsr: u32,
82+
pub fpcr: u32,
83+
}
7884
}
7985

8086
s_no_extra_traits! {
@@ -447,11 +453,3 @@ pub const PROT_MTE: ::c_int = 0x20;
447453

448454
// From NDK's asm/auxvec.h
449455
pub const AT_SYSINFO_EHDR: ::c_ulong = 33;
450-
pub const AT_VECTOR_SIZE_ARCH: ::c_ulong = 2;
451-
452-
cfg_if! {
453-
if #[cfg(libc_int128)] {
454-
mod int128;
455-
pub use self::int128::*;
456-
}
457-
}

‎src/unix/linux_like/linux/gnu/b64/aarch64/fallback.rs

-8
This file was deleted.

‎src/unix/linux_like/linux/gnu/b64/aarch64/int128.rs

-7
This file was deleted.

‎src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs

+6-10
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,12 @@ s! {
217217
__reserved: [[u64; 32]; 16],
218218
}
219219

220+
pub struct user_fpsimd_struct {
221+
pub vregs: [::__uint128_t; 32],
222+
pub fpsr: ::c_uint,
223+
pub fpcr: ::c_uint,
224+
}
225+
220226
#[repr(align(8))]
221227
pub struct clone_args {
222228
pub flags: ::c_ulonglong,
@@ -964,13 +970,3 @@ cfg_if! {
964970
pub use self::lp64::*;
965971
}
966972
}
967-
968-
cfg_if! {
969-
if #[cfg(libc_int128)] {
970-
mod int128;
971-
pub use self::int128::*;
972-
} else {
973-
mod fallback;
974-
pub use self::fallback::*;
975-
}
976-
}

‎src/unix/linux_like/linux/musl/b64/aarch64/int128.rs

-7
This file was deleted.

‎src/unix/linux_like/linux/musl/b64/aarch64/mod.rs

+6-7
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,12 @@ s! {
101101
pub set_tid_size: ::c_ulonglong,
102102
pub cgroup: ::c_ulonglong,
103103
}
104+
105+
pub struct user_fpsimd_struct {
106+
pub vregs: [::__uint128_t; 32],
107+
pub fpsr: u32,
108+
pub fpcr: u32,
109+
}
104110
}
105111

106112
s_no_extra_traits! {
@@ -684,10 +690,3 @@ pub const VMIN: usize = 6;
684690
pub const IEXTEN: ::tcflag_t = 0x00008000;
685691
pub const TOSTOP: ::tcflag_t = 0x00000100;
686692
pub const FLUSHO: ::tcflag_t = 0x00001000;
687-
688-
cfg_if! {
689-
if #[cfg(libc_int128)] {
690-
mod int128;
691-
pub use self::int128::*;
692-
}
693-
}

0 commit comments

Comments
 (0)