Skip to content

Commit 77d569c

Browse files
committed
Merge bitcoin/bitcoin#19817: build: macOS toolchain bump
a5550f8 build: use -stdlib++-isystem with Clang 10 (fanquake) 51d9d16 guix: use Clang 10 for the macOS cross compile (fanquake) b80a6af build: no longer patch threading out of ld64 (fanquake) c29cba4 build: Xcode 12.1, macOS SDK 10.15.6 (fanquake) 9ed2f19 build: native cctools 973.0.1, ld64 609 (fanquake) f48f187 build: Clang 10.0.1 (Hennadii Stepanov) 9b193cd build: libtapi 1100.0.11 (fanquake) Pull request description: Bumps our macOS toolchain to be using the following: * Clang 10.0.1 (gitian) & Clang 10.0.0 (Guix) * ld64 609 * libtapi 1100.0.11 * cctools 973.0.1 * Xcode 12.1 * macOS SDK 10.15.6 which are currently the most recent releases available as open source. See upstream [`cctools`](https://github.com/tpoechtrager/cctools-port/commits/973.0.1-ld64-609) and [`libtapi`](https://github.com/tpoechtrager/apple-libtapi/tree/1100.0.11). This should improve the possibility of Apple ARM cross-compilation in depends. This also removes our [patching out of pthreads usage](https://github.com/bitcoin/bitcoin/blob/master/depends/patches/native_cctools/ld64_disable_threading.patch) in `ld64`. There have been multiple changes since `ld64 450.3`, which have likely fixed the non-determinism we were working around. i.e from [InputFiles.cpp](https://opensource.apple.com/source/ld64/ld64-609/src/ld/InputFiles.cpp.auto.html): ```cpp // <rdar://problem/15002251> make implicit dylib order be deterministic by sorting by install_name std::sort(implicitDylibs.begin(), implicitDylibs.end(), DylibByInstallNameSorter()); ``` ```cpp // <rdar://problem/42675402> ld64 output is not deterministic due to dylib processing order std::sort(unprocessedDylibs.begin(), unprocessedDylibs.end(), [](const ld::dylib::File* lhs, const ld::dylib::File* rhs) { return strcmp(lhs->path(), rhs->path()) < 0; }); ``` Guix Build: ```bash find guix-build-$(git rev-parse --short=12 HEAD)/output/ -type f -print0 | env LC_ALL=C sort -z | xargs -r0 sha256sum f6c3817b8fe5f7370299d1ae2533e4a3acd313ba9f9aa8d423a8956117e52dd5 guix-build-a5550f877a2c/output/dist-archive/bitcoin-a5550f877a2c.tar.gz 4954dcf563c2d496b8d9fecd48f8e3f7fba2f319ffa254a5bc8ee12cfee6acf0 guix-build-a5550f877a2c/output/x86_64-apple-darwin18/bitcoin-a5550f877a2c-osx-unsigned.dmg 8f6095b445c7f1a8e6accd86bb7f0696d5849402084927d2b726b7d557831c3a guix-build-a5550f877a2c/output/x86_64-apple-darwin18/bitcoin-a5550f877a2c-osx-unsigned.tar.gz cc40f25477b4defc1617ae694313d80f307ddf6742fe6cc85c6bc0e215ef8be0 guix-build-a5550f877a2c/output/x86_64-apple-darwin18/bitcoin-a5550f877a2c-osx64.tar.gz ``` Gitian Build: ```bash Generating report 506a8abdefe559999b43dd9f14905b9b2b5a3363b1cd013d45ae47acc1f7ef6c bitcoin-a5550f877a2c-osx-unsigned.dmg f606997f74026dd12d110d683c6f116b40df324836904ef507dd7ac787e6ebe2 bitcoin-a5550f877a2c-osx-unsigned.tar.gz 5b495ef15f2c3260c2950921b61326912a9bf533cccd51e13818809fd225489e bitcoin-a5550f877a2c-osx64.tar.gz f6c3817b8fe5f7370299d1ae2533e4a3acd313ba9f9aa8d423a8956117e52dd5 src/bitcoin-a5550f877a2c.tar.gz 9eb0221e962d2839770963bd03c6c9e98e8bf3078566bee2ae42f06233a710fa bitcoin-core-osx-22-res.yml Done. ``` ACKs for top commit: hebasto: ACK a5550f8 Tree-SHA512: 504c4b0f9cd3b939714a322298320c5bde07e9356a48a9a000060b36f8dce4d6134ed60c3a5188810476a28ec5b108733eabbc6fb8053231b9ea8a494cc91b12
2 parents 6013238 + a5550f8 commit 77d569c

File tree

13 files changed

+32
-132
lines changed

13 files changed

+32
-132
lines changed

ci/test/00_setup_env_mac.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ export CONTAINER_NAME=ci_macos_cross
1010
export DOCKER_NAME_TAG=ubuntu:20.04 # Check that Focal can cross-compile to macos (Focal is used in the gitian build as well)
1111
export HOST=x86_64-apple-darwin18
1212
export PACKAGES="cmake imagemagick librsvg2-bin libz-dev libtiff-tools libtinfo5 python3-setuptools xorriso"
13-
export XCODE_VERSION=11.3.1
14-
export XCODE_BUILD_ID=11C505
13+
export XCODE_VERSION=12.1
14+
export XCODE_BUILD_ID=12A7403
1515
export RUN_UNIT_TESTS=false
1616
export RUN_FUNCTIONAL_TESTS=false
1717
export GOAL="deploy"

contrib/gitian-build.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ def main():
210210
args.macos = 'm' in args.os
211211

212212
# Disable for MacOS if no SDK found
213-
if args.macos and not os.path.isfile('gitian-builder/inputs/Xcode-11.3.1-11C505-extracted-SDK-with-libcxx-headers.tar.gz'):
213+
if args.macos and not os.path.isfile('gitian-builder/inputs/Xcode-12.1-12A7403-extracted-SDK-with-libcxx-headers.tar.gz'):
214214
print('Cannot build for MacOS, SDK does not exist. Will build for other OSes')
215215
args.macos = False
216216

contrib/gitian-descriptors/gitian-osx.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ remotes:
3131
- "url": "https://github.com/bitcoin/bitcoin.git"
3232
"dir": "bitcoin"
3333
files:
34-
- "Xcode-11.3.1-11C505-extracted-SDK-with-libcxx-headers.tar.gz"
34+
- "Xcode-12.1-12A7403-extracted-SDK-with-libcxx-headers.tar.gz"
3535
script: |
3636
set -e -o pipefail
3737
@@ -88,7 +88,7 @@ script: |
8888
BASEPREFIX="${PWD}/depends"
8989
9090
mkdir -p ${BASEPREFIX}/SDKs
91-
tar -C ${BASEPREFIX}/SDKs -xf ${BUILD_DIR}/Xcode-11.3.1-11C505-extracted-SDK-with-libcxx-headers.tar.gz
91+
tar -C ${BASEPREFIX}/SDKs -xf ${BUILD_DIR}/Xcode-12.1-12A7403-extracted-SDK-with-libcxx-headers.tar.gz
9292
9393
# Build dependencies for each host
9494
for i in $HOSTS; do

contrib/guix/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ find output/ -type f -print0 | sort -z | xargs -r0 sha256sum
167167
Set the path where _extracted_ SDKs can be found. This is passed through to
168168
the depends tree. Note that this is should be set to the _parent_ directory of
169169
the actual SDK (e.g. SDK_PATH=$HOME/Downloads/macOS-SDKs instead of
170-
$HOME/Downloads/macOS-SDKs/Xcode-11.3.1-11C505-extracted-SDK-with-libcxx-headers).
170+
$HOME/Downloads/macOS-SDKs/Xcode-12.1-12A7403-extracted-SDK-with-libcxx-headers).
171171

