diff options
author | Maamoun TK <maamoun.tk@googlemail.com> | 2020-12-20 18:03:11 +0100 |
---|---|---|
committer | Maamoun TK <maamoun.tk@googlemail.com> | 2020-12-20 18:03:11 +0100 |
commit | 2b75b5eed461dd21f126a2fd01eb957d0d71b891 (patch) | |
tree | f29370ecb16e2172473f18f259a5101994303b01 | |
parent | 27ef13bd3ea5dd9473f9633b241efb9b90143a75 (diff) | |
download | nettle-2b75b5eed461dd21f126a2fd01eb957d0d71b891.tar.gz |
[PowerPC64] Skip using getauxval() when it is not available
-rw-r--r-- | fat-ppc.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -43,8 +43,11 @@ #if defined(_AIX) # include <sys/systemcfg.h> #elif defined(__linux__) -# include <asm/cputable.h> -# include <sys/auxv.h> +# if defined(__GLIBC__) && defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 16) +# define USE_GETAUXVAL 1 +# include <asm/cputable.h> +# include <sys/auxv.h> +# endif #elif defined(__FreeBSD__) # include <machine/cpu.h> # ifdef PPC_FEATURE2_HAS_VEC_CRYPTO @@ -116,7 +119,7 @@ get_ppc_features (struct ppc_features *features) #else unsigned long hwcap = 0; unsigned long hwcap2 = 0; -# if defined(__linux__) +# if defined(__linux__) && USE_GETAUXVAL hwcap = getauxval(AT_HWCAP); hwcap2 = getauxval(AT_HWCAP2); # elif defined(__FreeBSD__) |