mirror of
https://github.com/nodejs/node.git
synced 2026-11-21 12:59:16 -05:00
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>
This commit is contained in:
1 parent
0d9a86c7cb
commit
576d0c6206
6 files changed
+155
-14
No files matched your search
Vendored
+7
-5
@@ -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 $@;
|
||||
|
||||
Vendored
+5
-4
@@ -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;
|
||||
Vendored
+3
-3
@@ -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) {
|
||||
|
||||
+47
@@ -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'],
|
||||
}],
|
||||
],
|
||||
}
|
||||
Vendored
+12
-2
@@ -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': {
|
||||
|
||||
Vendored
+81
@@ -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'],
|
||||
}],
|
||||
],
|
||||
}
|
||||
Reference in new issue
Block a user