bitcoin/depends
fanquake 08085c764d
Merge bitcoin/bitcoin#25633: depends: don't restrict --enable-lto to non-guix cctools
7f73f422a4 depends: don't restrict --enable-lto to non-guix cctools (fanquake)
9b60690b94 cctools: fixup building with LTO (fanquake)

Pull request description:

  This wasn't actually disabling LTO support anyways, because it's enabled
  by default.

  Guix Build (x86_64):
  ```bash
  af6e0b5fd494f714a84716161352aee415700c1f50f1f08665a474dc2ed56bad  guix-build-7f73f422a49f/output/aarch64-linux-gnu/SHA256SUMS.part
  1ecdbf2b579204cf2086001df3887da2ba50cd3f7b8f735113cce8f1b634fdb2  guix-build-7f73f422a49f/output/aarch64-linux-gnu/bitcoin-7f73f422a49f-aarch64-linux-gnu-debug.tar.gz
  878ea08855dc559e62fd1932f8a54d53fc63e0ce7d587345c7326892622feee9  guix-build-7f73f422a49f/output/aarch64-linux-gnu/bitcoin-7f73f422a49f-aarch64-linux-gnu.tar.gz
  4d1d35bd329935bc74b82a78a7fb8dd39c3268d4bbb33ecd877079e49de97a88  guix-build-7f73f422a49f/output/arm-linux-gnueabihf/SHA256SUMS.part
  c0c5418dc270d716b354d2190fddde3d25794758dee45c9068e9f5aac20e5617  guix-build-7f73f422a49f/output/arm-linux-gnueabihf/bitcoin-7f73f422a49f-arm-linux-gnueabihf-debug.tar.gz
  5e13ac8cacf1042746eef7e85695469c50d6afc06dfdb5da53039175e5185b52  guix-build-7f73f422a49f/output/arm-linux-gnueabihf/bitcoin-7f73f422a49f-arm-linux-gnueabihf.tar.gz
  218b2463a07503e77711fcf0245bc642eb9ed76e4a3e8b61d66a5c76bdc25c62  guix-build-7f73f422a49f/output/arm64-apple-darwin/SHA256SUMS.part
  dd15af2b7a333f3c4b3f75abd307e1789a1629728a0ae33d8a509478ace91134  guix-build-7f73f422a49f/output/arm64-apple-darwin/bitcoin-7f73f422a49f-arm64-apple-darwin-unsigned.dmg
  5cdfd9fc347007890991c68746b1bb36e0cced57fee685337b3d079d498f687d  guix-build-7f73f422a49f/output/arm64-apple-darwin/bitcoin-7f73f422a49f-arm64-apple-darwin-unsigned.tar.gz
  80f957e78177927ace323ea90d4bad2e8d2b846b199a0dcb085c3ceae8516631  guix-build-7f73f422a49f/output/arm64-apple-darwin/bitcoin-7f73f422a49f-arm64-apple-darwin.tar.gz
  3cb9cb04db3ebf328bfabfda874fce09764f3840c98bd850d85f71892617fb99  guix-build-7f73f422a49f/output/dist-archive/bitcoin-7f73f422a49f.tar.gz
  e4e7c9d5366b658fc420c1fd3cf12bfb9863b8061c83b06fe2492e934bb75ae9  guix-build-7f73f422a49f/output/powerpc64-linux-gnu/SHA256SUMS.part
  da4ea7dd9a131901ff2f7fcd6eba573fe946ea671ae6ada418a4ceebcc4bd3b6  guix-build-7f73f422a49f/output/powerpc64-linux-gnu/bitcoin-7f73f422a49f-powerpc64-linux-gnu-debug.tar.gz
  221f6e1d5193207eed400c186c8f83747fbf90c3244cd044b36acadbed0c83a6  guix-build-7f73f422a49f/output/powerpc64-linux-gnu/bitcoin-7f73f422a49f-powerpc64-linux-gnu.tar.gz
  12d36079b330ec75209219ce58ca580ca5a5eeac64fb7ae424c64e7f3d466ee5  guix-build-7f73f422a49f/output/powerpc64le-linux-gnu/SHA256SUMS.part
  3cef0194569d6fa968e92be1d2189be4f1337272dc213c25b8d4afe6b174310c  guix-build-7f73f422a49f/output/powerpc64le-linux-gnu/bitcoin-7f73f422a49f-powerpc64le-linux-gnu-debug.tar.gz
  a8ff109153926b3240f830c3501977046b6c470b67380a01c55aea2401a1a833  guix-build-7f73f422a49f/output/powerpc64le-linux-gnu/bitcoin-7f73f422a49f-powerpc64le-linux-gnu.tar.gz
  70b3a841bb232fefe27f857ee826ea6a84f59bc781acda608bd6d9385a1ef149  guix-build-7f73f422a49f/output/riscv64-linux-gnu/SHA256SUMS.part
  841a276263877027f256c3b7ad1c5bc3ae3ad4d6a7157690daa947f6809776e2  guix-build-7f73f422a49f/output/riscv64-linux-gnu/bitcoin-7f73f422a49f-riscv64-linux-gnu-debug.tar.gz
  6cce2c36c2a53035d7ee5d285c8b4b99256772c7a9dca1739f0639ecc0bed71d  guix-build-7f73f422a49f/output/riscv64-linux-gnu/bitcoin-7f73f422a49f-riscv64-linux-gnu.tar.gz
  e910b32efebca682cf8bc3994d2c7513b16cdeb6f94cef906efb6629ec53268d  guix-build-7f73f422a49f/output/x86_64-apple-darwin/SHA256SUMS.part
  3a4bc1573d9c576184d69b953ea6a85650d4e15b71503b909ccd4fb8a69ca383  guix-build-7f73f422a49f/output/x86_64-apple-darwin/bitcoin-7f73f422a49f-x86_64-apple-darwin-unsigned.dmg
  60a114ece1d9a274d9f3d80a9633eb22d589213ba53a956f3b1138d7c8f55560  guix-build-7f73f422a49f/output/x86_64-apple-darwin/bitcoin-7f73f422a49f-x86_64-apple-darwin-unsigned.tar.gz
  b6c6eca3e81bfadfed3ddcb7830857c954c8a7b0ff458f14050f4952240ebf27  guix-build-7f73f422a49f/output/x86_64-apple-darwin/bitcoin-7f73f422a49f-x86_64-apple-darwin.tar.gz
  aab972c6f051c379a20eb694128a4df4e3737758fbca3902d28d72cd93e6d33a  guix-build-7f73f422a49f/output/x86_64-linux-gnu/SHA256SUMS.part
  b8e643eeb72cf04664462f815497cbef1443f2e113de14bc93b058d83836c7df  guix-build-7f73f422a49f/output/x86_64-linux-gnu/bitcoin-7f73f422a49f-x86_64-linux-gnu-debug.tar.gz
  3b40fb5f1341cc3b49c9eccc68fc75e1cc7e7d2c6a5664fa2f8f095290e3733a  guix-build-7f73f422a49f/output/x86_64-linux-gnu/bitcoin-7f73f422a49f-x86_64-linux-gnu.tar.gz
  96138d5f591a8ba8589eb81d2c79ee269556996ae93c6a3fc77746e101b60cab  guix-build-7f73f422a49f/output/x86_64-w64-mingw32/SHA256SUMS.part
  6ef2d9436caa550bec7defda1d769bffc2e0fe8f7acf99e2fbcefd2e9b920a64  guix-build-7f73f422a49f/output/x86_64-w64-mingw32/bitcoin-7f73f422a49f-win64-debug.zip
  91c8c3f0aec623f4183c4ebc141816dddb4482509e99812d32298f3e83da920f  guix-build-7f73f422a49f/output/x86_64-w64-mingw32/bitcoin-7f73f422a49f-win64-setup-unsigned.exe
  1de7cd32d74990cfcd4e00428c53a35742b7a480f18ae1bd60dbf91b60400947  guix-build-7f73f422a49f/output/x86_64-w64-mingw32/bitcoin-7f73f422a49f-win64-unsigned.tar.gz
  e4d4ba33bbdd8d9181c8422af31ad6127f3627c327a93cbe8245d7154b5a936c  guix-build-7f73f422a49f/output/x86_64-w64-mingw32/bitcoin-7f73f422a49f-win64.zip
  ```

  Guix Build (arm64):
  ```bash
  4d1d35bd329935bc74b82a78a7fb8dd39c3268d4bbb33ecd877079e49de97a88  guix-build-7f73f422a49f/output/arm-linux-gnueabihf/SHA256SUMS.part
  c0c5418dc270d716b354d2190fddde3d25794758dee45c9068e9f5aac20e5617  guix-build-7f73f422a49f/output/arm-linux-gnueabihf/bitcoin-7f73f422a49f-arm-linux-gnueabihf-debug.tar.gz
  5e13ac8cacf1042746eef7e85695469c50d6afc06dfdb5da53039175e5185b52  guix-build-7f73f422a49f/output/arm-linux-gnueabihf/bitcoin-7f73f422a49f-arm-linux-gnueabihf.tar.gz
  5768bc05947954f8d0caa1869edbba7a9102339d43c47a43cbc5eabdabebfd16  guix-build-7f73f422a49f/output/arm64-apple-darwin/SHA256SUMS.part
  e506d3a635364751eaeccf553bd8c8847e5a2ab4a28bb03108052ae697b49e7e  guix-build-7f73f422a49f/output/arm64-apple-darwin/bitcoin-7f73f422a49f-arm64-apple-darwin-unsigned.dmg
  76fd8b6954ead8bbbba56fbf747459019dcd2def22ab6615ce817f2fff7adcb8  guix-build-7f73f422a49f/output/arm64-apple-darwin/bitcoin-7f73f422a49f-arm64-apple-darwin-unsigned.tar.gz
  f369a59d44cd31a505faf1eefd84b9ecde91f4cb036e79d38188c9ed0f9c094c  guix-build-7f73f422a49f/output/arm64-apple-darwin/bitcoin-7f73f422a49f-arm64-apple-darwin.tar.gz
  3cb9cb04db3ebf328bfabfda874fce09764f3840c98bd850d85f71892617fb99  guix-build-7f73f422a49f/output/dist-archive/bitcoin-7f73f422a49f.tar.gz
  e4e7c9d5366b658fc420c1fd3cf12bfb9863b8061c83b06fe2492e934bb75ae9  guix-build-7f73f422a49f/output/powerpc64-linux-gnu/SHA256SUMS.part
  da4ea7dd9a131901ff2f7fcd6eba573fe946ea671ae6ada418a4ceebcc4bd3b6  guix-build-7f73f422a49f/output/powerpc64-linux-gnu/bitcoin-7f73f422a49f-powerpc64-linux-gnu-debug.tar.gz
  221f6e1d5193207eed400c186c8f83747fbf90c3244cd044b36acadbed0c83a6  guix-build-7f73f422a49f/output/powerpc64-linux-gnu/bitcoin-7f73f422a49f-powerpc64-linux-gnu.tar.gz
  12d36079b330ec75209219ce58ca580ca5a5eeac64fb7ae424c64e7f3d466ee5  guix-build-7f73f422a49f/output/powerpc64le-linux-gnu/SHA256SUMS.part
  3cef0194569d6fa968e92be1d2189be4f1337272dc213c25b8d4afe6b174310c  guix-build-7f73f422a49f/output/powerpc64le-linux-gnu/bitcoin-7f73f422a49f-powerpc64le-linux-gnu-debug.tar.gz
  a8ff109153926b3240f830c3501977046b6c470b67380a01c55aea2401a1a833  guix-build-7f73f422a49f/output/powerpc64le-linux-gnu/bitcoin-7f73f422a49f-powerpc64le-linux-gnu.tar.gz
  70b3a841bb232fefe27f857ee826ea6a84f59bc781acda608bd6d9385a1ef149  guix-build-7f73f422a49f/output/riscv64-linux-gnu/SHA256SUMS.part
  841a276263877027f256c3b7ad1c5bc3ae3ad4d6a7157690daa947f6809776e2  guix-build-7f73f422a49f/output/riscv64-linux-gnu/bitcoin-7f73f422a49f-riscv64-linux-gnu-debug.tar.gz
  6cce2c36c2a53035d7ee5d285c8b4b99256772c7a9dca1739f0639ecc0bed71d  guix-build-7f73f422a49f/output/riscv64-linux-gnu/bitcoin-7f73f422a49f-riscv64-linux-gnu.tar.gz
  e910b32efebca682cf8bc3994d2c7513b16cdeb6f94cef906efb6629ec53268d  guix-build-7f73f422a49f/output/x86_64-apple-darwin/SHA256SUMS.part
  3a4bc1573d9c576184d69b953ea6a85650d4e15b71503b909ccd4fb8a69ca383  guix-build-7f73f422a49f/output/x86_64-apple-darwin/bitcoin-7f73f422a49f-x86_64-apple-darwin-unsigned.dmg
  60a114ece1d9a274d9f3d80a9633eb22d589213ba53a956f3b1138d7c8f55560  guix-build-7f73f422a49f/output/x86_64-apple-darwin/bitcoin-7f73f422a49f-x86_64-apple-darwin-unsigned.tar.gz
  b6c6eca3e81bfadfed3ddcb7830857c954c8a7b0ff458f14050f4952240ebf27  guix-build-7f73f422a49f/output/x86_64-apple-darwin/bitcoin-7f73f422a49f-x86_64-apple-darwin.tar.gz
  aab972c6f051c379a20eb694128a4df4e3737758fbca3902d28d72cd93e6d33a  guix-build-7f73f422a49f/output/x86_64-linux-gnu/SHA256SUMS.part
  b8e643eeb72cf04664462f815497cbef1443f2e113de14bc93b058d83836c7df  guix-build-7f73f422a49f/output/x86_64-linux-gnu/bitcoin-7f73f422a49f-x86_64-linux-gnu-debug.tar.gz
  3b40fb5f1341cc3b49c9eccc68fc75e1cc7e7d2c6a5664fa2f8f095290e3733a  guix-build-7f73f422a49f/output/x86_64-linux-gnu/bitcoin-7f73f422a49f-x86_64-linux-gnu.tar.gz
  96138d5f591a8ba8589eb81d2c79ee269556996ae93c6a3fc77746e101b60cab  guix-build-7f73f422a49f/output/x86_64-w64-mingw32/SHA256SUMS.part
  6ef2d9436caa550bec7defda1d769bffc2e0fe8f7acf99e2fbcefd2e9b920a64  guix-build-7f73f422a49f/output/x86_64-w64-mingw32/bitcoin-7f73f422a49f-win64-debug.zip
  91c8c3f0aec623f4183c4ebc141816dddb4482509e99812d32298f3e83da920f  guix-build-7f73f422a49f/output/x86_64-w64-mingw32/bitcoin-7f73f422a49f-win64-setup-unsigned.exe
  1de7cd32d74990cfcd4e00428c53a35742b7a480f18ae1bd60dbf91b60400947  guix-build-7f73f422a49f/output/x86_64-w64-mingw32/bitcoin-7f73f422a49f-win64-unsigned.tar.gz
  e4d4ba33bbdd8d9181c8422af31ad6127f3627c327a93cbe8245d7154b5a936c  guix-build-7f73f422a49f/output/x86_64-w64-mingw32/bitcoin-7f73f422a49f-win64.zip
  ```

