Skip to content

Commit 85572dc

Browse files
taiki-eAmanieu
authored andcommitted
std_detect: Do not use libc::getauxval on 32-bit Android
libc crate currently doesn't provide it.
1 parent 24c2188 commit 85572dc

File tree

1 file changed

+4
-2
lines changed
  • crates/std_detect/src/detect/os/linux

1 file changed

+4
-2
lines changed

crates/std_detect/src/detect/os/linux/auxvec.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ pub(crate) fn auxv() -> Result<AuxVec, ()> {
7171
#[cfg(all(
7272
feature = "std_detect_dlsym_getauxval",
7373
not(all(target_os = "linux", target_env = "gnu")),
74-
not(target_os = "android"),
74+
// TODO: libc crate currently doesn't provide getauxval on 32-bit Android.
75+
not(all(target_os = "android", target_pointer_width = "64")),
7576
))]
7677
{
7778
// Try to call a dynamically-linked getauxval function.
@@ -118,7 +119,8 @@ pub(crate) fn auxv() -> Result<AuxVec, ()> {
118119
#[cfg(any(
119120
not(feature = "std_detect_dlsym_getauxval"),
120121
all(target_os = "linux", target_env = "gnu"),
121-
target_os = "android",
122+
// TODO: libc crate currently doesn't provide getauxval on 32-bit Android.
123+
all(target_os = "android", target_pointer_width = "64"),
122124
))]
123125
{
124126
// Targets with only AT_HWCAP:

0 commit comments

Comments
 (0)