Skip to content

Commit ca3c50b

Browse files
committed
build: add basic arm64 support
This commit adds basic arm64 support to the build. Building the bundled openssl is disabled pending an upgrade to openssl 1.2, the currently bundled version has some hand-rolled assembly that is 32 bits only. PR-URL: #1028 Reviewed-By: Johan Bergström <[email protected]> Reviewed-By: Rod Vagg <[email protected]>
1 parent 3d6440c commit ca3c50b

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

configure

+12-3
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ parser.add_option('--debug',
3838
parser.add_option('--dest-cpu',
3939
action='store',
4040
dest='dest_cpu',
41-
help='CPU architecture to build for. Valid values are: arm, ia32, x32, x64')
41+
help='CPU architecture to build for. '
42+
'Valid values are: arm, arm64, ia32, x32, x64')
4243

4344
parser.add_option('--dest-os',
4445
action='store',
@@ -436,10 +437,11 @@ def host_arch_cc():
436437
k = cc_macros()
437438

438439
matchup = {
439-
'__x86_64__' : 'x64',
440-
'__i386__' : 'ia32',
440+
'__aarch64__' : 'arm64',
441441
'__arm__' : 'arm',
442+
'__i386__' : 'ia32',
442443
'__mips__' : 'mips',
444+
'__x86_64__' : 'x64',
443445
}
444446

445447
rtn = 'ia32' # default
@@ -510,6 +512,13 @@ def configure_node(o):
510512

511513
if target_arch == 'arm':
512514
configure_arm(o)
515+
elif (target_arch == 'arm64' and
516+
not options.shared_openssl and
517+
not options.without_ssl):
518+
# FIXME(bnoordhuis) It's not possible to build the bundled openssl due to
519+
# deps/openssl/asm/arm-elf-gas/modes/ghash-armv4.S, which is 32 bits only.
520+
warn('not building openssl, arm64 not yet supported')
521+
options.without_ssl = True
513522

514523
if flavor in ('solaris', 'mac', 'linux', 'freebsd'):
515524
use_dtrace = not options.without_dtrace

deps/openssl/config/opensslconf.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@
190190
* boundary. See crypto/rc4/rc4_enc.c for further details.
191191
*/
192192
# undef RC4_CHUNK
193-
# if defined(_M_X64) || defined(__x86_64__)
193+
# if defined(_M_X64) || defined(__aarch64__) || defined(__x86_64__)
194194
# define RC4_CHUNK unsigned long long
195195
# elif defined(__arm__)
196196
# define RC4_CHUNK unsigned long
@@ -220,7 +220,7 @@
220220
# undef THIRTY_TWO_BIT
221221
# undef SIXTEEN_BIT
222222
# undef EIGHT_BIT
223-
# if defined(_M_X64) || defined(__x86_64__)
223+
# if defined(_M_X64) || defined(__aarch64__) || defined(__x86_64__)
224224
# if defined(_LP64)
225225
# define SIXTY_FOUR_BIT_LONG
226226
# else

0 commit comments

Comments
 (0)