diff options
author | Piotr Kubaj <pkubaj@FreeBSD.org> | 2021-04-18 22:36:56 +0000 |
---|---|---|
committer | Piotr Kubaj <pkubaj@FreeBSD.org> | 2021-04-18 22:36:56 +0000 |
commit | 9b429b80e033ec7dabf0c87a76df372e3de36f2a (patch) | |
tree | 7c60f6e930159cb313762eadd790240f5e5a35c2 | |
parent | a2120a784b975714351fd9388b5000b87f3903f2 (diff) | |
download | ports-9b429b80e033ec7dabf0c87a76df372e3de36f2a.tar.gz ports-9b429b80e033ec7dabf0c87a76df372e3de36f2a.zip |
security/nettle: fix runtime issues on powerpc64 elfv2
nettle is compiled for elfv1 on powerpc64, which causes runtime crashes.
Submitted by: jhibbits
-rw-r--r-- | security/nettle/Makefile | 6 | ||||
-rw-r--r-- | security/nettle/files/extra-patch-powerpc64_machine.m4 | 32 |
2 files changed, 37 insertions, 1 deletions
diff --git a/security/nettle/Makefile b/security/nettle/Makefile index e28ec8166e04..694353749c2c 100644 --- a/security/nettle/Makefile +++ b/security/nettle/Makefile @@ -2,7 +2,7 @@ PORTNAME= nettle PORTVERSION= 3.7.2 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= security MASTER_SITES= GNU \ https://www.lysator.liu.se/~nisse/archive/ @@ -39,6 +39,10 @@ EXAMPLES_USES= ssl CONFIGURE_ENV+= CCPIC=-fPIC .endif +.if defined(PPC_ABI) && ${PPC_ABI} == ELFv2 +EXTRA_PATCHES= ${FILESDIR}/extra-patch-powerpc64_machine.m4 +.endif + post-patch: @${REINPLACE_CMD} -e '/libdir=/ s|lib32|lib|' ${WRKSRC}/configure .if ${ARCH} == "mips64" diff --git a/security/nettle/files/extra-patch-powerpc64_machine.m4 b/security/nettle/files/extra-patch-powerpc64_machine.m4 new file mode 100644 index 000000000000..e0bcdbd34fd2 --- /dev/null +++ b/security/nettle/files/extra-patch-powerpc64_machine.m4 @@ -0,0 +1,32 @@ +--- powerpc64/machine.m4.old 2021-04-18 10:51:29.072176000 -0500 ++++ powerpc64/machine.m4 2021-04-18 11:45:30.583315000 -0500 +@@ -1,26 +1,15 @@ + define(`PROLOGUE', + `.globl C_NAME($1) + DECLARE_FUNC(C_NAME($1)) +-ifelse(WORDS_BIGENDIAN,no, +-`ifdef(`FUNC_ALIGN',`.align FUNC_ALIGN') ++ifdef(`FUNC_ALIGN',`.align FUNC_ALIGN') + C_NAME($1): + addis 2,12,(.TOC.-C_NAME($1))@ha + addi 2,2,(.TOC.-C_NAME($1))@l +-.localentry C_NAME($1), .-C_NAME($1)', +-`.section ".opd","aw" +-.align 3 +-C_NAME($1): +-.quad .C_NAME($1),.TOC.@tocbase,0 +-.previous +-ifdef(`FUNC_ALIGN',`.align FUNC_ALIGN') +-.C_NAME($1):') ++.localentry C_NAME($1), .-C_NAME($1) + undefine(`FUNC_ALIGN')') + + define(`EPILOGUE', +-`ifelse(WORDS_BIGENDIAN,no, +-`.size C_NAME($1), . - C_NAME($1)', +-`.size .C_NAME($1), . - .C_NAME($1) +-.size C_NAME($1), . - .C_NAME($1)')') ++`.size C_NAME($1), . - C_NAME($1)') + + C Get vector-scalar register from vector register + C VSR(VR) |