Skip to content

Commit 56441a0

Browse files
shigekiBethGriggs
authored andcommitted
deps: fix for non GNU assembler in AIX
AIX has own assembler not GNU as that does not support --noexecstack. Backport-PR-URL: #26270 PR-URL: #25381 Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Shigeki Ohtsu <[email protected]>
1 parent e05eb3e commit 56441a0

File tree

3 files changed

+17
-23
lines changed

3 files changed

+17
-23
lines changed

deps/openssl/config/generate_gypi.pl

+13-7
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,6 @@
2525
my $nasm_banner = `nasm -v`;
2626
die "Error: nasm is not installed." if (!$nasm_banner);
2727

28-
my $nasm_version_min = 2.13.3;
29-
my ($nasm_version) = ($nasm_banner =~/^NASM version ([0-9]\.[0-9][0-9])+/);
30-
if ($nasm_version < $nasm_version_min) {
31-
die "Error: nasm version $nasm_version is too old." .
32-
"$nasm_version_min or higher is required.";
33-
}
34-
3528
# gas version check
3629
my $gas_version_min = 2.30;
3730
my $gas_banner = `gcc -Wa,-v -c -o /dev/null -x assembler /dev/null 2>&1`;
@@ -118,6 +111,17 @@
118111
$target{'lib_cppflags'} =~ s/-D//g;
119112
my @lib_cppflags = split(/ /, $target{'lib_cppflags'});
120113

114+
my @cflags = ();
115+
push(@cflags, @{$config{'cflags'}});
116+
push(@cflags, @{$config{'CFLAGS'}});
117+
push(@cflags, $target{'cflags'});
118+
push(@cflags, $target{'CFLAGS'});
119+
120+
# AIX has own assembler not GNU as that does not support --noexecstack
121+
if ($arch =~ /aix/) {
122+
@cflags = grep $_ ne '-Wa,--noexecstack', @cflags;
123+
}
124+
121125
# Create openssl.gypi
122126
my $template =
123127
Text::Template->new(TYPE => 'FILE',
@@ -132,6 +136,7 @@
132136
generated_srcs => \@generated_srcs,
133137
config => \%config,
134138
target => \%target,
139+
cflags => \@cflags,
135140
asm => \$asm,
136141
arch => \$arch,
137142
lib_cppflags => \@lib_cppflags,
@@ -155,6 +160,7 @@
155160
libapps_srcs => \@libapps_srcs,
156161
config => \%config,
157162
target => \%target,
163+
cflags => \@cflags,
158164
asm => \$asm,
159165
arch => \$arch,
160166
lib_cppflags => \@lib_cppflags,

deps/openssl/config/openssl-cl.gypi.tmpl

+2-8
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,9 @@
1414
$OUT .= " '$define',\n";
1515
} -%% ],
1616
'openssl_cflags_%%-$arch-%%': [
17-
%%- foreach $cflag (@{$config{cflags}}) {
17+
%%- foreach $cflag (@cflags) {
1818
$OUT .= " '$cflag',\n";
19-
}
20-
foreach $cflag (@{$config{CFLAGS}}) {
21-
$OUT .= " '$cflag',\n";
22-
} -%%
23-
'%%-$target{cflags}-%%',
24-
'%%-$target{CFLAGS}-%%',
25-
],
19+
} -%% ],
2620
'openssl_ex_libs_%%-$arch-%%': [
2721
'%%-$target{ex_libs}-%%',
2822
],

deps/openssl/config/openssl.gypi.tmpl

+2-8
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,9 @@ foreach $src (@libcrypto_srcs) {
2525
$OUT .= " '$define',\n";
2626
} -%% ],
2727
'openssl_cflags_%%-$arch-%%': [
28-
%%- foreach $cflag (@{$config{cflags}}) {
28+
%%- foreach $cflag (@cflags) {
2929
$OUT .= " '$cflag',\n";
30-
}
31-
foreach $cflag (@{$config{CFLAGS}}) {
32-
$OUT .= " '$cflag',\n";
33-
} -%%
34-
'%%-$target{cflags}-%%',
35-
'%%-$target{CFLAGS}-%%',
36-
],
30+
} -%% ],
3731
'openssl_ex_libs_%%-$arch-%%': [
3832
'%%-$target{ex_libs}-%%',
3933
],

0 commit comments

Comments
 (0)