Fix buildinf.h generation for space and backslash

Builds may be configured with CC or CFLAGS containing space and
double quotes. In particular on Windows, this may lead to passing
more than two arguments into mkbuildinf.pl.
In addition, backslashes must be escaped for constructing the C string.

Fixes #26253.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26315)
This commit is contained in:
Kai Pastor 2025-01-04 11:48:26 +01:00 committed by Richard Levitte
parent 3cfcf820bd
commit e87a3473fd

View File

@ -9,7 +9,9 @@
use strict;
use warnings;
my ($cflags, $platform) = @ARGV;
my $platform = pop @ARGV;
my $cflags = join(' ', @ARGV);
$cflags =~ s(\\)(\\\\)g;
$cflags = "compiler: $cflags";
# Use the value of the envvar SOURCE_DATE_EPOCH, even if it's