ACKs for top commit:
  hebasto:
    ACK 7f73f422a4

Tree-SHA512: 8e49bed15b9f92e9905a004c01134ebcef9d7e006c96a8bab1606b1af8a20d495e3aa9846344bac5169fee86fa611dc660cf0bd04dd07f393e5e3f1b12ad4a01
2022-08-04 08:28:13 +01:00
..
builders build: Let the depends build system define a path to dsymutil tool 2022-04-21 10:08:46 +02:00
hosts cctools: fixup building with LTO 2022-07-29 12:48:19 +01:00
packages Merge bitcoin/bitcoin#25633: depends: don't restrict --enable-lto to non-guix cctools 2022-08-04 08:28:13 +01:00
patches qt: use patch over sed for guix CROSS_LIBRARY_PATH change 2022-07-30 16:03:46 +01:00
.gitignore depends: Support for S390X targets 2019-12-05 12:12:46 -05:00
config.guess depends: latest config.guess (2021-05-24) 2021-05-26 13:28:47 +08:00
config.site.in build: Do not export PKG_CONFIG_{PATH|LIBDIR} variables 2022-07-27 10:07:34 +01:00
config.sub depends: latest config.sub (2021-04-30) 2021-05-26 13:30:18 +08:00
description.md doc: Fix whitespace errs in .md files, bitcoin.conf, Info.plist.in, and find_bdb48.m4 2019-09-17 03:21:22 -04:00
funcs.mk build: Fix libmultiprocess cross-compiling to Linux hosts 2022-05-01 10:41:32 +02:00
gen_id build: add *_STANDARD vars to depends gen_id 2022-06-17 14:44:49 +01:00
Makefile build: add *_STANDARD vars to depends gen_id 2022-06-17 14:44:49 +01:00
packages.md doc: Fix typos in packages.md 2021-11-28 18:13:52 +02:00
README.md build: add and use CXX_STANDARD in depends 2022-06-16 17:01:05 +01:00

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

