Skip to content

Commit

Permalink
Add build system support for macOS/arm64
Browse files Browse the repository at this point in the history
In addition to arm64e.
  • Loading branch information
oleavr committed Jul 6, 2020
1 parent 0c5294d commit 8c76f8c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
10 changes: 7 additions & 3 deletions Makefile.sdk.mk
Expand Up @@ -324,6 +324,10 @@ ifeq ($(host_platform_arch), macos-x86_64)
openssl_arch_args := macos64-x86_64 enable-ec_nistp_64_gcc_128
xcode_platform := MacOSX
endif
ifeq ($(host_platform_arch), macos-arm64)
openssl_arch_args := macos64-cross-arm64 enable-ec_nistp_64_gcc_128
xcode_platform := MacOSX
endif
ifeq ($(host_platform_arch), macos-arm64e)
openssl_arch_args := macos64-cross-arm64e enable-ec_nistp_64_gcc_128
xcode_platform := MacOSX
Expand Down Expand Up @@ -356,7 +360,7 @@ endif
IOS_MIN_SDK_VERSION=8.0 \
CONFIG_DISABLE_BITCODE=true \
$(NULL)
ifeq ($(host_platform_arch), macos-arm64e)
ifeq ($(host_platform_arch),$(filter $(host_platform_arch),macos-arm64 macos-arm64e))
openssl_host_env += MACOS_MIN_SDK_VERSION=10.16
else
openssl_host_env += MACOS_MIN_SDK_VERSION=10.9
Expand Down Expand Up @@ -526,12 +530,12 @@ v8_build_platform := $(shell echo $(build_platform) | sed 's,^macos$$,mac,')
ifeq ($(host_platform), macos)
v8_os := mac
v8_platform_args := libcxx_abi_unstable=false
ifeq ($(host_arch), arm64e)
ifeq ($(host_arch),$(filter $(host_arch),arm64 arm64e))
v8_platform_args += mac_deployment_target="10.16.0"
else
v8_platform_args += mac_deployment_target="10.9.0"
endif
ifeq ($(host_arch), arm64e)
ifeq ($(host_arch),$(filter $(host_arch),arm64 arm64e))
v8_platform_args += \
use_xcode_clang=true \
v8_enable_pointer_compression=false \
Expand Down
2 changes: 1 addition & 1 deletion releng/config.site.in
Expand Up @@ -106,7 +106,7 @@ case $frida_host_platform_arch in

frida_flags="$frida_flags -mthumb"
;;
macos-arm64e|ios-arm64|ios-arm64e)
macos-arm64|macos-arm64e|ios-arm64|ios-arm64e)
host_alias="aarch64-apple-darwin"
cross_compiling=yes
;;
Expand Down
9 changes: 9 additions & 0 deletions releng/openssl-config/20-apple-platforms.conf
Expand Up @@ -130,6 +130,15 @@ my %targets = (
sys_id => "tvOS",
},

## Apple macOS (arm64)
"macos64-cross-arm64" => {
inherit_from => [ "darwin-common", "macos-base", asm("aarch64_asm") ],
cflags => add("-arch arm64"),
bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
perlasm_scheme => "ios64",
sys_id => "macOS",
},

## Apple macOS (arm64e)
"macos64-cross-arm64e" => {
inherit_from => [ "darwin-common", "macos-base", asm("aarch64_asm") ],
Expand Down
2 changes: 1 addition & 1 deletion releng/setup-env.sh
Expand Up @@ -327,7 +327,7 @@ case $host_platform in
;;
macos)
case $host_arch in
arm64e)
arm64|arm64e)
macos_minver="10.16"
;;
*)
Expand Down

0 comments on commit 8c76f8c

Please sign in to comment.