Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 341eacc

Browse files
shigekiBethGriggs
authored andcommittedApr 9, 2019
deps: add ARM64 Windows support in openssl
This adds ARM64 Windows support in the OpenSSL build system. Since OpenSSL's ARM64 Windows support does not have support for ASM-- that is, VC-WIN64-ARM inherits from VC-noCE-common which has no ASM files--`openssl_no_asm.gypi` is always used for building. This essentially forces the 'no-asm' Configure flag. PR-URL: #26001 Fixes: #25998 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Signed-off-by: Beth Griggs <Bethany.Griggs@uk.ibm.com>
1 parent 2ba58a6 commit 341eacc

8 files changed

+178
-7
lines changed
 

‎deps/openssl/config/Makefile

+12-4
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@ endif
99
PERL = perl
1010

1111
# Supported architecture list
12-
ARCHS = aix-gcc aix64-gcc BSD-x86_64 \
12+
ASM_ARCHS = aix-gcc aix64-gcc BSD-x86_64 \
1313
darwin64-x86_64-cc darwin-i386-cc linux-aarch64 \
1414
linux-armv4 linux-elf linux-x32 linux-x86_64 linux-ppc \
1515
linux-ppc64 linux-ppc64le linux32-s390x linux64-s390x \
1616
solaris-x86-gcc solaris64-x86_64-gcc VC-WIN64A VC-WIN32
1717

18+
NO_ASM_ARCHS = VC-WIN64-ARM
19+
1820
CC = gcc
1921
FAKE_GCC = ../config/fake_gcc.pl
2022

@@ -40,17 +42,23 @@ INT_CFG_DIR = $(OPSSL_SRC)/crypto/include/internal
4042
PHONY = all clean replace
4143
.PHONY: $(PHONY)
4244

43-
all: $(ARCHS) replace
45+
all: $(ASM_ARCHS) $(NO_ASM_ARCHS) replace
4446