Bitcoin Core's configure script by default will ignore the depends output. In order for it to pick up libraries, tools, and settings from the depends build, you must set the CONFIG_SITE environment variable to point to a config.site settings file. In the above example, a file named depends/x86_64-w64-mingw32/share/config.site will be created. To use it during compilation:

CONFIG_SITE=$PWD/depends/x86_64-w64-mingw32/share/config.site ./configure

The default install prefix when using config.site is --prefix=depends/<host-platform-triplet>, so depends build outputs will be installed in that location.

Common host-platform-triplets for cross compilation are:

  • i686-pc-linux-gnu for Linux 32 bit
  • x86_64-pc-linux-gnu for x86 Linux
  • x86_64-w64-mingw32 for Win64
  • x86_64-apple-darwin for macOS
  • arm64-apple-darwin for ARM macOS
  • arm-linux-gnueabihf for Linux ARM 32 bit
  • aarch64-linux-gnu for Linux ARM 64 bit
  • powerpc64-linux-gnu for Linux POWER 64-bit (big endian)
  • powerpc64le-linux-gnu for Linux POWER 64-bit (little endian)
  • riscv32-linux-gnu for Linux RISC-V 32 bit
  • riscv64-linux-gnu for Linux RISC-V 64 bit
  • s390x-linux-gnu for Linux S390X
  • armv7a-linux-android for Android ARM 32 bit
  • aarch64-linux-android for Android ARM 64 bit
  • x86_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 bsdmainutils cmake libz-dev python3-setuptools libtinfo5 xorriso

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

