about summary refs log tree commit diff
path: root/library/stdarch/crates/std_detect/src
diff options
context:
space:
mode:
Diffstat (limited to 'library/stdarch/crates/std_detect/src')
-rw-r--r--library/stdarch/crates/std_detect/src/detect/os/linux/auxvec.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/library/stdarch/crates/std_detect/src/detect/os/linux/auxvec.rs b/library/stdarch/crates/std_detect/src/detect/os/linux/auxvec.rs
index 077fc9e4c89..76908db3140 100644
--- a/library/stdarch/crates/std_detect/src/detect/os/linux/auxvec.rs
+++ b/library/stdarch/crates/std_detect/src/detect/os/linux/auxvec.rs
@@ -1,5 +1,5 @@
 //! Parses ELF auxiliary vectors.
-#![cfg_attr(not(target_arch = "aarch64"), allow(dead_code))]
+#![allow(dead_code)]
 
 pub(crate) const AT_NULL: usize = 0;
 
@@ -89,11 +89,10 @@ pub(crate) fn auxv() -> Result<AuxVec, ()> {
 
     #[cfg(not(feature = "std_detect_dlsym_getauxval"))]
     {
-        let hwcap = unsafe { libc::getauxval(AT_HWCAP as libc::c_ulong) as usize };
-
         // Targets with only AT_HWCAP:
         #[cfg(any(target_arch = "aarch64", target_arch = "mips", target_arch = "mips64"))]
         {
+            let hwcap = unsafe { libc::getauxval(AT_HWCAP as libc::c_ulong) as usize };
             if hwcap != 0 {
                 return Ok(AuxVec { hwcap });
             }
@@ -106,6 +105,7 @@ pub(crate) fn auxv() -> Result<AuxVec, ()> {
             target_arch = "powerpc64"
         ))]
         {
+            let hwcap = unsafe { libc::getauxval(AT_HWCAP as libc::c_ulong) as usize };
             let hwcap2 = unsafe { libc::getauxval(AT_HWCAP2 as libc::c_ulong) as usize };
             if hwcap != 0 && hwcap2 != 0 {
                 return Ok(AuxVec { hwcap, hwcap2 });