4547
# Configure and generate openssl asm files for each archs
46-
$(ARCHS):
48+
$(ASM_ARCHS):
4749
cd $(OPSSL_SRC); $(NO_WARN_ENV) CC=$(CC) $(PERL) $(CONFIGURE) $(COPTS) $@;
4850
$(PERL) -w -I$(OPSSL_SRC) $(GENERATE) asm $@
4951
# Confgure asm_avx2 and generate upto avx2 support
5052
cd $(OPSSL_SRC); $(NO_WARN_ENV) CC=$(FAKE_GCC) $(PERL) $(CONFIGURE) \
5153
$(COPTS) $@;
5254
$(PERL) -w -I$(OPSSL_SRC) $(GENERATE) asm_avx2 $@
53-
# Confgure no-asm and generate no-asm sources
55+
# Configure no-asm and generate no-asm sources
56+
cd $(OPSSL_SRC); $(NO_WARN_ENV) $(PERL) $(CONFIGURE) $(COPTS) \
57+
no-asm $@;
58+
$(PERL) -w -I$(OPSSL_SRC) $(GENERATE) no-asm $@
59+
60+
$(NO_ASM_ARCHS):
61+
# Configure no-asm and generate no-asm sources
5462
cd $(OPSSL_SRC); $(NO_WARN_ENV) $(PERL) $(CONFIGURE) $(COPTS) \
5563
no-asm $@;
5664
$(PERL) -w -I$(OPSSL_SRC) $(GENERATE) no-asm $@
+147
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
2+
##
3+
## Makefile for OpenSSL
4+
##
5+
## WARNING: do not edit!
6+
## Generated by Configure from Configurations/common0.tmpl, Configurations/windows-makefile.tmpl, Configurations/common.tmpl
7+
8+
9+
PLATFORM=VC-WIN64-ARM
10+
SRCDIR=.
11+
BLDDIR=.
12+
13+
VERSION=1.1.1a
14+
MAJOR=1
15+
MINOR=1.1
16+
17+
SHLIB_VERSION_NUMBER=1.1
18+
19+
GENERATED_MANDATORY=crypto/include/internal/bn_conf.h crypto/include/internal/dso_conf.h include/openssl/opensslconf.h
20+
21+
INSTALL_LIBS="libcrypto.lib" "libssl.lib"
22+
INSTALL_SHLIBS="libcrypto-1_1-arm64.dll" "libssl-1_1-arm64.dll"
23+
INSTALL_SHLIBPDBS="libcrypto-1_1-arm64.pdb" "libssl-1_1-arm64.pdb"
24+
INSTALL_ENGINES="engines/capi.dll" "engines/padlock.dll"
25+
INSTALL_ENGINEPDBS="engines/capi.pdb" "engines/padlock.pdb"
26+
INSTALL_PROGRAMS="apps/openssl.exe"
27+
INSTALL_PROGRAMPDBS="apps/openssl.pdb"
28+
29+
BIN_SCRIPTS="$(BLDDIR)\tools\c_rehash.pl"
30+
MISC_SCRIPTS="$(BLDDIR)\apps\CA.pl" "$(BLDDIR)\apps\tsget.pl"
31+
32+
33+
APPS_OPENSSL="apps/openssl"
34+
35+
# Do not edit these manually. Use Configure with --prefix or --openssldir
36+
# to change this! Short explanation in the top comment in Configure
37+
INSTALLTOP_dev=
38+
INSTALLTOP_dir=\OpenSSL
39+
OPENSSLDIR_dev=
40+
OPENSSLDIR_dir=\SSL
41+
LIBDIR=lib
42+
ENGINESDIR_dev=
43+
ENGINESDIR_dir=\OpenSSL/lib/engines-1_1
44+
INSTALLTOP=$(INSTALLTOP_dev)$(INSTALLTOP_dir)
45+
OPENSSLDIR=$(OPENSSLDIR_dev)$(OPENSSLDIR_dir)
46+
ENGINESDIR=$(ENGINESDIR_dev)$(ENGINESDIR_dir)
47+
48+
# $(libdir) is chosen to be compatible with the GNU coding standards
49+
libdir=$(INSTALLTOP)\$(LIBDIR)
50+
51+
##### User defined commands and flags ################################
52+
53+
CC=cl
54+
CPP=$(CC) /EP /C
55+
CPPFLAGS=
56+
CFLAGS=/W3 /wd4090 /nologo /O2
57+
LD=link
58+
LDFLAGS=/nologo /debug
59+
EX_LIBS=
60+
61+
PERL=/usr/bin/perl
62+
63+
AR=lib
64+
ARFLAGS= /nologo
65+
66+
MT=mt
67+
MTFLAGS= -nologo
68+
69+
AS=
70+
ASFLAGS=
71+
72+
RC=rc
73+
74+
ECHO="$(PERL)" "$(SRCDIR)\util\echo.pl"
75+
76+
##### Special command flags ##########################################
77+
78+
COUTFLAG=/Fo$(OSSL_EMPTY)
79+
LDOUTFLAG=/out:$(OSSL_EMPTY)
80+
AROUTFLAG=/out:$(OSSL_EMPTY)
81+
MTINFLAG=-manifest $(OSSL_EMPTY)
82+
MTOUTFLAG=-outputresource:$(OSSL_EMPTY)
83+
ASOUTFLAG=$(OSSL_EMPTY)
84+
RCOUTFLAG=/fo$(OSSL_EMPTY)
85+
86+
##### Project flags ##################################################
87+
88+
# Variables starting with CNF_ are common variables for all product types
89+
90+
CNF_ASFLAGS=
91+
CNF_CPPFLAGS=-D"OPENSSL_SYS_WIN32" -D"WIN32_LEAN_AND_MEAN" -D"UNICODE" -D"_UNICODE" -D"_CRT_SECURE_NO_DEPRECATE" -D"_WINSOCK_DEPRECATED_NO_WARNINGS" -D"_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE" -D"OPENSSL_SYS_WIN_CORE" -D"NDEBUG"
92+
CNF_CFLAGS=/Gs0 /GF /Gy /MD
93+
CNF_CXXFLAGS=
94+
CNF_LDFLAGS=/NODEFAULTLIB:kernel32.lib
95+
CNF_EX_LIBS=onecore.lib
96+
97+
# Variables starting with LIB_ are used to build library object files
98+
# and shared libraries.
99+
# Variables starting with DSO_ are used to build DSOs and their object files.
100+
# Variables starting with BIN_ are used to build programs and their object
101+
# files.
102+
103+
LIB_ASFLAGS=$(CNF_ASFLAGS) $(ASFLAGS)
104+
LIB_CPPFLAGS=-D"L_ENDIAN" -D"OPENSSL_PIC" -D"OPENSSLDIR=\"\\SSL\"" -D"ENGINESDIR=\"\\OpenSSL/lib/engines-1_1\"" $(CNF_CPPFLAGS) $(CPPFLAGS)
105+
LIB_CFLAGS=/Zi /Fdossl_static.pdb $(CNF_CFLAGS) $(CFLAGS)
106+
LIB_LDFLAGS=/dll $(CNF_LDFLAGS) $(LDFLAGS)
107+
LIB_EX_LIBS=$(CNF_EX_LIBS) $(EX_LIBS)
108+
DSO_ASFLAGS=$(CNF_ASFLAGS) $(ASFLAGS)
109+
DSO_CPPFLAGS=$(CNF_CPPFLAGS) $(CPPFLAGS)
110+
DSO_CFLAGS=/Zi /Fddso.pdb $(CNF_CFLAGS) $(CFLAGS)
111+
DSO_LDFLAGS=/dll $(CNF_LDFLAGS) $(LDFLAGS)
112+
DSO_EX_LIBS=$(CNF_EX_LIBS) $(EX_LIBS)
113+
BIN_ASFLAGS=$(CNF_ASFLAGS) $(ASFLAGS)
114+
BIN_CPPFLAGS=$(CNF_CPPFLAGS) $(CPPFLAGS)
115+
BIN_CFLAGS=/Zi /Fdapp.pdb $(CNF_CFLAGS) $(CFLAGS)
116+
BIN_LDFLAGS=/subsystem:console /opt:ref $(CNF_LDFLAGS) $(LDFLAGS)
117+
BIN_EX_LIBS=$(CNF_EX_LIBS) $(EX_LIBS)
118+
119+
# CPPFLAGS_Q is used for one thing only: to build up buildinf.h
120+
CPPFLAGS_Q=-D"L_ENDIAN" -D"OPENSSL_PIC"
121+
122+
PERLASM_SCHEME=
123+
124+
PROCESSOR=
125+
126+
build_generated: $(GENERATED_MANDATORY)
127+
128+
crypto/buildinf.h:
129+
"$(PERL)" "util/mkbuildinf.pl" "$(CC) $(LIB_CFLAGS) $(CPPFLAGS_Q)" "$(PLATFORM)" > $@
130+
131+
apps/progs.h:
132+
"$(PERL)" "apps/progs.pl" $(APPS_OPENSSL) > $@
133+
134+
crypto/include/internal/bn_conf.h:
135+
"$(PERL)" "-I$(BLDDIR)" -Mconfigdata "util/dofile.pl" \
136+
"-omakefile" "crypto/include/internal/bn_conf.h.in" > $@
137+
crypto/include/internal/dso_conf.h:
138+
"$(PERL)" "-I$(BLDDIR)" -Mconfigdata "util/dofile.pl" \
139+
"-omakefile" "crypto/include/internal/dso_conf.h.in" > $@
140+
include/openssl/opensslconf.h:
141+
"$(PERL)" "-I$(BLDDIR)" -Mconfigdata "util/dofile.pl" \
142+
"-omakefile" "include/openssl/opensslconf.h.in" > $@
143+
144+
distclean:
145+
$(RM) $(GENERATED)
146+
$(RM) /Q /F configdata.pm
147+
$(RM) /Q /F makefile

