7d78f06a92
a5550f877a2c46d01bb620ae051c0c8ed0fecd0b build: use -stdlib++-isystem with Clang 10 (fanquake) 51d9d1607f2e9d593693ca799393f068192e41aa guix: use Clang 10 for the macOS cross compile (fanquake) b80a6af9e55325d444e117e85bbfc76d88d898a8 build: no longer patch threading out of ld64 (fanquake) c29cba44b3706e0a2035e440e560f2d15d50433b build: Xcode 12.1, macOS SDK 10.15.6 (fanquake) 9ed2f19d385aa95f65807999bba2e18417b143dc build: native cctools 973.0.1, ld64 609 (fanquake) f48f187cce7fa43646fb0d796c244e1515e763ec build: Clang 10.0.1 (Hennadii Stepanov) 9b193cd2a3ca20917611fbed56dfbcd8a39aeab8 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 a5550f877a2c46d01bb620ae051c0c8ed0fecd0b Tree-SHA512: 504c4b0f9cd3b939714a322298320c5bde07e9356a48a9a000060b36f8dce4d6134ed60c3a5188810476a28ec5b108733eabbc6fb8053231b9ea8a494cc91b12 |
||
---|---|---|
.. | ||
builders | ||
hosts | ||
packages | ||
patches | ||
.gitignore | ||
config.guess | ||
config.site.in | ||
config.sub | ||
description.md | ||
funcs.mk | ||
Makefile | ||
packages.md | ||
README.md |
Usage
To build dependencies for the current arch+OS:
make
To build for another arch/OS:
make HOST=host-platform-triplet
For example:
make HOST=x86_64-w64-mingw32 -j4
A prefix will be generated that's suitable for plugging into Dash's configure. In the above example, a dir named x86_64-w64-mingw32 will be created. To use it for Dash:
./configure --prefix=`pwd`/depends/x86_64-w64-mingw32
Common host-platform-triplets
for cross compilation are:
x86_64-w64-mingw32
for Win64x86_64-apple-darwin19
for macOSarm-linux-gnueabihf
for Linux ARM 32 bitaarch64-linux-gnu
for Linux ARM 64 bitriscv32-linux-gnu
for Linux RISC-V 32 bitriscv64-linux-gnu
for Linux RISC-V 64 bitarmv7a-linux-android
for Android ARM 32 bitaarch64-linux-android
for Android ARM 64 biti686-linux-android
for Android x86 32 bitx86_64-linux-android
for Android x86 64 bit
The paths are automatically configured and no other options are needed unless targeting Android.
Install the required dependencies: Ubuntu & Debian
For macOS cross compilation
sudo apt-get install curl librsvg2-bin libtiff-tools bsdmainutils cmake imagemagick libcap-dev libz-dev libbz2-dev python3-setuptools libtinfo5
Note: You must obtain the macOS SDK before proceeding with a cross-compile.
Under the depends directory, create a subdirectory named SDKs
.
Then, place the extracted SDK under this new directory.
For more information, see SDK Extraction.
For Win64 cross compilation
- see build-windows.md
For linux (including i386, ARM) cross compilation
Common linux dependencies:
sudo apt-get install make automake curl g++-multilib libtool binutils-gold bsdmainutils pkg-config python3 patch bison
For linux ARM cross compilation:
sudo apt-get install g++-arm-linux-gnueabihf binutils-arm-linux-gnueabihf
For linux AARCH64 cross compilation:
sudo apt-get install g++-aarch64-linux-gnu binutils-aarch64-linux-gnu
For linux RISC-V 64-bit cross compilation (there are no packages for 32-bit):
sudo apt-get install g++-riscv64-linux-gnu binutils-riscv64-linux-gnu
RISC-V known issue: gcc-7.3.0 and gcc-7.3.1 result in a broken test_dash
executable (see https://github.com/bitcoin/bitcoin/pull/13543),
this is apparently fixed in gcc-8.1.0.
Dependency Options
The following can be set when running make: make FOO=bar
- SOURCES_PATH
- downloaded sources will be placed here
- BASE_CACHE
- built packages will be placed here
- SDK_PATH
- Path where sdk's can be found (used by macOS)
- FALLBACK_DOWNLOAD_PATH
- If a source file can't be fetched, try here before giving up
- NO_QT
- Don't download/build/cache qt and its dependencies
- NO_QR
- Don't download/build/cache packages needed for enabling qrencode
- NO_ZMQ
- Don't download/build/cache packages needed for enabling zeromq
- NO_WALLET
- Don't download/build/cache libs needed to enable the wallet
- NO_BDB
- Don't download/build/cache BerkeleyDB
- NO_SQLITE
- Don't download/build/cache SQLite
- NO_UPNP
- Don't download/build/cache packages needed for enabling upnp
- NO_NATPMP
- Don't download/build/cache packages needed for enabling NAT-PMP
- DEBUG
- disable some optimizations and enable more runtime checking
- HOST_ID_SALT
- Optional salt to use when generating host package ids
- BUILD_ID_SALT
- Optional salt to use when generating build package ids
- FORCE_USE_SYSTEM_CLANG
- (EXPERTS ONLY) When cross-compiling for macOS, use Clang found in the
system's
$PATH
rather than the default prebuilt release of Clang from llvm.org. Clang 8 or later is required.
Additional targets
download: run 'make download' to fetch all sources without building them
download-osx: run 'make download-osx' to fetch all sources needed for macOS builds
download-win: run 'make download-win' to fetch all sources needed for win builds
download-linux: run 'make download-linux' to fetch all sources needed for linux builds
Android
Before proceeding with an Android build one needs to get the Android SDK and use the "SDK Manager" tool to download the NDK and one or more "Platform packages" (these are Android versions and have a corresponding API level).
In order to build ANDROID_API_LEVEL
(API level corresponding to the Android version targeted, e.g. Android 9.0 Pie is 28 and its "Platform package" needs to be available) and ANDROID_TOOLCHAIN_BIN
(path to toolchain binaries depending on the platform the build is being performed on) need to be set.
API levels from 24 to 29 have been tested to work.
If the build includes Qt, environment variables ANDROID_SDK
and ANDROID_NDK
need to be set as well but can otherwise be omitted.
This is an example command for a default build with no disabled dependencies:
ANDROID_SDK=/home/user/Android/Sdk ANDROID_NDK=/home/user/Android/Sdk/ndk-bundle make HOST=aarch64-linux-android ANDROID_API_LEVEL=28 ANDROID_TOOLCHAIN_BIN=/home/user/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin
Other documentation
- description.md: General description of the depends system
- packages.md: Steps for adding packages