Skip to content

Commit eb7a235

Browse files
author
Shigeki Ohtsu
committed
deps: add x32 and arm64 support for opensslconf.h
linux-x32 and linux-aarch64(arm64) are officially supported in openssl-1.0.2. With this fix opensslconf.h for these new architectures can be generated by Makefile. The patch for opensslconf.h of linux-x32 with Makefile was removed. For the fix of opensslconf.h in WIN32/WIN64, adding defines of OPENSSL_NO_DYNAMIC_ENGINE and OPENSSL_NO_CAPIENG move to openssl.gypi so that we no longer need insert a patch with Makefile and removed it. Fixes: #589 PR-URL: #1389 Reviewed-By: Fedor Indutny <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
1 parent 033a663 commit eb7a235

File tree

2 files changed

+6
-33
lines changed

2 files changed

+6
-33
lines changed

deps/openssl/config/Makefile

+3-30
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ CONFIGURE = ./Configure
33
COPT = no-shared no-symlinks
44

55
ARCHS = BSD-x86 BSD-x86_64 VC-WIN32 VC-WIN64A darwin64-x86_64-cc \
6-
darwin-i386-cc linux-armv4 linux-elf linux-x86_64 solaris-x86-gcc \
7-
solaris64-x86_64-gcc
6+
darwin-i386-cc linux-aarch64 linux-armv4 linux-elf linux-x32 \
7+
linux-x86_64 solaris-x86-gcc solaris64-x86_64-gcc
88

99
CFG = opensslconf.h
1010
SRC_CFG = ../openssl/crypto/$(CFG)
@@ -14,36 +14,17 @@ BACKUP_EXT = iojsbackup
1414
# OPENSSL_CPUID_OBJ is defined in openssl.gypi for use --openssl-no-asm
1515
CPUIDFIX = 's/\#define OPENSSL_CPUID_OBJ$$//;'
1616

17-
X32FIX = 's/\#define OPENSSL_CPUID_OBJ$$//;\
18-
s/RC4_CHUNK unsigned long$$/RC4_CHUNK unsigned long long/;\
19-
s/define SIXTY_FOUR_BIT_LONG$$/undef SIXTY_FOUR_BIT_LONG/;\
20-
s/undef SIXTY_FOUR_BIT$$/define SIXTY_FOUR_BIT/;'
21-
2217
MACFIX ='s/define RC4_INT unsigned char$$/define RC4_INT unsigned int/;'
2318

24-
WINFIX = 'if(/ifndef OPENSSL_DOING_MAKEDEPEND$$/){\
25-
print "\n\#ifndef OPENSSL_NO_DYNAMIC_ENGINE\n";\
26-
print "\# define OPENSSL_NO_DYNAMIC_ENGINE\n";\
27-
print "\#endif\n";\
28-
print "\#ifndef OPENSSL_NO_CAPIENG\n";\
29-
print "\# define OPENSSL_NO_CAPIENG\n";\
30-
print "\#endif\n\n";}'
31-
3219
PHONY = all clean backup restore
3320
.PHONY: $(PHONY)
3421

35-
all: backup $(ARCHS) linux-x32 cleanconf fixdarwin64 fixwin restore
22+
all: backup $(ARCHS) cleanconf fixdarwin64 restore
3623

3724
$(ARCHS):
3825
cd ../openssl; $(PERL) $(CONFIGURE) $(COPT) $@ > /dev/null
3926
$(PERL) -p -e $(CPUIDFIX) $(SRC_CFG) > ./archs/$@/$(CFG)
4027

41-
# linux-x32 was made by comparing define values of opensslconf.h which
42-
# was generated `Configure linux-x32' in openssl-1.0.2a
43-
linux-x32:
44-
cd ../openssl; $(PERL) $(CONFIGURE) $(COPT) linux-x86_64 > /dev/null;
45-
$(PERL) -p -e $(X32FIX) $(SRC_CFG) > ./archs/$@/$(CFG)
46-
4728
# The current openssl release does not use RC4 asm since it explicitly
4829
# specified as `$asm=~s/rc4\-[^:]+//;` in
4930
# https://github.com/openssl/openssl/blob/OpenSSL_1_0_1-stable/Configure#L584
@@ -53,14 +34,6 @@ linux-x32:
5334
fixdarwin64:
5435
$(PERL) -pi -e $(MACFIX) ./archs/darwin64-x86_64-cc/$(CFG)
5536

56-
57-
# OPENSSL_NO_DYNAMIC_ENGINE is needed for building static
58-
# library. OPENSSL_NO_CAPIENG is needed to avoid build errors on
59-
# Win. See the comments in `deps/openssl/openssl/engines/e_capi.c` for
60-
# detail.
61-
fixwin:
62-
$(PERL) -pi -e $(WINFIX) ./archs/VC-WIN32/$(CFG) ./archs/VC-WIN64A/$(CFG)
63-
6437
# backup files to avoid to be overwritten
6538
backup:
6639
@for f in $(BACKUP_FILES); do \

deps/openssl/config/opensslconf.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
| --dest-os | --dest-cpu | OpenSSL target arch | CI |
2020
| --------- | ---------- | -------------------- | --- |
2121
| linux | ia32 | linux-elf | o |
22-
| linux | x32 | patched linux-x86_64 | - |
22+
| linux | x32 | linux-x32 | - |
2323
| linux | x64 | linux-x86_64 | o |
2424
| linux | arm | linux-armv4 | o |
25-
| linux | arm64 | N/A | - |
25+
| linux | arm64 | linux-aarch64 | o |
2626
| mac | ia32 | darwin-i386-cc | o |
2727
| mac | x64 | darwin64-x86-cc | o |
2828
| win | ia32 | VC-WIN32 | - |
@@ -90,7 +90,7 @@
9090
#elif defined(OPENSSL_LINUX) && defined(__arm__)
9191
# include "./archs/linux-armv4/opensslconf.h"
9292
#elif defined(OPENSSL_LINUX) && defined(__aarch64__)
93-
/* Not Supported Yet */
93+
# include "./archs/linux-aarch64/opensslconf.h"
9494
#elif defined(__APPLE__) && defined(__MACH__) && defined(__i386__)
9595
# include "./archs/darwin-i386-cc/opensslconf.h"
9696
#elif defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__)

0 commit comments

Comments
 (0)