From: Richard Levitte Date: Wed, 15 Apr 2020 10:54:23 +0000 (+0200) Subject: Include BN assembler alongside CPUID code X-Git-Tag: openssl-3.0.0-alpha14~48 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5ad3e6c56eb1c295a7de92de5bb2f54614d5c277;p=thirdparty%2Fopenssl.git Include BN assembler alongside CPUID code It turns out that some CPUID code requires the presence of some BN assembler code, so we make sure it's included in the same manner as the CPUID code itself. Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/14755) --- diff --git a/crypto/bn/build.info b/crypto/bn/build.info index 237d5e90edf..89ff0044f25 100644 --- a/crypto/bn/build.info +++ b/crypto/bn/build.info @@ -107,17 +107,21 @@ $COMMON=bn_add.c bn_div.c bn_exp.c bn_lib.c bn_ctx.c bn_mul.c \ bn_recp.c bn_mont.c bn_mpi.c bn_exp2.c bn_gf2m.c bn_nist.c \ bn_intern.c bn_dh.c bn_rsa_fips186_4.c bn_const.c SOURCE[../../libcrypto]=$COMMON $BNASM bn_print.c bn_err.c bn_srp.c +DEFINE[../../libcrypto]=$BNDEF IF[{- !$disabled{'deprecated-3.0'} -}] SOURCE[../../libcrypto]=bn_depr.c bn_x931p.c ENDIF SOURCE[../../providers/libfips.a]=$COMMON $BNASM +DEFINE[../../providers/libfips.a]=$BNDEF +# Because some CPUID implementations use some BN assembler (!!!), we +# must include assembler code into the legacy provider under the same +# conditions as CPUID code is included. See ../build.info SOURCE[../../providers/liblegacy.a]=$BNASM +DEFINE[../../providers/liblegacy.a]=$BNDEF # Implementations are now spread across several libraries, so the defines # need to be applied to all affected libraries and modules. -DEFINE[../../libcrypto]=$BNDEF -DEFINE[../../providers/libfips.a]=$BNDEF -DEFINE[../../providers/liblegacy.a]=$BNDEF DEFINE[../../providers/libimplementations.a]=$BNDEF +DEFINE[../../providers/libcommon.a]=$BNDEF INCLUDE[bn_exp.o]=.. diff --git a/crypto/build.info b/crypto/build.info index e6dce8ebc2c..560f872ee2c 100644 --- a/crypto/build.info +++ b/crypto/build.info @@ -67,8 +67,8 @@ INCLUDE[cpuid.o]=.. SOURCE[../libcrypto]=$CPUID_COMMON DEFINE[../libcrypto]=$CPUIDDEF -SOURCE[../providers/fips]=$CPUID_COMMON -DEFINE[../providers/fips]=$CPUIDDEF +SOURCE[../providers/libfips.a]=$CPUID_COMMON +DEFINE[../providers/libfips.a]=$CPUIDDEF # We only need to include the CPUID stuff in the legacy provider when it's a # separate module and it's dynamically linked with libcrypto. Otherwise, it # already gets everything that the static libcrypto.a has, and doesn't need it @@ -80,7 +80,6 @@ ENDIF # Implementations are now spread across several libraries, so the CPUID define # need to be applied to all affected libraries and modules. -DEFINE[../providers/libfips.a]=$CPUIDDEF DEFINE[../providers/libimplementations.a]=$CPUIDDEF DEFINE[../providers/libcommon.a]=$CPUIDDEF