getauxv and ARMv7 platform detection
Tue May 21 02:52:00 GMT 2019
I just noticed the following code was failing on ARMv7 platforms:
// For older machines, like GCC 4.3 on ARMv6
# define HWCAP_ARMv7 (1 << 29)
inline bool CPU_QueryARMv7()
if (getauxval(AT_HWCAP) & HWCAP_ARMv7) != 0)
Looking through Torvalds GitHub  I don't see a reliable define for
HWCAP_ARMv7 in hwcap.h.
I know I can fallback to NEON, but that misses earlier devices that
are ARMv7 but lacks NEON.
Searching is turning up a lot of spurious noise (for Aarch64/ARMv8),
and one hit for Mozilla working around the same problem .
My question is, how do we use getauxval to detect ARMv7 platforms?
Thanks in advance.
More information about the Libc-help