Improve robustness and performance of building Unix static libraries
authorDr. David von Oheimb <David.von.Oheimb@siemens.com>
Tue, 8 Sep 2020 21:05:13 +0000 (23:05 +0200)
committerDr. David von Oheimb <David.von.Oheimb@siemens.com>
Fri, 11 Sep 2020 10:21:57 +0000 (12:21 +0200)
This is a fixup of 385deae79f26dd685339d3141a06d04d6bd753cd, which solved #12116

Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/12821)

Configurations/00-base-templates.conf
Configurations/unix-Makefile.tmpl

index 340e7893264ed6b59ebf406fcf83d1e4313e9d8a..1da5c5f0d04e209b699fe9091984c9882c2b9019 100644 (file)
@@ -27,8 +27,8 @@ my %targets=(
        build_scheme    => [ "unified", "unix" ],
        build_file      => "Makefile",
 
-       AR              => "ar",
-       ARFLAGS         => "r",
+       AR              => "(unused)",
+       ARFLAGS         => "(unused)",
        CC              => "cc",
        HASHBANGPERL    => "/usr/bin/env perl",
        RANLIB          => sub { which("$config{cross_compile_prefix}ranlib")
index cb6263c911b4aeb795c8d29994402f775e9c7980..ad5c3111e31025ded63496535a9bdb9a4b613a97 100644 (file)
@@ -1510,13 +1510,14 @@ EOF
       my @objs = map { platform->obj($_) } @{$args{objs}};
       my $deps = join(" \\\n" . ' ' x (length($lib) + 2),
                       fill_lines(' ', $COLUMNS - length($lib) - 2, @objs));
-      my $max_per_call = 250;
+      my $max_per_call = 500;
       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: $deps
+       \$(RM) $lib
        $fill_lib
        \$(RANLIB) \$\@ || echo Never mind.
 EOF