Build: Remove BEGINRAW / ENDRAW / OVERRIDE
authorRichard Levitte <levitte@openssl.org>
Wed, 30 Jan 2019 17:58:01 +0000 (18:58 +0100)
committerRichard Levitte <levitte@openssl.org>
Thu, 31 Jan 2019 15:19:49 +0000 (16:19 +0100)
It was an ugly hack to avoid certain problems that are no more.

Also added GENERATE lines for perlasm scripts that didn't have that
explicitly.

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/8125)

Configurations/README
Configurations/README.design
Configurations/common.tmpl
Configure
crypto/aes/build.info
crypto/chacha/build.info
crypto/ec/build.info
crypto/modes/build.info
crypto/poly1305/build.info
crypto/rc4/build.info
crypto/sha/build.info

index c1f80fe49e8db90e528b0a3df7561aaca3af0e1a..65841b38b6e915606a94566754690bbc906d7e6b 100644 (file)
@@ -486,48 +486,6 @@ be used in that case:
 
 NOTE: GENERATE lines are limited to one command only per GENERATE.
 
 
 NOTE: GENERATE lines are limited to one command only per GENERATE.
 
-As a last resort, it's possible to have raw build file lines, between
-BEGINRAW and ENDRAW lines as follows:
-
-    BEGINRAW[Makefile(unix)]
-    haha.h: {- $builddir -}/Makefile
-        echo "/* haha */" > haha.h
-    ENDRAW[Makefile(unix)]
-
-The word within square brackets is the build_file configuration item
-or the build_file configuration item followed by the second word in the
-build_scheme configuration item for the configured target within
-parenthesis as shown above.  For example, with the following relevant
-configuration items:
-
-   build_file   => "build.ninja"
-   build_scheme => [ "unified", "unix" ]
-
-... these lines will be considered:
-
-   BEGINRAW[build.ninja]
-   build haha.h: echo "/* haha */" > haha.h
-   ENDRAW[build.ninja]
-
-   BEGINRAW[build.ninja(unix)]
-   build hoho.h: echo "/* hoho */" > hoho.h
-   ENDRAW[build.ninja(unix)]
-
-Should it be needed because the recipes within a RAW section might
-clash with those generated by Configure, it's possible to tell it
-not to generate them with the use of OVERRIDES, for example:
-
-    SOURCE[libfoo]=foo.c bar.c
-    
-    OVERRIDES=bar.o
-    BEGINRAW[Makefile(unix)]
-    bar.o: bar.c
-       $(CC) $(CFLAGS) -DSPECIAL -c -o $@ $<
-    ENDRAW[Makefile(unix)]
-
-See the documentation further up for more information on configuration
-items.
-
 Finally, you can have some simple conditional use of the build.info
 information, looking like this:
 
 Finally, you can have some simple conditional use of the build.info
 information, looking like this:
 
index c0b05bd5b29726374e723dfe2239f3fa6b0ef826..43b6a6620e2281239722ecd3f55418492d3abf7b 100644 (file)
@@ -112,9 +112,6 @@ Two things are worth an extra note:
 'DEPEND[cversion.o]' mentions an object file.  DEPEND indexes is the
 only location where it's valid to mention them
 
 'DEPEND[cversion.o]' mentions an object file.  DEPEND indexes is the
 only location where it's valid to mention them
 
-Lines in 'BEGINRAW'..'ENDRAW' sections must always mention files as
-seen from the top directory, no exception.
-
     # ssl/build.info
     LIBS=../libssl
     SOURCE[../libssl]=tls.c
     # ssl/build.info
     LIBS=../libssl
     SOURCE[../libssl]=tls.c
@@ -234,11 +231,6 @@ indexes:
   programs  => a list of programs.  These are directly inferred from
                the PROGRAMS variable in build.info files.
 
   programs  => a list of programs.  These are directly inferred from
                the PROGRAMS variable in build.info files.
 
-  rawlines  => a list of build-file lines.  These are a direct copy of
-               the BEGINRAW..ENDRAW lines in build.info files.  Note:
-               only the BEGINRAW..ENDRAW section for the current
-               platform are copied, the rest are ignored.
-
   scripts   => a list of scripts.  There are directly inferred from
                the SCRIPTS variable in build.info files.
 
   scripts   => a list of scripts.  There are directly inferred from
                the SCRIPTS variable in build.info files.
 
@@ -352,9 +344,6 @@ section above would be digested into a %unified_info table:
             [
                 "apps/openssl",
             ],
             [
                 "apps/openssl",
             ],
