nettle: always use auxval on ppc, and fix on ppc64 big endian

This commit is contained in:
q66 2021-04-18 18:10:59 +02:00
parent c5d4caeafb
commit b082953404
2 changed files with 43 additions and 0 deletions

View file

@ -0,0 +1,21 @@
This ensures that efficient capability checks are used on musl.
--- fat-ppc.c
+++ fat-ppc.c
@@ -42,12 +42,10 @@
#if defined(_AIX)
# include <sys/systemcfg.h>
-#elif defined(__linux__) && defined(__GLIBC__) && defined(__GLIBC_PREREQ)
-# if __GLIBC_PREREQ(2, 16)
-# define USE_GETAUXVAL 1
-# include <asm/cputable.h>
-# include <sys/auxv.h>
-# endif
+#elif defined(__linux__)
+# define USE_GETAUXVAL 1
+# include <asm/cputable.h>
+# include <sys/auxv.h>
#elif defined(__FreeBSD__)
# include <machine/cpu.h>
# ifdef PPC_FEATURE2_HAS_VEC_CRYPTO

View file

@ -0,0 +1,22 @@
Ensure that ELFv2 ABI is used on all ppc64, including big endian.
--- powerpc64/machine.m4
+++ powerpc64/machine.m4
@@ -1,7 +1,7 @@
define(`PROLOGUE',
`.globl C_NAME($1)
DECLARE_FUNC(C_NAME($1))
-ifelse(WORDS_BIGENDIAN,no,
+ifelse(`no',`no',
`ifdef(`FUNC_ALIGN',`.align FUNC_ALIGN')
C_NAME($1):
addis 2,12,(.TOC.-C_NAME($1))@ha
@@ -17,7 +17,7 @@ ifdef(`FUNC_ALIGN',`.align FUNC_ALIGN')
undefine(`FUNC_ALIGN')')
define(`EPILOGUE',
-`ifelse(WORDS_BIGENDIAN,no,
+`ifelse(`no',`no',
`.size C_NAME($1), . - C_NAME($1)',
`.size .C_NAME($1), . - .C_NAME($1)
.size C_NAME($1), . - .C_NAME($1)')')