3
0
forked from pool/openssl-3
openssl-3/openssl-ppc64-fix-build.patch

56 lines
1.7 KiB
Diff

From d18f9e0354894a5d3d86b9b0b09acc5953766e54 Mon Sep 17 00:00:00 2001
From: Martin Schwenke <martin@meltin.net>
Date: Thu, 1 Jul 2021 14:23:50 +1000
Subject: [PATCH 1/3] bn: Use a basic branch-if-not-zero
Ancient toolchains fail the build because they don't like the hints,
newer ISAs recommend not using the hints and relying on dynamic branch
prediction.
Signed-off-by: Martin Schwenke <martin@meltin.net>
---
crypto/bn/asm/ppc64-mont-fixed.pl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: openssl-3.0.0-beta1/crypto/bn/asm/ppc64-mont-fixed.pl
===================================================================
--- openssl-3.0.0-beta1.orig/crypto/bn/asm/ppc64-mont-fixed.pl
+++ openssl-3.0.0-beta1/crypto/bn/asm/ppc64-mont-fixed.pl
@@ -267,7 +267,7 @@ ___
addze $tp[$n],$tp[$n+1]
addi $i,$i,$SIZE_T
- bc 25,0,$label->{"outer"}
+ bdnz $label->{"outer"}
and. $tp[$n],$tp[$n],$tp[$n]
bne $label->{"sub"}
@@ -322,7 +322,7 @@ ___
$self->add_code(<<___);
li r3,1
blr
-.size ${fname},.-${fname}
+.size .${fname},.-.${fname}
___
}
Index: openssl-3.0.0-beta1/crypto/ppccap.c
===================================================================
--- openssl-3.0.0-beta1.orig/crypto/ppccap.c
+++ openssl-3.0.0-beta1/crypto/ppccap.c
@@ -68,12 +68,14 @@ int bn_mul_mont(BN_ULONG *rp, const BN_U
* no opportunity to figure it out...
*/
+#if defined(_ARCH_PPC64)
if (num == 6) {
if (OPENSSL_ppccap_P & PPC_MADD300)
return bn_mul_mont_300_fixed_n6(rp, ap, bp, np, n0, num);
else
return bn_mul_mont_fixed_n6(rp, ap, bp, np, n0, num);
}
+#endif
return bn_mul_mont_int(rp, ap, bp, np, n0, num);
}