Skip to content

Commit 3bcd857

Browse files
shigekijasnell
authored andcommitted
build: limit assembler version check on x86
The current openssl checks assembler version only x86_64 or ia32 target arch for use of AES-NI, AVX and AVX2. This requires --openssl-no-asm option during configure when an older assembler version is found only on x86_64 or ia32. PR-URL: #20226 Fixes: #19944 Refs: #20217 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ali Ijaz Sheikh <[email protected]> Reviewed-By: Myles Borins <[email protected]> Reviewed-By: Richard Lau <[email protected]>
1 parent de96899 commit 3bcd857

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

BUILDING.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,16 @@ Depending on host platform, the selection of toolchains may vary.
9494
#### OpenSSL asm support
9595

9696
OpenSSL-1.1.0 requires the following asssembler version for use of asm
97-
support.
97+
support on x86_64 and ia32.
9898

9999
* gas (GNU assembler) version 2.23 or higher
100100
* xcode version 5.0 or higher
101101
* llvm version 3.3 or higher
102102
* nasm version 2.10 or higher in Windows
103103

104-
Otherwise, `--openssl-no-asm` is added with warning in configure.
104+
Otherwise `configure` will fail with an error. This can be avoided by
105+
either providing a newer assembler as per the list above or by
106+
using the `--openssl-no-asm` flag.
105107

106108
*Note:* The forthcoming OpenSSL-1.1.1 will require higher
107109
version. Please refer

configure

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1106,6 +1106,8 @@ def configure_openssl(o):
11061106
o['defines'] += ['NODE_WITHOUT_NODE_OPTIONS']
11071107

11081108
if not options.shared_openssl and not options.openssl_no_asm:
1109+
is_x86 = 'x64' in variables['target_arch'] or 'ia32' in variables['target_arch']
1110+
11091111
# supported asm compiler for AVX2. See https://github.com/openssl/openssl/
11101112
# blob/OpenSSL_1_1_0-stable/crypto/modes/asm/aesni-gcm-x86_64.pl#L52-L69
11111113
openssl110_asm_supported = \
@@ -1114,7 +1116,7 @@ def configure_openssl(o):
11141116
('llvm_version' in variables and float(variables['llvm_version']) >= 3.3) or \
11151117
('nasm_version' in variables and float(variables['nasm_version']) >= 2.10)
11161118

1117-
if not openssl110_asm_supported:
1119+
if is_x86 and not openssl110_asm_supported:
11181120
error('''Did not find a new enough assembler, install one or build with
11191121
--openssl-no-asm.
11201122
Please refer to BUILDING.md''')

0 commit comments

Comments
 (0)