diff --git a/libc-test/semver/android-aarch64.txt b/libc-test/semver/android-aarch64.txt index 8a38e32dd5022..d634779743526 100644 --- a/libc-test/semver/android-aarch64.txt +++ b/libc-test/semver/android-aarch64.txt @@ -1,3 +1,5 @@ +AT_SYSINFO_EHDR +AT_VECTOR_SIZE_ARCH HWCAP2_DCPODP HWCAP2_FLAGM2 HWCAP2_FRINT diff --git a/libc-test/semver/android-arm.txt b/libc-test/semver/android-arm.txt index fe1ce5bba1c5d..15578095c5c5f 100644 --- a/libc-test/semver/android-arm.txt +++ b/libc-test/semver/android-arm.txt @@ -1,3 +1,4 @@ +AT_SYSINFO_EHDR NGREG PTRACE_GETFPREGS PTRACE_GETREGS diff --git a/libc-test/semver/android-i686.txt b/libc-test/semver/android-i686.txt index eb6ecadba60b5..5ffb45ebc32c6 100644 --- a/libc-test/semver/android-i686.txt +++ b/libc-test/semver/android-i686.txt @@ -1,3 +1,7 @@ +AT_SYSINFO +AT_SYSINFO_EHDR +AT_VECTOR_SIZE_ARCH +SYS_memfd_secret __c_anonymous_uc_sigmask __c_anonymous_uc_sigmask_with_padding time64_t diff --git a/libc-test/semver/android-riscv64.txt b/libc-test/semver/android-riscv64.txt new file mode 100644 index 0000000000000..723278a289464 --- /dev/null +++ b/libc-test/semver/android-riscv64.txt @@ -0,0 +1,90 @@ +AT_SYSINFO_EHDR +AT_VECTOR_SIZE_ARCH +HWCAP2_AFP +HWCAP2_BF16 +HWCAP2_BTI +HWCAP2_DCPODP +HWCAP2_DGH +HWCAP2_EBF16 +HWCAP2_ECV +HWCAP2_FLAGM2 +HWCAP2_FRINT +HWCAP2_I8MM +HWCAP2_MTE +HWCAP2_MTE3 +HWCAP2_RNG +HWCAP2_RPRES +HWCAP2_SME +HWCAP2_SME_B16F32 +HWCAP2_SME_F16F32 +HWCAP2_SME_F32F32 +HWCAP2_SME_F64F64 +HWCAP2_SME_FA64 +HWCAP2_SME_I16I64 +HWCAP2_SME_I8I32 +HWCAP2_SVE2 +HWCAP2_SVEAES +HWCAP2_SVEBF16 +HWCAP2_SVEBITPERM +HWCAP2_SVEF32MM +HWCAP2_SVEF64MM +HWCAP2_SVEI8MM +HWCAP2_SVEPMULL +HWCAP2_SVESHA3 +HWCAP2_SVESM4 +HWCAP2_SVE_EBF16 +HWCAP2_WFXT +HWCAP_AES +HWCAP_ASIMD +HWCAP_ASIMDDP +HWCAP_ASIMDFHM +HWCAP_ASIMDHP +HWCAP_ASIMDRDM +HWCAP_ATOMICS +HWCAP_CPUID +HWCAP_CRC32 +HWCAP_DCPOP +HWCAP_DIT +HWCAP_EVTSTRM +HWCAP_FCMA +HWCAP_FLAGM +HWCAP_FP +HWCAP_FPHP +HWCAP_ILRCPC +HWCAP_JSCVT +HWCAP_LRCPC +HWCAP_PACA +HWCAP_PACG +HWCAP_PMULL +HWCAP_SB +HWCAP_SHA1 +HWCAP_SHA2 +HWCAP_SHA3 +HWCAP_SHA512 +HWCAP_SM3 +HWCAP_SM4 +HWCAP_SSBS +HWCAP_SVE +HWCAP_USCAT +PROT_BTI +PROT_MTE +SYS_accept +SYS_arch_specific_syscall +SYS_fcntl +SYS_getrlimit +SYS_memfd_secret +SYS_migrate_pages +SYS_msgctl +SYS_msgget +SYS_msgrcv +SYS_msgsnd +SYS_semctl +SYS_semget +SYS_semop +SYS_semtimedop +SYS_shmat +SYS_shmctl +SYS_shmdt +SYS_shmget +SYS_sync_file_range +SYS_syscalls diff --git a/libc-test/semver/android-x86_64.txt b/libc-test/semver/android-x86_64.txt index c4bb87bccb66d..05919bb6f40e5 100644 --- a/libc-test/semver/android-x86_64.txt +++ b/libc-test/semver/android-x86_64.txt @@ -1,3 +1,5 @@ +AT_SYSINFO_EHDR +AT_VECTOR_SIZE_ARCH EFLAGS FS_BASE GS_BASE diff --git a/libc-test/semver/android.txt b/libc-test/semver/android.txt index 28b3286bfc339..945c53e7e0651 100644 --- a/libc-test/semver/android.txt +++ b/libc-test/semver/android.txt @@ -136,13 +136,39 @@ ATF_NETMASK ATF_PERM ATF_PUBL ATF_USETRAILERS +AT_BASE +AT_BASE_PLATFORM +AT_CLKTCK +AT_EGID AT_EMPTY_PATH +AT_ENTRY +AT_EUID +AT_EXECFD +AT_EXECFN AT_FDCWD +AT_FLAGS +AT_GID +AT_HWCAP +AT_HWCAP2 +AT_IGNORE +AT_MINSIGSTKSZ +AT_NOTELF AT_NO_AUTOMOUNT +AT_NULL +AT_PAGESZ +AT_PHDR +AT_PHENT +AT_PHNUM +AT_PLATFORM +AT_RANDOM AT_RECURSIVE AT_REMOVEDIR +AT_RSEQ_ALIGN +AT_RSEQ_FEATURE_SIZE +AT_SECURE AT_SYMLINK_FOLLOW AT_SYMLINK_NOFOLLOW +AT_UID B0 B1000000 B110 diff --git a/src/unix/linux_like/android/b32/arm.rs b/src/unix/linux_like/android/b32/arm.rs index a062175eef746..c4c78939cba48 100644 --- a/src/unix/linux_like/android/b32/arm.rs +++ b/src/unix/linux_like/android/b32/arm.rs @@ -533,6 +533,9 @@ pub const REG_R15: ::c_int = 15; pub const NGREG: ::c_int = 18; +// From NDK's asm/auxvec.h +pub const AT_SYSINFO_EHDR: ::c_ulong = 33; + f! { // Sadly, Android before 5.0 (API level 21), the accept4 syscall is not // exposed by the libc. As work-around, we implement it through `syscall` diff --git a/src/unix/linux_like/android/b32/x86/mod.rs b/src/unix/linux_like/android/b32/x86/mod.rs index e549f3b5168e6..64ce93dd22916 100644 --- a/src/unix/linux_like/android/b32/x86/mod.rs +++ b/src/unix/linux_like/android/b32/x86/mod.rs @@ -585,6 +585,11 @@ pub const REG_EFL: ::c_int = 16; pub const REG_UESP: ::c_int = 17; pub const REG_SS: ::c_int = 18; +// From NDK's asm/auxvec.h +pub const AT_SYSINFO: ::c_ulong = 32; +pub const AT_SYSINFO_EHDR: ::c_ulong = 33; +pub const AT_VECTOR_SIZE_ARCH: ::c_ulong = 3; + // socketcall values from linux/net.h (only the needed ones, and not public) const SYS_ACCEPT4: ::c_int = 18; diff --git a/src/unix/linux_like/android/b64/aarch64/mod.rs b/src/unix/linux_like/android/b64/aarch64/mod.rs index 7b87a1d49dc3e..bd3146deb7f9f 100644 --- a/src/unix/linux_like/android/b64/aarch64/mod.rs +++ b/src/unix/linux_like/android/b64/aarch64/mod.rs @@ -417,6 +417,10 @@ pub const SYS_syscalls: ::c_long = 436; pub const PROT_BTI: ::c_int = 0x10; 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_align)] { mod align; diff --git a/src/unix/linux_like/android/b64/mod.rs b/src/unix/linux_like/android/b64/mod.rs index 9639e1b4fa589..97cf137b7fc79 100644 --- a/src/unix/linux_like/android/b64/mod.rs +++ b/src/unix/linux_like/android/b64/mod.rs @@ -264,32 +264,6 @@ pub const RTLD_GLOBAL: ::c_int = 0x00100; pub const RTLD_NOW: ::c_int = 2; pub const RTLD_DEFAULT: *mut ::c_void = 0i64 as *mut ::c_void; -// From NDK's linux/auxvec.h -pub const AT_NULL: ::c_ulong = 0; -pub const AT_IGNORE: ::c_ulong = 1; -pub const AT_EXECFD: ::c_ulong = 2; -pub const AT_PHDR: ::c_ulong = 3; -pub const AT_PHENT: ::c_ulong = 4; -pub const AT_PHNUM: ::c_ulong = 5; -pub const AT_PAGESZ: ::c_ulong = 6; -pub const AT_BASE: ::c_ulong = 7; -pub const AT_FLAGS: ::c_ulong = 8; -pub const AT_ENTRY: ::c_ulong = 9; -pub const AT_NOTELF: ::c_ulong = 10; -pub const AT_UID: ::c_ulong = 11; -pub const AT_EUID: ::c_ulong = 12; -pub const AT_GID: ::c_ulong = 13; -pub const AT_EGID: ::c_ulong = 14; -pub const AT_PLATFORM: ::c_ulong = 15; -pub const AT_HWCAP: ::c_ulong = 16; -pub const AT_CLKTCK: ::c_ulong = 17; -pub const AT_SECURE: ::c_ulong = 23; -pub const AT_BASE_PLATFORM: ::c_ulong = 24; -pub const AT_RANDOM: ::c_ulong = 25; -pub const AT_HWCAP2: ::c_ulong = 26; -pub const AT_EXECFN: ::c_ulong = 31; -pub const AT_MINSIGSTKSZ: ::c_ulong = 51; - pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t { value: 0, __reserved: [0; 36], diff --git a/src/unix/linux_like/android/b64/riscv64/mod.rs b/src/unix/linux_like/android/b64/riscv64/mod.rs index 9d414dc15fb39..209f050f25ce5 100644 --- a/src/unix/linux_like/android/b64/riscv64/mod.rs +++ b/src/unix/linux_like/android/b64/riscv64/mod.rs @@ -345,6 +345,18 @@ pub const SYS_fsmount: ::c_long = 432; pub const SYS_fspick: ::c_long = 433; pub const SYS_syscalls: ::c_long = 436; +// From NDK's asm/auxvec.h +pub const AT_SYSINFO_EHDR: ::c_ulong = 33; +pub const AT_L1I_CACHESIZE: ::c_ulong = 40; +pub const AT_L1I_CACHEGEOMETRY: ::c_ulong = 41; +pub const AT_L1D_CACHESIZE: ::c_ulong = 42; +pub const AT_L1D_CACHEGEOMETRY: ::c_ulong = 43; +pub const AT_L2_CACHESIZE: ::c_ulong = 44; +pub const AT_L2_CACHEGEOMETRY: ::c_ulong = 45; +pub const AT_L3_CACHESIZE: ::c_ulong = 46; +pub const AT_L3_CACHEGEOMETRY: ::c_ulong = 47; +pub const AT_VECTOR_SIZE_ARCH: ::c_ulong = 9; + cfg_if! { if #[cfg(libc_align)] { mod align; diff --git a/src/unix/linux_like/android/b64/x86_64/mod.rs b/src/unix/linux_like/android/b64/x86_64/mod.rs index be6b5011c21cc..a7363304c65ce 100644 --- a/src/unix/linux_like/android/b64/x86_64/mod.rs +++ b/src/unix/linux_like/android/b64/x86_64/mod.rs @@ -794,6 +794,10 @@ pub const REG_TRAPNO: ::c_int = 20; pub const REG_OLDMASK: ::c_int = 21; pub const REG_CR2: ::c_int = 22; +// From NDK's asm/auxvec.h +pub const AT_SYSINFO_EHDR: ::c_ulong = 33; +pub const AT_VECTOR_SIZE_ARCH: ::c_ulong = 3; + cfg_if! { if #[cfg(libc_align)] { mod align; diff --git a/src/unix/linux_like/android/mod.rs b/src/unix/linux_like/android/mod.rs index a9cc5943bb469..2e2d25903e539 100644 --- a/src/unix/linux_like/android/mod.rs +++ b/src/unix/linux_like/android/mod.rs @@ -3535,6 +3535,34 @@ pub const KLOG_CONSOLE_LEVEL: ::c_int = 8; pub const KLOG_SIZE_UNREAD: ::c_int = 9; pub const KLOG_SIZE_BUFFER: ::c_int = 10; +// From NDK's linux/auxvec.h +pub const AT_NULL: ::c_ulong = 0; +pub const AT_IGNORE: ::c_ulong = 1; +pub const AT_EXECFD: ::c_ulong = 2; +pub const AT_PHDR: ::c_ulong = 3; +pub const AT_PHENT: ::c_ulong = 4; +pub const AT_PHNUM: ::c_ulong = 5; +pub const AT_PAGESZ: ::c_ulong = 6; +pub const AT_BASE: ::c_ulong = 7; +pub const AT_FLAGS: ::c_ulong = 8; +pub const AT_ENTRY: ::c_ulong = 9; +pub const AT_NOTELF: ::c_ulong = 10; +pub const AT_UID: ::c_ulong = 11; +pub const AT_EUID: ::c_ulong = 12; +pub const AT_GID: ::c_ulong = 13; +pub const AT_EGID: ::c_ulong = 14; +pub const AT_PLATFORM: ::c_ulong = 15; +pub const AT_HWCAP: ::c_ulong = 16; +pub const AT_CLKTCK: ::c_ulong = 17; +pub const AT_SECURE: ::c_ulong = 23; +pub const AT_BASE_PLATFORM: ::c_ulong = 24; +pub const AT_RANDOM: ::c_ulong = 25; +pub const AT_HWCAP2: ::c_ulong = 26; +pub const AT_RSEQ_FEATURE_SIZE: ::c_ulong = 27; +pub const AT_RSEQ_ALIGN: ::c_ulong = 28; +pub const AT_EXECFN: ::c_ulong = 31; +pub const AT_MINSIGSTKSZ: ::c_ulong = 51; + // Most `*_SUPER_MAGIC` constants are defined at the `linux_like` level; the // following are only available on newer Linux versions than the versions // currently used in CI in some configurations, so we define them here.