From 41286408751b62ba22ce9fb579ed8e60479785dc Mon Sep 17 00:00:00 2001 From: Severen Redwood Date: Sun, 17 Mar 2024 18:57:01 +1300 Subject: [PATCH 01/14] Correct the value of FAN_MARK_IGNORE --- src/unix/linux_like/linux/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs index ee2999861f5c5..1365da17f03d2 100644 --- a/src/unix/linux_like/linux/mod.rs +++ b/src/unix/linux_like/linux/mod.rs @@ -4074,7 +4074,7 @@ pub const FAN_MARK_IGNORED_MASK: ::c_uint = 0x0000_0020; pub const FAN_MARK_IGNORED_SURV_MODIFY: ::c_uint = 0x0000_0040; pub const FAN_MARK_FLUSH: ::c_uint = 0x0000_0080; pub const FAN_MARK_EVICTABLE: ::c_uint = 0x0000_0200; -pub const FAN_MARK_IGNORE: ::c_uint = 0x0000_0100; +pub const FAN_MARK_IGNORE: ::c_uint = 0x0000_0400; pub const FAN_MARK_INODE: ::c_uint = 0x0000_0000; pub const FAN_MARK_MOUNT: ::c_uint = 0x0000_0010; From 0b08bd511e0879eb41828885c4d3a2249c4f5bb6 Mon Sep 17 00:00:00 2001 From: Logan Magee Date: Mon, 25 Mar 2024 15:33:02 -0700 Subject: [PATCH 02/14] Add `SYS_lseek` and `SYS_mmap` for aarch64 Android Values are sourced from https://android.googlesource.com/platform/bionic/+/0339184/libc/kernel/uapi/asm-generic/unistd.h. --- libc-test/semver/android-aarch64.txt | 2 ++ src/unix/linux_like/android/b64/aarch64/mod.rs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/libc-test/semver/android-aarch64.txt b/libc-test/semver/android-aarch64.txt index 9b4cc355e3f9e..8a38e32dd5022 100644 --- a/libc-test/semver/android-aarch64.txt +++ b/libc-test/semver/android-aarch64.txt @@ -10,6 +10,8 @@ HWCAP2_SVESM4 PROT_BTI PROT_MTE SYS_arch_specific_syscall +SYS_lseek +SYS_mmap SYS_syscalls SYS_fcntl __system_property_wait diff --git a/src/unix/linux_like/android/b64/aarch64/mod.rs b/src/unix/linux_like/android/b64/aarch64/mod.rs index ac67fddabecd4..7b87a1d49dc3e 100644 --- a/src/unix/linux_like/android/b64/aarch64/mod.rs +++ b/src/unix/linux_like/android/b64/aarch64/mod.rs @@ -191,6 +191,7 @@ pub const SYS_vhangup: ::c_long = 58; pub const SYS_pipe2: ::c_long = 59; pub const SYS_quotactl: ::c_long = 60; pub const SYS_getdents64: ::c_long = 61; +pub const SYS_lseek: ::c_long = 62; pub const SYS_read: ::c_long = 63; pub const SYS_write: ::c_long = 64; pub const SYS_readv: ::c_long = 65; @@ -347,6 +348,7 @@ pub const SYS_request_key: ::c_long = 218; pub const SYS_keyctl: ::c_long = 219; pub const SYS_clone: ::c_long = 220; pub const SYS_execve: ::c_long = 221; +pub const SYS_mmap: ::c_long = 222; pub const SYS_swapon: ::c_long = 224; pub const SYS_swapoff: ::c_long = 225; pub const SYS_mprotect: ::c_long = 226; From e5bc243cc83e9a94b7068bf920cb6a392f1e995b Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Tue, 30 Apr 2024 19:40:41 +0900 Subject: [PATCH 03/14] Update FreeBSD 13 CI image --- .cirrus.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index e428871c41b84..1650f3ead158b 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -1,7 +1,7 @@ task: name: nightly x86_64-unknown-freebsd-13 freebsd_instance: - image_family: freebsd-13-2 + image_family: freebsd-13-3 setup_script: - pkg install -y libnghttp2 curl - curl https://sh.rustup.rs -sSf --output rustup.sh From fceb18ee4154d55063d1bfaaeef5c0fa3ed4b83b Mon Sep 17 00:00:00 2001 From: Ryan Zoeller Date: Wed, 27 Mar 2024 19:17:41 -0500 Subject: [PATCH 04/14] android: add FUTEX_LOCK_PI2 --- libc-test/semver/android.txt | 1 + src/unix/linux_like/android/mod.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/libc-test/semver/android.txt b/libc-test/semver/android.txt index 36f808fdce816..21b277a018747 100644 --- a/libc-test/semver/android.txt +++ b/libc-test/semver/android.txt @@ -627,6 +627,7 @@ FUTEX_CMP_REQUEUE FUTEX_CMP_REQUEUE_PI FUTEX_FD FUTEX_LOCK_PI +FUTEX_LOCK_PI2 FUTEX_PRIVATE_FLAG FUTEX_REQUEUE FUTEX_TRYLOCK_PI diff --git a/src/unix/linux_like/android/mod.rs b/src/unix/linux_like/android/mod.rs index 8e5032aa81576..ce8e9782c49a0 100644 --- a/src/unix/linux_like/android/mod.rs +++ b/src/unix/linux_like/android/mod.rs @@ -3017,6 +3017,7 @@ pub const FUTEX_WAIT_BITSET: ::c_int = 9; pub const FUTEX_WAKE_BITSET: ::c_int = 10; pub const FUTEX_WAIT_REQUEUE_PI: ::c_int = 11; pub const FUTEX_CMP_REQUEUE_PI: ::c_int = 12; +pub const FUTEX_LOCK_PI2: ::c_int = 13; pub const FUTEX_PRIVATE_FLAG: ::c_int = 128; pub const FUTEX_CLOCK_REALTIME: ::c_int = 256; From dc88f4cc91d00743411d7e91dbe59aecb77f04f7 Mon Sep 17 00:00:00 2001 From: Alisa Sireneva Date: Wed, 1 May 2024 18:22:13 +0300 Subject: [PATCH 05/14] Fix out-of-bounds pointer arithmetic in CMSG_NXTHDR --- src/unix/linux_like/linux/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs index 1365da17f03d2..99c06426771f1 100644 --- a/src/unix/linux_like/linux/mod.rs +++ b/src/unix/linux_like/linux/mod.rs @@ -4650,7 +4650,7 @@ f! { as *mut cmsghdr; let max = (*mhdr).msg_control as usize + (*mhdr).msg_controllen as usize; - if (next.offset(1)) as usize > max || + if (next.wrapping_offset(1)) as usize > max || next as usize + super::CMSG_ALIGN((*next).cmsg_len as usize) > max { 0 as *mut cmsghdr From 03e47e6e770504a75f776127c5c9c1b44b6833b2 Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Fri, 3 May 2024 09:11:04 +0900 Subject: [PATCH 06/14] Revert "Support posix_spawn on Android" --- libc-test/build.rs | 36 ++-------- src/unix/linux_like/linux/mod.rs | 105 ++++++++++++++++++++++++++++ src/unix/linux_like/mod.rs | 116 ------------------------------- 3 files changed, 110 insertions(+), 147 deletions(-) diff --git a/libc-test/build.rs b/libc-test/build.rs index ee211ebbf227f..2b15c958d2d51 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -1613,7 +1613,6 @@ fn test_android(target: &str) { "sched.h", "semaphore.h", "signal.h", - "spawn.h", "stddef.h", "stdint.h", "stdio.h", @@ -1980,30 +1979,14 @@ fn test_android(target: &str) { // Added in API level 28, but some tests use level 24. "getrandom" => true, + + // Added in API level 28, but some tests use level 24. "syncfs" => true, + + // Added in API level 28, but some tests use level 24. "pthread_attr_getinheritsched" | "pthread_attr_setinheritsched" => true, + // Added in API level 28, but some tests use level 24. "fread_unlocked" | "fwrite_unlocked" | "fgets_unlocked" | "fflush_unlocked" => true, - "posix_spawn" - | "posix_spawnp" - | "posix_spawnattr_init" - | "posix_spawnattr_destroy" - | "posix_spawnattr_getsigdefault" - | "posix_spawnattr_setsigdefault" - | "posix_spawnattr_getsigmask" - | "posix_spawnattr_setsigmask" - | "posix_spawnattr_getflags" - | "posix_spawnattr_setflags" - | "posix_spawnattr_getpgroup" - | "posix_spawnattr_setpgroup" - | "posix_spawnattr_getschedpolicy" - | "posix_spawnattr_setschedpolicy" - | "posix_spawnattr_getschedparam" - | "posix_spawnattr_setschedparam" - | "posix_spawn_file_actions_init" - | "posix_spawn_file_actions_destroy" - | "posix_spawn_file_actions_addopen" - | "posix_spawn_file_actions_addclose" - | "posix_spawn_file_actions_adddup2" => true, // FIXME: bad function pointers: "isalnum" | "isalpha" | "iscntrl" | "isdigit" | "isgraph" | "islower" | "isprint" @@ -2726,7 +2709,6 @@ fn test_emscripten(target: &str) { "semaphore.h", "shadow.h", "signal.h", - "spawn.h", "stddef.h", "stdint.h", "stdio.h", @@ -3620,10 +3602,6 @@ fn test_linux(target: &str) { "priority_t" if musl => true, "name_t" if musl => true, - // These are intended to be opaque, but glibc and musl define them. - "posix_spawn_file_actions_t" => true, - "posix_spawnattr_t" => true, - t => { if musl { // LFS64 types have been removed in musl 1.2.4+ @@ -3772,10 +3750,6 @@ fn test_linux(target: &str) { // kernel so we can drop this and test the type once this new version is used in CI. "sched_attr" => true, - // These are intended to be opaque, but glibc and musl define them. - "posix_spawn_file_actions_t" => true, - "posix_spawnattr_t" => true, - _ => false, } }); diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs index 99c06426771f1..dc0d3eaca5335 100644 --- a/src/unix/linux_like/linux/mod.rs +++ b/src/unix/linux_like/linux/mod.rs @@ -452,6 +452,26 @@ s! { pub mnt_passno: ::c_int, } + pub struct posix_spawn_file_actions_t { + __allocated: ::c_int, + __used: ::c_int, + __actions: *mut ::c_int, + __pad: [::c_int; 16], + } + + pub struct posix_spawnattr_t { + __flags: ::c_short, + __pgrp: ::pid_t, + __sd: ::sigset_t, + __ss: ::sigset_t, + #[cfg(any(target_env = "musl", target_env = "ohos"))] + __prio: ::c_int, + #[cfg(not(any(target_env = "musl", target_env = "ohos")))] + __sp: ::sched_param, + __policy: ::c_int, + __pad: [::c_int; 16], + } + pub struct genlmsghdr { pub cmd: u8, pub version: u8, @@ -1839,6 +1859,8 @@ pub const POSIX_MADV_NORMAL: ::c_int = 0; pub const POSIX_MADV_RANDOM: ::c_int = 1; pub const POSIX_MADV_SEQUENTIAL: ::c_int = 2; pub const POSIX_MADV_WILLNEED: ::c_int = 3; +pub const POSIX_SPAWN_USEVFORK: ::c_int = 64; +pub const POSIX_SPAWN_SETSID: ::c_int = 128; pub const S_IEXEC: mode_t = 64; pub const S_IWRITE: mode_t = 128; @@ -2596,6 +2618,13 @@ pub const ETH_P_PHONET: ::c_int = 0x00F5; pub const ETH_P_IEEE802154: ::c_int = 0x00F6; pub const ETH_P_CAIF: ::c_int = 0x00F7; +pub const POSIX_SPAWN_RESETIDS: ::c_int = 0x01; +pub const POSIX_SPAWN_SETPGROUP: ::c_int = 0x02; +pub const POSIX_SPAWN_SETSIGDEF: ::c_int = 0x04; +pub const POSIX_SPAWN_SETSIGMASK: ::c_int = 0x08; +pub const POSIX_SPAWN_SETSCHEDPARAM: ::c_int = 0x10; +pub const POSIX_SPAWN_SETSCHEDULER: ::c_int = 0x20; + pub const NLMSG_NOOP: ::c_int = 0x1; pub const NLMSG_ERROR: ::c_int = 0x2; pub const NLMSG_DONE: ::c_int = 0x3; @@ -5425,6 +5454,82 @@ extern "C" { pub fn endmntent(streamp: *mut ::FILE) -> ::c_int; pub fn hasmntopt(mnt: *const ::mntent, opt: *const ::c_char) -> *mut ::c_char; + pub fn posix_spawn( + pid: *mut ::pid_t, + path: *const ::c_char, + file_actions: *const ::posix_spawn_file_actions_t, + attrp: *const ::posix_spawnattr_t, + argv: *const *mut ::c_char, + envp: *const *mut ::c_char, + ) -> ::c_int; + pub fn posix_spawnp( + pid: *mut ::pid_t, + file: *const ::c_char, + file_actions: *const ::posix_spawn_file_actions_t, + attrp: *const ::posix_spawnattr_t, + argv: *const *mut ::c_char, + envp: *const *mut ::c_char, + ) -> ::c_int; + pub fn posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> ::c_int; + pub fn posix_spawnattr_destroy(attr: *mut posix_spawnattr_t) -> ::c_int; + pub fn posix_spawnattr_getsigdefault( + attr: *const posix_spawnattr_t, + default: *mut ::sigset_t, + ) -> ::c_int; + pub fn posix_spawnattr_setsigdefault( + attr: *mut posix_spawnattr_t, + default: *const ::sigset_t, + ) -> ::c_int; + pub fn posix_spawnattr_getsigmask( + attr: *const posix_spawnattr_t, + default: *mut ::sigset_t, + ) -> ::c_int; + pub fn posix_spawnattr_setsigmask( + attr: *mut posix_spawnattr_t, + default: *const ::sigset_t, + ) -> ::c_int; + pub fn posix_spawnattr_getflags( + attr: *const posix_spawnattr_t, + flags: *mut ::c_short, + ) -> ::c_int; + pub fn posix_spawnattr_setflags(attr: *mut posix_spawnattr_t, flags: ::c_short) -> ::c_int; + pub fn posix_spawnattr_getpgroup( + attr: *const posix_spawnattr_t, + flags: *mut ::pid_t, + ) -> ::c_int; + pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: ::pid_t) -> ::c_int; + pub fn posix_spawnattr_getschedpolicy( + attr: *const posix_spawnattr_t, + flags: *mut ::c_int, + ) -> ::c_int; + pub fn posix_spawnattr_setschedpolicy(attr: *mut posix_spawnattr_t, flags: ::c_int) -> ::c_int; + pub fn posix_spawnattr_getschedparam( + attr: *const posix_spawnattr_t, + param: *mut ::sched_param, + ) -> ::c_int; + pub fn posix_spawnattr_setschedparam( + attr: *mut posix_spawnattr_t, + param: *const ::sched_param, + ) -> ::c_int; + + pub fn posix_spawn_file_actions_init(actions: *mut posix_spawn_file_actions_t) -> ::c_int; + pub fn posix_spawn_file_actions_destroy(actions: *mut posix_spawn_file_actions_t) -> ::c_int; + pub fn posix_spawn_file_actions_addopen( + actions: *mut posix_spawn_file_actions_t, + fd: ::c_int, + path: *const ::c_char, + oflag: ::c_int, + mode: ::mode_t, + ) -> ::c_int; + pub fn posix_spawn_file_actions_addclose( + actions: *mut posix_spawn_file_actions_t, + fd: ::c_int, + ) -> ::c_int; + pub fn posix_spawn_file_actions_adddup2( + actions: *mut posix_spawn_file_actions_t, + fd: ::c_int, + newfd: ::c_int, + ) -> ::c_int; pub fn fread_unlocked( buf: *mut ::c_void, size: ::size_t, diff --git a/src/unix/linux_like/mod.rs b/src/unix/linux_like/mod.rs index e4740d76aeef6..749c8a16d0148 100644 --- a/src/unix/linux_like/mod.rs +++ b/src/unix/linux_like/mod.rs @@ -6,13 +6,6 @@ pub type timer_t = *mut ::c_void; pub type key_t = ::c_int; pub type id_t = ::c_uint; -cfg_if! { - if #[cfg(not(target_os = "emscripten"))] { - pub type posix_spawn_file_actions_t = *mut ::c_void; - pub type posix_spawnattr_t = *mut ::c_void; - } -} - missing! { #[cfg_attr(feature = "extra_traits", derive(Debug))] pub enum timezone {} @@ -1538,19 +1531,6 @@ cfg_if! { } } -cfg_if! { - if #[cfg(not(target_os = "emscripten"))] { - pub const POSIX_SPAWN_RESETIDS: ::c_int = 0x01; - pub const POSIX_SPAWN_SETPGROUP: ::c_int = 0x02; - pub const POSIX_SPAWN_SETSIGDEF: ::c_int = 0x04; - pub const POSIX_SPAWN_SETSIGMASK: ::c_int = 0x08; - pub const POSIX_SPAWN_SETSCHEDPARAM: ::c_int = 0x10; - pub const POSIX_SPAWN_SETSCHEDULER: ::c_int = 0x20; - pub const POSIX_SPAWN_USEVFORK: ::c_int = 0x40; - pub const POSIX_SPAWN_SETSID: ::c_int = 0x80; - } -} - const_fn! { {const} fn CMSG_ALIGN(len: usize) -> usize { len + ::mem::size_of::() - 1 & !(::mem::size_of::() - 1) @@ -1915,102 +1895,6 @@ cfg_if! { } } -cfg_if! { - if #[cfg(not(target_os = "emscripten"))] { - extern "C" { - pub fn posix_spawn( - pid: *mut ::pid_t, - path: *const ::c_char, - file_actions: *const ::posix_spawn_file_actions_t, - attrp: *const ::posix_spawnattr_t, - argv: *const *mut ::c_char, - envp: *const *mut ::c_char, - ) -> ::c_int; - pub fn posix_spawnp( - pid: *mut ::pid_t, - file: *const ::c_char, - file_actions: *const ::posix_spawn_file_actions_t, - attrp: *const ::posix_spawnattr_t, - argv: *const *mut ::c_char, - envp: *const *mut ::c_char, - ) -> ::c_int; - pub fn posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> ::c_int; - pub fn posix_spawnattr_destroy(attr: *mut posix_spawnattr_t) -> ::c_int; - pub fn posix_spawnattr_getsigdefault( - attr: *const posix_spawnattr_t, - default: *mut ::sigset_t, - ) -> ::c_int; - pub fn posix_spawnattr_setsigdefault( - attr: *mut posix_spawnattr_t, - default: *const ::sigset_t, - ) -> ::c_int; - pub fn posix_spawnattr_getsigmask( - attr: *const posix_spawnattr_t, - default: *mut ::sigset_t, - ) -> ::c_int; - pub fn posix_spawnattr_setsigmask( - attr: *mut posix_spawnattr_t, - default: *const ::sigset_t, - ) -> ::c_int; - pub fn posix_spawnattr_getflags( - attr: *const posix_spawnattr_t, - flags: *mut ::c_short, - ) -> ::c_int; - pub fn posix_spawnattr_setflags( - attr: *mut posix_spawnattr_t, - flags: ::c_short, - ) -> ::c_int; - pub fn posix_spawnattr_getpgroup( - attr: *const posix_spawnattr_t, - flags: *mut ::pid_t, - ) -> ::c_int; - pub fn posix_spawnattr_setpgroup( - attr: *mut posix_spawnattr_t, - flags: ::pid_t, - ) -> ::c_int; - pub fn posix_spawnattr_getschedpolicy( - attr: *const posix_spawnattr_t, - flags: *mut ::c_int, - ) -> ::c_int; - pub fn posix_spawnattr_setschedpolicy( - attr: *mut posix_spawnattr_t, - flags: ::c_int, - ) -> ::c_int; - pub fn posix_spawnattr_getschedparam( - attr: *const posix_spawnattr_t, - param: *mut ::sched_param, - ) -> ::c_int; - pub fn posix_spawnattr_setschedparam( - attr: *mut posix_spawnattr_t, - param: *const ::sched_param, - ) -> ::c_int; - - pub fn posix_spawn_file_actions_init( - actions: *mut posix_spawn_file_actions_t, - ) -> ::c_int; - pub fn posix_spawn_file_actions_destroy( - actions: *mut posix_spawn_file_actions_t, - ) -> ::c_int; - pub fn posix_spawn_file_actions_addopen( - actions: *mut posix_spawn_file_actions_t, - fd: ::c_int, - path: *const ::c_char, - oflag: ::c_int, - mode: ::mode_t, - ) -> ::c_int; - pub fn posix_spawn_file_actions_addclose( - actions: *mut posix_spawn_file_actions_t, - fd: ::c_int, - ) -> ::c_int; - pub fn posix_spawn_file_actions_adddup2( - actions: *mut posix_spawn_file_actions_t, - fd: ::c_int, - newfd: ::c_int, - ) -> ::c_int; - } - } -} - cfg_if! { if #[cfg(target_os = "emscripten")] { mod emscripten; From 853bdfd90ec414424f085b197b7fd63fa5e07ff6 Mon Sep 17 00:00:00 2001 From: Lzu Tao Date: Tue, 7 May 2024 01:01:47 +0700 Subject: [PATCH 07/14] ci: wrong cfg emscripten --- build.rs | 3 ++- libc-test/test/makedev.rs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/build.rs b/build.rs index 40d4140e8f65e..ee0d86edecb81 100644 --- a/build.rs +++ b/build.rs @@ -8,6 +8,7 @@ use std::string::String; // make sure to add it to this list as well. const ALLOWED_CFGS: &'static [&'static str] = &[ "emscripten_new_stat_abi", + "espidf_time64", "freebsd10", "freebsd11", "freebsd12", @@ -51,7 +52,7 @@ fn main() { let align_cargo_feature = env::var("CARGO_FEATURE_ALIGN").is_ok(); let const_extern_fn_cargo_feature = env::var("CARGO_FEATURE_CONST_EXTERN_FN").is_ok(); let libc_ci = env::var("LIBC_CI").is_ok(); - let libc_check_cfg = env::var("LIBC_CHECK_CFG").is_ok(); + let libc_check_cfg = env::var("LIBC_CHECK_CFG").is_ok() || rustc_minor_ver >= 80; if env::var("CARGO_FEATURE_USE_STD").is_ok() { println!( diff --git a/libc-test/test/makedev.rs b/libc-test/test/makedev.rs index c9a92aa83e686..6b5b85efb8197 100644 --- a/libc-test/test/makedev.rs +++ b/libc-test/test/makedev.rs @@ -79,7 +79,7 @@ mod t { // These OSes allow 32 bits for both minor and major #[cfg(any( - target_os = "empscripten", + target_os = "emscripten", target_os = "freebsd", target_os = "fuchsia", target_os = "linux", From 0a61e7e7ee4d864038199cd6f8ed378abd7ea61c Mon Sep 17 00:00:00 2001 From: Lzu Tao Date: Tue, 7 May 2024 02:06:55 +0700 Subject: [PATCH 08/14] Fix warnings by `rustc --print cfg --target ci/switch.json` ``` warning: target json file contains unused fields: abi-blacklist, family, has-elf-tls, target-env ``` --- ci/switch.json | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/ci/switch.json b/ci/switch.json index bc1894879d7f7..c2df6610c5628 100644 --- a/ci/switch.json +++ b/ci/switch.json @@ -1,7 +1,5 @@ { - "family": "unix", "env": "newlib", - "target-env": "newlib", "target-family": "unix", "target-c-int-width": "32", "target-endian": "little", @@ -9,14 +7,6 @@ "os": "horizon", "arch": "aarch64", "panic-strategy": "unwind", - "abi-blacklist": [ - "stdcall", - "fastcall", - "vectorcall", - "thiscall", - "win64", - "sysv64" - ], "dynamic-linking" : false, "features": "+a53,+strict-align", "data-layout": "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128", @@ -24,7 +14,7 @@ "position-independent-executables" : true, "linker-flavor": "gcc", "llvm-target": "aarch64-unknown-none", - "has-elf-tls" : false, + "has-thread-local": false, "linker-is-gnu" : true, "disable-redzone" : true, "relocation-model" : "pic", @@ -34,4 +24,4 @@ "trap-unreachable" : true, "emit-debug-gdb-scripts" : true, "requires-uwtable" : true -} \ No newline at end of file +} From 5eff703b923d3e1b042e91bc67409cca961f3976 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Mon, 6 May 2024 15:00:03 -0600 Subject: [PATCH 09/14] redox: correct EPOLL constants --- src/unix/redox/mod.rs | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/unix/redox/mod.rs b/src/unix/redox/mod.rs index 19315c3872c88..5036f458067b6 100644 --- a/src/unix/redox/mod.rs +++ b/src/unix/redox/mod.rs @@ -677,22 +677,22 @@ pub const EPOLL_CLOEXEC: ::c_int = 0x0100_0000; pub const EPOLL_CTL_ADD: ::c_int = 1; pub const EPOLL_CTL_DEL: ::c_int = 2; pub const EPOLL_CTL_MOD: ::c_int = 3; -pub const EPOLLIN: ::c_int = 1; -pub const EPOLLPRI: ::c_int = 0; -pub const EPOLLOUT: ::c_int = 2; -pub const EPOLLRDNORM: ::c_int = 0; -pub const EPOLLNVAL: ::c_int = 0; -pub const EPOLLRDBAND: ::c_int = 0; -pub const EPOLLWRNORM: ::c_int = 0; -pub const EPOLLWRBAND: ::c_int = 0; -pub const EPOLLMSG: ::c_int = 0; -pub const EPOLLERR: ::c_int = 0; -pub const EPOLLHUP: ::c_int = 0; -pub const EPOLLRDHUP: ::c_int = 0; -pub const EPOLLEXCLUSIVE: ::c_int = 0; -pub const EPOLLWAKEUP: ::c_int = 0; -pub const EPOLLONESHOT: ::c_int = 0; -pub const EPOLLET: ::c_int = 0; +pub const EPOLLIN: ::c_int = 0x001; +pub const EPOLLPRI: ::c_int = 0x002; +pub const EPOLLOUT: ::c_int = 0x004; +pub const EPOLLERR: ::c_int = 0x008; +pub const EPOLLHUP: ::c_int = 0x010; +pub const EPOLLNVAL: ::c_int = 0x020; +pub const EPOLLRDNORM: ::c_int = 0x040; +pub const EPOLLRDBAND: ::c_int = 0x080; +pub const EPOLLWRNORM: ::c_int = 0x100; +pub const EPOLLWRBAND: ::c_int = 0x200; +pub const EPOLLMSG: ::c_int = 0x400; +pub const EPOLLRDHUP: ::c_int = 0x2000; +pub const EPOLLEXCLUSIVE: ::c_int = 1 << 28; +pub const EPOLLWAKEUP: ::c_int = 1 << 29; +pub const EPOLLONESHOT: ::c_int = 1 << 30; +pub const EPOLLET: ::c_int = 1 << 31; // sys/stat.h pub const S_IFMT: ::c_int = 0o0_170_000; From b2b2fd71f4cb866c2d3e4579a50a70aa460aab8e Mon Sep 17 00:00:00 2001 From: Lzu Tao Date: Tue, 7 May 2024 00:34:46 +0700 Subject: [PATCH 10/14] Readd posix_spawn{_file_actions_t,attr_t} on Android Co-authored-by: Jorge Aparicio --- libc-test/build.rs | 4 ++++ src/unix/linux_like/android/mod.rs | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/libc-test/build.rs b/libc-test/build.rs index 2b15c958d2d51..f8d797f126736 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -1613,6 +1613,7 @@ fn test_android(target: &str) { "sched.h", "semaphore.h", "signal.h", + "spawn.h", "stddef.h", "stdint.h", "stdio.h", @@ -1767,6 +1768,9 @@ fn test_android(target: &str) { // These are tested in the `linux_elf.rs` file. "Elf64_Phdr" | "Elf32_Phdr" => true, + // These are intended to be opaque + "posix_spawn_file_actions_t" => true, + "posix_spawnattr_t" => true, _ => false, } }); diff --git a/src/unix/linux_like/android/mod.rs b/src/unix/linux_like/android/mod.rs index ce8e9782c49a0..fb0b06701507c 100644 --- a/src/unix/linux_like/android/mod.rs +++ b/src/unix/linux_like/android/mod.rs @@ -48,6 +48,10 @@ pub type Elf64_Xword = u64; pub type eventfd_t = u64; +// these structs sit behind a heap allocation on Android +pub type posix_spawn_file_actions_t = *mut ::c_void; +pub type posix_spawnattr_t = *mut ::c_void; + s! { pub struct stack_t { pub ss_sp: *mut ::c_void, From 80535f34aafbf089f201dfb217d659e36a18671a Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 17 May 2024 09:58:41 -0700 Subject: [PATCH 11/14] Revert "Upgrade Docker images to Ubuntu 23.10" on sparc64 This partially reverts commit 946c348bc7ce61fb8b92c27ea8328c8fbbcecf72. The test binaries were getting a symbol version for `GLIBC_2.38`, but the debian-11 image used for qemu doesn't have that new of glibc. --- ci/docker/sparc64-unknown-linux-gnu/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/docker/sparc64-unknown-linux-gnu/Dockerfile b/ci/docker/sparc64-unknown-linux-gnu/Dockerfile index 99ba40276a568..ff6810a7fac58 100644 --- a/ci/docker/sparc64-unknown-linux-gnu/Dockerfile +++ b/ci/docker/sparc64-unknown-linux-gnu/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:23.10 +FROM ubuntu:22.04 RUN apt-get update && apt-get install -y --no-install-recommends \ curl ca-certificates \ From 73d2004d3e8ed9c15d46fd4e69b5f3f7dbbe86c7 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 17 May 2024 10:21:53 -0700 Subject: [PATCH 12/14] Skip `SECCOMP_FILTER_FLAG_WAIT_KILLABLE_RECV` on sparc64 --- libc-test/build.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libc-test/build.rs b/libc-test/build.rs index 2b15c958d2d51..2a48af6aff546 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -3909,6 +3909,9 @@ fn test_linux(target: &str) { | "SW_CNT" if ppc64 || riscv64 => true, + // FIXME: requires more recent kernel headers on CI + "SECCOMP_FILTER_FLAG_WAIT_KILLABLE_RECV" if sparc64 => true, + // FIXME: Not currently available in headers on ARM and musl. "NETLINK_GET_STRICT_CHK" if arm || musl => true, From 61331df06f425934fa43a506e25217f49a039a7c Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 17 May 2024 11:27:55 -0700 Subject: [PATCH 13/14] Also skip `MFD_EXEC` and `MFD_NOEXEC_SEAL` on sparc64 --- libc-test/build.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libc-test/build.rs b/libc-test/build.rs index 2a48af6aff546..e7c1b8a2dcf31 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -3910,7 +3910,10 @@ fn test_linux(target: &str) { if ppc64 || riscv64 => true, // FIXME: requires more recent kernel headers on CI - "SECCOMP_FILTER_FLAG_WAIT_KILLABLE_RECV" if sparc64 => true, + | "MFD_EXEC" + | "MFD_NOEXEC_SEAL" + | "SECCOMP_FILTER_FLAG_WAIT_KILLABLE_RECV" + if sparc64 => true, // FIXME: Not currently available in headers on ARM and musl. "NETLINK_GET_STRICT_CHK" if arm || musl => true, From 15c74a4faba398a579a3a551f77cf790d5abf1f8 Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Sun, 5 May 2024 23:28:10 +0200 Subject: [PATCH 14/14] Update version to 0.2.155 --- Cargo.toml | 2 +- libc-test/Cargo.toml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 48b8e189077c1..062f76472fa9c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "libc" -version = "0.2.154" +version = "0.2.155" authors = ["The Rust Project Developers"] license = "MIT OR Apache-2.0" readme = "README.md" diff --git a/libc-test/Cargo.toml b/libc-test/Cargo.toml index eee6fe83da0b1..b20b4a60cae4e 100644 --- a/libc-test/Cargo.toml +++ b/libc-test/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "libc-test" -version = "0.2.154" +version = "0.2.155" authors = ["The Rust Project Developers"] license = "MIT OR Apache-2.0" build = "build.rs" @@ -12,7 +12,7 @@ A test crate for the libc crate. [dependencies.libc] path = ".." -version = "0.2.154" +version = "0.2.155" default-features = false [build-dependencies]