aboutsummaryrefslogtreecommitdiff
path: root/contrib/depends
diff options
context:
space:
mode:
authorHoward Chu <hyc@symas.com>2022-05-03 15:51:34 +0100
committerHoward Chu <hyc@symas.com>2022-05-04 22:33:40 +0100
commita86c4cb75ffb577922334cf6e212bcd5bac1716d (patch)
treef520bee7427d827cc69330bf1b4477b1b57cc8a3 /contrib/depends
parentMerge pull request #8275 (diff)
downloadmonero-a86c4cb75ffb577922334cf6e212bcd5bac1716d.tar.xz
Update to MacOSX SDK 11.1, add Mac M1
Diffstat (limited to 'contrib/depends')
-rw-r--r--contrib/depends/README.md4
-rw-r--r--contrib/depends/hosts/darwin.mk11
-rw-r--r--contrib/depends/toolchain.cmake.in31
3 files changed, 32 insertions, 14 deletions
diff --git a/contrib/depends/README.md b/contrib/depends/README.md
index 10866acbe..f7c0b922f 100644
--- a/contrib/depends/README.md
+++ b/contrib/depends/README.md
@@ -61,9 +61,9 @@ download-linux: run 'make download-linux' to fetch all sources needed for linux
#Darwin (macos) builds:
-To build with the x86_64-apple-darwin11 you require the mac os developer tools in MacOSX10.11.sdk.
+To build with the x86_64-apple-darwin11 you require the mac os developer tools in MacOSX11.1.sdk.
Download it from apple, or search for it on github. Create a new directoty called SDKs in this
-directory and place the entire MacOSX10.11.sdk folder in it. The depends build will then pick it up automatically
+directory and place the entire MacOSX11.1.sdk folder in it. The depends build will then pick it up automatically
(without requiring SDK_PATH).
diff --git a/contrib/depends/hosts/darwin.mk b/contrib/depends/hosts/darwin.mk
index 7b5c8b051..0b6582003 100644
--- a/contrib/depends/hosts/darwin.mk
+++ b/contrib/depends/hosts/darwin.mk
@@ -1,9 +1,14 @@
OSX_MIN_VERSION=10.8
-OSX_SDK_VERSION=10.11
+OSX_SDK_VERSION=11.1
OSX_SDK=$(SDK_PATH)/MacOSX$(OSX_SDK_VERSION).sdk
LD64_VERSION=253.9
-darwin_CC=clang -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -mlinker-version=$(LD64_VERSION) -B $(host_prefix)/native/bin
-darwin_CXX=clang++ -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -mlinker-version=$(LD64_VERSION) -stdlib=libc++ -B $(host_prefix)/native/bin
+ifeq (aarch64, $(host_arch))
+CC_target=arm64-apple-darwin11
+else
+CC_target=$(host)
+endif
+darwin_CC=clang -target $(CC_target) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -mlinker-version=$(LD64_VERSION) -B$(host_prefix)/native/bin/$(host)-
+darwin_CXX=clang++ -target $(CC_target) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -mlinker-version=$(LD64_VERSION) -stdlib=libc++ -B$(host_prefix)/native/bin/$(host)-
darwin_CFLAGS=-pipe
darwin_CXXFLAGS=$(darwin_CFLAGS)
diff --git a/contrib/depends/toolchain.cmake.in b/contrib/depends/toolchain.cmake.in
index c3a0df59b..3ed97633b 100644
--- a/contrib/depends/toolchain.cmake.in
+++ b/contrib/depends/toolchain.cmake.in
@@ -69,22 +69,35 @@ set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) # Find includes in target
# specify the cross compiler to be used. Darwin uses clang provided by the SDK.
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
+ if(ARCHITECTURE STREQUAL "aarch64")
+ SET(CLANG_TARGET "arm64-apple-darwin11")
+ SET(CONF_TRIPLE "aarch64-apple-darwin11")
+ SET(BUILD_TAG "mac-armv8")
+ SET(CMAKE_OSX_ARCHITECTURES "arm64")
+ set(ARM ON)
+ set(ARM_ID "armv8-a")
+ else()
+ SET(CLANG_TARGET "x86_64-apple-darwin11")
+ SET(CONF_TRIPLE "x86_64-apple-darwin11")
+ SET(BUILD_TAG "mac-x64")
+ SET(CMAKE_OSX_ARCHITECTURES "x86_64")
+ endif()
+ SET(_CMAKE_TOOLCHAIN_PREFIX @prefix@/native/bin/${CONF_TRIPLE}-)
SET(CMAKE_C_COMPILER @prefix@/native/bin/clang)
- SET(CMAKE_C_COMPILER_TARGET x86_64-apple-darwin11)
+ SET(CMAKE_C_COMPILER_TARGET ${CLANG_TARGET})
+ SET(CMAKE_C_FLAGS_INIT -B${_CMAKE_TOOLCHAIN_PREFIX})
SET(CMAKE_CXX_COMPILER @prefix@/native/bin/clang++ -stdlib=libc++)
- SET(CMAKE_CXX_COMPILER_TARGET x86_64-apple-darwin11)
- SET(CMAKE_ASM_COMPILER_TARGET x86_64-apple-darwin11)
- SET(CMAKE_ASM-ATT_COMPILER_TARGET x86_64-apple-darwin11)
- SET(_CMAKE_TOOLCHAIN_PREFIX x86_64-apple-darwin11-)
+ SET(CMAKE_CXX_COMPILER_TARGET ${CLANG_TARGET})
+ SET(CMAKE_CXX_FLAGS_INIT -B${_CMAKE_TOOLCHAIN_PREFIX})
+ SET(CMAKE_ASM_COMPILER_TARGET ${CLANG_TARGET})
+ SET(CMAKE_ASM-ATT_COMPILER_TARGET ${CLANG_TARGET})
SET(APPLE True)
- SET(BUILD_TAG "mac-x64")
SET(BUILD_64 ON)
SET(BREW OFF)
SET(PORT OFF)
- SET(CMAKE_OSX_SYSROOT "@sdk@/MacOSX10.11.sdk/")
+ SET(CMAKE_OSX_SYSROOT "@sdk@/MacOSX11.1.sdk/")
SET(CMAKE_OSX_DEPLOYMENT_TARGET "10.08")
SET(CMAKE_CXX_STANDARD 14)
- SET(CMAKE_OSX_ARCHITECTURES "x86_64")
SET(LLVM_ENABLE_PIC OFF)
SET(LLVM_ENABLE_PIE OFF)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Android")
@@ -126,7 +139,7 @@ elseif(ARCHITECTURE STREQUAL "aarch64")
set(ARM_ID "armv8-a")
if(ANDROID)
set(BUILD_TAG "android-armv8")
- else()
+ elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(BUILD_TAG "linux-armv8")
endif()
set(BUILD_64 ON)