summaryrefslogtreecommitdiff
path: root/deps/openssl
diff options
context:
space:
mode:
authorShigeki Ohtsu <ohtsu@ohtsu.org>2018-11-08 15:45:29 +0900
committerSam Roberts <vieuxtech@gmail.com>2019-01-22 13:33:37 -0800
commit576d0c620683057b69fc1167b409fa60b03af513 (patch)
treef0f1b21de618963fb0a797c7058e10ccff386de2 /deps/openssl
parent0d9a86c7cb3566b22becc656691282402f5026c0 (diff)
downloadandroid-node-v8-576d0c620683057b69fc1167b409fa60b03af513.tar.gz
android-node-v8-576d0c620683057b69fc1167b409fa60b03af513.tar.bz2
android-node-v8-576d0c620683057b69fc1167b409fa60b03af513.zip
deps: add only avx2 configs for OpenSSL-1.1.1
OpenSSL-1.1.1 has new support of AVX-512 but AVX-2 asm files still need to be generated for the older assembler support to keep backward compatibilities. PR-URL: https://github.com/nodejs/node/pull/25381 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Shigeki Ohtsu <ohtsu@ohtsu.org>
Diffstat (limited to 'deps/openssl')
-rw-r--r--deps/openssl/config/Makefile12
-rwxr-xr-xdeps/openssl/config/fake_gcc.pl9
-rwxr-xr-xdeps/openssl/config/generate_gypi.pl6
-rw-r--r--deps/openssl/openssl-cl_asm_avx2.gypi47
-rw-r--r--deps/openssl/openssl.gyp14
-rw-r--r--deps/openssl/openssl_asm_avx2.gypi81
6 files changed, 155 insertions, 14 deletions
diff --git a/deps/openssl/config/Makefile b/deps/openssl/config/Makefile
index a86f392ef2..300ab009d8 100644
--- a/deps/openssl/config/Makefile
+++ b/deps/openssl/config/Makefile
@@ -16,6 +16,8 @@ linux-ppc64 linux-ppc64le linux32-s390x linux64-s390x \
solaris-x86-gcc solaris64-x86_64-gcc VC-WIN64A VC-WIN32
CC = gcc
+FAKE_GCC = ../config/fake_gcc.pl
+
CONFIGURE = ./Configure
# no-comp: against CRIME attack
# no-shared: openssl-cli needs static link
@@ -45,12 +47,12 @@ all: $(ARCHS) replace
$(ARCHS):
# Remove openssl .gitignore to follow nodejs .gitignore
if [ -e $(GITIGNORE) ]; then rm $(GITIGNORE); fi
- if [ "$(findstring darwin, $@)" = "" ]; then \
- cd $(OPSSL_SRC); $(NO_WARN_ENV) ARC=$@ CC=$(CC) $(PERL) $(CONFIGURE) $(COPTS) $@; \
- else \
- cd $(OPSSL_SRC); $(NO_WARN_ENV) ARC=$@ CC=./fake_gcc.pl $(PERL) $(CONFIGURE) $(COPTS) $@; \
- fi
+ cd $(OPSSL_SRC); $(NO_WARN_ENV) CC=$(CC) $(PERL) $(CONFIGURE) $(COPTS) $@;
$(PERL) -w -I$(OPSSL_SRC) $(GENERATE) asm $@
+# Confgure asm_avx2 and generate upto avx2 support
+ cd $(OPSSL_SRC); $(NO_WARN_ENV) CC=$(FAKE_GCC) $(PERL) $(CONFIGURE) \
+ $(COPTS) $@;
+ $(PERL) -w -I$(OPSSL_SRC) $(GENERATE) asm_avx2 $@
# Confgure no-asm and generate no-asm sources
cd $(OPSSL_SRC); $(NO_WARN_ENV) $(PERL) $(CONFIGURE) $(COPTS) \
no-asm $@;
diff --git a/deps/openssl/config/fake_gcc.pl b/deps/openssl/config/fake_gcc.pl
index aa9f977449..6c77c3acbc 100755
--- a/deps/openssl/config/fake_gcc.pl
+++ b/deps/openssl/config/fake_gcc.pl
@@ -1,11 +1,12 @@
#! /usr/bin/env perl
use 5.10.0;
use strict;
-my $arch = $ENV{ARC};
+my $args = join(' ', @ARGV);
+
my $ret;
-if ($arch =~ /^darwin/) {
- $ret = "Apple LLVM version 10.0.0 (clang-1000.11.45.2)\n";
+if ($args eq '-Wa,-v -c -o /dev/null -x assembler /dev/null') {
+ $ret = "GNU assembler version 2.23.52.0.1 (x86_64-redhat-linux) using BFD version version 2.23.52.0.1-30.el7_1.2 20130226\n";
} else {
- $ret = `gcc -Wa,-v -c -o /dev/null -x assembler /dev/null 2>&1`;
+ $ret = `gcc $args`;
}
print STDOUT $ret;
diff --git a/deps/openssl/config/generate_gypi.pl b/deps/openssl/config/generate_gypi.pl
index 813bd28a86..4a0a649c7c 100755
--- a/deps/openssl/config/generate_gypi.pl
+++ b/deps/openssl/config/generate_gypi.pl
@@ -16,7 +16,7 @@ use configdata;
my $asm = $ARGV[0];
-unless ($asm eq "asm" or $asm eq "no-asm") {
+unless ($asm eq "asm" or $asm eq "asm_avx2" or $asm eq "no-asm") {
die "Error: $asm is invalid argument";
}
my $arch = $ARGV[1];
@@ -25,7 +25,7 @@ my $arch = $ARGV[1];
my $nasm_banner = `nasm -v`;
die "Error: nasm is not installed." if (!$nasm_banner);
-my $nasm_version_min = 2.11;
+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." .
@@ -33,7 +33,7 @@ if ($nasm_version < $nasm_version_min) {
}
# gas version check
-my $gas_version_min = 2.26;
+my $gas_version_min = 2.30;
my $gas_banner = `gcc -Wa,-v -c -o /dev/null -x assembler /dev/null 2>&1`;
my ($gas_version) = ($gas_banner =~/GNU assembler version ([2-9]\.[0-9]+)/);
if ($gas_version < $gas_version_min) {
diff --git a/deps/openssl/openssl-cl_asm_avx2.gypi b/deps/openssl/openssl-cl_asm_avx2.gypi
new file mode 100644
index 0000000000..f05c02171a
--- /dev/null
+++ b/deps/openssl/openssl-cl_asm_avx2.gypi
@@ -0,0 +1,47 @@
+{
+ 'conditions': [
+ ['target_arch=="ppc" and OS=="aix"', {
+ 'includes': ['config/archs/aix-gcc/asm_avx2/openssl-cl.gypi'],
+ }, 'target_arch=="ppc" and OS=="linux"', {
+ 'includes': ['config/archs/linux-ppc/asm_avx2/openssl-cl.gypi'],
+ }, 'target_arch=="ppc64" and OS=="aix"', {
+ 'includes': ['config/archs/aix64-gcc/asm_avx2/openssl-cl.gypi'],
+ }, 'target_arch=="ppc64" and OS=="linux" and node_byteorder =="little"', {
+ 'includes': ['config/archs/linux-ppc64le/asm_avx2/openssl-cl.gypi'],
+ }, 'target_arch=="ppc64" and OS=="linux"', {
+ 'includes': ['config/archs/linux-ppc64/asm_avx2/openssl-cl.gypi'],
+ }, 'target_arch=="s390" and OS=="linux"', {
+ 'includes': ['config/archs/linux32-s390x/asm_avx2/openssl-cl.gypi'],
+ }, 'target_arch=="s390x" and OS=="linux"', {
+ 'includes': ['config/archs/linux64-s390x/asm_avx2/openssl-cl.gypi'],
+ }, 'target_arch=="arm" and OS=="linux"', {
+ 'includes': ['config/archs/linux-armv4/asm_avx2/openssl-cl.gypi'],
+ }, 'target_arch=="arm64" and OS=="linux"', {
+ 'includes': ['config/archs/linux-aarch64/asm_avx2/openssl-cl.gypi'],
+ }, 'target_arch=="ia32" and OS=="linux"', {
+ 'includes': ['config/archs/linux-elf/asm_avx2/openssl-cl.gypi'],
+ }, 'target_arch=="ia32" and OS=="mac"', {
+ 'includes': ['config/archs/darwin-i386-cc/asm_avx2/openssl-cl.gypi'],
+ }, 'target_arch=="ia32" and OS=="solaris"', {
+ 'includes': ['config/archs/solaris-x86-gcc/asm_avx2/openssl-cl.gypi'],
+ }, 'target_arch=="ia32" and OS=="win"', {
+ 'includes': ['config/archs/VC-WIN32/asm_avx2/openssl-cl.gypi'],
+ }, 'target_arch=="ia32"', {
+ # noasm linux-elf for other ia32 platforms
+ 'includes': ['config/archs/linux-elf/asm_avx2/openssl-cl.gypi'],
+ }, 'target_arch=="x64" and OS=="freebsd"', {
+ 'includes': ['config/archs/BSD-x86_64/asm_avx2/openssl-cl.gypi'],
+ }, 'target_arch=="x64" and OS=="mac"', {
+ 'includes': ['config/archs/darwin64-x86_64-cc/asm_avx2/openssl-cl.gypi'],
+ }, 'target_arch=="x64" and OS=="solaris"', {
+ 'includes': ['config/archs/solaris64-x86_64-gcc/asm_avx2/openssl-cl.gypi'],
+ }, 'target_arch=="x64" and OS=="win"', {
+ 'includes': ['config/archs/VC-WIN64A/asm_avx2/openssl-cl.gypi'],
+ }, 'target_arch=="x64" and OS=="linux"', {
+ 'includes': ['config/archs/linux-x86_64/asm_avx2/openssl-cl.gypi'],
+ }, {
+ # Other architectures don't use assembly
+ 'includes': ['config/archs/linux-x86_64/asm_avx2/openssl-cl.gypi'],
+ }],
+ ],
+}
diff --git a/deps/openssl/openssl.gyp b/deps/openssl/openssl.gyp
index 4a6b556866..5f53248756 100644
--- a/deps/openssl/openssl.gyp
+++ b/deps/openssl/openssl.gyp
@@ -1,4 +1,9 @@
{
+ 'variables': {
+ 'gas_version%': 0,
+ 'llvm_version%': 0,
+ 'nasm_version%': 0,
+ },
'targets': [
{
'target_name': 'openssl',
@@ -11,10 +16,15 @@
'OPENSSL_NO_HW',
],
'conditions': [
- [ 'openssl_no_asm==0', {
+ [ 'openssl_no_asm==1', {
+ 'includes': ['./openssl_no_asm.gypi'],
+ }, 'gas_version >= "2.26" or nasm_version >= "2.11.8"', {
+ # Require AVX512IFMA supported. See
+ # https://www.openssl.org/docs/man1.1.1/man3/OPENSSL_ia32cap.html
+ # Currently crypto/poly1305/asm/poly1305-x86_64.pl requires AVX512IFMA.
'includes': ['./openssl_asm.gypi'],
}, {
- 'includes': ['./openssl_no_asm.gypi'],
+ 'includes': ['./openssl_asm_avx2.gypi'],
}],
],
'direct_dependent_settings': {
diff --git a/deps/openssl/openssl_asm_avx2.gypi b/deps/openssl/openssl_asm_avx2.gypi
new file mode 100644
index 0000000000..c5a636a330
--- /dev/null
+++ b/deps/openssl/openssl_asm_avx2.gypi
@@ -0,0 +1,81 @@
+{
+ 'conditions': [
+ ['target_arch=="ppc" and OS=="aix"', {
+ 'includes': ['config/archs/aix-gcc/asm_avx2/openssl.gypi'],
+ }, 'target_arch=="ppc" and OS=="linux"', {
+ 'includes': ['config/archs/linux-ppc/asm_avx2/openssl.gypi'],
+ }, 'target_arch=="ppc64" and OS=="aix"', {
+ 'includes': ['config/archs/aix64-gcc/asm_avx2/openssl.gypi'],
+ }, 'target_arch=="ppc64" and OS=="linux" and node_byteorder =="little"', {
+ 'includes': ['config/archs/linux-ppc64le/asm_avx2/openssl.gypi'],
+ }, 'target_arch=="ppc64" and OS=="linux"', {
+ 'includes': ['config/archs/linux-ppc64/asm_avx2/openssl.gypi'],
+ }, 'target_arch=="s390" and OS=="linux"', {
+ 'includes': ['config/archs/linux32-s390x/asm_avx2/openssl.gypi'],
+ }, 'target_arch=="s390x" and OS=="linux"', {
+ 'includes': ['config/archs/linux64-s390x/asm_avx2/openssl.gypi'],
+ }, 'target_arch=="arm" and OS=="linux"', {
+ 'includes': ['config/archs/linux-armv4/asm_avx2/openssl.gypi'],
+ }, 'target_arch=="arm64" and OS=="linux"', {
+ 'includes': ['config/archs/linux-aarch64/asm_avx2/openssl.gypi'],
+ }, 'target_arch=="ia32" and OS=="linux"', {
+ 'includes': ['config/archs/linux-elf/asm_avx2/openssl.gypi'],
+ }, 'target_arch=="ia32" and OS=="mac"', {
+ 'includes': ['config/archs/darwin-i386-cc/asm_avx2/openssl.gypi'],
+ }, 'target_arch=="ia32" and OS=="solaris"', {
+ 'includes': ['config/archs/solaris-x86-gcc/asm_avx2/openssl.gypi'],
+ }, 'target_arch=="ia32" and OS=="win"', {
+ 'includes': ['config/archs/VC-WIN32/asm_avx2/openssl.gypi'],
+ 'rules': [
+ {
+ 'rule_name': 'Assemble',
+ 'extension': 'asm',
+ 'inputs': [],
+ 'outputs': [
+ '<(INTERMEDIATE_DIR)/<(RULE_INPUT_ROOT).obj',
+ ],
+ 'action': [
+ 'nasm.exe',
+ '-f win32',
+ '-o', '<(INTERMEDIATE_DIR)/<(RULE_INPUT_ROOT).obj',
+ '<(RULE_INPUT_PATH)',
+ ],
+ }
+ ],
+ }, 'target_arch=="ia32"', {
+ 'includes': ['config/archs/linux-elf/asm_avx2/openssl.gypi'],
+ }, 'target_arch=="x64" and OS=="freebsd"', {
+ 'includes': ['config/archs/BSD-x86_64/asm_avx2/openssl.gypi'],
+ }, 'target_arch=="x64" and OS=="mac"', {
+ 'includes': ['config/archs/darwin64-x86_64-cc/asm_avx2/openssl.gypi'],
+ }, 'target_arch=="x64" and OS=="solaris"', {
+ 'includes': ['config/archs/solaris64-x86_64-gcc/asm_avx2/openssl.gypi'],
+ }, 'target_arch=="x64" and OS=="win"', {
+ 'includes': ['config/archs/VC-WIN64A/asm_avx2/openssl.gypi'],
+ 'rules': [
+ {
+ 'rule_name': 'Assemble',
+ 'extension': 'asm',
+ 'inputs': [],
+ 'outputs': [
+ '<(INTERMEDIATE_DIR)/<(RULE_INPUT_ROOT).obj',
+ ],
+ 'action': [
+ 'nasm.exe',
+ '-f win64',
+ '-DNEAR',
+ '-Ox',
+ '-g',
+ '-o', '<(INTERMEDIATE_DIR)/<(RULE_INPUT_ROOT).obj',
+ '<(RULE_INPUT_PATH)',
+ ],
+ }
+ ],
+ }, 'target_arch=="x64" and OS=="linux"', {
+ 'includes': ['config/archs/linux-x86_64/asm_avx2/openssl.gypi'],
+ }, {
+ # Other architectures don't use assembly
+ 'includes': ['config/archs/linux-x86_64/asm_avx2/openssl.gypi'],
+ }],
+ ],
+}