Skip to content

Commit

Permalink
Add android-riscv64 API check
Browse files Browse the repository at this point in the history
(backport <rust-lang#3779>)
(cherry picked from commit d22cc19)
  • Loading branch information
yujincheng08 authored and tgross35 committed Aug 20, 2024
1 parent 73af7aa commit c7ce9a9
Show file tree
Hide file tree
Showing 4 changed files with 105 additions and 14 deletions.
90 changes: 90 additions & 0 deletions libc-test/semver/android-riscv64.txt
Original file line number Diff line number Diff line change
@@ -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
7 changes: 4 additions & 3 deletions src/unix/linux_like/android/b64/aarch64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -417,15 +417,16 @@ 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;
pub use self::align::*;
}
}
// 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)] {
Expand Down
14 changes: 7 additions & 7 deletions src/unix/linux_like/android/b64/riscv64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -345,13 +345,6 @@ pub const SYS_fsmount: ::c_long = 432;
pub const SYS_fspick: ::c_long = 433;
pub const SYS_syscalls: ::c_long = 436;

cfg_if! {
if #[cfg(libc_align)] {
mod align;
pub use self::align::*;
}
}

// From NDK's asm/auxvec.h
pub const AT_SYSINFO_EHDR: ::c_ulong = 33;
pub const AT_L1I_CACHESIZE: ::c_ulong = 40;
Expand All @@ -363,3 +356,10 @@ 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;
pub use self::align::*;
}
}
8 changes: 4 additions & 4 deletions src/unix/linux_like/android/b64/x86_64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -794,13 +794,13 @@ 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;
pub use self::align::*;
}
}

// From NDK's asm/auxvec.h
pub const AT_SYSINFO_EHDR: ::c_ulong = 33;
pub const AT_VECTOR_SIZE_ARCH: ::c_ulong = 3;

0 comments on commit c7ce9a9

Please sign in to comment.