From 246b50605ff4c278c91c22b84bb7ed3f4bd677ec Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Sun, 16 Jun 2019 22:28:32 +0200 Subject: [PATCH] Move poly1305_asm_src file information to build.info files Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/9166) --- Configurations/00-base-templates.conf | 10 -------- Configurations/10-main.conf | 1 - Configure | 3 --- crypto/poly1305/build.info | 36 ++++++++++++++++++++++++--- 4 files changed, 32 insertions(+), 18 deletions(-) diff --git a/Configurations/00-base-templates.conf b/Configurations/00-base-templates.conf index 5427af8a4b..edc176241e 100644 --- a/Configurations/00-base-templates.conf +++ b/Configurations/00-base-templates.conf @@ -15,7 +15,6 @@ my %targets=( thread_defines => [], padlock_asm_src => "", - poly1305_asm_src => "", keccak1600_asm_src => "keccak1600.c", unistd => "", @@ -154,7 +153,6 @@ my %targets=( x86_asm => { template => 1, padlock_asm_src => "e_padlock-x86.s", - poly1305_asm_src=> "poly1305-x86.s", }, x86_elf_asm => { template => 1, @@ -163,16 +161,13 @@ my %targets=( x86_64_asm => { template => 1, padlock_asm_src => "e_padlock-x86_64.s", - poly1305_asm_src=> "poly1305-x86_64.s", keccak1600_asm_src => "keccak1600-x86_64.s", }, ia64_asm => { template => 1, - poly1305_asm_src=> "asm/poly1305-ia64.S", }, sparcv9_asm => { template => 1, - poly1305_asm_src=> "poly1305-sparcv9.S", }, sparcv8_asm => { template => 1, @@ -186,21 +181,17 @@ my %targets=( mips64_asm => { inherit_from => [ "mips32_asm" ], template => 1, - poly1305_asm_src=> "poly1305-mips.S", }, s390x_asm => { template => 1, - poly1305_asm_src=> "poly1305-s390x.S", keccak1600_asm_src => "keccak1600-s390x.S", }, armv4_asm => { template => 1, - poly1305_asm_src=> "poly1305-armv4.S", keccak1600_asm_src => "keccak1600-armv4.S", }, aarch64_asm => { template => 1, - poly1305_asm_src=> "poly1305-armv8.S", keccak1600_asm_src => "keccak1600-armv8.S", }, parisc11_asm => { @@ -212,7 +203,6 @@ my %targets=( }, ppc32_asm => { template => 1, - poly1305_asm_src=> "poly1305-ppc.s poly1305-ppcfp.s", }, ppc64_asm => { inherit_from => [ "ppc32_asm" ], diff --git a/Configurations/10-main.conf b/Configurations/10-main.conf index 69a3710f3c..e2202c744d 100644 --- a/Configurations/10-main.conf +++ b/Configurations/10-main.conf @@ -949,7 +949,6 @@ my %targets = ( cppflags => combine("-DOPENSSL_SMALL_FOOTPRINT", threads("-D_REENTRANT")), bn_ops => "BN_LLONG", - poly1305_asm_src => "poly1305-c64xplus.s", thread_scheme => "pthreads", asm_arch => 'c64xplus', perlasm_scheme => "void", diff --git a/Configure b/Configure index 7f37d15c19..7ec44a3c2b 100755 --- a/Configure +++ b/Configure @@ -1410,9 +1410,6 @@ unless ($disabled{asm}) { if ($target{padlock_asm_src} ne $table{DEFAULTS}->{padlock_asm_src}) { push @{$config{dso_defines}}, "PADLOCK_ASM"; } - if ($target{poly1305_asm_src} ne "") { - push @{$config{lib_defines}}, "POLY1305_ASM"; - } } my %predefined_C = compiler_predefined($config{CROSS_COMPILE}.$config{CC}); diff --git a/crypto/poly1305/build.info b/crypto/poly1305/build.info index 60eeeeec9d..064c2599d5 100644 --- a/crypto/poly1305/build.info +++ b/crypto/poly1305/build.info @@ -1,8 +1,36 @@ LIBS=../../libcrypto -SOURCE[../../libcrypto]=\ - poly1305_ameth.c \ - poly1305_meth.c \ - poly1305.c {- $target{poly1305_asm_src} -} + +$POLY1305ASM= +IF[{- !$disabled{asm} -}] + $POLY1305ASM_x86=poly1305-x86.s + $POLY1305ASM_x86_64=poly1305-x86_64.s + + $POLY1305ASM_ia64=asm/poly1305-ia64.S + + $POLY1305ASM_sparcv9=poly1305-sparcv9.S + + $POLY1305ASM_mips64=poly1305-mips.S + + $POLY1305ASM_s390x=poly1305-s390x.S + + $POLY1305ASM_armv4=poly1305-armv4.S + $POLY1305ASM_aarch64=poly1305-armv8.S + + $POLY1305ASM_ppc32=poly1305-ppc.s poly1305-ppcfp.s + $POLY1305ASM_ppc64=$POLY1305ASM_ppc32 + + $POLY1305ASM_c64xplus=poly1305-c64xplus.s + + # Now that we have defined all the arch specific variables, use the + # appropriate one, and define the appropriate macros + IF[$POLY1305ASM_{- $target{asm_arch} -}] + $POLY1305ASM=$POLY1305ASM_{- $target{asm_arch} -} + $POLY1305DEF=POLY1305_ASM + ENDIF +ENDIF + +SOURCE[../../libcrypto]=poly1305_ameth.c poly1305_meth.c poly1305.c $POLY1305ASM +DEFINE[../../libcrypto]=$POLY1305DEF GENERATE[poly1305-sparcv9.S]=asm/poly1305-sparcv9.pl $(PERLASM_SCHEME) INCLUDE[poly1305-sparcv9.o]=.. -- 2.34.1