Skip to content

Commit

Permalink
Configure: do not check for an absolute prefix in cross-builds
Browse files Browse the repository at this point in the history
The check is always made according to the host platform's rules, which may
not be true for true when the target platform is different, e.g. when
cross-building for Windows on a Linux machine. So skip this check when
used together with the `--cross-compile-prefix=` option.

Fixes #9520

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from #22723)
  • Loading branch information
vszakats authored and t8m committed Nov 15, 2023
1 parent dcfd8cf commit 4ea7529
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Configure
Original file line number Diff line number Diff line change
Expand Up @@ -980,8 +980,6 @@ while (@argvcopy)
if (/^--prefix=(.*)$/)
{
$config{prefix}=$1;
die "Directory given with --prefix MUST be absolute\n"
unless file_name_is_absolute($config{prefix});
}
elsif (/^--api=(.*)$/)
{
Expand Down Expand Up @@ -1440,6 +1438,11 @@ foreach (keys %useradd) {
# At this point, we can forget everything about %user and %useradd,
# because it's now all been merged into the corresponding $config entry

if ($config{prefix} && !$config{CROSS_COMPILE}) {
die "Directory given with --prefix MUST be absolute\n"
unless file_name_is_absolute($config{prefix});
}

if (grep { $_ =~ /(?:^|\s)-static(?:\s|$)/ } @{$config{LDFLAGS}}) {
disable('static', 'pic', 'threads');
}
Expand Down

0 comments on commit 4ea7529

Please sign in to comment.