Move wp_asm_src file information to build.info files
authorRichard Levitte <levitte@openssl.org>
Sun, 16 Jun 2019 20:03:00 +0000 (22:03 +0200)
committerRichard Levitte <levitte@openssl.org>
Mon, 17 Jun 2019 14:08:52 +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/README
Configure
crypto/whrlpool/build.info

index 1621cd3443f1050b25065ec0ee06919cc9d447b0..1cb6049045a8f654c7c5021ac8ea8f8b742af263 100644 (file)
@@ -14,7 +14,6 @@ my %targets=(
        thread_scheme   => "(unknown)", # Assume we don't know
        thread_defines  => [],
 
-       wp_asm_src      => "wp_block.c",
        cmll_asm_src    => "camellia.c cmll_misc.c cmll_cbc.c",
        modes_asm_src   => "",
        padlock_asm_src => "",
@@ -157,7 +156,6 @@ my %targets=(
 
     x86_asm => {
        template        => 1,
-       wp_asm_src      => "wp_block.c wp-mmx.s",
        cmll_asm_src    => "cmll-x86.s",
        modes_asm_src   => "ghash-x86.s",
        padlock_asm_src => "e_padlock-x86.s",
@@ -170,7 +168,6 @@ my %targets=(
     },
     x86_64_asm => {
        template        => 1,
-       wp_asm_src      => "wp-x86_64.s",
        cmll_asm_src    => "cmll-x86_64.s cmll_misc.c",
        modes_asm_src   => "ghash-x86_64.s aesni-gcm-x86_64.s",
        padlock_asm_src => "e_padlock-x86_64.s",
index ad219876baefe5dff3c5d1d9d936a6ba1bb0283d..3c47d4676de4512eaa4b8f53fe5d58a0de0fef80 100644 (file)
@@ -240,8 +240,6 @@ In each table entry, the following keys are significant:
                                                 export vars as
                                                 accessor functions.
 
-        wp_asm_src      => Assembler implementation of core WHIRLPOOL
-                           functions.
         cmll_asm_src    => Assembler implementation of core CAMELLIA
                            functions.
                            Defaults to 'camellia.c cmll_misc.c cmll_cbc.c'
index dc93fa04089480b3220628da81152245c51be820..256b060749c91f6348abaa1803ab758c7be42f0e 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -1407,13 +1407,6 @@ unless ($disabled{asm}) {
     if ($target{keccak1600_asm_src} ne $table{DEFAULTS}->{keccak1600_asm_src}) {
         push @{$config{lib_defines}}, "KECCAK1600_ASM";
     }
-    if ($target{wp_asm_src} =~ /mmx/) {
-        if ($config{processor} eq "386") {
-            $target{wp_asm_src}=$table{DEFAULTS}->{wp_asm_src};
-        } elsif (!$disabled{"whirlpool"}) {
-            push @{$config{lib_defines}}, "WHIRLPOOL_ASM";
-        }
-    }
     if ($target{modes_asm_src} =~ /ghash-/) {
         push @{$config{lib_defines}}, "GHASH_ASM";
     }
@@ -3351,7 +3344,6 @@ sub print_table_entry
         "loutflag",
         "ex_libs",
         "bn_ops",
-        "wp_asm_src",
         "cmll_asm_src",
         "modes_asm_src",
         "padlock_asm_src",
index 4b167b504ec35e7ac3a1878bc29ea156bbe324cc..f67bf41b5e63f699ad6a2d58a23f00683b63ba28 100644 (file)
@@ -1,5 +1,24 @@
 LIBS=../../libcrypto
-SOURCE[../../libcrypto]=wp_dgst.c {- $target{wp_asm_src} -}
+
+$WPASM=wp_block.c
+IF[{- !$disabled{asm} -}]
+  IF[{- $config{processor} ne "386" -}]
+    $WPASM_x86=wp_block.c wp-mmx.s
+    $WPDEF_x86=WHIRLPOOL_ASM
+  ENDIF
+  $WPASM_x86_64=wp-x86_64.s
+  $WPDEF_x86_64=WHIRLPOOL_ASM
+
+  # Now that we have defined all the arch specific variables, use the
+  # appropriate one, and define the appropriate macros
+  IF[$WPASM_{- $target{asm_arch} -}]
+    $WPASM=$WPASM_{- $target{asm_arch} -}
+    $WPDEF=$WPDEF_{- $target{asm_arch} -}
+  ENDIF
+ENDIF
+
+SOURCE[../../libcrypto]=wp_dgst.c $WPASM
+DEFINE[../../libcrypto]=$WPDEF
 
 GENERATE[wp-mmx.s]=asm/wp-mmx.pl \
         $(PERLASM_SCHEME) $(LIB_CFLAGS) $(LIB_CPPFLAGS) $(PROCESSOR)