Move poly1305_asm_src file information to build.info files
authorRichard Levitte <levitte@openssl.org>
Sun, 16 Jun 2019 20:28:32 +0000 (22:28 +0200)
committerRichard Levitte <levitte@openssl.org>
Mon, 17 Jun 2019 14:08:53 +0000 (16:08 +0200)
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/9166)

Configurations/00-base-templates.conf
Configurations/10-main.conf
Configure
crypto/poly1305/build.info

index 5427af8a4bb31fb3a2ded6ee97a108148b0d95a8..edc176241e18f9781e477985e9c6377c374ed1aa 100644 (file)
@@ -15,7 +15,6 @@ my %targets=(
        thread_defines  => [],
 
        padlock_asm_src => "",
-       poly1305_asm_src        => "",
        keccak1600_asm_src      => "keccak1600.c",
 
        unistd          => "<unistd.h>",
@@ -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" ],
index 69a3710f3c5e13a7a0b70b168585269fda3c175e..e2202c744de6f1767ba5ce9a5ab914e91c2954b5 100644 (file)
@@ -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",
index 7f37d15c199958ba1d22ed49dd433000a6c3185e..7ec44a3c2bcf03a2158fd6076d7e9e0373000c18 100755 (executable)
--- 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});
index 60eeeeec9d189a7a38e60279ee63769b32fa14ac..064c2599d55e66094d7a309ece9400e86484d25e 100644 (file)
@@ -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]=..