Skip to content

Commit 83c7512

Browse files
committed
arm: Call getauxval through libc.
See rust-lang/stdarch#1746
1 parent c633d5e commit 83c7512

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

src/cpu/arm/linux.rs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,7 @@ pub fn detect_features() -> u32 {
4747
#[cfg(not(target_env = "uclibc"))]
4848
{
4949
use super::CAPS_STATIC;
50-
51-
// The `libc` crate doesn't provide this functionality on all
52-
// 32-bit Linux targets, like Android or -musl. Use this polyfill
53-
// for all 32-bit ARM targets so that testing on one of them will
54-
// be more meaningful to the others.
55-
use libc::c_ulong;
56-
extern "C" {
57-
pub fn getauxval(type_: c_ulong) -> c_ulong;
58-
}
59-
const AT_HWCAP: c_ulong = 16;
60-
const HWCAP_NEON: c_ulong = 1 << 12;
50+
use libc::{getauxval, AT_HWCAP, HWCAP_NEON};
6151

6252
if CAPS_STATIC & Neon::mask() != Neon::mask() {
6353
let caps = unsafe { getauxval(AT_HWCAP) };

0 commit comments

Comments
 (0)