Skip to content

Commit e65fce1

Browse files
joshtripletttgross35
authored andcommittedNov 17, 2024
Require rust >= 1.26 and drop libc_int128 conditional
[ resolve conflicts and add test skips that seem to be needed now - Trevor ] (apply <rust-lang#4060> to `main`) (cherry picked from commit 23a0d01)
1 parent bf19e3e commit e65fce1

File tree

10 files changed

+37
-41
lines changed

10 files changed

+37
-41
lines changed
 

‎build.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ fn main() {
4444
let libc_ci = env::var("LIBC_CI").is_ok();
4545
let libc_check_cfg = env::var("LIBC_CHECK_CFG").is_ok() || rustc_minor_ver >= 80;
4646
let const_extern_fn_cargo_feature = env::var("CARGO_FEATURE_CONST_EXTERN_FN").is_ok();
47-
47+
,
4848
// The ABI of libc used by std is backward compatible with FreeBSD 12.
4949
// The ABI of libc from crates.io is backward compatible with FreeBSD 11.
5050
//

‎libc-test/build.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,9 @@ fn test_apple(target: &str) {
318318
// FIXME: Requires the macOS 14.4 SDK.
319319
"os_sync_wake_by_address_flags_t" | "os_sync_wait_on_address_flags_t" => true,
320320

321+
// FIXME: "'__uint128' undeclared" in C
322+
"__uint128" => true,
323+
321324
_ => false,
322325
}
323326
});
@@ -1804,6 +1807,10 @@ fn test_android(target: &str) {
18041807
// These are intended to be opaque
18051808
"posix_spawn_file_actions_t" => true,
18061809
"posix_spawnattr_t" => true,
1810+
1811+
// FIXME: "'__uint128' undeclared" in C
1812+
"__uint128" => true,
1813+
18071814
_ => false,
18081815
}
18091816
});
@@ -3659,7 +3666,7 @@ fn test_linux(target: &str) {
36593666
"priority_t" if musl => true,
36603667
"name_t" if musl => true,
36613668

3662-
// FIXME: Somehow fails to test after removing cfg hacks:
3669+
// FIXME: "'__uint128' undeclared" in C
36633670
"__uint128" => true,
36643671

36653672
t => {

‎src/fixed_width_ints.rs

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

2222
cfg_if! {
23-
if #[cfg(all(target_arch = "aarch64", not(any(target_os = "windows", target_os = "macos", target_os = "ios", target_os = "tvos", target_os = "watchos"))))] {
23+
if #[cfg(all(
24+
target_arch = "aarch64",
25+
not(any(
26+
target_os = "windows",
27+
target_os = "macos",
28+
target_os = "ios",
29+
target_os = "tvos",
30+
target_os = "watchos",
31+
))
32+
))] {
2433
// This introduces partial support for FFI with __int128 and
2534
// equivalent types on platforms where Rust's definition is validated
2635
// to match the standard C ABI of that platform.

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

-7
This file was deleted.

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

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

8187
s_no_extra_traits! {
@@ -466,6 +472,3 @@ pub const PROT_MTE: ::c_int = 0x20;
466472
// From NDK's asm/auxvec.h
467473
pub const AT_SYSINFO_EHDR: ::c_ulong = 33;
468474
pub const AT_VECTOR_SIZE_ARCH: ::c_ulong = 2;
469-
470-
mod int128;
471-
pub use self::int128::*;

‎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-3
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,6 +970,3 @@ cfg_if! {
964970
pub use self::lp64::*;
965971
}
966972
}
967-
968-
mod int128;
969-
pub use self::int128::*;

‎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-3
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! {
@@ -686,6 +692,3 @@ pub const VMIN: usize = 6;
686692
pub const IEXTEN: ::tcflag_t = 0x00008000;
687693
pub const TOSTOP: ::tcflag_t = 0x00000100;
688694
pub const FLUSHO: ::tcflag_t = 0x00001000;
689-
690-
mod int128;
691-
pub use self::int128::*;

0 commit comments

Comments
 (0)