summaryrefslogtreecommitdiff
path: root/Configure
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2021-05-17 14:33:16 +0200
committerRichard Levitte <levitte@openssl.org>2021-05-19 10:13:02 +0200
commit2660b7cfbad710dcd9df26e68c18d6c7d6ebaca0 (patch)
tree5a0774dc29e27e0592ff255735918402c78f9443 /Configure
parentda51dc5f68c9e7924be3d5071ba8aea439a4d1c9 (diff)
downloadopenssl-new-2660b7cfbad710dcd9df26e68c18d6c7d6ebaca0.tar.gz
Rework how a build file (Makefile, ...) is produced
The memory footprint of how we produced the Makefile was quite... important, because we have all the processing in one perl snippet, and generate the details of the build file by appending to the "magic" variable $OUT. The result is that this variable gets to hold the majority of the build file text, and depending on memory reallocation strategies for strings, the heap may hold multiple (possibly not just a few) copies of this string, almost all of them "freed" but still taking up space. This has resulted in memory exhaustion. We therefore change strategy, and generate the build file in two phases, where the first phase generates the full template using small perl snippets for each detail, and the second phase processes this template. This is much kinder to process memory. Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15310)
Diffstat (limited to 'Configure')
-rwxr-xr-xConfigure6
1 files changed, 2 insertions, 4 deletions
diff --git a/Configure b/Configure
index 2996cd1b4a..cd40abedf7 100755
--- a/Configure
+++ b/Configure
@@ -1918,9 +1918,7 @@ if ($builder eq "unified") {
$config{build_file_templates}
= [ cleanfile($srcdir, catfile("Configurations", "common0.tmpl"),
$blddir),
- $build_file_template,
- cleanfile($srcdir, catfile("Configurations", "common.tmpl"),
- $blddir) ];
+ $build_file_template ];
my @build_dirs = ( [ ] ); # current directory
@@ -2789,7 +2787,7 @@ my %template_vars = (
my $configdata_outname = 'configdata.pm';
print "Creating $configdata_outname\n";
open CONFIGDATA, ">$configdata_outname.new"
- or die "Trying to create $configdata_outname.new: $!";
+ or die "Trying to create $configdata_outname.new: $!";
my $configdata_tmplname = cleanfile($srcdir, "configdata.pm.in", $blddir);
my $configdata_tmpl =
OpenSSL::Template->new(TYPE => 'FILE', SOURCE => $configdata_tmplname);