‎deps/openssl/config/bn_conf_no-asm.h

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
# include "./archs/VC-WIN32/no-asm/crypto/include/internal/bn_conf.h"
2222
#elif defined(_WIN32) && defined(_M_X64)
2323
# include "./archs/VC-WIN64A/no-asm/crypto/include/internal/bn_conf.h"
24+
#elif defined(_WIN32) && defined(_M_ARM64)
25+
# include "./archs/VC-WIN64-ARM/no-asm/crypto/include/internal/bn_conf.h"
2426
#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__)
2527
# include "./archs/BSD-x86/no-asm/crypto/include/internal/bn_conf.h"
2628
#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__)

‎deps/openssl/config/dso_conf_no-asm.h

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
# include "./archs/VC-WIN32/no-asm/crypto/include/internal/dso_conf.h"
2222
#elif defined(_WIN32) && defined(_M_X64)
2323
# include "./archs/VC-WIN64A/no-asm/crypto/include/internal/dso_conf.h"
24+
#elif defined(_WIN32) && defined(_M_ARM64)
25+
# include "./archs/VC-WIN64-ARM/no-asm/crypto/include/internal/dso_conf.h"
2426
#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__)
2527
# include "./archs/BSD-x86/no-asm/crypto/include/internal/dso_conf.h"
2628
#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__)