172172
* _**JOBS**_
173173

contrib/guix/manifest.scm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,5 +239,5 @@ chain for " target " development."))
239239
((string-contains target "-linux-")
240240
(list (make-bitcoin-cross-toolchain target)))
241241
((string-contains target "darwin")
242-
(list clang-toolchain-8 binutils imagemagick libtiff librsvg font-tuffy cmake xorriso))
242+
(list clang-toolchain-10 binutils imagemagick libtiff librsvg font-tuffy cmake xorriso))
243243
(else '())))))

contrib/macdeploy/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ When complete, it will have produced `Bitcoin-Core.dmg`.
1313
### Step 1: Obtaining `Xcode.app`
1414

1515
Our current macOS SDK
16-
(`Xcode-11.3.1-11C505-extracted-SDK-with-libcxx-headers.tar.gz`) can be
16+
(`Xcode-12.1-12A7403-extracted-SDK-with-libcxx-headers.tar.gz`) can be
1717
extracted from
18-
[Xcode_11.3.1.xip](https://download.developer.apple.com/Developer_Tools/Xcode_11.3.1/Xcode_11.3.1.xip).
18+
[Xcode_12.1.xip](https://download.developer.apple.com/Developer_Tools/Xcode_12.1/Xcode_12.1.xip).
1919
An Apple ID is needed to download this.
2020

2121
After Xcode version 7.x, Apple started shipping the `Xcode.app` in a `.xip`
@@ -27,25 +27,25 @@ approach (tested on Debian Buster) is outlined below:
2727
apt install cpio
2828
git clone https://github.com/bitcoin-core/apple-sdk-tools.git
2929

30-
# Unpack Xcode_11.3.1.xip and place the resulting Xcode.app in your current
30+
# Unpack Xcode_12.1.xip and place the resulting Xcode.app in your current
3131
# working directory
32-
python3 apple-sdk-tools/extract_xcode.py -f Xcode_11.3.1.xip | cpio -d -i
32+
python3 apple-sdk-tools/extract_xcode.py -f Xcode_12.1.xip | cpio -d -i
3333
```
3434

3535
On macOS the process is more straightforward:
3636

3737
```bash
38-
xip -x Xcode_11.3.1.xip
38+
xip -x Xcode_12.1.xip
3939
```
4040

41-
### Step 2: Generating `Xcode-11.3.1-11C505-extracted-SDK-with-libcxx-headers.tar.gz` from `Xcode.app`
41+
### Step 2: Generating `Xcode-12.1-12A7403-extracted-SDK-with-libcxx-headers.tar.gz` from `Xcode.app`
4242

43-
To generate `Xcode-11.3.1-11C505-extracted-SDK-with-libcxx-headers.tar.gz`, run
43+
To generate `Xcode-12.1-12A7403-extracted-SDK-with-libcxx-headers.tar.gz`, run
4444
the script [`gen-sdk`](./gen-sdk) with the path to `Xcode.app` (extracted in the
4545
previous stage) as the first argument.
4646

4747
```bash
48-
# Generate a Xcode-11.3.1-11C505-extracted-SDK-with-libcxx-headers.tar.gz from
48+
# Generate a Xcode-12.1-12A7403-extracted-SDK-with-libcxx-headers.tar.gz from
4949
# the supplied Xcode.app
5050
./contrib/macdeploy/gen-sdk '/path/to/Xcode.app'
5151
```

depends/hosts/darwin.mk

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
OSX_MIN_VERSION=10.14
2-
OSX_SDK_VERSION=10.15.1
3-
XCODE_VERSION=11.3.1
4-
XCODE_BUILD_ID=11C505
5-
LD64_VERSION=530
2+
OSX_SDK_VERSION=10.15.6
3+
XCODE_VERSION=12.1
4+
XCODE_BUILD_ID=12A7403
5+
LD64_VERSION=609
66

77
OSX_SDK=$(SDK_PATH)/Xcode-$(XCODE_VERSION)-$(XCODE_BUILD_ID)-extracted-SDK-with-libcxx-headers
88

@@ -60,16 +60,11 @@ $(foreach TOOL,$(cctools_TOOLS),$(eval darwin_$(TOOL) = $$(build_prefix)/bin/$$(
6060
# Explicitly point to our binaries (e.g. cctools) so that they are
6161
# ensured to be found and preferred over other possibilities.
6262
#
63-
# -stdlib=libc++ -nostdinc++ -Xclang -cxx-isystem$(OSX_SDK)/usr/include/c++/v1
63+
# -stdlib=libc++ -stdlib++-isystem$(OSX_SDK)/usr/include/c++/v1
6464
#
6565
# Forces clang to use the libc++ headers from our SDK and completely
6666
# forget about the libc++ headers from the standard directories
6767
#
68-
# TODO: Once we start requiring a clang version that has the
69-
# -stdlib++-isystem<directory> flag first introduced here:
70-
# https://reviews.llvm.org/D64089, we should use that instead. Read the
71-
# differential summary there for more details.
72-
#
7368
# -Xclang -*system<path_a> \
7469
# -Xclang -*system<path_b> \
7570
# -Xclang -*system<path_c> ...
@@ -109,8 +104,8 @@ darwin_CXX=env -u C_INCLUDE_PATH -u CPLUS_INCLUDE_PATH \
109104
$(clangxx_prog) --target=$(host) -mmacosx-version-min=$(OSX_MIN_VERSION) \
110105
-B$(build_prefix)/bin -mlinker-version=$(LD64_VERSION) \
111106
-isysroot$(OSX_SDK) \
112-
-stdlib=libc++ -nostdinc++ \
113-
-Xclang -cxx-isystem$(OSX_SDK)/usr/include/c++/v1 \
107+
-stdlib=libc++ \
108+
-stdlib++-isystem$(OSX_SDK)/usr/include/c++/v1 \
114109
-Xclang -internal-externc-isystem$(clang_resource_dir)/include \
115110
-Xclang -internal-externc-isystem$(OSX_SDK)/usr/include
116111

depends/packages/native_cctools.mk

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
package=native_cctools
2-
$(package)_version=55562e4073dea0fbfd0b20e0bf69ffe6390c7f97
2+
$(package)_version=2ef2e931cf641547eb8a68cfebde61003587c9fd
33
$(package)_download_path=https://github.com/tpoechtrager/cctools-port/archive
44
$(package)_file_name=$($(package)_version).tar.gz
5-
$(package)_sha256_hash=e51995a843533a3dac155dd0c71362dd471597a2d23f13dff194c6285362f875
5+
$(package)_sha256_hash=6b73269efdf5c58a070e7357b66ee760501388549d6a12b423723f45888b074b
66
$(package)_build_subdir=cctools
7-
$(package)_patches=ld64_disable_threading.patch
87
$(package)_dependencies=native_libtapi
98

109
define $(package)_set_vars
@@ -17,10 +16,6 @@ define $(package)_set_vars
1716
$(package)_cxx=$(clangxx_prog)
1817
endef
1918

20-
define $(package)_preprocess_cmds
21-
patch -p1 < $($(package)_patch_dir)/ld64_disable_threading.patch
22-
endef
23-
2419
define $(package)_config_cmds
2520
$($(package)_autoconf)
2621
endef

depends/packages/native_clang.mk

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package=native_clang
2-
$(package)_version=8.0.0
3-
$(package)_download_path=https://releases.llvm.org/$($(package)_version)
4-
$(package)_download_file=clang+llvm-$($(package)_version)-x86_64-linux-gnu-ubuntu-14.04.tar.xz
5-
$(package)_file_name=clang-llvm-$($(package)_version)-x86_64-linux-gnu-ubuntu-14.04.tar.xz
6-
$(package)_sha256_hash=9ef854b71949f825362a119bf2597f744836cb571131ae6b721cd102ffea8cd0
2+
$(package)_version=10.0.1
3+
$(package)_download_path=https://github.com/llvm/llvm-project/releases/download/llvmorg-$($(package)_version)
4+
$(package)_download_file=clang+llvm-$($(package)_version)-x86_64-linux-gnu-ubuntu-16.04.tar.xz
5+
$(package)_file_name=clang+llvm-$($(package)_version)-x86_64-linux-gnu-ubuntu-16.04.tar.xz
6+
$(package)_sha256_hash=48b83ef827ac2c213d5b64f5ad7ed082c8bcb712b46644e0dc5045c6f462c231
77

88
define $(package)_preprocess_cmds
99
rm -f $($(package)_extract_dir)/lib/libc++abi.so*

depends/packages/native_libtapi.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package=native_libtapi
2-
$(package)_version=3efb201881e7a76a21e0554906cf306432539cef
2+
$(package)_version=664b8414f89612f2dfd35a9b679c345aa5389026
33
$(package)_download_path=https://github.com/tpoechtrager/apple-libtapi/archive
44
$(package)_download_file=$($(package)_version).tar.gz
55
$(package)_file_name=$($(package)_version).tar.gz
6-
$(package)_sha256_hash=380c1ca37cfa04a8699d0887a8d3ee1ad27f3d08baba78887c73b09485c0fbd3
6+
$(package)_sha256_hash=62e419c12d1c9fad67cc1cd523132bc00db050998337c734c15bc8d73cc02b61
77

88
ifeq ($(strip $(FORCE_USE_SYSTEM_CLANG)),)
99
$(package)_dependencies=native_clang

0 commit comments

Comments
 (0)