diff --git a/deps/openssl/config/generate_gypi.pl b/deps/openssl/config/generate_gypi.pl index 4a0a649c7cddd5..891ccb62bbf6d4 100755 --- a/deps/openssl/config/generate_gypi.pl +++ b/deps/openssl/config/generate_gypi.pl @@ -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`; @@ -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', @@ -132,6 +136,7 @@ generated_srcs => \@generated_srcs, config => \%config, target => \%target, + cflags => \@cflags, asm => \$asm, arch => \$arch, lib_cppflags => \@lib_cppflags, @@ -155,6 +160,7 @@ libapps_srcs => \@libapps_srcs, config => \%config, target => \%target, + cflags => \@cflags, asm => \$asm, arch => \$arch, lib_cppflags => \@lib_cppflags, diff --git a/deps/openssl/config/openssl-cl.gypi.tmpl b/deps/openssl/config/openssl-cl.gypi.tmpl index 44361ce165e163..d0306fc052bc51 100644 --- a/deps/openssl/config/openssl-cl.gypi.tmpl +++ b/deps/openssl/config/openssl-cl.gypi.tmpl @@ -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}-%%', ], diff --git a/deps/openssl/config/openssl.gypi.tmpl b/deps/openssl/config/openssl.gypi.tmpl index 4426879b5b9226..191bbb444af021 100644 --- a/deps/openssl/config/openssl.gypi.tmpl +++ b/deps/openssl/config/openssl.gypi.tmpl @@ -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}-%%', ],