forked from jl777/komodo
-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #618 from KomodoPlatform/patch-macos-build-clang
build: use native clang as darwin compiler
- Loading branch information
Showing
21 changed files
with
138 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,23 @@ | ||
build_darwin_CC = gcc-8 | ||
build_darwin_CXX = g++-8 | ||
build_darwin_CC:=$(shell xcrun -f clang) --sysroot $(shell xcrun --show-sdk-path) | ||
build_darwin_CXX:=$(shell xcrun -f clang++) --sysroot $(shell xcrun --show-sdk-path) | ||
build_darwin_AR: = $(shell xcrun -f ar) | ||
build_darwin_RANLIB: = $(shell xcrun -f ranlib) | ||
build_darwin_STRIP: = $(shell xcrun -f strip) | ||
build_darwin_OTOOL: = $(shell xcrun -f otool) | ||
build_darwin_NM: = $(shell xcrun -f nm) | ||
build_darwin_INSTALL_NAME_TOOL:=$(shell xcrun -f install_name_tool) | ||
build_darwin_SHA256SUM = shasum -a 256 | ||
build_darwin_DOWNLOAD = curl --connect-timeout $(DOWNLOAD_CONNECT_TIMEOUT) --retry $(DOWNLOAD_RETRIES) -L -f -o | ||
build_darwin_DOWNLOAD=curl --location --fail --connect-timeout $(DOWNLOAD_CONNECT_TIMEOUT) --retry $(DOWNLOAD_RETRIES) -o | ||
|
||
#darwin host on darwin builder. overrides darwin host preferences. | ||
darwin_CC= gcc-8 | ||
darwin_CXX= g++-8 | ||
darwin_CC=$(shell xcrun -f clang) -mmacosx-version-min=$(OSX_MIN_VERSION) -fvisibility=hidden -fvisibility-inlines-hidden --sysroot $(shell xcrun --show-sdk-path) | ||
darwin_CXX:=$(shell xcrun -f clang++) -mmacosx-version-min=$(OSX_MIN_VERSION) -fvisibility=hidden -fvisibility-inlines-hidden -stdlib=libc++ --sysroot $(shell xcrun --show-sdk-path) | ||
darwin_AR:=$(shell xcrun -f ar) | ||
darwin_RANLIB:=$(shell xcrun -f ranlib) | ||
darwin_STRIP:=$(shell xcrun -f strip) | ||
darwin_LIBTOOL:=$(shell xcrun -f libtool) | ||
darwin_OTOOL:=$(shell xcrun -f otool) | ||
darwin_NM:=$(shell xcrun -f nm) | ||
darwin_INSTALL_NAME_TOOL:=$(shell xcrun -f install_name_tool) | ||
darwin_native_binutils= | ||
darwin_native_toolchain= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,50 @@ | ||
OSX_MIN_VERSION=10.12 | ||
OSX_SDK_VERSION=10.12 | ||
OSX_SDK=$(SDK_PATH)/MacOSX$(OSX_SDK_VERSION).sdk | ||
LD64_VERSION=253.9 | ||
darwin_CC=gcc-8 -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -mlinker-version=$(LD64_VERSION) | ||
darwin_CXX=g++-8 -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -mlinker-version=$(LD64_VERSION) | ||
OSX_MIN_VERSION=10.15 | ||
OSX_SDK_VERSION=10.15.6 | ||
XCODE_VERSION=12.1 | ||
XCODE_BUILD_ID=12A7403 | ||
LD64_VERSION=609 | ||
|
||
OSX_SDK=$(SDK_PATH)/Xcode-$(XCODE_VERSION)-$(XCODE_BUILD_ID)-extracted-SDK-with-libcxx-headers | ||
|
||
# Flag explanations: | ||
# | ||
# -mlinker-version | ||
# | ||
# Ensures that modern linker features are enabled. See here for more | ||
# details: https://github.com/bitcoin/bitcoin/pull/19407. | ||
# | ||
# -B$(build_prefix)/bin | ||
# | ||
# Explicitly point to our binaries (e.g. cctools) so that they are | ||
# ensured to be found and preferred over other possibilities. | ||
# | ||
# -nostdinc++ -isystem $(OSX_SDK)/usr/include/c++/v1 | ||
# | ||
# Forces clang to use the libc++ headers from our SDK and completely | ||
# forget about the libc++ headers from the standard directories | ||
# | ||
# TODO: Once we start requiring a clang version that has the | ||
# -stdlib++-isystem<directory> flag first introduced here: | ||
# https://reviews.llvm.org/D64089, we should use that instead. Read the | ||
# differential summary there for more details. | ||
# | ||
darwin_CC=clang -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -mlinker-version=$(LD64_VERSION) -B$(build_prefix)/bin | ||
darwin_CXX=clang++ -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -stdlib=libc++ -mlinker-version=$(LD64_VERSION) -B$(build_prefix)/bin -nostdinc++ -isystem $(OSX_SDK)/usr/include/c++/v1 | ||
|
||
darwin_CFLAGS=-pipe | ||
darwin_CXXFLAGS=$(darwin_CFLAGS) | ||
|
||
darwin_release_CFLAGS=-g -O2 | ||
darwin_release_CFLAGS=-O2 | ||
darwin_release_CXXFLAGS=$(darwin_release_CFLAGS) | ||
|
||
darwin_debug_CFLAGS=-g -O0 | ||
darwin_debug_CXXFLAGS=$(darwin_debug_CFLAGS) | ||
|
||
darwin_native_binutils=native_cctools | ||
ifeq ($(strip $(FORCE_USE_SYSTEM_CLANG)),) | ||
darwin_native_toolchain=native_cctools | ||
else | ||
darwin_native_toolchain= | ||
endif | ||
|
||
darwin_cmake_system=Darwin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.