Rework how a build file (Makefile, ...) is produced
authorRichard Levitte <levitte@openssl.org>
Mon, 17 May 2021 12:33:16 +0000 (14:33 +0200)
committerRichard Levitte <levitte@openssl.org>
Wed, 19 May 2021 08:13:02 +0000 (10:13 +0200)
commit2660b7cfbad710dcd9df26e68c18d6c7d6ebaca0
tree5a0774dc29e27e0592ff255735918402c78f9443
parentda51dc5f68c9e7924be3d5071ba8aea439a4d1c9
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)
.gitignore
Configurations/common.tmpl [deleted file]
Configurations/gentemplate.pm [new file with mode: 0644]
Configure
configdata.pm.in