[openssl] master update

Richard Levitte levitte at openssl.org
Mon Sep 7 07:24:34 UTC 2020


The branch master has been updated
       via  385deae79f26dd685339d3141a06d04d6bd753cd (commit)
      from  6353507e9d4afe666ade7b8fdf0f0e673f57b36c (commit)


- Log -----------------------------------------------------------------
commit 385deae79f26dd685339d3141a06d04d6bd753cd
Author: Richard Levitte <levitte at openssl.org>
Date:   Sun Aug 23 18:33:57 2020 +0200

    Building: Build Unix static libraries one object file at a time
    
    We're hitting problems that the 'ar' command line becomes too long for
    some 'make' versions, or the shell it uses.
    
    We therefore change the way we create a static library by doing so one
    object file at a time.  This is slower, but has better guarantees to
    work properly on limited systems.
    
    Fixes #12116
    
    Reviewed-by: David von Oheimb <david.von.oheimb at siemens.com>
    (Merged from https://github.com/openssl/openssl/pull/12706)

-----------------------------------------------------------------------

Summary of changes:
 Configurations/00-base-templates.conf |  2 +-
 Configurations/unix-Makefile.tmpl     | 11 ++++++++---
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/Configurations/00-base-templates.conf b/Configurations/00-base-templates.conf
index 821a211cc8..340e789326 100644
--- a/Configurations/00-base-templates.conf
+++ b/Configurations/00-base-templates.conf
@@ -66,7 +66,7 @@ my %targets=(
         template        => 1,
 
         AR              => "ar",
-        ARFLAGS         => "r",
+        ARFLAGS         => "qc",
         CC              => "cc",
         lflags          =>
             sub { $withargs{zlib_lib} ? "-L".$withargs{zlib_lib} : () },
diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix-Makefile.tmpl
index ff4803be74..ff37aa0290 100644
--- a/Configurations/unix-Makefile.tmpl
+++ b/Configurations/unix-Makefile.tmpl
@@ -1508,11 +1508,16 @@ EOF
       my %args = @_;
       my $lib = platform->staticlib($args{lib});
       my @objs = map { platform->obj($_) } @{$args{objs}};
-      my $objs = join(" \\\n" . ' ' x (length($lib) + 2),
+      my $deps = join(" \\\n" . ' ' x (length($lib) + 2),
                       fill_lines(' ', $COLUMNS - length($lib) - 2, @objs));
+      my $max_per_call = 250;
+      my @objs_grouped;
+      push @objs_grouped, join(" ", splice @objs, 0, $max_per_call) while @objs;
+      my $fill_lib =
+          join("\n\t", (map { "\$(AR) \$(ARFLAGS) $lib $_" } @objs_grouped));
       return <<"EOF";
-$lib: $objs
-	\$(AR) \$(ARFLAGS) \$\@ \$\?
+$lib: $deps
+	$fill_lib
 	\$(RANLIB) \$\@ || echo Never mind.
 EOF
   }


More information about the openssl-commits mailing list