For linux (including i386, ARM) cross compilation

Common linux dependencies:

sudo apt-get install make automake cmake 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 POWER 64-bit cross compilation (there are no packages for 32-bit):

sudo apt-get install g++-powerpc64-linux-gnu binutils-powerpc64-linux-gnu g++-powerpc64le-linux-gnu binutils-powerpc64le-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

For linux S390X cross compilation:

sudo apt-get install g++-s390x-linux-gnu binutils-s390x-linux-gnu

Install the required dependencies: OpenBSD

pkg_add bash gtar

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 SDKs can be found (used by macOS)
  • FALLBACK_DOWNLOAD_PATH: If a source file can't be fetched, try here before giving up
  • C_STANDARD: Set the C standard version used. Defaults to c11.
  • CXX_STANDARD: Set the C++ standard version used. Defaults to c++17.
  • 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
  • ALLOW_HOST_PACKAGES: Packages that are missed in dependencies (due to NO_* option or build script logic) are searched for among the host system packages using pkg-config. It allows building with packages of other (newer) versions
  • MULTIPROCESS: Build libmultiprocess (experimental, requires CMake)
  • 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
  • LOG: Use file-based logging for individual packages. During a package build its log file resides in the depends directory, and the log file is printed out automatically in case of build error. After successful build log files are moved along with package archives
  • LTO: Use LTO when building packages.

If some packages are not built, for example make NO_WALLET=1, the appropriate options will be passed to bitcoin's configure. In this case, --disable-wallet.

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

Other documentation