bn_ppc.c: Fix build failure on AIX with XLC/XLCLANG
authorTomas Mraz <tomas@openssl.org>
Thu, 13 Jan 2022 17:07:08 +0000 (18:07 +0100)
committerTomas Mraz <tomas@openssl.org>
Mon, 17 Jan 2022 17:16:26 +0000 (18:16 +0100)
These compilers define _ARCH_PPC64 for 32 bit builds
so we cannot depend solely on this define to identify
32 bit build.

Fixes #17087

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17497)

crypto/bn/bn_ppc.c

index 05c0c4cb9250bc09787be1eb3cf23098f334e7bd..5424c25d47645383ff50e423f2d82eb4edc9db29 100644 (file)
@@ -40,7 +40,7 @@ int bn_mul_mont(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp,
      * no opportunity to figure it out...
      */
 
-#if defined(_ARCH_PPC64)
+#if defined(_ARCH_PPC64) && !defined(__ILP32__)
     if (num == 6) {
         if (OPENSSL_ppccap_P & PPC_MADD300)
             return bn_mul_mont_300_fixed_n6(rp, ap, bp, np, n0, num);