‎deps/openssl/config/opensslconf_no-asm.h

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
# include "./archs/VC-WIN32/no-asm/include/openssl/opensslconf.h"
1717
#elif defined(_WIN32) && defined(_M_X64)
1818
# include "./archs/VC-WIN64A/no-asm/include/openssl/opensslconf.h"
19+
#elif defined(_WIN32) && defined(_M_ARM64)
20+
# include "./archs/VC-WIN64-ARM/no-asm/include/openssl/opensslconf.h"
1921
#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__i386__)
2022
# include "./archs/BSD-x86/no-asm/include/openssl/opensslconf.h"
2123
#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__x86_64__)

‎deps/openssl/openssl-cl_no_asm.gypi

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
'includes': ['config/archs/linux-armv4/no-asm/openssl-cl.gypi'],
1919
}, 'target_arch=="arm64" and OS=="linux"', {
2020
'includes': ['config/archs/linux-aarch64/no-asm/openssl-cl.gypi'],
21+
}, 'target_arch=="arm64" and OS=="win"', {
22+
'includes': ['config/archs/VC-WIN64-ARM/no-asm/openssl-cl.gypi'],
2123
}, 'target_arch=="ia32" and OS=="linux"', {
2224
'includes': ['config/archs/linux-elf/no-asm/openssl-cl.gypi'],
2325
}, 'target_arch=="ia32" and OS=="mac"', {

‎deps/openssl/openssl.gyp

+9-3
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
'conditions': [
1919
[ 'openssl_no_asm==1', {
2020
'includes': ['./openssl_no_asm.gypi'],
21+
}, 'target_arch=="arm64" and OS=="win"', {
22+
# VC-WIN64-ARM inherits from VC-noCE-common that has no asms.
23+
'includes': ['./openssl_no_asm.gypi'],
2124
}, 'gas_version >= "2.26" or nasm_version >= "2.11.8"', {
2225
# Require AVX512IFMA supported. See
2326
# https://www.openssl.org/docs/man1.1.1/man3/OPENSSL_ia32cap.html
@@ -37,10 +40,13 @@
3740
'dependencies': ['openssl'],
3841
'includes': ['./openssl_common.gypi'],
3942
'conditions': [
40-
['openssl_no_asm==0', {
41-
'includes': ['./openssl-cl_asm.gypi'],
42-
}, {
43+
['openssl_no_asm==1', {
4344
'includes': ['./openssl-cl_no_asm.gypi'],
45+
}, 'target_arch=="arm64" and OS=="win"', {
46+
# VC-WIN64-ARM inherits from VC-noCE-common that has no asms.
47+
'includes': ['./openssl-cl_no_asm.gypi'],
48+
}, {
49+
'includes': ['./openssl-cl_asm.gypi'],
4450
}],
4551
],
4652
},

‎deps/openssl/openssl_no_asm.gypi

+2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838
'includes': ['config/archs/solaris64-x86_64-gcc/no-asm/openssl.gypi'],
3939
}, 'target_arch=="x64" and OS=="win"', {
4040
'includes': ['config/archs/VC-WIN64A/no-asm/openssl.gypi'],
41+
}, 'target_arch=="arm64" and OS=="win"', {
42+
'includes': ['config/archs/VC-WIN64-ARM/no-asm/openssl.gypi'],
4143
}, 'target_arch=="x64" and OS=="linux"', {
4244
'includes': ['config/archs/linux-x86_64/no-asm/openssl.gypi'],
4345
}, {

0 commit comments

Comments
 (0)
Please sign in to comment.