-
Notifications
You must be signed in to change notification settings - Fork 37.7k
build: macOS toolchain update #16392
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
077b9df
to
31f7825
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Concept ack.
+1 for a new prog to replace our dmg hacks. I think that might also mean that we could get rid of CMake.
Will review in depth.
Concept ACK |
Needs rebase |
Tested building depends on macOS 10.14.6 Mojave. I still had to do this annoying workaround:
And building protobuf fails: log If I remove protobuf and native_protobuf it does build. I can then compile QT: ./autogen.sh
./configure --prefix=`pwd`/depends/x86_64-apple-darwin18.7.0 --disable-bip70
make This works, but I get a flood of warnings at the end: log Will test on macOS 10.15 Catalina later. We should backport this to 0.18 given #16387 and ideally do a 0.18.2 tag before Catalina is out (September or October). Our 0.19 release is scheduled for November #15940, so otherwise there's no tag to build from. Concept ACK on bumping macOS from 10.10 to 10.12, though a small percentage of users would have to stay on the 0.18 branch (the last tag before backport). The bottleneck for upgrading macOS is hardware, and that's pretty durable. Here are the minimum specs for 10.10: Some refurbished machines for sale: Some second hand machines at an even lower price point still work: |
Yep, that isn't new with this change, but may go away if we can remove any reliance on having the headers in the now deprecated location. See details in the
Did you try to build depends before installing the new headers? If you |
31f7825
to
536034b
Compare
Concept ACK. Aidium publishes their update stats and it looks like, >10% was using 10.11 this week. It'd say we wait with this. |
I thought I did, but maybe not. I just tried
If it doesn't break anything else, maybe we can do this bump when we bump QT to 5.12 (LTS)? |
536034b
to
7decfd4
Compare
Updated to add some documentation (Linux) for the macOS 10.14 SDK extraction. This doesn't have to be the final docs, but should be useful for someone on a Linux machine wanting to extract the SDK and test this PR.
We don't have to bump the minimum to |
From Apple: "All Macintosh computers that can run Mountain Lion, Mavericks, or Yosemite can run El Capitan" (10.11). I suspect many people just don't realize they can upgrade. I managed to build
That means this PR is not enough to support Catalina, at least not without some other workaround. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the most part this looks great. I've added a few notes around libtapi which still needs a little work IMO.
I've not tried building yet, I'll work on getting an SDK extracted.
@@ -52,6 +67,9 @@ endef | |||
|
|||
define $(package)_stage_cmds | |||
$(MAKE) DESTDIR=$($(package)_staging_dir) install && \ | |||
mkdir -p $($(package)_staging_prefix_dir)/lib/ && \ | |||
cd $($(package)_extract_dir)/installed_libtapi && \ | |||
cp lib/libtapi.so.6 $($(package)_staging_prefix_dir)/lib/ && \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We want this built statically if possible, otherwise this introduces a (rather unnecessary) LDPATH runtime requirement. Does build.sh have static lib support?
I tested a few of my cleanup suggestions above, and they seem to work fine. |
7decfd4
to
97b3349
Compare
@theuni I've incorporated some of your suggestions (trimming the LD64 stuff, and the clang hacks) and added you as co-author to the relevant commits. We are now pointing back to upstream We are also now pointing back to the upstream
I still need to address:
|
Building depends on macOS 10.14.6 Mojave still works as of 97b3349. |
Modernise macOS cross-compilation toolchain Cherry-picked from the following upstream PRs: - bitcoin/bitcoin#13617 - Excluding the QT GUI changes. - bitcoin/bitcoin#17550 - bitcoin/bitcoin#16392 - Excluding the QT GUI changes. - bitcoin/bitcoin#18589 - bitcoin/bitcoin#19240 - bitcoin/bitcoin#19407 - bitcoin/bitcoin#17919 - Only the ancillary changes, not the `FORCE_USE_SYSTEM_CLANG` change. - bitcoin/bitcoin#19530 After these changes, macOS versions earlier than 10.12 are no longer supported. To cross-compile for macOS: - Follow the instructions in `contrib/macdeploy/README.md` to generate `Xcode-11.3.1-11C505-extracted-SDK-with-libcxx-headers.tar.gz` (requires an Apple Developer Account) - Extract it into `depends/SDKs` (creating that folder first if it does not exist) - `HOST=x86_64-apple-darwin16 ./zcutil/build.sh`
Modernise macOS cross-compilation toolchain Cherry-picked from the following upstream PRs: - bitcoin/bitcoin#13617 - Excluding the QT GUI changes. - bitcoin/bitcoin#17550 - bitcoin/bitcoin#16392 - Excluding the QT GUI changes. - bitcoin/bitcoin#18589 - bitcoin/bitcoin#19240 - bitcoin/bitcoin#19407 - bitcoin/bitcoin#17919 - Only the ancillary changes, not the `FORCE_USE_SYSTEM_CLANG` change. - bitcoin/bitcoin#19530 After these changes, macOS versions earlier than 10.12 are no longer supported. To cross-compile for macOS: - Follow the instructions in `contrib/macdeploy/README.md` to generate `Xcode-11.3.1-11C505-extracted-SDK-with-libcxx-headers.tar.gz` (requires an Apple Developer Account) - Extract it into `depends/SDKs` (creating that folder first if it does not exist) - `HOST=x86_64-apple-darwin16 ./zcutil/build.sh`
7d7bf2f build: set minimum supported macOS to 10.12 (fanquake) Pull request description: Extracted from bitcoin#16392 as this doesn't need to wait for the other build changes. Reasoning: * `10.10` has been unsupported since July 2017 (~3 years at `v0.20.0` release) * `10.11` has been unsupported since July 2018 (~2 years at `v0.20.0` release) * macOS users are consistent at upgrading to new releases. * Qt 5.12 LTS only supports [macOS > 10.12](https://doc-snapshots.qt.io/qt5-5.12/supported-platforms.html). As long as we're supporting macOS < 10.12 we would not be able to bump Qt in depends to 5.12 for the `v0.20.0` release. Once we drop support for 10.12 and start using the 10.15 SDK there are some other follow ups: * Enabling support for [`thread_local`](https://github.com/bitcoin/bitcoin/blob/master/configure.ac#L901). * Removing some of the macOS notification code * Removing macOS [startup item code](https://github.com/bitcoin/bitcoin/blob/master/src/qt/guiutil.cpp#L695). There was also some related discussion in the `#bitcoin-builds` channel yesterday arvo. ACKs for top commit: laanwj: ACK 7d7bf2f dongcarl: post-IRC-grilling-ACK 7d7bf2f Tree-SHA512: 30b0ed75e3b4df2d3f94db2091b7982c1ea7be8fb3a2732d8efd1a53ef1e492d7265a47e90c38e92f66e638d10e9400a6ecb56e5093688bb26d1621645b453e8
dc9305b random: don't special case clock usage on macOS (fanquake) Pull request description: `clock_gettime()`, `CLOCK_MONOTONIC` and `CLOCK_REALTIME` are all available for use on macOS (now that we require macOS >=10.12 and build against 10.14). Use them rather than the [deprecated](https://developer.apple.com/library/archive/documentation/Darwin/Conceptual/KernelProgramming/Mach/Mach.html) `mach_timespec_t` time API. I mentioned the possibility for this change [in bitcoin#17270](bitcoin#17270 (comment)). [master](1dbf335): ```bash 2019-12-23T20:49:43Z Feeding 216 bytes of dynamic environment data into RNG 2019-12-23T20:50:43Z Feeding 216 bytes of dynamic environment data into RNG ``` This PR: ```bash 2019-12-23T20:32:41Z Feeding 232 bytes of dynamic environment data into RNG 2019-12-23T20:33:42Z Feeding 232 bytes of dynamic environment data into RNG ``` ~~Depends on bitcoin#16392.~~ Merged. ACKs for top commit: laanwj: ACK dc9305b Tree-SHA512: 18c2f336ea628f9cf7339b817381d230a18893fd9c0351bf99a39ca6f45c5b0a20af9d599d48d6c09515627d5edafa91337c17f9f790264251d2cdcb3763bbd5
1fbb8b6 script: Remove outdated extract-osx-sdk.sh (Hennadii Stepanov) Pull request description: The removed script was used to prepare `MacOSX10.11.sdk` which we do not use since 0.20 (7e21044 from #16392). See bitcoin-core/docs#68. ACKs for top commit: laanwj: ACK 1fbb8b6 Tree-SHA512: ab5128ec2c505a43b1a12e06abf38d8fa8f62a03efe760de2c842550e82f68ca512dee1b6c220a4f8af2465a9c35a429ca91cb179cc4ce016fcd87c61fbc8b07
1fbb8b6 script: Remove outdated extract-osx-sdk.sh (Hennadii Stepanov) Pull request description: The removed script was used to prepare `MacOSX10.11.sdk` which we do not use since 0.20 (bitcoin@7e21044 from bitcoin#16392). See bitcoin-core/docs#68. ACKs for top commit: laanwj: ACK 1fbb8b6 Tree-SHA512: ab5128ec2c505a43b1a12e06abf38d8fa8f62a03efe760de2c842550e82f68ca512dee1b6c220a4f8af2465a9c35a429ca91cb179cc4ce016fcd87c61fbc8b07
e1b89ac Fix QPainter non-determinism on macOS (Andrew Chow) 831c317 macOS deploy: use the new plistlib API (Jonas Schnelli) 5857aaf doc: Document ALLOW_HOST_PACKAGES dependency option (skmcontrib) 2329e08 build: Fix behavior when ALLOW_HOST_PACKAGES unset (Hennadii Stepanov) 1768870 depends: native_ds_store 1.3.0 (fanquake) 3f9f3e5 depends: pull upstream libdmg-hfsplus changes (fanquake) f7606dc depends: latest config.guess & config.sub (fanquake) cc3ae74 depends: bump native_cctools for fixed lto with external clang (Cory Fields) b26c648 depends: enable lto support for Apple's ld64 (Cory Fields) 50933d7 depends: Add documentation for FORCE_USE_SYSTEM_CLANG make flag (Carl Dong) ba3ddf2 depends: Reformat make options as definition list (Carl Dong) 3b855a7 depends: Add justifications for macOS clang flags (Carl Dong) 4104de0 depends: specify libc++ header location for darwin (Cory Fields) cd4335f depends: force a new host id string if FORCE_USE_SYSTEM_CLANG is in use (Cory Fields) d30e1af depends: Allow building with system clang (Carl Dong) 234828b depends: Decouple toolchain + binutils (Carl Dong) 1dd3a5a doc: explain why passing -mlinker-version is required (fanquake) 5cc0d0f darwin: pass mlinker-version so that clang enables new features (Cory Fields) 813a552 macos: Bump to xcode 11.3.1 and 10.15 SDK (Cory Fields) ee7085f depends: bump MacOS toolchain (Cory Fields) e5b092b contrib: macdeploy: Remove historical extraction notes (Carl Dong) 5893caf contrib: macdeploy: Use apple-sdk-tools instead of xar+pbzx (Carl Dong) 9f2d4ba native_cctools: Don't use libc++ from pinned clang (Carl Dong) 0c8d217 Adapt rest of tooling to new SDK naming scheme (Carl Dong) bdacfa8 contrib: macdeploy: Correctly generate macOS SDK (Carl Dong) f7eee2c Fix naming of macOS SDK and clarify version (Andrew Chow) 62f9e23 build: use macOS 10.14 SDK (fanquake) bc2e1af depends: native_cctools 921, ld64 409.12, libtapi 1000.10.8 (fanquake) a296d87 depends: clang 6.0.1 (fanquake) 8f6c475 build: Set minimum supported macOS to 10.12 (Fuzzbawls) Pull request description: This backports the following upstream PRs to update the macOS cross-compiling tools: bitcoin#17550 bitcoin#16392 bitcoin#18589 bitcoin#19240 bitcoin#19407 bitcoin#17919 bitcoin#19530 bitcoin#17057 bitcoin#20333 bitcoin#18051 bitcoin#19124 bitcoin#20298 bitcoin#20447 The tools being updated are ### Clang Upgraded from `3.7.1` to `8.0.0` ### cctools * cctools `877.8` -> `949.0.1` * LD64 `253.9` -> `530` * TAPI `1000.10.8` ### DSStore Upgraded from `1.1.2` to `1.3.0` (this removes the biplist dependency) This also effectively bumps our minimum supported macOS version to 10.12 (Sierra). ACKs for top commit: furszy: tested ACK e1b89ac random-zebra: utACK e1b89ac Tree-SHA512: f5cec8db57e07d8855070646b9e1400d48aac1d01e3c2c3b3e134665c6372d6535f3328888bb9a75087f7b3d5231ecb4b509723bfa51bd40770ffe2810c67f65
TLDR: This updates our macOS toolchain to use a newer version of Clang, cctools (including new dependency on libtapi), LD64 and the macOS SDK.
I've been testing depends builds (
HOST=x86_64-apple-darwin16
) inside a Debian Buster Docker container, and running the resultantbitcoind
andbitcoin-qt
binaries on a macOS10.14.4
system. The.dmg
generated by amake deploy
also mounts correctly on the same macOS system.Clang
Upgraded from
3.7.1
to6.0.1
cctools
877.8
->921
253.9
->409.12
1000.10.8
See tpoechtrager/cctools-port and tpoechtrager/apple-libtapi.
macOS SDK
Upgraded from building against the macOS
10.11
SDK to the macOS10.14
SDK.TODO
10.14
SDK available to Travis.Fixes: #16052
Closes: #14797