Move modes_asm_src file information to build.info files
authorRichard Levitte <levitte@openssl.org>
Sun, 16 Jun 2019 20:17:26 +0000 (22:17 +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
Configurations/README
Configure
crypto/modes/build.info

index 168d776ba1b72f6546bf864fc9f416786de6aba5..5c73ce35ade0a176ceb33e17ba5d80e240603ce4 100644 (file)
@@ -14,7 +14,6 @@ my %targets=(
        thread_scheme   => "(unknown)", # Assume we don't know
        thread_defines  => [],
 
-       modes_asm_src   => "",
        padlock_asm_src => "",
        chacha_asm_src  => "chacha_enc.c",
        poly1305_asm_src        => "",
@@ -155,7 +154,6 @@ my %targets=(
 
     x86_asm => {
        template        => 1,
-       modes_asm_src   => "ghash-x86.s",
        padlock_asm_src => "e_padlock-x86.s",
        chacha_asm_src  => "chacha-x86.s",
        poly1305_asm_src=> "poly1305-x86.s",
@@ -166,7 +164,6 @@ my %targets=(
     },
     x86_64_asm => {
        template        => 1,
-       modes_asm_src   => "ghash-x86_64.s aesni-gcm-x86_64.s",
        padlock_asm_src => "e_padlock-x86_64.s",
        chacha_asm_src  => "chacha-x86_64.s",
        poly1305_asm_src=> "poly1305-x86_64.s",
@@ -174,13 +171,11 @@ my %targets=(
     },
     ia64_asm => {
        template        => 1,
-       modes_asm_src   => "ghash-ia64.s",
        chacha_asm_src  => "chacha-ia64.S",
        poly1305_asm_src=> "asm/poly1305-ia64.S",
     },
     sparcv9_asm => {
        template        => 1,
-       modes_asm_src   => "ghash-sparcv9.S",
        poly1305_asm_src=> "poly1305-sparcv9.S",
     },
     sparcv8_asm => {
@@ -188,7 +183,6 @@ my %targets=(
     },
     alpha_asm => {
        template        => 1,
-       modes_asm_src   => "ghash-alpha.S",
     },
     mips32_asm => {
        template        => 1,
@@ -200,28 +194,24 @@ my %targets=(
     },
     s390x_asm => {
        template        => 1,
-       modes_asm_src   => "ghash-s390x.S",
        chacha_asm_src  => "chacha-s390x.S",
        poly1305_asm_src=> "poly1305-s390x.S",
        keccak1600_asm_src      => "keccak1600-s390x.S",
     },
     armv4_asm => {
        template        => 1,
-       modes_asm_src   => "ghash-armv4.S ghashv8-armx.S",
        chacha_asm_src  => "chacha-armv4.S",
        poly1305_asm_src=> "poly1305-armv4.S",
        keccak1600_asm_src      => "keccak1600-armv4.S",
     },
     aarch64_asm => {
        template        => 1,
-       modes_asm_src   => "ghashv8-armx.S",
        chacha_asm_src  => "chacha-armv8.S",
        poly1305_asm_src=> "poly1305-armv8.S",
        keccak1600_asm_src      => "keccak1600-armv8.S",
     },
     parisc11_asm => {
        template        => 1,
-       modes_asm_src   => "ghash-parisc.s",
     },
     parisc20_64_asm => {
        template        => 1,
@@ -229,7 +219,6 @@ my %targets=(
     },
     ppc32_asm => {
        template        => 1,
-       modes_asm_src   => "ghashp8-ppc.s",
        chacha_asm_src  => "chacha-ppc.s",
        poly1305_asm_src=> "poly1305-ppc.s poly1305-ppcfp.s",
     },
index 2895eef4fee6c30565127c980f3fecabdb5af1a6..450fe0dcb8eb782c2beeac6ae2e23aee548f2218 100644 (file)
@@ -949,7 +949,6 @@ my %targets = (
         cppflags         => combine("-DOPENSSL_SMALL_FOOTPRINT",
                                     threads("-D_REENTRANT")),
         bn_ops           => "BN_LLONG",
-        modes_asm_src    => "ghash-c64xplus.s",
         chacha_asm_src   => "chacha-c64xplus.s",
         poly1305_asm_src => "poly1305-c64xplus.s",
         thread_scheme    => "pthreads",
@@ -1852,7 +1851,6 @@ my %targets = (
         perlasm_scheme   => 'ias',
         pointer_size     => "",
 
-        modes_asm_src    => "", # Because ghash-ia64.s doesn't work on VMS
     },
     "vms-ia64-p32" => {
         inherit_from     => [ "vms-ia64" ],
index 664e8d86bd9db4666a9ca247b3a3ab890cc13765..84e7b20c7d51cfbecc42c6bf5582383167000a65 100644 (file)
@@ -240,9 +240,6 @@ In each table entry, the following keys are significant:
                                                 export vars as
                                                 accessor functions.
 
-        modes_asm_src   => Assembler implementation of cipher modes,
-                           currently the functions gcm_gmult_4bit and
-                           gcm_ghash_4bit.
         padlock_asm_src => Assembler implementation of core parts of
                            the padlock engine.  This is mandatory on
                            any platform where the padlock engine might
index 3a8ba0cd6bf6497244decf5178e034566d9b700e..c88cd45899c6bb160bc972f283bbe8c2ca01ee6d 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -1407,9 +1407,6 @@ unless ($disabled{asm}) {
     if ($target{keccak1600_asm_src} ne $table{DEFAULTS}->{keccak1600_asm_src}) {
         push @{$config{lib_defines}}, "KECCAK1600_ASM";
     }
-    if ($target{modes_asm_src} =~ /ghash-/) {
-        push @{$config{lib_defines}}, "GHASH_ASM";
-    }
     if ($target{padlock_asm_src} ne $table{DEFAULTS}->{padlock_asm_src}) {
         push @{$config{dso_defines}}, "PADLOCK_ASM";
     }
@@ -3344,7 +3341,6 @@ sub print_table_entry
         "loutflag",
         "ex_libs",
         "bn_ops",
-        "modes_asm_src",
         "padlock_asm_src",
         "chacha_asm_src",
         "poly1035_asm_src",
index 4157af3ff99aa04e0c06d0d397a6b34d05eb0275..6024606a546844fc059d5983fe9d34ad3157c464 100644 (file)
@@ -1,9 +1,59 @@
 LIBS=../../libcrypto
 
-$COMMON=cbc128.c ctr128.c cfb128.c ofb128.c {- $target{modes_asm_src} -}
+$MODESASM=
+IF[{- !$disabled{asm} -}]
+  $MODESASM_x86=ghash-x86.s
+  $MODESDEF_x86=GHASH_ASM
+  $MODESASM_x86_64=ghash-x86_64.s aesni-gcm-x86_64.s
+  $MODESDEF_x86_64=GHASH_ASM
+
+  # ghash-ia64.s doesn't work on VMS
+  IF[{- $config{target} !~ /^vms-/ -}]
+    $MODESASM_ia64=ghash-ia64.s
+    $MODESDEF_ia64=GHASH_ASM
+  ENDIF
+
+  $MODESASM_sparcv9=ghash-sparcv9.S
+  $MODESDEF_sparcv9=GHASH_ASM
+
+  $MODESASM_alpha=ghash-alpha.S
+  $MODESDEF_alpha=GHASH_ASM
+
+  $MODESASM_s390x=ghash-s390x.S
+  $MODESDEF_s390x=GHASH_ASM
+
+  $MODESASM_armv4=ghash-armv4.S ghashv8-armx.S
+  $MODESDEF_armv4=GHASH_ASM
+  $MODESASM_aarch64=ghashv8-armx.S
+  $MODESDEF_aarch64=GHASH_ASM
+
+  $MODESASM_parisc11=ghash-parisc.s
+  $MODESDEF_parisc11=GHASH_ASM
+  $MODESASM_parisc20_64=$MODESASM_parisc11
+  $MODESDEF_parisc20_64=$MODESDEF_parisc11
+
+  $MODESASM_ppc32=ghashp8-ppc.s
+  $MODESDEF_ppc32=
+  $MODESASM_ppc64=$MODESASM_ppc32
+  $MODESDEF_ppc64=$MODESDEF_ppc32
+
+  $MODESASM_c64xplus=ghash-c64xplus.s
+  $MODESDEF_c64xplus=GHASH_ASM
+
+  # Now that we have defined all the arch specific variables, use the
+  # appropriate one, and define the appropriate macros
+  IF[$MODESASM_{- $target{asm_arch} -}]
+    $MODESASM=$MODESASM_{- $target{asm_arch} -}
+    $MODESDEF=$MODESDEF_{- $target{asm_arch} -}
+  ENDIF
+ENDIF
+
+$COMMON=cbc128.c ctr128.c cfb128.c ofb128.c $MODESASM
 SOURCE[../../libcrypto]=$COMMON \
         cts128.c gcm128.c ccm128.c xts128.c wrap128.c ocb128.c siv128.c
+DEFINE[../../libcrypto]=$MODESDEF
 SOURCE[../../providers/fips]=$COMMON
+DEFINE[../../providers/fips]=$MODESDEF
 
 INCLUDE[gcm128.o]=..