-        "rawlines" =>
-            [
-            ],
         "sources" =>
             {
                 "apps/openssl" =>
         "sources" =>
             {
                 "apps/openssl" =>
index 53384c7307b01f07a33cf0217f8482f44446b236..a15971ef98ff2c8d9f338f3e80aed22822e233b6 100644 (file)
  foreach (@{$unified_info{scripts}})   { doscript($_); }
 
  foreach (sort keys %{$unified_info{dirinfo}})  { dodir($_); }
  foreach (@{$unified_info{scripts}})   { doscript($_); }
 
  foreach (sort keys %{$unified_info{dirinfo}})  { dodir($_); }
-
- # Finally, should there be any applicable BEGINRAW/ENDRAW sections,
- # they are added here.
- $OUT .= $_."\n" foreach @{$unified_info{rawlines}};
 -}
 -}
index 53460fe8ac4a3b0f7e3ba508368ba9fb2c04cc33..8052643155aea5c133802e397ac9acb7c977bd22 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -1714,9 +1714,7 @@ if ($builder eq "unified") {
         my @engines = ();
         my @scripts = ();
         my @extra = ();
         my @engines = ();
         my @scripts = ();
         my @extra = ();
-        my @overrides = ();
         my @intermediates = ();
         my @intermediates = ();
-        my @rawlines = ();
 
         my %attributes = ();
         my %sources = ();
 
         my %attributes = ();
         my %sources = ();
@@ -1872,9 +1870,6 @@ if ($builder eq "unified") {
             qr/^\s*EXTRA\s*=\s*(.*)\s*$/
             => sub { push @extra, tokenize($1)
                          if !@skip || $skip[$#skip] > 0 },
             qr/^\s*EXTRA\s*=\s*(.*)\s*$/
             => sub { push @extra, tokenize($1)
                          if !@skip || $skip[$#skip] > 0 },
-            qr/^\s*OVERRIDES\s*=\s*(.*)\s*$/
-            => sub { push @overrides, tokenize($1)
-                         if !@skip || $skip[$#skip] > 0 },
 
             qr/^\s*ORDINALS\[((?:\\.|[^\\\]])+)\]\s*=\s*(.*)\s*$/,
             => sub { push @{$ordinals{$1}}, tokenize($2)
 
             qr/^\s*ORDINALS\[((?:\\.|[^\\\]])+)\]\s*=\s*(.*)\s*$/,
             => sub { push @{$ordinals{$1}}, tokenize($2)
@@ -1901,23 +1896,6 @@ if ($builder eq "unified") {
             => sub { warn "RENAME is no longer supported\n" },
              qr/^\s*SHARED_NAME\[((?:\\.|[^\\\]])+)\]\s*=\s*(.*)\s*$/
             => sub { warn "SHARED_NAME is no longer supported\n" },
             => sub { warn "RENAME is no longer supported\n" },
              qr/^\s*SHARED_NAME\[((?:\\.|[^\\\]])+)\]\s*=\s*(.*)\s*$/
             => sub { warn "SHARED_NAME is no longer supported\n" },
-            qr/^\s*BEGINRAW\[((?:\\.|[^\\\]])+)\]\s*$/
-            => sub {
-                my $lineiterator = shift;
-                my $target_kind = $1;
-                while (defined $lineiterator->()) {
-                    s|\R$||;
-                    if (/^\s*ENDRAW\[((?:\\.|[^\\\]])+)\]\s*$/) {
-                        die "ENDRAW doesn't match BEGINRAW"
-                            if $1 ne $target_kind;
-                        last;
-                    }
-                    next if @skip && $skip[$#skip] <= 0;
-                    push @rawlines,  $_
-                        if ($target_kind eq $target{build_file}
-                            || $target_kind eq $target{build_file}."(".$builder_platform.")");
-                }
-            },
             qr/^\s*(?:#.*)?$/ => sub { },
             "OTHERWISE" => sub { die "Something wrong with this line:\n$_\nat $sourced/$f" },
             "BEFORE" => sub {
             qr/^\s*(?:#.*)?$/ => sub { },
             "OTHERWISE" => sub { die "Something wrong with this line:\n$_\nat $sourced/$f" },
             "BEFORE" => sub {
@@ -1953,8 +1931,7 @@ EOF
                           libraries => [ @libraries ],
                           engines   => [ @engines   ],
                           scripts   => [ @scripts   ],
                           libraries => [ @libraries ],
                           engines   => [ @engines   ],
                           scripts   => [ @scripts   ],
-                          extra     => [ @extra     ],
-                          overrides => [ @overrides ] );
+                          extra     => [ @extra     ] );
             foreach my $k (keys %infos) {
                 foreach (@{$infos{$k}}) {
                     my $item = cleanfile($buildd, $_, $blddir);
             foreach my $k (keys %infos) {
                 foreach (@{$infos{$k}}) {
                     my $item = cleanfile($buildd, $_, $blddir);
@@ -1963,8 +1940,6 @@ EOF
             }
         }
 
             }
         }
 
-        push @{$unified_info{rawlines}}, @rawlines;
-
         # Check that we haven't defined any library as both shared and
         # explicitly static.  That is forbidden.
         my @doubles = ();
         # Check that we haven't defined any library as both shared and
         # explicitly static.  That is forbidden.
         my @doubles = ();
@@ -2259,7 +2234,7 @@ EOF
 
     ### Make unified_info a bit more efficient
     # One level structures
 
     ### Make unified_info a bit more efficient
     # One level structures
-    foreach (("programs", "libraries", "engines", "scripts", "extra", "overrides")) {
+    foreach (("programs", "libraries", "modules", "scripts", "extra")) {
         $unified_info{$_} = [ sort keys %{$unified_info{$_}} ];
     }
     # Two level structures
         $unified_info{$_} = [ sort keys %{$unified_info{$_}} ];
     }
     # Two level structures
index 0f04863640def6bd905cc838a085efb2be1b6516..1aa7a18dfb27375b399fc1422b9411bf67ab44d7 100644 (file)
@@ -52,13 +52,4 @@ INCLUDE[bsaes-armv7.o]=..
 GENERATE[aes-s390x.S]=asm/aes-s390x.pl $(PERLASM_SCHEME)
 INCLUDE[aes-s390x.o]=..
 
 GENERATE[aes-s390x.S]=asm/aes-s390x.pl $(PERLASM_SCHEME)
 INCLUDE[aes-s390x.o]=..
 
-BEGINRAW[Makefile]
-##### AES assembler implementations
-
-# GNU make "catch all"
-{- $builddir -}/aes-%.S:       {- $sourcedir -}/asm/aes-%.pl
-       CC="$(CC)" $(PERL) $< $(PERLASM_SCHEME) $@
-{- $builddir -}/bsaes-%.S:     {- $sourcedir -}/asm/bsaes-%.pl
-       CC="$(CC)" $(PERL) $< $(PERLASM_SCHEME) $@
-
-ENDRAW[Makefile]
+GENERATE[aes-c64xplus.S]=asm/aes-c64xplus.pl $(PERLASM_SCHEME)
index e1d6116466936b0a07a16eee360e2740ef23b182..bbd9ca8b333f092841bdb1d9be2ed574df7bccb7 100644 (file)
@@ -10,10 +10,5 @@ INCLUDE[chacha-armv4.o]=..
 GENERATE[chacha-armv8.S]=asm/chacha-armv8.pl $(PERLASM_SCHEME)
 INCLUDE[chacha-armv8.o]=..
 INCLUDE[chacha-s390x.o]=..
 GENERATE[chacha-armv8.S]=asm/chacha-armv8.pl $(PERLASM_SCHEME)
 INCLUDE[chacha-armv8.o]=..
 INCLUDE[chacha-s390x.o]=..
-
-BEGINRAW[Makefile(unix)]
-##### CHACHA assembler implementations
-
-{- $builddir -}/chacha-%.S:    {- $sourcedir -}/asm/chacha-%.pl
-       CC="$(CC)" $(PERL) $< $(PERLASM_SCHEME) $@
-ENDRAW[Makefile(unix)]
+GENERATE[chacha-c64xplus.S]=asm/chacha-c64xplus.pl $(PERLASM_SCHEME)
+GENERATE[chacha-s390x.S]=asm/chacha-s390x.pl $(PERLASM_SCHEME)
index a1e673e347d0708da78fca91b5c1c5e20e445766..dd1c891e1958ca86d875d00f53f7aa873208b8c3 100644 (file)
@@ -29,11 +29,6 @@ GENERATE[ecp_nistz256-ppc64.s]=asm/ecp_nistz256-ppc64.pl $(PERLASM_SCHEME)
 GENERATE[x25519-x86_64.s]=asm/x25519-x86_64.pl $(PERLASM_SCHEME)
 GENERATE[x25519-ppc64.s]=asm/x25519-ppc64.pl $(PERLASM_SCHEME)
 
 GENERATE[x25519-x86_64.s]=asm/x25519-x86_64.pl $(PERLASM_SCHEME)
 GENERATE[x25519-ppc64.s]=asm/x25519-ppc64.pl $(PERLASM_SCHEME)
 
-BEGINRAW[Makefile]
-{- $builddir -}/ecp_nistz256-%.S:      {- $sourcedir -}/asm/ecp_nistz256-%.pl
-       CC="$(CC)" $(PERL) $< $(PERLASM_SCHEME) $@
-ENDRAW[Makefile]
-
 INCLUDE[curve448/arch_32/f_impl.o]=curve448/arch_32 curve448
 INCLUDE[curve448/f_generic.o]=curve448/arch_32 curve448
 INCLUDE[curve448/scalar.o]=curve448/arch_32 curve448
 INCLUDE[curve448/arch_32/f_impl.o]=curve448/arch_32 curve448
 INCLUDE[curve448/f_generic.o]=curve448/arch_32 curve448
 INCLUDE[curve448/scalar.o]=curve448/arch_32 curve448
index 1820ab26ba1b2d88cdad36567060e9bb05378671..f015a4c3028ed0e29eabc47ead4e46c92948b917 100644 (file)
@@ -22,9 +22,4 @@ GENERATE[ghashv8-armx.S]=asm/ghashv8-armx.pl $(PERLASM_SCHEME)
 INCLUDE[ghashv8-armx.o]=..
 GENERATE[ghash-s390x.S]=asm/ghash-s390x.pl $(PERLASM_SCHEME)
 INCLUDE[ghash-s390x.o]=..
 INCLUDE[ghashv8-armx.o]=..
 GENERATE[ghash-s390x.S]=asm/ghash-s390x.pl $(PERLASM_SCHEME)
 INCLUDE[ghash-s390x.o]=..
-
-BEGINRAW[Makefile]
-# GNU make "catch all"
-{- $builddir -}/ghash-%.S:     {- $sourcedir -}/asm/ghash-%.pl
-       CC="$(CC)" $(PERL) $< $(PERLASM_SCHEME) $@
-ENDRAW[Makefile]
+GENERATE[ghash-c64xplus.S]=asm/ghash-c64xplus.pl $(PERLASM_SCHEME)
index 363d62e6ebde276e9366020a59ed2d3d2558c592..de44bb8803f5c79dc83ba06b6d6abb6a037b7708 100644 (file)
@@ -17,8 +17,5 @@ GENERATE[poly1305-armv8.S]=asm/poly1305-armv8.pl $(PERLASM_SCHEME)
 INCLUDE[poly1305-armv8.o]=..
 GENERATE[poly1305-mips.S]=asm/poly1305-mips.pl $(PERLASM_SCHEME)
 INCLUDE[poly1305-mips.o]=..
 INCLUDE[poly1305-armv8.o]=..
 GENERATE[poly1305-mips.S]=asm/poly1305-mips.pl $(PERLASM_SCHEME)
 INCLUDE[poly1305-mips.o]=..
-
-BEGINRAW[Makefile(unix)]
-{- $builddir -}/poly1305-%.S:  {- $sourcedir -}/asm/poly1305-%.pl
-       CC="$(CC)" $(PERL) $< $(PERLASM_SCHEME) $@
-ENDRAW[Makefile(unix)]
+GENERATE[poly1305-c64xplus.S]=asm/poly1305-c64xplus.pl $(PERLASM_SCHEME)
+GENERATE[poly1305-s390x.S]=asm/poly1305-s390x.pl $(PERLASM_SCHEME)
index 46ee66b61c68a2d44650c7fe81c88bb0a37c19e1..9941e6ea15506d66641eb1953aa44a62f0c17e6e 100644 (file)
@@ -10,9 +10,5 @@ GENERATE[rc4-x86_64.s]=asm/rc4-x86_64.pl $(PERLASM_SCHEME)
 GENERATE[rc4-md5-x86_64.s]=asm/rc4-md5-x86_64.pl $(PERLASM_SCHEME)
 
 GENERATE[rc4-parisc.s]=asm/rc4-parisc.pl $(PERLASM_SCHEME)
 GENERATE[rc4-md5-x86_64.s]=asm/rc4-md5-x86_64.pl $(PERLASM_SCHEME)
 
 GENERATE[rc4-parisc.s]=asm/rc4-parisc.pl $(PERLASM_SCHEME)
-
-BEGINRAW[Makefile]
-# GNU make "catch all"
-{- $builddir -}/rc4-%.s:       {- $sourcedir -}/asm/rc4-%.pl
-       CC="$(CC)" $(PERL) $< $(PERLASM_SCHEME) $@
-ENDRAW[Makefile]
+GENERATE[rc4-c64xplus.S]=asm/rc4-c64xplus.pl $(PERLASM_SCHEME)
+GENERATE[rc4-s390x.S]=asm/rc4-s390x.pl $(PERLASM_SCHEME)
index 5dd5a9941d34f8f1df1a71a196ffb5be1fbc0281..58d15bbb6dc100f0bdc888e0050753dadbcf2ecf 100644 (file)
@@ -26,6 +26,7 @@ GENERATE[sha256-mb-x86_64.s]=asm/sha256-mb-x86_64.pl $(PERLASM_SCHEME)
 GENERATE[sha512-x86_64.s]=asm/sha512-x86_64.pl $(PERLASM_SCHEME)
 GENERATE[keccak1600-x86_64.s]=asm/keccak1600-x86_64.pl $(PERLASM_SCHEME)
 
 GENERATE[sha512-x86_64.s]=asm/sha512-x86_64.pl $(PERLASM_SCHEME)
 GENERATE[keccak1600-x86_64.s]=asm/keccak1600-x86_64.pl $(PERLASM_SCHEME)
 
+GENERATE[sha1-sparcv9a.S]=asm/sha1-sparcv9a.pl $(PERLASM_SCHEME)
 GENERATE[sha1-sparcv9.S]=asm/sha1-sparcv9.pl $(PERLASM_SCHEME)
 INCLUDE[sha1-sparcv9.o]=..
 GENERATE[sha256-sparcv9.S]=asm/sha512-sparcv9.pl $(PERLASM_SCHEME)
 GENERATE[sha1-sparcv9.S]=asm/sha1-sparcv9.pl $(PERLASM_SCHEME)
 INCLUDE[sha1-sparcv9.o]=..
 GENERATE[sha256-sparcv9.S]=asm/sha512-sparcv9.pl $(PERLASM_SCHEME)
@@ -76,14 +77,15 @@ GENERATE[sha512-s390x.S]=asm/sha512-s390x.pl $(PERLASM_SCHEME)
 INCLUDE[sha512-s390x.o]=..
 GENERATE[keccak1600-s390x.S]=asm/keccak1600-s390x.pl $(PERLASM_SCHEME)
 
 INCLUDE[sha512-s390x.o]=..
 GENERATE[keccak1600-s390x.S]=asm/keccak1600-s390x.pl $(PERLASM_SCHEME)
 
-BEGINRAW[Makefile(unix)]
-##### SHA assembler implementations
+GENERATE[sha1-c64xplus.S]=asm/sha1-c64xplus.pl $(PERLASM_SCHEME)
+GENERATE[sha256-c64xplus.S]=asm/sha256-c64xplus.pl $(PERLASM_SCHEME)
+GENERATE[sha512-c64xplus.S]=asm/sha512-c64xplus.pl $(PERLASM_SCHEME)
+GENERATE[keccak1600-c64x.S]=asm/keccak1600-c64x.pl $(PERLASM_SCHEME)
 
 
-# GNU make "catch all"
-{- $builddir -}/sha1-%.S:      {- $sourcedir -}/asm/sha1-%.pl
-       CC="$(CC)" $(PERL) $< $(PERLASM_SCHEME) $@
-{- $builddir -}/sha256-%.S:    {- $sourcedir -}/asm/sha512-%.pl
-       CC="$(CC)" $(PERL) $< $(PERLASM_SCHEME) $@
-{- $builddir -}/sha512-%.S:    {- $sourcedir -}/asm/sha512-%.pl
-       CC="$(CC)" $(PERL) $< $(PERLASM_SCHEME) $@
-ENDRAW[Makefile(unix)]
+# These are not yet used
+GENERATE[keccak1600-avx2.S]=asm/keccak1600-avx2.pl $(PERLASM_SCHEME)
+GENERATE[keccak1600-avx512.S]=asm/keccak1600-avx512.pl $(PERLASM_SCHEME)
+GENERATE[keccak1600-avx512vl.S]=asm/keccak1600-avx512vl.pl $(PERLASM_SCHEME)
+GENERATE[keccak1600-mmx.S]=asm/keccak1600-mmx.pl $(PERLASM_SCHEME)
+GENERATE[keccak1600p8-ppc.S]=asm/keccak1600p8-ppc.pl $(PERLASM_SCHEME)
+GENERATE[sha1-thumb.S]=asm/sha1-thumb.pl $(PERLASM_SCHEME)