getauxval() is available on Android since API 18. https://developer.android.com/ndk/guides/cpu-features#features_using_libcs_g...
--- fat-arm64.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/fat-arm64.c b/fat-arm64.c index 240302a6..45cce0cc 100644 --- a/fat-arm64.c +++ b/fat-arm64.c @@ -43,9 +43,14 @@ #if defined(__linux__) && defined(__GLIBC__) && defined(__GLIBC_PREREQ) # if __GLIBC_PREREQ(2, 16) # define USE_GETAUXVAL 1 -# include <asm/hwcap.h> -# include <sys/auxv.h> # endif +#elif __ANDROID_API__ >= 18 +# define USE_GETAUXVAL 1 +#endif + +#if USE_GETAUXVAL +# include <asm/hwcap.h> +# include <sys/auxv.h> #elif defined(__OpenBSD__) # include <sys/sysctl.h> # include <machine/cpu.h>
Foolbar fooapr@outlook.com writes:
getauxval() is available on Android since API 18. https://developer.android.com/ndk/guides/cpu-features#features_using_libcs_g...
Thanks, now merged to the master-updates branch.
I wonder if there's some easy way to test this in the CI? I've tried building in termux on my android phone, and it seems to work fine (setting NETTLE_FAT_VERBOSE=1 says that it enables sha1, sha256,pmul and aes instructions). I got a mysterious (not reproducible) linker crash on first try, though, "Pointer tag for 0x14 was truncated".
Regards, /Niels
Niels Möller wrote:
I wonder if there's some easy way to test this in the CI?
Sadly no from what I know other than setting up an Android emulator.
I got a mysterious (not reproducible) linker crash on first try, though, "Pointer tag for 0x14 was truncated".
Not sure why this happened, but it should not be caused by this patch.
Regards, Foolbar
nettle-bugs@lists.lysator.liu.se