Skip to content

Commit

Permalink
deps: fix for non GNU assembler in AIX
Browse files Browse the repository at this point in the history
AIX has own assembler not GNU as that does not support --noexecstack.

Backport-PR-URL: #26270
PR-URL: #25381
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Shigeki Ohtsu <ohtsu@ohtsu.org>
  • Loading branch information
shigeki authored and BethGriggs committed Mar 28, 2019
1 parent e05eb3e commit 56441a0
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 23 deletions.
20 changes: 13 additions & 7 deletions deps/openssl/config/generate_gypi.pl
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,6 @@
my $nasm_banner = `nasm -v`;
die "Error: nasm is not installed." if (!$nasm_banner);

my $nasm_version_min = 2.13.3;
my ($nasm_version) = ($nasm_banner =~/^NASM version ([0-9]\.[0-9][0-9])+/);
if ($nasm_version < $nasm_version_min) {
die "Error: nasm version $nasm_version is too old." .
"$nasm_version_min or higher is required.";
}

# gas version check
my $gas_version_min = 2.30;
my $gas_banner = `gcc -Wa,-v -c -o /dev/null -x assembler /dev/null 2>&1`;
Expand Down Expand Up @@ -118,6 +111,17 @@
$target{'lib_cppflags'} =~ s/-D//g;
my @lib_cppflags = split(/ /, $target{'lib_cppflags'});

my @cflags = ();
push(@cflags, @{$config{'cflags'}});
push(@cflags, @{$config{'CFLAGS'}});
push(@cflags, $target{'cflags'});
push(@cflags, $target{'CFLAGS'});

# AIX has own assembler not GNU as that does not support --noexecstack
if ($arch =~ /aix/) {
@cflags = grep $_ ne '-Wa,--noexecstack', @cflags;
}

# Create openssl.gypi
my $template =
Text::Template->new(TYPE => 'FILE',
Expand All @@ -132,6 +136,7 @@
generated_srcs => \@generated_srcs,
config => \%config,
target => \%target,
cflags => \@cflags,
asm => \$asm,
arch => \$arch,
lib_cppflags => \@lib_cppflags,
Expand All @@ -155,6 +160,7 @@
libapps_srcs => \@libapps_srcs,
config => \%config,
target => \%target,
cflags => \@cflags,
asm => \$asm,
arch => \$arch,
lib_cppflags => \@lib_cppflags,
Expand Down
10 changes: 2 additions & 8 deletions deps/openssl/config/openssl-cl.gypi.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,9 @@
$OUT .= " '$define',\n";
} -%% ],
'openssl_cflags_%%-$arch-%%': [
%%- foreach $cflag (@{$config{cflags}}) {
%%- foreach $cflag (@cflags) {
$OUT .= " '$cflag',\n";
}
foreach $cflag (@{$config{CFLAGS}}) {
$OUT .= " '$cflag',\n";
} -%%
'%%-$target{cflags}-%%',
'%%-$target{CFLAGS}-%%',
],
} -%% ],
'openssl_ex_libs_%%-$arch-%%': [
'%%-$target{ex_libs}-%%',
],
Expand Down
10 changes: 2 additions & 8 deletions deps/openssl/config/openssl.gypi.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,9 @@ foreach $src (@libcrypto_srcs) {
$OUT .= " '$define',\n";
} -%% ],
'openssl_cflags_%%-$arch-%%': [
%%- foreach $cflag (@{$config{cflags}}) {
%%- foreach $cflag (@cflags) {
$OUT .= " '$cflag',\n";
}
foreach $cflag (@{$config{CFLAGS}}) {
$OUT .= " '$cflag',\n";
} -%%
'%%-$target{cflags}-%%',
'%%-$target{CFLAGS}-%%',
],
} -%% ],
'openssl_ex_libs_%%-$arch-%%': [
'%%-$target{ex_libs}-%%',
],
Expand Down

0 comments on commit 56441a0

Please sign in to comment.