"Yuriy M. Kaminskiy" yumkam@gmail.com writes:
On 14.03.2019 08:41, Niels Möller wrote:
"Yuriy M. Kaminskiy" yumkam@gmail.com writes:
When compiled for armv6+ and getauxval() is present (glibc 2.16+), avoid slow and unreliable /proc/cpuinfo parsing.
E.g. /proc/cpuinfo contains junk with qemu-user and can be unavailable in some chroot environment.
Do you know what's the preferred way to do this on android? Do we still need /proc/cpuinfo, or are there any library facilities?
Google suggests https://developer.android.com/ndk/guides/cpu-features I have no experience with it.
That page says that getauxval is available on later versions ("API level 18" and later, whatever that means). So should hopefully work, with the same configure check.
Not sure if there's any easy way to test on android, without downloading either the ndk (with whatever license agreements required) or just the cross-compiler binaries. Is http://android-rebuilds.beuc.net/ the way to go? I also tried native compile under termux a while ago, but configure failed because there was no /bin/sh.
There are (const char *)getauxval(AT_PLATFORM); it is expected to be "v[45678][lb]"; probably, I should use it.
Things that should be checked: arm (32bit) userland with aarch64/arm64 kernel.
Any progress on this? I'd really like to have the arch version check also done via getauxval, if that's possible.
Regards, /Niels