]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
[PowerPC64] Skip using getauxval() when it is not available
authorMaamoun TK <maamoun.tk@googlemail.com>
Sun, 20 Dec 2020 17:03:11 +0000 (18:03 +0100)
committerMaamoun TK <maamoun.tk@googlemail.com>
Sun, 20 Dec 2020 17:03:11 +0000 (18:03 +0100)
fat-ppc.c

index 847af14f7407c6af01d4a5beddf68c1d901f5d38..365d4d9bcf13bca9a570e4f88842f7f3e43c8105 100644 (file)
--- a/fat-ppc.c
+++ b/fat-ppc.c
 #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__)