From 339281e80807f7715f34725cc73818d950839103 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Wed, 11 Sep 2024 11:56:02 +0200 Subject: [PATCH 001/103] Bitcoin: 22c5a986e95d2bd14273465ca0e15fbe3772252 (depends: Consistent use of package variable). --- depends/packages/boost.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/depends/packages/boost.mk b/depends/packages/boost.mk index fa8d0cfa..b527177c 100644 --- a/depends/packages/boost.mk +++ b/depends/packages/boost.mk @@ -24,11 +24,11 @@ $(package)_cxxflags_linux=-fPIC endef define $(package)_preprocess_cmds - echo "using $(boost_toolset_$(host_os)) : : $($(package)_cxx) : \"$($(package)_cxxflags) $($(package)_cppflags)\" \"$($(package)_ldflags)\" \"$(boost_archiver_$(host_os))\" \"$(host_STRIP)\" \"$(host_RANLIB)\" \"$(host_WINDRES)\" : ;" > user-config.jam + echo "using $($(package)_toolset_$(host_os)) : : $($(package)_cxx) : \"$($(package)_cxxflags) $($(package)_cppflags)\" \"$($(package)_ldflags)\" \"$($(package)_archiver_$(host_os))\" \"$(host_STRIP)\" \"$(host_RANLIB)\" \"$(host_WINDRES)\" : ;" > user-config.jam endef define $(package)_config_cmds - ./bootstrap.sh --without-icu --with-libraries=$(boost_config_libraries) + ./bootstrap.sh --without-icu --with-libraries=$($(package)_config_libraries) endef define $(package)_build_cmds From af3241ef2414cf7296510a7d446569be2af41fd6 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Wed, 11 Sep 2024 13:36:12 +0200 Subject: [PATCH 002/103] Bitcoin: 0e519fe28425b0148fe0d026bd084ecd244f566 (build: Fix behavior when ALLOW_HOST_PACKAGES unset). --- depends/config.site.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/depends/config.site.in b/depends/config.site.in index c5731e52..fb9bf713 100644 --- a/depends/config.site.in +++ b/depends/config.site.in @@ -59,7 +59,7 @@ PKG_CONFIG="`which pkg-config` --static" # avoid ruining the cache. Sigh. export PKG_CONFIG_PATH=$depends_prefix/share/pkgconfig:$depends_prefix/lib/pkgconfig if test -z "@allow_host_packages@"; then - export PKGCONFIG_LIBDIR= + export PKG_CONFIG_LIBDIR=$depends_prefix/lib/pkgconfig fi CPPFLAGS="-I$depends_prefix/include/ $CPPFLAGS" From 31550029911c892944b6a3b8645fa2ef67e0283d Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Wed, 11 Sep 2024 13:38:09 +0200 Subject: [PATCH 003/103] Bitcoin: 1de8c067c74cd171144c8a900a8a20efe3072c4 (depends: clang 6.0.1). --- depends/packages/native_cctools.mk | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/depends/packages/native_cctools.mk b/depends/packages/native_cctools.mk index a065256c..833787a2 100644 --- a/depends/packages/native_cctools.mk +++ b/depends/packages/native_cctools.mk @@ -4,11 +4,11 @@ $(package)_download_path=https://github.com/theuni/cctools-port/archive $(package)_file_name=$($(package)_version).tar.gz $(package)_sha256_hash=a09c9ba4684670a0375e42d9d67e7f12c1f62581a27f28f7c825d6d7032ccc6a $(package)_build_subdir=cctools -$(package)_clang_version=3.7.1 -$(package)_clang_download_path=https://llvm.org/releases/$($(package)_clang_version) +$(package)_clang_version=6.0.1 +$(package)_clang_download_path=https://releases.llvm.org/$($(package)_clang_version) $(package)_clang_download_file=clang+llvm-$($(package)_clang_version)-x86_64-linux-gnu-ubuntu-14.04.tar.xz $(package)_clang_file_name=clang-llvm-$($(package)_clang_version)-x86_64-linux-gnu-ubuntu-14.04.tar.xz -$(package)_clang_sha256_hash=99b28a6b48e793705228a390471991386daa33a9717cd9ca007fcdde69608fd9 +$(package)_clang_sha256_hash=fa5416553ca94a8c071a27134c094a5fb736fe1bd0ecc5ef2d9bc02754e1bef0 $(package)_extra_sources=$($(package)_clang_file_name) define $(package)_fetch_cmds @@ -21,12 +21,9 @@ define $(package)_extract_cmds echo "$($(package)_sha256_hash) $($(package)_source)" > $($(package)_extract_dir)/.$($(package)_file_name).hash && \ echo "$($(package)_clang_sha256_hash) $($(package)_source_dir)/$($(package)_clang_file_name)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \ $(build_SHA256SUM) -c $($(package)_extract_dir)/.$($(package)_file_name).hash && \ - mkdir -p toolchain/bin toolchain/lib/clang/3.5/include && \ + mkdir -p toolchain/bin toolchain/lib/clang/$($(package)_clang_version)/include && \ tar --no-same-owner --strip-components=1 -C toolchain -xf $($(package)_source_dir)/$($(package)_clang_file_name) && \ rm -f toolchain/lib/libc++abi.so* && \ - echo "#!/bin/sh" > toolchain/bin/$(host)-dsymutil && \ - echo "exit 0" >> toolchain/bin/$(host)-dsymutil && \ - chmod +x toolchain/bin/$(host)-dsymutil && \ tar --no-same-owner --strip-components=1 -xf $($(package)_source) endef From d260f242c005efa2779c59a25d499eb909f11ace Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Wed, 11 Sep 2024 13:39:10 +0200 Subject: [PATCH 004/103] Bitcoin: ca5055a5aa07aba81a87cf12f6f0526a63c423b (depends: native_cctools 921, ld64 409.12, libtapi 1000.10.8). --- depends/hosts/darwin.mk | 5 ++--- depends/packages/native_cctools.mk | 36 +++++++++++++++++++++--------- depends/packages/qt.mk | 1 - depends/patches/qt/mac-qmake.conf | 2 +- 4 files changed, 29 insertions(+), 15 deletions(-) diff --git a/depends/hosts/darwin.mk b/depends/hosts/darwin.mk index 1f88c209..3968a761 100644 --- a/depends/hosts/darwin.mk +++ b/depends/hosts/darwin.mk @@ -1,9 +1,8 @@ OSX_MIN_VERSION=10.12 OSX_SDK_VERSION=10.11 OSX_SDK=$(SDK_PATH)/MacOSX$(OSX_SDK_VERSION).sdk -LD64_VERSION=253.9 -darwin_CC=clang -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -mlinker-version=$(LD64_VERSION) -darwin_CXX=clang++ -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -mlinker-version=$(LD64_VERSION) -stdlib=libc++ +darwin_CC=clang -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) +darwin_CXX=clang++ -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -stdlib=libc++ darwin_CFLAGS=-pipe darwin_CXXFLAGS=$(darwin_CFLAGS) diff --git a/depends/packages/native_cctools.mk b/depends/packages/native_cctools.mk index 833787a2..4195230b 100644 --- a/depends/packages/native_cctools.mk +++ b/depends/packages/native_cctools.mk @@ -1,42 +1,55 @@ package=native_cctools -$(package)_version=807d6fd1be5d2224872e381870c0a75387fe05e6 -$(package)_download_path=https://github.com/theuni/cctools-port/archive +$(package)_version=3764b223c011574971ee3ae09ce968ba5dc2f00f +$(package)_download_path=https://github.com/tpoechtrager/cctools-port/archive $(package)_file_name=$($(package)_version).tar.gz -$(package)_sha256_hash=a09c9ba4684670a0375e42d9d67e7f12c1f62581a27f28f7c825d6d7032ccc6a +$(package)_sha256_hash=3e35907bf376269a844df08e03cbb43e345c88125374f2228e03724b5f9a2a04 $(package)_build_subdir=cctools $(package)_clang_version=6.0.1 $(package)_clang_download_path=https://releases.llvm.org/$($(package)_clang_version) $(package)_clang_download_file=clang+llvm-$($(package)_clang_version)-x86_64-linux-gnu-ubuntu-14.04.tar.xz $(package)_clang_file_name=clang-llvm-$($(package)_clang_version)-x86_64-linux-gnu-ubuntu-14.04.tar.xz $(package)_clang_sha256_hash=fa5416553ca94a8c071a27134c094a5fb736fe1bd0ecc5ef2d9bc02754e1bef0 + +$(package)_libtapi_version=3efb201881e7a76a21e0554906cf306432539cef +$(package)_libtapi_download_path=https://github.com/tpoechtrager/apple-libtapi/archive +$(package)_libtapi_download_file=$($(package)_libtapi_version).tar.gz +$(package)_libtapi_file_name=$($(package)_libtapi_version).tar.gz +$(package)_libtapi_sha256_hash=380c1ca37cfa04a8699d0887a8d3ee1ad27f3d08baba78887c73b09485c0fbd3 + $(package)_extra_sources=$($(package)_clang_file_name) +$(package)_extra_sources += $($(package)_libtapi_file_name) define $(package)_fetch_cmds $(call fetch_file,$(package),$($(package)_download_path),$($(package)_download_file),$($(package)_file_name),$($(package)_sha256_hash)) && \ -$(call fetch_file,$(package),$($(package)_clang_download_path),$($(package)_clang_download_file),$($(package)_clang_file_name),$($(package)_clang_sha256_hash)) +$(call fetch_file,$(package),$($(package)_clang_download_path),$($(package)_clang_download_file),$($(package)_clang_file_name),$($(package)_clang_sha256_hash)) && \ +$(call fetch_file,$(package),$($(package)_libtapi_download_path),$($(package)_libtapi_download_file),$($(package)_libtapi_file_name),$($(package)_libtapi_sha256_hash)) endef define $(package)_extract_cmds mkdir -p $($(package)_extract_dir) && \ echo "$($(package)_sha256_hash) $($(package)_source)" > $($(package)_extract_dir)/.$($(package)_file_name).hash && \ echo "$($(package)_clang_sha256_hash) $($(package)_source_dir)/$($(package)_clang_file_name)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \ + echo "$($(package)_libtapi_sha256_hash) $($(package)_source_dir)/$($(package)_libtapi_file_name)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \ $(build_SHA256SUM) -c $($(package)_extract_dir)/.$($(package)_file_name).hash && \ mkdir -p toolchain/bin toolchain/lib/clang/$($(package)_clang_version)/include && \ + mkdir -p libtapi && \ + tar --no-same-owner --strip-components=1 -C libtapi -xf $($(package)_source_dir)/$($(package)_libtapi_file_name) && \ tar --no-same-owner --strip-components=1 -C toolchain -xf $($(package)_source_dir)/$($(package)_clang_file_name) && \ rm -f toolchain/lib/libc++abi.so* && \ tar --no-same-owner --strip-components=1 -xf $($(package)_source) endef define $(package)_set_vars -$(package)_config_opts=--target=$(host) --disable-lto-support -$(package)_ldflags+=-Wl,-rpath=\\$$$$$$$$\$$$$$$$$ORIGIN/../lib -$(package)_cc=$($(package)_extract_dir)/toolchain/bin/clang -$(package)_cxx=$($(package)_extract_dir)/toolchain/bin/clang++ + $(package)_config_opts=--target=$(host) --disable-lto-support --with-libtapi=$($(package)_extract_dir) + $(package)_ldflags+=-Wl,-rpath=\\$$$$$$$$\$$$$$$$$ORIGIN/../lib + $(package)_cc=$($(package)_extract_dir)/toolchain/bin/clang + $(package)_cxx=$($(package)_extract_dir)/toolchain/bin/clang++ endef define $(package)_preprocess_cmds - cd $($(package)_build_subdir); ./autogen.sh && \ - sed -i.old "/define HAVE_PTHREADS/d" ld64/src/ld/InputFiles.h + CC=$($(package)_cc) CXX=$($(package)_cxx) INSTALLPREFIX=$($(package)_extract_dir) ./libtapi/build.sh && \ + CC=$($(package)_cc) CXX=$($(package)_cxx) INSTALLPREFIX=$($(package)_extract_dir) ./libtapi/install.sh && \ + sed -i.old "/define HAVE_PTHREADS/d" $($(package)_build_subdir)/ld64/src/ld/InputFiles.h endef define $(package)_config_cmds @@ -49,6 +62,9 @@ endef define $(package)_stage_cmds $(MAKE) DESTDIR=$($(package)_staging_dir) install && \ + mkdir -p $($(package)_staging_prefix_dir)/lib/ && \ + cd $($(package)_extract_dir) && \ + cp lib/libtapi.so.6 $($(package)_staging_prefix_dir)/lib/ && \ cd $($(package)_extract_dir)/toolchain && \ mkdir -p $($(package)_staging_prefix_dir)/lib/clang/$($(package)_clang_version)/include && \ mkdir -p $($(package)_staging_prefix_dir)/bin $($(package)_staging_prefix_dir)/include && \ diff --git a/depends/packages/qt.mk b/depends/packages/qt.mk index f22746ae..42f35302 100644 --- a/depends/packages/qt.mk +++ b/depends/packages/qt.mk @@ -121,7 +121,6 @@ $(package)_config_opts_darwin += -device-option MAC_SDK_VERSION=$(OSX_SDK_VERSIO $(package)_config_opts_darwin += -device-option CROSS_COMPILE="$(host)-" $(package)_config_opts_darwin += -device-option MAC_MIN_VERSION=$(OSX_MIN_VERSION) $(package)_config_opts_darwin += -device-option MAC_TARGET=$(host) -$(package)_config_opts_darwin += -device-option MAC_LD64_VERSION=$(LD64_VERSION) endif $(package)_config_opts_linux = -qt-xkbcommon-x11 diff --git a/depends/patches/qt/mac-qmake.conf b/depends/patches/qt/mac-qmake.conf index 337d0eb9..4cd96df2 100644 --- a/depends/patches/qt/mac-qmake.conf +++ b/depends/patches/qt/mac-qmake.conf @@ -18,7 +18,7 @@ QMAKE_APPLE_DEVICE_ARCHS=x86_64 !host_build: QMAKE_CFLAGS += -target $${MAC_TARGET} !host_build: QMAKE_OBJECTIVE_CFLAGS += $$QMAKE_CFLAGS !host_build: QMAKE_CXXFLAGS += $$QMAKE_CFLAGS -!host_build: QMAKE_LFLAGS += -target $${MAC_TARGET} -mlinker-version=$${MAC_LD64_VERSION} +!host_build: QMAKE_LFLAGS += -target $${MAC_TARGET} QMAKE_AR = $${CROSS_COMPILE}ar cq QMAKE_RANLIB=$${CROSS_COMPILE}ranlib QMAKE_LIBTOOL=$${CROSS_COMPILE}libtool From a0c5c5eb5e596f600cef2bb6b6fc639b9e5eedd0 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Wed, 11 Sep 2024 13:49:27 +0200 Subject: [PATCH 005/103] Bitcoin: 7e2104433cd0905ccf94632511b3ca0ce5b0463 (build: use macOS 10.14 SDK). --- ci/test/00_setup_env_mac.sh | 2 +- contrib/gitian-build.py | 2 +- contrib/gitian-descriptors/gitian-osx.yml | 4 +- contrib/macdeploy/README.md | 136 ++++++++++++++++++++-- depends/hosts/darwin.mk | 2 +- doc/build-osx.md | 92 --------------- 6 files changed, 133 insertions(+), 105 deletions(-) diff --git a/ci/test/00_setup_env_mac.sh b/ci/test/00_setup_env_mac.sh index ebf0274f..cdd99daf 100644 --- a/ci/test/00_setup_env_mac.sh +++ b/ci/test/00_setup_env_mac.sh @@ -8,7 +8,7 @@ export LC_ALL=C.UTF-8 export HOST=x86_64-apple-darwin16 export PACKAGES="cmake imagemagick libcap-dev librsvg2-bin libz-dev libbz2-dev libtiff-tools python3-dev python3-setuptools" -export OSX_SDK=10.11 +export OSX_SDK=10.14 export RUN_UNIT_TESTS=false export RUN_FUNCTIONAL_TESTS=false export GOAL="deploy" diff --git a/contrib/gitian-build.py b/contrib/gitian-build.py index 6dd3f172..0842ba59 100755 --- a/contrib/gitian-build.py +++ b/contrib/gitian-build.py @@ -207,7 +207,7 @@ def main(): args.macos = 'm' in args.os # Disable for MacOS if no SDK found - if args.macos and not os.path.isfile('gitian-builder/inputs/MacOSX10.11.sdk.tar.gz'): + if args.macos and not os.path.isfile('gitian-builder/inputs/MacOSX10.14.sdk.tar.gz'): print('Cannot build for MacOS, SDK does not exist. Will build for other OSes') args.macos = False diff --git a/contrib/gitian-descriptors/gitian-osx.yml b/contrib/gitian-descriptors/gitian-osx.yml index 606003d5..ad78520c 100644 --- a/contrib/gitian-descriptors/gitian-osx.yml +++ b/contrib/gitian-descriptors/gitian-osx.yml @@ -32,7 +32,7 @@ remotes: - "url": "https://github.com/aurarad/auroracoin.git" "dir": "auroracoin" files: -- "MacOSX10.11.sdk.tar.gz" +- "MacOSX10.14.sdk.tar.gz" script: | set -e -o pipefail @@ -89,7 +89,7 @@ script: | BASEPREFIX=`pwd`/depends mkdir -p ${BASEPREFIX}/SDKs - tar -C ${BASEPREFIX}/SDKs -xf ${BUILD_DIR}/MacOSX10.11.sdk.tar.gz + tar -C ${BASEPREFIX}/SDKs -xf ${BUILD_DIR}/MacOSX10.14.sdk.tar.gz # Build dependencies for each host for i in $HOSTS; do diff --git a/contrib/macdeploy/README.md b/contrib/macdeploy/README.md index d2bcc0c2..a614322e 100644 --- a/contrib/macdeploy/README.md +++ b/contrib/macdeploy/README.md @@ -1,15 +1,135 @@ -### MacDeploy ### +# MacOS Deployment -For Snow Leopard (which uses [Python 2.6](http://www.python.org/download/releases/2.6/)), you will need the param_parser package: +The `macdeployqtplus` script should not be run manually. Instead, after building as usual: - sudo easy_install argparse +```bash +make deploy +``` -This script should not be run manually, instead, after building as usual: +During the deployment process, the disk image window will pop up briefly +when the fancy settings are applied. This is normal, please do not interfere, +the process will unmount the DMG and cleanup before finishing. - make deploy +When complete, it will have produced `Auroracoin-Qt.dmg`. -During the process, the disk image window will pop up briefly where the fancy -settings are applied. This is normal, please do not interfere. +## SDK Extraction -When finished, it will produce `Auroracoin-Qt.dmg`. +`Xcode.app` is packaged in a `.xip` archive. +This makes the SDK less-trivial to extract on non-macOS machines. +One approach (tested on Debian Buster) is outlined below: +```bash + +apt install clang cpio git liblzma-dev libxml2-dev libssl-dev make + +git clone https://github.com/tpoechtrager/xar +pushd xar/xar +./configure +make +make install +popd + +git clone https://github.com/NiklasRosenstein/pbzx +pushd pbzx +clang -llzma -lxar pbzx.c -o pbzx -Wl,-rpath=/usr/local/lib +popd + +xar -xf Xcode_10.2.1.xip -C . + +./pbzx/pbzx -n Content | cpio -i + +find Xcode.app -type d -name MacOSX.sdk -execdir sh -c 'tar -c MacOSX.sdk/ | gzip -9n > /MacOSX10.14.sdk.tar.gz' \; +``` + +on macOS the process is more straightforward: + +```bash +xip -x Xcode_10.2.1.xip +tar -C Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/ -czf MacOSX10.14.sdk.tar.gz MacOSX.sdk +``` + +Our previously used macOS SDK (`MacOSX10.11.sdk`) can be extracted from +[Xcode 7.3.1 dmg](https://developer.apple.com/devcenter/download.action?path=/Developer_Tools/Xcode_7.3.1/Xcode_7.3.1.dmg). +The script [`extract-osx-sdk.sh`](./extract-osx-sdk.sh) automates this. First +ensure the DMG file is in the current directory, and then run the script. You +may wish to delete the `intermediate 5.hfs` file and `MacOSX10.11.sdk` (the +directory) when you've confirmed the extraction succeeded. + +```bash +apt-get install p7zip-full sleuthkit +contrib/macdeploy/extract-osx-sdk.sh +rm -rf 5.hfs MacOSX10.11.sdk +``` + +## Deterministic macOS DMG Notes +Working macOS DMGs are created in Linux by combining a recent `clang`, the Apple +`binutils` (`ld`, `ar`, etc) and DMG authoring tools. + +Apple uses `clang` extensively for development and has upstreamed the necessary +functionality so that a vanilla clang can take advantage. It supports the use of `-F`, +`-target`, `-mmacosx-version-min`, and `--sysroot`, which are all necessary when +building for macOS. + +Apple's version of `binutils` (called `cctools`) contains lots of functionality missing in the +FSF's `binutils`. In addition to extra linker options for frameworks and sysroots, several +other tools are needed as well such as `install_name_tool`, `lipo`, and `nmedit`. These +do not build under Linux, so they have been patched to do so. The work here was used as +a starting point: [mingwandroid/toolchain4](https://github.com/mingwandroid/toolchain4). + +In order to build a working toolchain, the following source packages are needed from +Apple: `cctools`, `dyld`, and `ld64`. + +These tools inject timestamps by default, which produce non-deterministic binaries. The +`ZERO_AR_DATE` environment variable is used to disable that. + +This version of `cctools` has been patched to use the current version of `clang`'s headers +and its `libLTO.so` rather than those from `llvmgcc`, as it was originally done in `toolchain4`. + +To complicate things further, all builds must target an Apple SDK. These SDKs are free to +download, but not redistributable. To obtain it, register for an Apple Developer Account, +then download [Xcode 10.2.1](https://download.developer.apple.com/Developer_Tools/Xcode_10.2.1/Xcode_10.2.1.xip). + +This file is many gigabytes in size, but most (but not all) of what we need is +contained only in a single directory: + +```bash +Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk +``` + +See the SDK Extraction notes above for how to obtain it. + +The Gitian descriptors build 2 sets of files: Linux tools, then Apple binaries which are +created using these tools. The build process has been designed to avoid including the +SDK's files in Gitian's outputs. All interim tarballs are fully deterministic and may be freely +redistributed. + +`genisoimage` is used to create the initial DMG. It is not deterministic as-is, so it has been +patched. A system `genisoimage` will work fine, but it will not be deterministic because +the file-order will change between invocations. The patch can be seen here: [cdrkit-deterministic.patch](https://github.com/bitcoin/bitcoin/blob/master/depe +No effort was made to fix this cleanly, so it likely leaks memory badly, however it's only used for +a single invocation, so that's no real concern. + +`genisoimage` cannot compress DMGs, so afterwards, the DMG tool from the +`libdmg-hfsplus` project is used to compress it. There are several bugs in this tool and its +maintainer has seemingly abandoned the project. + +The DMG tool has the ability to create DMGs from scratch as well, but this functionality is +broken. Only the compression feature is currently used. Ideally, the creation could be fixed +and `genisoimage` would no longer be necessary. + +Background images and other features can be added to DMG files by inserting a +`.DS_Store` before creation. This is generated by the script `contrib/macdeploy/custom_dsstore.py`. + +As of OS X 10.9 Mavericks, using an Apple-blessed key to sign binaries is a requirement in +order to satisfy the new Gatekeeper requirements. Because this private key cannot be +shared, we'll have to be a bit creative in order for the build process to remain somewhat +deterministic. Here's how it works: + +- Builders use Gitian to create an unsigned release. This outputs an unsigned DMG which + users may choose to bless and run. It also outputs an unsigned app structure in the form + of a tarball, which also contains all of the tools that have been previously (deterministically) + built in order to create a final DMG. +- The Apple keyholder uses this unsigned app to create a detached signature, using the + script that is also included there. Detached signatures are available from this [repository](https://github.com/bitcoin-core/bitcoin-detached-sigs). +- Builders feed the unsigned app + detached signature back into Gitian. It uses the + pre-built tools to recombine the pieces into a deterministic DMG. \ No newline at end of file diff --git a/depends/hosts/darwin.mk b/depends/hosts/darwin.mk index 3968a761..1bc4fb81 100644 --- a/depends/hosts/darwin.mk +++ b/depends/hosts/darwin.mk @@ -1,5 +1,5 @@ OSX_MIN_VERSION=10.12 -OSX_SDK_VERSION=10.11 +OSX_SDK_VERSION=10.14 OSX_SDK=$(SDK_PATH)/MacOSX$(OSX_SDK_VERSION).sdk darwin_CC=clang -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) darwin_CXX=clang++ -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -stdlib=libc++ diff --git a/doc/build-osx.md b/doc/build-osx.md index bb93f97d..36caa0e7 100644 --- a/doc/build-osx.md +++ b/doc/build-osx.md @@ -112,95 +112,3 @@ tail -f $HOME/Library/Application\ Support/Auroracoin/debug.log * Tested on OS X 10.12 Sierra through macOS 10.15 Catalina on 64-bit Intel processors only. * Building with downloaded Qt binaries is not officially supported. See the notes in [#7714](https://github.com/bitcoin/bitcoin/issues/7714). - -## Deterministic macOS DMG Notes -Working macOS DMGs are created in Linux by combining a recent `clang`, the Apple -`binutils` (`ld`, `ar`, etc) and DMG authoring tools. - -Apple uses `clang` extensively for development and has upstreamed the necessary -functionality so that a vanilla clang can take advantage. It supports the use of `-F`, -`-target`, `-mmacosx-version-min`, and `--sysroot`, which are all necessary when -building for macOS. - -Apple's version of `binutils` (called `cctools`) contains lots of functionality missing in the -FSF's `binutils`. In addition to extra linker options for frameworks and sysroots, several -other tools are needed as well such as `install_name_tool`, `lipo`, and `nmedit`. These -do not build under Linux, so they have been patched to do so. The work here was used as -a starting point: [mingwandroid/toolchain4](https://github.com/mingwandroid/toolchain4). - -In order to build a working toolchain, the following source packages are needed from -Apple: `cctools`, `dyld`, and `ld64`. - -These tools inject timestamps by default, which produce non-deterministic binaries. The -`ZERO_AR_DATE` environment variable is used to disable that. - -This version of `cctools` has been patched to use the current version of `clang`'s headers -and its `libLTO.so` rather than those from `llvmgcc`, as it was originally done in `toolchain4`. - -To complicate things further, all builds must target an Apple SDK. These SDKs are free to -download, but not redistributable. To obtain it, register for an Apple Developer Account, -then download the [Xcode 7.3.1 dmg](https://developer.apple.com/devcenter/download.action?path=/Developer_Tools/Xcode_7.3.1/Xcode_7.3.1.dmg). - -This file is several gigabytes in size, but only a single directory inside is needed: -``` -Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -``` - -Unfortunately, the usual Linux tools (7zip, hpmount, loopback mount) are incapable of -opening this file. To create a tarball suitable for Gitian input, there are two options: - -Using macOS, you can mount the DMG, and then create it with: -```shell -hdiutil attach Xcode_7.3.1.dmg -tar -C /Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/ -czf MacOSX10.11.sdk.tar.gz MacOSX10.11.sdk -``` - -Alternatively, you can use 7zip and SleuthKit to extract the files one by one. The script -[`extract-osx-sdk.sh`](./../contrib/macdeploy/extract-osx-sdk.sh) automates this. First -ensure the DMG file is in the current directory, and then run the script. You may wish to -delete the `intermediate 5.hfs` file and `MacOSX10.11.sdk` (the directory) when you've -confirmed the extraction succeeded. - -```shell -apt-get install p7zip-full sleuthkit -contrib/macdeploy/extract-osx-sdk.sh -rm -rf 5.hfs MacOSX10.11.sdk -``` - -The Gitian descriptors build 2 sets of files: Linux tools, then Apple binaries which are -created using these tools. The build process has been designed to avoid including the -SDK's files in Gitian's outputs. All interim tarballs are fully deterministic and may be freely -redistributed. - -`genisoimage` is used to create the initial DMG. It is not deterministic as-is, so it has been -patched. A system `genisoimage` will work fine, but it will not be deterministic because -the file-order will change between invocations. The patch can be seen here: [theuni/osx-cross-depends](https://raw.githubusercontent.com/theuni/osx-cross-depends/master/patches/cdrtools/genisoimage.diff). -No effort was made to fix this cleanly, so it likely leaks memory badly. But it's only used for -a single invocation, so that's no real concern. - -`genisoimage` cannot compress DMGs, so afterwards, the DMG tool from the -`libdmg-hfsplus` project is used to compress it. There are several bugs in this tool and its -maintainer has seemingly abandoned the project. It has been forked and is available -(with fixes) here: [theuni/libdmg-hfsplus](https://github.com/theuni/libdmg-hfsplus). - -The DMG tool has the ability to create DMGs from scratch as well, but this functionality is -broken. Only the compression feature is currently used. Ideally, the creation could be fixed -and `genisoimage` would no longer be necessary. - -Background images and other features can be added to DMG files by inserting a -`.DS_Store` before creation. This is generated by the script -`contrib/macdeploy/custom_dsstore.py`. - -As of OS X 10.9 Mavericks, using an Apple-blessed key to sign binaries is a requirement in -order to satisfy the new Gatekeeper requirements. Because this private key cannot be -shared, we'll have to be a bit creative in order for the build process to remain somewhat -deterministic. Here's how it works: - -- Builders use Gitian to create an unsigned release. This outputs an unsigned DMG which - users may choose to bless and run. It also outputs an unsigned app structure in the form - of a tarball, which also contains all of the tools that have been previously (deterministically) - built in order to create a final DMG. -- The Apple keyholder uses this unsigned app to create a detached signature, using the - script that is also included there. Detached signatures are available from this [repository](https://github.com/bitcoin-core/bitcoin-detached-sigs). -- Builders feed the unsigned app + detached signature back into Gitian. It uses the - pre-built tools to recombine the pieces into a deterministic DMG. From b840f25d1fb0319ebe40b9c19c16035b3490e574 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Wed, 11 Sep 2024 13:50:45 +0200 Subject: [PATCH 006/103] Bitcoin: cb9e88e73a042ff4e1c83289a6f8fa1db03fb09 (build: don't embed a build-id when building libdmg-hfsplus). --- depends/packages/native_libdmg-hfsplus.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/depends/packages/native_libdmg-hfsplus.mk b/depends/packages/native_libdmg-hfsplus.mk index 8493f1d9..c0f0ce74 100644 --- a/depends/packages/native_libdmg-hfsplus.mk +++ b/depends/packages/native_libdmg-hfsplus.mk @@ -12,7 +12,7 @@ define $(package)_preprocess_cmds endef define $(package)_config_cmds - cmake -DCMAKE_INSTALL_PREFIX:PATH=$(build_prefix) .. + cmake -DCMAKE_INSTALL_PREFIX:PATH=$(build_prefix) -DCMAKE_C_FLAGS="-Wl,--build-id=none" .. endef define $(package)_build_cmds From cf5cb894cb9d12d12256da06f928696749cc0948 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Wed, 11 Sep 2024 13:52:05 +0200 Subject: [PATCH 007/103] Bitcoin: fa55a2554c2661b8f2a759044d5ac85c9979d9c (depends: Remove reference to win32). --- depends/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/depends/README.md b/depends/README.md index ddbcd351..33c4d3d4 100644 --- a/depends/README.md +++ b/depends/README.md @@ -41,7 +41,7 @@ No other options are needed, the paths are automatically configured. sudo apt-get install curl librsvg2-bin libtiff-tools bsdmainutils cmake imagemagick libcap-dev libz-dev libbz2-dev python3-setuptools -#### For Win32/Win64 cross compilation +#### For Win64 cross compilation - see [build-windows.md](../doc/build-windows.md#cross-compilation-for-ubuntu-and-windows-subsystem-for-linux) From f816e98aaf5a17a14b6e507654418d36065a2513 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Fri, 20 Sep 2024 10:35:07 +0200 Subject: [PATCH 008/103] Bitcoin: 1d0a87e712a6253ef3f9b06a9611fd8e113401d (build: remove chrono package from depends Boost). --- depends/packages/boost.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/depends/packages/boost.mk b/depends/packages/boost.mk index b527177c..98c74cac 100644 --- a/depends/packages/boost.mk +++ b/depends/packages/boost.mk @@ -18,7 +18,7 @@ $(package)_config_opts_i686_linux=address-model=32 architecture=x86 $(package)_toolset_$(host_os)=gcc $(package)_archiver_$(host_os)=$($(package)_ar) $(package)_toolset_darwin=clang-darwin -$(package)_config_libraries=chrono,filesystem,system,thread,test +$(package)_config_libraries=filesystem,system,thread,test $(package)_cxxflags=-std=c++11 -fvisibility=hidden $(package)_cxxflags_linux=-fPIC endef From a07ce3cee5ec00c2ff86439e1d256b7c87d5df59 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Fri, 20 Sep 2024 10:36:58 +0200 Subject: [PATCH 009/103] Bitcoin: 492971de35bab26346545f68365872211f458b0 (build: Fix mingw pkgconfig file and dependency naming). --- depends/patches/qt/fix_qt_pkgconfig.patch | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/depends/patches/qt/fix_qt_pkgconfig.patch b/depends/patches/qt/fix_qt_pkgconfig.patch index 34302a9f..8c722ffb 100644 --- a/depends/patches/qt/fix_qt_pkgconfig.patch +++ b/depends/patches/qt/fix_qt_pkgconfig.patch @@ -1,11 +1,23 @@ --- old/qtbase/mkspecs/features/qt_module.prf +++ new/qtbase/mkspecs/features/qt_module.prf -@@ -245,7 +245,7 @@ +@@ -264,7 +264,7 @@ load(qt_targets) # this builds on top of qt_common -!internal_module:!lib_bundle:if(unix|mingw) { -+unix|mingw { ++if(unix|mingw):!if(darwin:debug_and_release:CONFIG(debug, debug|release)) { CONFIG += create_pc QMAKE_PKGCONFIG_DESTDIR = pkgconfig host_build: \ +@@ -274,9 +274,9 @@ + QMAKE_PKGCONFIG_INCDIR = $$[QT_INSTALL_HEADERS/raw] + QMAKE_PKGCONFIG_CFLAGS = -I${includedir}/$$MODULE_INCNAME + QMAKE_PKGCONFIG_NAME = $$replace(TARGET, ^Qt, "Qt$$QT_MAJOR_VERSION ") +- QMAKE_PKGCONFIG_FILE = $$replace(TARGET, ^Qt, Qt$$QT_MAJOR_VERSION) ++ QMAKE_PKGCONFIG_FILE = $$replace(TARGET, ^Qt, Qt$$QT_MAJOR_VERSION)$$qtPlatformTargetSuffix() + for(i, MODULE_DEPENDS): \ +- QMAKE_PKGCONFIG_REQUIRES += $$replace(QT.$${i}.name, ^Qt, Qt$$section(QT.$${i}.VERSION, ., 0, 0)) ++ QMAKE_PKGCONFIG_REQUIRES += $$replace(QT.$${i}.name, ^Qt, Qt$$section(QT.$${i}.VERSION, ., 0, 0))$$qtPlatformTargetSuffix() + isEmpty(QMAKE_PKGCONFIG_DESCRIPTION): \ + QMAKE_PKGCONFIG_DESCRIPTION = $$replace(TARGET, ^Qt, "Qt ") module + pclib_replace.match = $$lib_replace.match From 4f5780324250a1d078a7f9d666d8e13fd5437ce0 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Fri, 20 Sep 2024 10:47:11 +0200 Subject: [PATCH 010/103] Bitcoin: ddbb41931019ed4226af3df37874c7eb7cf570f (build: Use pkg-config in BITCOIN_QT_CONFIGURE for all hosts). --- build-aux/m4/auroracoin_qt.m4 | 182 +--------------------------------- configure.ac | 2 +- depends/config.site.in | 9 -- 3 files changed, 6 insertions(+), 187 deletions(-) diff --git a/build-aux/m4/auroracoin_qt.m4 b/build-aux/m4/auroracoin_qt.m4 index dac38802..0edafcca 100644 --- a/build-aux/m4/auroracoin_qt.m4 +++ b/build-aux/m4/auroracoin_qt.m4 @@ -80,25 +80,12 @@ AC_DEFUN([AURORACOIN_QT_INIT],[ AC_SUBST(QT_TRANSLATION_DIR,$qt_translation_path) ]) -dnl Find the appropriate version of Qt libraries and includes. -dnl Inputs: $1: Whether or not pkg-config should be used. yes|no. Default: yes. -dnl Inputs: $2: If $1 is "yes" and --with-gui=auto, which qt version should be -dnl tried first. -dnl Outputs: See _AURORACOIN_QT_FIND_LIBS_* +dnl Find Qt libraries and includes. +dnl Outputs: See _AURORACOIN_QT_FIND_LIBS dnl Outputs: Sets variables for all qt-related tools. dnl Outputs: auroracoin_enable_qt, auroracoin_enable_qt_dbus, auroracoin_enable_qt_test AC_DEFUN([AURORACOIN_QT_CONFIGURE],[ - use_pkgconfig=$1 - - if test "x$use_pkgconfig" = x; then - use_pkgconfig=yes - fi - - if test "x$use_pkgconfig" = xyes; then - AURORACOIN_QT_CHECK([_AURORACOIN_QT_FIND_LIBS_WITH_PKGCONFIG]) - else - AURORACOIN_QT_CHECK([_AURORACOIN_QT_FIND_LIBS_WITHOUT_PKGCONFIG]) - fi + AURORACOIN_QT_CHECK([_AURORACOIN_QT_FIND_LIBS]) dnl This is ugly and complicated. Yuck. Works as follows: dnl For Qt5, we can check a header to find out whether Qt is build @@ -135,7 +122,7 @@ AC_DEFUN([AURORACOIN_QT_CONFIGURE],[ CXXFLAGS=$TEMP_CXXFLAGS ]) - if test "x$use_pkgconfig$qt_bin_path" = xyes; then + if test "x$qt_bin_path" = x; then qt_bin_path="`$PKG_CONFIG --variable=host_bins Qt5Core 2>/dev/null`" fi @@ -251,47 +238,6 @@ dnl All macros below are internal and should _not_ be used from the main dnl configure.ac. dnl ---- -dnl Internal. Check included version of Qt against minimum specified in doc/dependencies.md -dnl Requires: INCLUDES must be populated as necessary. -dnl Output: auroracoin_cv_qt58=yes|no -AC_DEFUN([_AURORACOIN_QT_CHECK_QT5],[ - AC_CACHE_CHECK(for Qt 5, auroracoin_cv_qt5,[ - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - #include - #ifndef QT_VERSION - # include - #endif - ]], - [[ - #if QT_VERSION < 0x050501 - choke - #endif - ]])], - [auroracoin_cv_qt5=yes], - [auroracoin_cv_qt5=no]) -])]) - -dnl Internal. Check if the included version of Qt is greater than Qt58. -dnl Requires: INCLUDES must be populated as necessary. -dnl Output: auroracoin_cv_qt5=yes|no -AC_DEFUN([_AURORACOIN_QT_CHECK_QT58],[ - AC_CACHE_CHECK(for > Qt 5.7, auroracoin_cv_qt58,[ - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - #include - #ifndef QT_VERSION - # include - #endif - ]], - [[ - #if QT_VERSION_MINOR < 8 - choke - #endif - ]])], - [auroracoin_cv_qt58=yes], - [auroracoin_cv_qt58=no]) -])]) - - dnl Internal. Check if the linked version of Qt was built as static libs. dnl Requires: Qt5. dnl Requires: INCLUDES and LIBS must be populated as necessary. @@ -346,8 +292,6 @@ AC_DEFUN([_AURORACOIN_QT_FIND_STATIC_PLUGINS],[ if test -d "$qt_plugin_path/accessible"; then QT_LIBS="$QT_LIBS -L$qt_plugin_path/accessible" fi - if test "x$use_pkgconfig" = xyes; then - : dnl m4_ifdef([PKG_CHECK_MODULES],[ if test x$auroracoin_cv_qt58 = xno; then PKG_CHECK_MODULES([QTPLATFORM], [Qt5PlatformSupport], [QT_LIBS="$QTPLATFORM_LIBS $QT_LIBS"]) @@ -367,49 +311,13 @@ AC_DEFUN([_AURORACOIN_QT_FIND_STATIC_PLUGINS],[ PKG_CHECK_MODULES([QTCGL], [Qt5CglSupport], [QT_LIBS="-lQt5CglSupport $QT_LIBS"]) fi ]) - else - if test "x$TARGET_OS" = xwindows; then - AC_CACHE_CHECK(for Qt >= 5.6, auroracoin_cv_need_platformsupport,[ - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - #include - #ifndef QT_VERSION - # include - #endif - ]], - [[ - #if QT_VERSION < 0x050600 || QT_VERSION_MINOR < 6 - choke - #endif - ]])], - [auroracoin_cv_need_platformsupport=yes], - [auroracoin_cv_need_platformsupport=no]) - ]) - if test "x$auroracoin_cv_need_platformsupport" = xyes; then - if test x$auroracoin_cv_qt58 = xno; then - AURORACOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}PlatformSupport],[main],,AURORACOIN_QT_FAIL(lib$QT_LIB_PREFIXPlatformSupport not found))) - else - AURORACOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}FontDatabaseSupport],[main],,AURORACOIN_QT_FAIL(lib$QT_LIB_PREFIXFontDatabaseSupport not found))) - AURORACOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}EventDispatcherSupport],[main],,AURORACOIN_QT_FAIL(lib$QT_LIB_PREFIXEventDispatcherSupport not found))) - AURORACOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}ThemeSupport],[main],,AURORACOIN_QT_FAIL(lib$QT_LIB_PREFIXThemeSupport not found))) - AURORACOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}FbSupport],[main],,AURORACOIN_QT_FAIL(lib$QT_LIB_PREFIXFbSupport not found))) - AURORACOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}DeviceDiscoverySupport],[main],,AURORACOIN_QT_FAIL(lib$QT_LIB_PREFIXDeviceDiscoverySupport not found))) - AURORACOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}AccessibilitySupport],[main],,AURORACOIN_QT_FAIL(lib$QT_LIB_PREFIXAccessibilitySupport not found))) - QT_LIBS="$QT_LIBS -lversion -ldwmapi -luxtheme" - fi - fi - fi - fi fi ]) dnl Internal. Find Qt libraries using pkg-config. -dnl Inputs: auroracoin_qt_want_version (from --with-gui=). The version to check -dnl first. -dnl Inputs: $1: If auroracoin_qt_want_version is "auto", check for this version -dnl first. dnl Outputs: All necessary QT_* variables are set. dnl Outputs: have_qt_test and have_qt_dbus are set (if applicable) to yes|no. -AC_DEFUN([_AURORACOIN_QT_FIND_LIBS_WITH_PKGCONFIG],[ +AC_DEFUN([_AURORACOIN_QT_FIND_LIBS],[ m4_ifdef([PKG_CHECK_MODULES],[ QT_LIB_PREFIX=Qt5 qt5_modules="Qt5Core Qt5Gui Qt5Network Qt5Widgets" @@ -430,83 +338,3 @@ AC_DEFUN([_AURORACOIN_QT_FIND_LIBS_WITH_PKGCONFIG],[ ]) true; dnl ]) - -dnl Internal. Find Qt libraries without using pkg-config. Version is deduced -dnl from the discovered headers. -dnl Inputs: auroracoin_qt_want_version (from --with-gui=). The version to use. -dnl If "auto", the version will be discovered by _AURORACOIN_QT_CHECK_QT5. -dnl Outputs: All necessary QT_* variables are set. -dnl Outputs: have_qt_test and have_qt_dbus are set (if applicable) to yes|no. -AC_DEFUN([_AURORACOIN_QT_FIND_LIBS_WITHOUT_PKGCONFIG],[ - TEMP_CPPFLAGS="$CPPFLAGS" - TEMP_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$PIC_FLAGS $CXXFLAGS" - TEMP_LIBS="$LIBS" - AURORACOIN_QT_CHECK([ - if test "x$qt_include_path" != x; then - QT_INCLUDES="-I$qt_include_path -I$qt_include_path/QtCore -I$qt_include_path/QtGui -I$qt_include_path/QtWidgets -I$qt_include_path/QtNetwork -I$qt_include_path/QtTest -I$qt_include_path/QtDBus" - CPPFLAGS="$QT_INCLUDES $CPPFLAGS" - fi - ]) - - AURORACOIN_QT_CHECK([AC_CHECK_HEADER([QtPlugin],,AURORACOIN_QT_FAIL(QtCore headers missing))]) - AURORACOIN_QT_CHECK([AC_CHECK_HEADER([QApplication],, AURORACOIN_QT_FAIL(QtGui headers missing))]) - AURORACOIN_QT_CHECK([AC_CHECK_HEADER([QLocalSocket],, AURORACOIN_QT_FAIL(QtNetwork headers missing))]) - - AURORACOIN_QT_CHECK([ - if test "x$auroracoin_qt_want_version" = xauto; then - _AURORACOIN_QT_CHECK_QT5 - _AURORACOIN_QT_CHECK_QT58 - fi - QT_LIB_PREFIX=Qt5 - ]) - - AURORACOIN_QT_CHECK([ - LIBS= - if test "x$qt_lib_path" != x; then - LIBS="$LIBS -L$qt_lib_path" - fi - - if test "x$TARGET_OS" = xwindows; then - AC_CHECK_LIB([imm32], [main],, AURORACOIN_QT_FAIL(libimm32 not found)) - fi - ]) - - AURORACOIN_QT_CHECK(AC_CHECK_LIB([z] ,[main],,AC_MSG_WARN([zlib not found. Assuming qt has it built-in]))) - if test x$auroracoin_cv_qt58 = xno; then - AURORACOIN_QT_CHECK(AC_SEARCH_LIBS([png_error] ,[qtpng png],,AC_MSG_WARN([libpng not found. Assuming qt has it built-in]))) - AURORACOIN_QT_CHECK(AC_SEARCH_LIBS([pcre16_exec], [qtpcre pcre16],,AC_MSG_WARN([libpcre16 not found. Assuming qt has it built-in]))) - else - AURORACOIN_QT_CHECK(AC_SEARCH_LIBS([png_error] ,[qtlibpng png],,AC_MSG_WARN([libpng not found. Assuming qt has it built-in]))) - AURORACOIN_QT_CHECK(AC_SEARCH_LIBS([pcre2_match_16], [qtpcre2 libqtpcre2],,AC_MSG_WARN([libqtpcre2 not found. Assuming qt has it built-in]))) - fi - AURORACOIN_QT_CHECK(AC_SEARCH_LIBS([hb_ot_tags_from_script] ,[qtharfbuzzng qtharfbuzz harfbuzz],,AC_MSG_WARN([libharfbuzz not found. Assuming qt has it built-in or support is disabled]))) - AURORACOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Core] ,[main],,AURORACOIN_QT_FAIL(lib${QT_LIB_PREFIX}Core not found))) - AURORACOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Gui] ,[main],,AURORACOIN_QT_FAIL(lib${QT_LIB_PREFIX}Gui not found))) - AURORACOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Network],[main],,AURORACOIN_QT_FAIL(lib${QT_LIB_PREFIX}Network not found))) - AURORACOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Widgets],[main],,AURORACOIN_QT_FAIL(lib${QT_LIB_PREFIX}Widgets not found))) - QT_LIBS="$LIBS" - LIBS="$TEMP_LIBS" - - AURORACOIN_QT_CHECK([ - LIBS= - if test "x$qt_lib_path" != x; then - LIBS="-L$qt_lib_path" - fi - AC_CHECK_LIB([${QT_LIB_PREFIX}Test], [main],, have_qt_test=no) - AC_CHECK_HEADER([QTest],, have_qt_test=no) - QT_TEST_LIBS="$LIBS" - if test "x$use_dbus" != xno; then - LIBS= - if test "x$qt_lib_path" != x; then - LIBS="-L$qt_lib_path" - fi - AC_CHECK_LIB([${QT_LIB_PREFIX}DBus], [main],, have_qt_dbus=no) - AC_CHECK_HEADER([QtDBus],, have_qt_dbus=no) - QT_DBUS_LIBS="$LIBS" - fi - ]) - CPPFLAGS="$TEMP_CPPFLAGS" - CXXFLAGS="$TEMP_CXXFLAGS" - LIBS="$TEMP_LIBS" -]) diff --git a/configure.ac b/configure.ac index 8c4cf2fe..1d3aaebb 100644 --- a/configure.ac +++ b/configure.ac @@ -1029,7 +1029,7 @@ else AURORACOIN_QT_INIT dnl sets $auroracoin_enable_qt, $auroracoin_enable_qt_test, $auroracoin_enable_qt_dbus - AURORACOIN_QT_CONFIGURE([$use_pkgconfig]) + AURORACOIN_QT_CONFIGURE fi if test x$enable_wallet != xno; then diff --git a/depends/config.site.in b/depends/config.site.in index fb9bf713..bb10f727 100644 --- a/depends/config.site.in +++ b/depends/config.site.in @@ -42,15 +42,6 @@ if test x@host_os@ = xdarwin; then PORT=no fi -if test x@host_os@ = xmingw32; then - if test -z $with_qt_incdir; then - with_qt_incdir=$depends_prefix/include - fi - if test -z $with_qt_libdir; then - with_qt_libdir=$depends_prefix/lib - fi -fi - PATH=$depends_prefix/native/bin:$PATH PKG_CONFIG="`which pkg-config` --static" From d2c1f3d872ac4a96d84d7768bc55029e8052f25b Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Fri, 20 Sep 2024 10:51:22 +0200 Subject: [PATCH 011/103] Bitcoin: 079df9609e6ed2a09949ebe5e98a179f6170980 (build: Drop ZeroMQ patch for Mingw-w64 < 4.0). --- depends/packages/zeromq.mk | 3 +- .../0001-fix-build-with-older-mingw64.patch | 30 ------------------- 2 files changed, 1 insertion(+), 32 deletions(-) delete mode 100644 depends/patches/zeromq/0001-fix-build-with-older-mingw64.patch diff --git a/depends/packages/zeromq.mk b/depends/packages/zeromq.mk index ce85c437..3cea1a3e 100644 --- a/depends/packages/zeromq.mk +++ b/depends/packages/zeromq.mk @@ -3,7 +3,7 @@ $(package)_version=4.3.1 $(package)_download_path=https://github.com/zeromq/libzmq/releases/download/v$($(package)_version)/ $(package)_file_name=$(package)-$($(package)_version).tar.gz $(package)_sha256_hash=bcbabe1e2c7d0eec4ed612e10b94b112dd5f06fcefa994a0c79a45d835cd21eb -$(package)_patches=0001-fix-build-with-older-mingw64.patch 0002-disable-pthread_set_name_np.patch +$(package)_patches=0002-disable-pthread_set_name_np.patch define $(package)_set_vars $(package)_config_opts=--without-docs --disable-shared --disable-curve --disable-curve-keygen --disable-perf @@ -15,7 +15,6 @@ define $(package)_set_vars endef define $(package)_preprocess_cmds - patch -p1 < $($(package)_patch_dir)/0001-fix-build-with-older-mingw64.patch && \ patch -p1 < $($(package)_patch_dir)/0002-disable-pthread_set_name_np.patch && \ cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub config endef diff --git a/depends/patches/zeromq/0001-fix-build-with-older-mingw64.patch b/depends/patches/zeromq/0001-fix-build-with-older-mingw64.patch deleted file mode 100644 index ba6872fa..00000000 --- a/depends/patches/zeromq/0001-fix-build-with-older-mingw64.patch +++ /dev/null @@ -1,30 +0,0 @@ -From f6866b0f166ad168618aae64c7fbee8775d3eb23 Mon Sep 17 00:00:00 2001 -From: mruddy <6440430+mruddy@users.noreply.github.com> -Date: Sat, 30 Jun 2018 09:44:58 -0400 -Subject: [PATCH] fix build with older mingw64 - ---- - src/windows.hpp | 7 +++++++ - 1 file changed, 7 insertions(+) - -diff --git a/src/windows.hpp b/src/windows.hpp -index 6c3839fd..2c32ec79 100644 ---- a/src/windows.hpp -+++ b/src/windows.hpp -@@ -58,6 +58,13 @@ - #include - #include - #include -+ -+#if defined __MINGW64_VERSION_MAJOR && __MINGW64_VERSION_MAJOR < 4 -+// Workaround for mingw-w64 < v4.0 which did not include ws2ipdef.h in iphlpapi.h. -+// Fixed in mingw-w64 by 9bd8fe9148924840d315b4c915dd099955ea89d1. -+#include -+#include -+#endif - #include - - #if !defined __MINGW32__ ---. -2.17.1 - From b37eed51358d53f0abf9b19151cfe13f2e0915ce Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Fri, 20 Sep 2024 10:52:58 +0200 Subject: [PATCH 012/103] Bitcoin: f642b49af73fedc6dc9af4ac299e4cfa8075558 (build: Drop ZeroMQ patch for glibc < 2.12). --- depends/packages/zeromq.mk | 2 -- .../0002-disable-pthread_set_name_np.patch | 35 ------------------- 2 files changed, 37 deletions(-) delete mode 100644 depends/patches/zeromq/0002-disable-pthread_set_name_np.patch diff --git a/depends/packages/zeromq.mk b/depends/packages/zeromq.mk index 3cea1a3e..8e6f1f16 100644 --- a/depends/packages/zeromq.mk +++ b/depends/packages/zeromq.mk @@ -3,7 +3,6 @@ $(package)_version=4.3.1 $(package)_download_path=https://github.com/zeromq/libzmq/releases/download/v$($(package)_version)/ $(package)_file_name=$(package)-$($(package)_version).tar.gz $(package)_sha256_hash=bcbabe1e2c7d0eec4ed612e10b94b112dd5f06fcefa994a0c79a45d835cd21eb -$(package)_patches=0002-disable-pthread_set_name_np.patch define $(package)_set_vars $(package)_config_opts=--without-docs --disable-shared --disable-curve --disable-curve-keygen --disable-perf @@ -15,7 +14,6 @@ define $(package)_set_vars endef define $(package)_preprocess_cmds - patch -p1 < $($(package)_patch_dir)/0002-disable-pthread_set_name_np.patch && \ cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub config endef diff --git a/depends/patches/zeromq/0002-disable-pthread_set_name_np.patch b/depends/patches/zeromq/0002-disable-pthread_set_name_np.patch deleted file mode 100644 index b1c6f78a..00000000 --- a/depends/patches/zeromq/0002-disable-pthread_set_name_np.patch +++ /dev/null @@ -1,35 +0,0 @@ -From c9bbdd6581d07acfe8971e4bcebe278a3676cf03 Mon Sep 17 00:00:00 2001 -From: mruddy <6440430+mruddy@users.noreply.github.com> -Date: Sat, 30 Jun 2018 09:57:18 -0400 -Subject: [PATCH] disable pthread_set_name_np - -pthread_set_name_np adds a Glibc requirement on >= 2.12. ---- - src/thread.cpp | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/src/thread.cpp b/src/thread.cpp -index a1086b0c..9943f354 100644 ---- a/src/thread.cpp -+++ b/src/thread.cpp -@@ -308,7 +308,7 @@ void zmq::thread_t::setThreadName (const char *name_) - */ - if (!name_) - return; -- -+#if 0 - #if defined(ZMQ_HAVE_PTHREAD_SETNAME_1) - int rc = pthread_setname_np (name_); - if (rc) -@@ -324,6 +324,8 @@ void zmq::thread_t::setThreadName (const char *name_) - #elif defined(ZMQ_HAVE_PTHREAD_SET_NAME) - pthread_set_name_np (_descriptor, name_); - #endif -+#endif -+ return; - } - - #endif --- -2.17.1 - From 40a6fbb1b104b354587b0b76cba9193ce01dbc6e Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Fri, 20 Sep 2024 11:04:42 +0200 Subject: [PATCH 013/103] Bitcoin: 9e071b00898aedd9632f105a22d976dc6dbc84b (test: remove rapidcheck integration and tests). --- build_msvc/README.md | 3 +- build_msvc/vcpkg-packages.txt | 2 +- configure.ac | 23 --------- depends/Makefile | 7 --- depends/README.md | 1 - depends/packages/packages.mk | 2 - depends/packages/rapidacheck.mk | 20 -------- doc/rapidcheck.md | 84 --------------------------------- src/Makefile.test.include | 11 +---- src/test/gen/crypto_gen.cpp | 19 -------- src/test/gen/crypto_gen.h | 63 ------------------------- src/test/key_properties.cpp | 49 ------------------- 12 files changed, 3 insertions(+), 281 deletions(-) delete mode 100644 depends/packages/rapidacheck.mk delete mode 100644 doc/rapidcheck.md delete mode 100644 src/test/gen/crypto_gen.cpp delete mode 100644 src/test/gen/crypto_gen.h delete mode 100644 src/test/key_properties.cpp diff --git a/build_msvc/README.md b/build_msvc/README.md index 6c3ab6f6..7887262a 100644 --- a/build_msvc/README.md +++ b/build_msvc/README.md @@ -12,7 +12,7 @@ Quick Start The minimal steps required to build Bitcoin Core with the msbuild toolchain are below. More detailed instructions are contained in the following sections. ``` -vcpkg install --triplet x64-windows-static boost-filesystem boost-signals2 boost-test libevent openssl zeromq berkeleydb rapidcheck double-conversion +vcpkg install --triplet x64-windows-static berkeleydb boost-filesystem boost-multi-index boost-signals2 boost-test boost-thread libevent[thread] zeromq double-conversion py -3 build_msvc\msvc-autogen.py msbuild /m build_msvc\bitcoin.sln /p:Platform=x64 /p:Configuration=Release /t:build ``` @@ -35,7 +35,6 @@ The [external dependencies](https://github.com/bitcoin/bitcoin/blob/master/doc/d - libevent - OpenSSL - Qt5 -- RapidCheck - ZeroMQ Qt diff --git a/build_msvc/vcpkg-packages.txt b/build_msvc/vcpkg-packages.txt index 082a13f1..307f295f 100644 --- a/build_msvc/vcpkg-packages.txt +++ b/build_msvc/vcpkg-packages.txt @@ -1 +1 @@ -berkeleydb boost-filesystem boost-multi-index boost-signals2 boost-test boost-thread libevent openssl rapidcheck zeromq double-conversion \ No newline at end of file +berkeleydb boost-filesystem boost-multi-index boost-signals2 boost-test boost-thread libevent[thread] zeromq double-conversion \ No newline at end of file diff --git a/configure.ac b/configure.ac index 1d3aaebb..d2dae3bc 100644 --- a/configure.ac +++ b/configure.ac @@ -132,12 +132,6 @@ AC_ARG_ENABLE(gui-tests, [use_gui_tests=$enableval], [use_gui_tests=$use_tests]) -AC_ARG_WITH([rapidcheck], - [AS_HELP_STRING([--with-rapidcheck], - [enable RapidCheck property-based tests (default is yes if librapidcheck is found)])], - [use_rapidcheck=$withval], - [use_rapidcheck=auto]) - AC_ARG_ENABLE(bench, AS_HELP_STRING([--disable-bench],[do not compile benchmarks (default is to compile)]), [use_bench=$enableval], @@ -1328,22 +1322,6 @@ AC_CHECK_DECLS([EVP_MD_CTX_new],,,[AC_INCLUDES_DEFAULT ]) CXXFLAGS="${save_CXXFLAGS}" -dnl RapidCheck property-based testing - -enable_property_tests=no -if test "x$use_rapidcheck" = xauto; then - AC_CHECK_HEADERS([rapidcheck.h], [enable_property_tests=yes]) -elif test "x$use_rapidcheck" != xno; then - enable_property_tests=yes -fi - -RAPIDCHECK_LIBS= -if test "x$enable_property_tests" = xyes; then - RAPIDCHECK_LIBS=-lrapidcheck -fi -AC_SUBST(RAPIDCHECK_LIBS) -AM_CONDITIONAL([ENABLE_PROPERTY_TESTS], [test x$enable_property_tests = xyes]) - dnl univalue check need_bundled_univalue=yes @@ -1713,7 +1691,6 @@ fi echo " with zmq = $use_zmq" echo " with test = $use_tests" if test x$use_tests != xno; then - echo " with prop = $enable_property_tests" echo " with fuzz = $enable_fuzz" fi echo " with bench = $use_bench" diff --git a/depends/Makefile b/depends/Makefile index da58525c..888dddec 100644 --- a/depends/Makefile +++ b/depends/Makefile @@ -10,7 +10,6 @@ BASE_CACHE ?= $(BASEDIR)/built SDK_PATH ?= $(BASEDIR)/SDKs NO_QT ?= NO_QR ?= -RAPIDCHECK ?= NO_WALLET ?= NO_ZMQ ?= NO_UPNP ?= @@ -104,8 +103,6 @@ wallet_packages_$(NO_WALLET) = $(wallet_packages) upnp_packages_$(NO_UPNP) = $(upnp_packages) zmq_packages_$(NO_ZMQ) = $(zmq_packages) -rapidcheck_packages_$(RAPIDCHECK) = $(rapidcheck_packages) - packages += $($(host_arch)_$(host_os)_packages) $($(host_os)_packages) $(qt_packages_) $(wallet_packages_) $(upnp_packages_) native_packages += $($(host_arch)_$(host_os)_native_packages) $($(host_os)_native_packages) @@ -113,10 +110,6 @@ ifneq ($(zmq_packages_),) packages += $(zmq_packages) endif -ifeq ($(rapidcheck_packages_),) -packages += $(rapidcheck_packages) -endif - all_packages = $(packages) $(native_packages) meta_depends = Makefile funcs.mk builders/default.mk hosts/default.mk hosts/$(host_os).mk builders/$(build_os).mk diff --git a/depends/README.md b/depends/README.md index 33c4d3d4..3a96a57e 100644 --- a/depends/README.md +++ b/depends/README.md @@ -84,7 +84,6 @@ The following can be set when running make: make FOO=bar NO_WALLET: Don't download/build/cache libs needed to enable the wallet NO_UPNP: Don't download/build/cache packages needed for enabling upnp DEBUG: disable some optimizations and enable more runtime checking - RAPIDCHECK: build rapidcheck (experimental, requires cmake) HOST_ID_SALT: Optional salt to use when generating host package ids BUILD_ID_SALT: Optional salt to use when generating build package ids diff --git a/depends/packages/packages.mk b/depends/packages/packages.mk index 57eec833..3bbea254 100644 --- a/depends/packages/packages.mk +++ b/depends/packages/packages.mk @@ -6,8 +6,6 @@ qrencode_packages = qrencode qt_linux_packages:=qt expat libxcb xcb_proto libXau xproto freetype fontconfig -rapidcheck_packages = rapidcheck - qt_darwin_packages=qt qt_mingw32_packages=qt diff --git a/depends/packages/rapidacheck.mk b/depends/packages/rapidacheck.mk deleted file mode 100644 index a6c06cd2..00000000 --- a/depends/packages/rapidacheck.mk +++ /dev/null @@ -1,20 +0,0 @@ -$(package)_version=d9482c683429fe79122e3dcab14c9655874aeb8e -$(package)_download_path=https://github.com/emil-e/rapidcheck/archive -$(package)_file_name=$($(package)_version).tar.gz -$(package)_sha256_hash=b9ee8955b175fd3c0757ebd887bb075541761af08b0c28391b7c6c0685351f6b - -define $(package)_config_cmds - cmake -DCMAKE_INSTALL_PREFIX=$($(package)_staging_dir)$(host_prefix) -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=true -DRC_ENABLE_BOOST_TEST=ON -B . -endef - -define $(package)_preprocess_cmds - sed -i.old 's/ -Wall//' CMakeLists.txt -endef - -define $(package)_build_cmds - $(MAKE) rapidcheck -endef - -define $(package)_stage_cmds - $(MAKE) rapidcheck install -endef \ No newline at end of file diff --git a/doc/rapidcheck.md b/doc/rapidcheck.md deleted file mode 100644 index bc780016..00000000 --- a/doc/rapidcheck.md +++ /dev/null @@ -1,84 +0,0 @@ -# RapidCheck property-based testing for Auroracoin - -## Concept - -Property-based testing is experimentally being added to Auroracoin with -[RapidCheck](https://github.com/emil-e/rapidcheck), a C++ framework for -property-based testing inspired by the Haskell library -[QuickCheck](https://hackage.haskell.org/package/QuickCheck). - -RapidCheck performs random testing of program properties. A specification of the -program is given in the form of properties which functions should satisfy, and -RapidCheck tests that the properties hold in a large number of randomly -generated cases. - -If an exception is found, RapidCheck tries to find the smallest case, for some -definition of smallest, for which the property is still false and displays it as -a counter-example. For example, if the input is an integer, RapidCheck tries to -find the smallest integer for which the property is false. - -## Running - -If RapidCheck is installed, Auroracoin will automatically run the -property-based tests with the unit tests during `make check`, unless the -`--without-rapidcheck` flag is passed when configuring. - -For more information, run `./configure --help` and see `--with-rapidcheck` under -Optional Packages. - -## Setup - -The following instructions have been tested with Linux Debian and macOS. - -1. Clone the RapidCheck source code and cd into the repository. - - ```shell - git clone https://github.com/emil-e/rapidcheck.git - cd rapidcheck - ``` - -2. Build RapidCheck (requires CMake to be installed). - - ```shell - cmake -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=true -DRC_ENABLE_BOOST_TEST=ON $(pwd) - make && make install - ``` - -3. Configure Auroracoin with RapidCheck. - - `cd` to the directory of your local auroracoin repository and run - `./configure`. In the output you should see: - - ```shell - checking rapidcheck.h usability... yes - checking rapidcheck.h presence... yes - checking for rapidcheck.h... yes - [...] - Options used to compile and link: - [...] - with test = yes - with prop = yes - ``` - -4. Build Auroracoin with RapidCheck. - - Now you can run `make` and should see the property-based tests compiled with - the unit tests: - - ```shell - Making all in src - [...] - CXX test/gen/test_auroracoin-crypto_gen.o - CXX test/test_auroracoin-key_properties.o - ``` - -5. Run the unit tests with `make check`. The property-based tests will be run - with the unit tests. - - ```shell - Running tests: crypto_tests from test/crypto_tests.cpp - [...] - Running tests: key_properties from test/key_properties.cpp - ``` - -That's it! You are now running property-based tests in Auroracoin. \ No newline at end of file diff --git a/src/Makefile.test.include b/src/Makefile.test.include index 63374e75..452116fd 100644 --- a/src/Makefile.test.include +++ b/src/Makefile.test.include @@ -151,15 +151,6 @@ AURORACOIN_TESTS =\ test/validation_block_tests.cpp \ test/versionbits_tests.cpp -if ENABLE_PROPERTY_TESTS -AURORACOIN_TESTS += \ - test/key_properties.cpp - -AURORACOIN_TEST_SUITE += \ - test/gen/crypto_gen.cpp \ - test/gen/crypto_gen.h -endif - if ENABLE_WALLET AURORACOIN_TESTS += \ wallet/test/db_tests.cpp \ @@ -188,7 +179,7 @@ test_test_auroracoin_LDADD += $(LIBAURORACOIN_SERVER) $(LIBAURORACOIN_CLI) $(LIB $(LIBLEVELDB) $(LIBLEVELDB_SSE42) $(LIBMEMENV) $(BOOST_LIBS) $(BOOST_UNIT_TEST_FRAMEWORK_LIB) $(LIBSECP256K1) $(EVENT_LIBS) $(EVENT_PTHREADS_LIBS) test_test_auroracoin_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) -test_test_auroracoin_LDADD += $(BDB_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) $(RAPIDCHECK_LIBS) +test_test_auroracoin_LDADD += $(BDB_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) test_test_auroracoin_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) -static if ENABLE_ZMQ diff --git a/src/test/gen/crypto_gen.cpp b/src/test/gen/crypto_gen.cpp deleted file mode 100644 index 35124964..00000000 --- a/src/test/gen/crypto_gen.cpp +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) 2018 The Bitcoin Core developers -// Distributed under the MIT software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. -#include - -#include - -#include -#include -#include -#include - -/** Generates 1 to 20 keys for OP_CHECKMULTISIG */ -rc::Gen> MultisigKeys() -{ - return rc::gen::suchThat(rc::gen::arbitrary>(), [](const std::vector& keys) { - return keys.size() >= 1 && keys.size() <= 15; - }); -}; \ No newline at end of file diff --git a/src/test/gen/crypto_gen.h b/src/test/gen/crypto_gen.h deleted file mode 100644 index 7d0ff5e3..00000000 --- a/src/test/gen/crypto_gen.h +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) 2018 The Bitcoin Core developers -// Distributed under the MIT software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef AURORACOIN_TEST_GEN_CRYPTO_GEN_H -#define AURORACOIN_TEST_GEN_CRYPTO_GEN_H - -#include -#include -#include -#include -#include -#include -#include - -/** Generates 1 to 15 keys for OP_CHECKMULTISIG */ -rc::Gen> MultisigKeys(); - -namespace rc -{ -/** Generator for a new CKey */ -template <> -struct Arbitrary { - static Gen arbitrary() - { - return rc::gen::map([](int x) { - CKey key; - key.MakeNewKey(true); - return key; - }); - }; -}; - -/** Generator for a CPrivKey */ -template <> -struct Arbitrary { - static Gen arbitrary() - { - return gen::map(gen::arbitrary(), [](const CKey& key) { - return key.GetPrivKey(); - }); - }; -}; - -/** Generator for a new CPubKey */ -template <> -struct Arbitrary { - static Gen arbitrary() - { - return gen::map(gen::arbitrary(), [](const CKey& key) { - return key.GetPubKey(); - }); - }; -}; -/** Generates a arbitrary uint256 */ -template <> -struct Arbitrary { - static Gen arbitrary() - { - return rc::gen::just(GetRandHash()); - }; -}; -} //namespace rc -#endif diff --git a/src/test/key_properties.cpp b/src/test/key_properties.cpp deleted file mode 100644 index abcfc454..00000000 --- a/src/test/key_properties.cpp +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) 2018-2019 The Bitcoin Core developers -// Distributed under the MIT software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. -#include - -#include -#include -#include -#include - -#include -#include -#include -#include - -#include - -BOOST_FIXTURE_TEST_SUITE(key_properties, BasicTestingSetup) - -/** Check CKey uniqueness */ -RC_BOOST_PROP(key_uniqueness, (const CKey& key1, const CKey& key2)) -{ - RC_ASSERT(!(key1 == key2)); -} - -/** Verify that a private key generates the correct public key */ -RC_BOOST_PROP(key_generates_correct_pubkey, (const CKey& key)) -{ - CPubKey pubKey = key.GetPubKey(); - RC_ASSERT(key.VerifyPubKey(pubKey)); -} - -/** Create a CKey using the 'Set' function must give us the same key */ -RC_BOOST_PROP(key_set_symmetry, (const CKey& key)) -{ - CKey key1; - key1.Set(key.begin(), key.end(), key.IsCompressed()); - RC_ASSERT(key1 == key); -} - -/** Create a CKey, sign a piece of data, then verify it with the public key */ -RC_BOOST_PROP(key_sign_symmetry, (const CKey& key, const uint256& hash)) -{ - std::vector vchSig; - key.Sign(hash, vchSig, 0); - const CPubKey& pubKey = key.GetPubKey(); - RC_ASSERT(pubKey.Verify(hash, vchSig)); -} -BOOST_AUTO_TEST_SUITE_END() From bb159ae2fd4dd5e06e0ee192c2619fb0dcfcea76 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Fri, 20 Sep 2024 11:08:26 +0200 Subject: [PATCH 014/103] Bitcoin: d6306466626635e6fee44385e6a688c8dc118eb (libmultiprocess depends build). --- depends/Makefile | 8 ++++++++ depends/README.md | 1 + depends/config.site.in | 7 +++++++ depends/funcs.mk | 1 + depends/packages/boost.mk | 2 +- depends/packages/capnp.mk | 17 +++++++++++++++++ depends/packages/libmultiprocess.mk | 18 ++++++++++++++++++ depends/packages/native_boost.mk | 13 +++++++++++++ depends/packages/native_capnp.mk | 18 ++++++++++++++++++ depends/packages/native_libmultiprocess.mk | 18 ++++++++++++++++++ depends/packages/packages.mk | 3 +++ 11 files changed, 105 insertions(+), 1 deletion(-) create mode 100644 depends/packages/capnp.mk create mode 100644 depends/packages/libmultiprocess.mk create mode 100644 depends/packages/native_boost.mk create mode 100644 depends/packages/native_capnp.mk create mode 100644 depends/packages/native_libmultiprocess.mk diff --git a/depends/Makefile b/depends/Makefile index 888dddec..b3cf5873 100644 --- a/depends/Makefile +++ b/depends/Makefile @@ -13,6 +13,7 @@ NO_QR ?= NO_WALLET ?= NO_ZMQ ?= NO_UPNP ?= +MULTIPROCESS ?= FALLBACK_DOWNLOAD_PATH ?= https://bitcoincore.org/depends-sources BUILD = $(shell ./config.guess) @@ -102,6 +103,7 @@ qt_packages_$(NO_QT) = $(qt_packages) $(qt_$(host_os)_packages) $(qt_$(host_arch wallet_packages_$(NO_WALLET) = $(wallet_packages) upnp_packages_$(NO_UPNP) = $(upnp_packages) zmq_packages_$(NO_ZMQ) = $(zmq_packages) +multiprocess_packages_$(MULTIPROCESS) = $(multiprocess_packages) packages += $($(host_arch)_$(host_os)_packages) $($(host_os)_packages) $(qt_packages_) $(wallet_packages_) $(upnp_packages_) native_packages += $($(host_arch)_$(host_os)_native_packages) $($(host_os)_native_packages) @@ -110,6 +112,11 @@ ifneq ($(zmq_packages_),) packages += $(zmq_packages) endif +ifeq ($(multiprocess_packages_),) +packages += $(multiprocess_packages) +native_packages += $(multiprocess_native_packages) +endif + all_packages = $(packages) $(native_packages) meta_depends = Makefile funcs.mk builders/default.mk hosts/default.mk hosts/$(host_os).mk builders/$(build_os).mk @@ -150,6 +157,7 @@ $(host_prefix)/share/config.site : config.site.in $(host_prefix)/.stamp_$(final_ -e 's|@no_zmq@|$(NO_ZMQ)|' \ -e 's|@no_wallet@|$(NO_WALLET)|' \ -e 's|@no_upnp@|$(NO_UPNP)|' \ + -e 's|@multiprocess@|$(MULTIPROCESS)|' \ -e 's|@debug@|$(DEBUG)|' \ $< > $@ $(AT)touch $@ diff --git a/depends/README.md b/depends/README.md index 3a96a57e..1a4427e9 100644 --- a/depends/README.md +++ b/depends/README.md @@ -83,6 +83,7 @@ The following can be set when running make: make FOO=bar 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_UPNP: Don't download/build/cache packages needed for enabling upnp + 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 diff --git a/depends/config.site.in b/depends/config.site.in index bb10f727..87a33793 100644 --- a/depends/config.site.in +++ b/depends/config.site.in @@ -16,6 +16,9 @@ fi if test -z $with_qt_bindir && test -z "@no_qt@"; then with_qt_bindir=$depends_prefix/native/bin fi +if test -z $with_mpgen && test -n "@multiprocess@"; then + with_mpgen=$depends_prefix/native +fi if test -z $with_qrencode && test -n "@no_qr@"; then with_qrencode=no @@ -25,6 +28,10 @@ if test -z $enable_wallet && test -n "@no_wallet@"; then enable_wallet=no fi +if test -z $enable_multiprocess && test -n "@multiprocess@"; then + enable_multiprocess=yes +fi + if test -z $with_miniupnpc && test -n "@no_upnp@"; then with_miniupnpc=no fi diff --git a/depends/funcs.mk b/depends/funcs.mk index a4434b51..23ad9b13 100644 --- a/depends/funcs.mk +++ b/depends/funcs.mk @@ -130,6 +130,7 @@ $(1)_config_env+=$($(1)_config_env_$(host_arch)_$(host_os)) $($(1)_config_env_$( $(1)_config_env+=PKG_CONFIG_LIBDIR=$($($(1)_type)_prefix)/lib/pkgconfig $(1)_config_env+=PKG_CONFIG_PATH=$($($(1)_type)_prefix)/share/pkgconfig +$(1)_config_env+=CMAKE_MODULE_PATH=$($($(1)_type)_prefix)/lib/cmake $(1)_config_env+=PATH=$(build_prefix)/bin:$(PATH) $(1)_build_env+=PATH=$(build_prefix)/bin:$(PATH) $(1)_stage_env+=PATH=$(build_prefix)/bin:$(PATH) diff --git a/depends/packages/boost.mk b/depends/packages/boost.mk index 98c74cac..dc67c280 100644 --- a/depends/packages/boost.mk +++ b/depends/packages/boost.mk @@ -1,7 +1,7 @@ package=boost $(package)_version=1_70_0 $(package)_download_path=https://boostorg.jfrog.io/artifactory/main/release/1.70.0/source/ -$(package)_file_name=$(package)_$($(package)_version).tar.bz2 +$(package)_file_name=boost_$($(package)_version).tar.bz2 $(package)_sha256_hash=430ae8354789de4fd19ee52f3b1f739e1fba576f0aded0897c3c2bc00fb38778 define $(package)_set_vars diff --git a/depends/packages/capnp.mk b/depends/packages/capnp.mk new file mode 100644 index 00000000..360cedd6 --- /dev/null +++ b/depends/packages/capnp.mk @@ -0,0 +1,17 @@ +package=capnp +$(package)_version=$(native_$(package)_version) +$(package)_download_path=$(native_$(package)_download_path) +$(package)_file_name=$(native_$(package)_file_name) +$(package)_sha256_hash=$(native_$(package)_sha256_hash) + +define $(package)_config_cmds + $($(package)_autoconf) +endef + +define $(package)_build_cmds + $(MAKE) +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install +endef diff --git a/depends/packages/libmultiprocess.mk b/depends/packages/libmultiprocess.mk new file mode 100644 index 00000000..91798f67 --- /dev/null +++ b/depends/packages/libmultiprocess.mk @@ -0,0 +1,18 @@ +package=libmultiprocess +$(package)_version=$(native_$(package)_version) +$(package)_download_path=$(native_$(package)_download_path) +$(package)_file_name=$(native_$(package)_file_name) +$(package)_sha256_hash=$(native_$(package)_sha256_hash) +$(package)_dependencies=native_$(package) boost capnp + +define $(package)_config_cmds + cmake -DCMAKE_INSTALL_PREFIX=$($($(package)_type)_prefix) +endef + +define $(package)_build_cmds + $(MAKE) +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install +endef diff --git a/depends/packages/native_boost.mk b/depends/packages/native_boost.mk new file mode 100644 index 00000000..b9e62537 --- /dev/null +++ b/depends/packages/native_boost.mk @@ -0,0 +1,13 @@ +package=native_boost +$(package)_version=$(boost_version) +$(package)_download_path=$(boost_download_path) +$(package)_file_name=$(boost_file_name) +$(package)_sha256_hash=$(boost_sha256_hash) + +define $(package)_config_cmds + ./bootstrap.sh --prefix=$($($(package)_type)_prefix) --with-libraries=headers +endef + +define $(package)_stage_cmds + ./b2 -d0 --prefix=$($(package)_staging_prefix_dir) install +endef diff --git a/depends/packages/native_capnp.mk b/depends/packages/native_capnp.mk new file mode 100644 index 00000000..ed5a6dee --- /dev/null +++ b/depends/packages/native_capnp.mk @@ -0,0 +1,18 @@ +package=native_capnp +$(package)_version=0.7.0 +$(package)_download_path=https://capnproto.org/ +$(package)_download_file=capnproto-c++-$($(package)_version).tar.gz +$(package)_file_name=capnproto-cxx-$($(package)_version).tar.gz +$(package)_sha256_hash=c9a4c0bd88123064d483ab46ecee777f14d933359e23bff6fb4f4dbd28b4cd41 + +define $(package)_config_cmds + $($(package)_autoconf) +endef + +define $(package)_build_cmds + $(MAKE) +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install +endef diff --git a/depends/packages/native_libmultiprocess.mk b/depends/packages/native_libmultiprocess.mk new file mode 100644 index 00000000..94da1377 --- /dev/null +++ b/depends/packages/native_libmultiprocess.mk @@ -0,0 +1,18 @@ +package=native_libmultiprocess +$(package)_version=1d630f536d43d1fdba028f2cfccf49bc27da92db +$(package)_download_path=https://github.com/chaincodelabs/libmultiprocess/archive +$(package)_file_name=$($(package)_version).tar.gz +$(package)_sha256_hash=f43183ccf59fa7596d113e56518563673f5823a721974b4058d8778ef53bd476 +$(package)_dependencies=native_boost native_capnp + +define $(package)_config_cmds + cmake -DCMAKE_INSTALL_PREFIX=$($($(package)_type)_prefix) +endef + +define $(package)_build_cmds + $(MAKE) +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install +endef diff --git a/depends/packages/packages.mk b/depends/packages/packages.mk index 3bbea254..e348a63f 100644 --- a/depends/packages/packages.mk +++ b/depends/packages/packages.mk @@ -15,6 +15,9 @@ zmq_packages=zeromq upnp_packages=miniupnpc +multiprocess_packages = libmultiprocess capnp +multiprocess_native_packages = native_libmultiprocess native_boost native_capnp + darwin_native_packages = native_biplist native_ds_store native_mac_alias ifneq ($(build_os),darwin) From 00de75a6007ff50fe5d10fbbfc37e31263fa5659 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Fri, 20 Sep 2024 11:09:46 +0200 Subject: [PATCH 015/103] Bitcoin: b919efadff3d0393f4a8c3c1dc735f7ac5c665b (depends: Use default macos clang compiler). --- depends/builders/darwin.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/depends/builders/darwin.mk b/depends/builders/darwin.mk index eb587fca..9513b6c2 100644 --- a/depends/builders/darwin.mk +++ b/depends/builders/darwin.mk @@ -1,5 +1,5 @@ -build_darwin_CC:=$(shell xcrun -f clang) -build_darwin_CXX:=$(shell xcrun -f clang++) +build_darwin_CC:=clang +build_darwin_CXX:=clang++ build_darwin_AR:=$(shell xcrun -f ar) build_darwin_RANLIB:=$(shell xcrun -f ranlib) build_darwin_STRIP:=$(shell xcrun -f strip) From 4076136d2883c16ca1649d55e4e8a12df4f58fc7 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Fri, 20 Sep 2024 11:24:14 +0200 Subject: [PATCH 016/103] Bitcoin: f29bd546ec169dd9af2ca6265c76353e68db92b (Revert Merge --- depends/Makefile | 8 -------- depends/README.md | 1 - depends/builders/darwin.mk | 4 ++-- depends/config.site.in | 7 ------- depends/funcs.mk | 1 - depends/packages/boost.mk | 2 +- depends/packages/capnp.mk | 17 ----------------- depends/packages/libmultiprocess.mk | 18 ------------------ depends/packages/native_boost.mk | 13 ------------- depends/packages/native_capnp.mk | 18 ------------------ depends/packages/native_libmultiprocess.mk | 18 ------------------ depends/packages/packages.mk | 3 --- 12 files changed, 3 insertions(+), 107 deletions(-) delete mode 100644 depends/packages/capnp.mk delete mode 100644 depends/packages/libmultiprocess.mk delete mode 100644 depends/packages/native_boost.mk delete mode 100644 depends/packages/native_capnp.mk delete mode 100644 depends/packages/native_libmultiprocess.mk diff --git a/depends/Makefile b/depends/Makefile index b3cf5873..888dddec 100644 --- a/depends/Makefile +++ b/depends/Makefile @@ -13,7 +13,6 @@ NO_QR ?= NO_WALLET ?= NO_ZMQ ?= NO_UPNP ?= -MULTIPROCESS ?= FALLBACK_DOWNLOAD_PATH ?= https://bitcoincore.org/depends-sources BUILD = $(shell ./config.guess) @@ -103,7 +102,6 @@ qt_packages_$(NO_QT) = $(qt_packages) $(qt_$(host_os)_packages) $(qt_$(host_arch wallet_packages_$(NO_WALLET) = $(wallet_packages) upnp_packages_$(NO_UPNP) = $(upnp_packages) zmq_packages_$(NO_ZMQ) = $(zmq_packages) -multiprocess_packages_$(MULTIPROCESS) = $(multiprocess_packages) packages += $($(host_arch)_$(host_os)_packages) $($(host_os)_packages) $(qt_packages_) $(wallet_packages_) $(upnp_packages_) native_packages += $($(host_arch)_$(host_os)_native_packages) $($(host_os)_native_packages) @@ -112,11 +110,6 @@ ifneq ($(zmq_packages_),) packages += $(zmq_packages) endif -ifeq ($(multiprocess_packages_),) -packages += $(multiprocess_packages) -native_packages += $(multiprocess_native_packages) -endif - all_packages = $(packages) $(native_packages) meta_depends = Makefile funcs.mk builders/default.mk hosts/default.mk hosts/$(host_os).mk builders/$(build_os).mk @@ -157,7 +150,6 @@ $(host_prefix)/share/config.site : config.site.in $(host_prefix)/.stamp_$(final_ -e 's|@no_zmq@|$(NO_ZMQ)|' \ -e 's|@no_wallet@|$(NO_WALLET)|' \ -e 's|@no_upnp@|$(NO_UPNP)|' \ - -e 's|@multiprocess@|$(MULTIPROCESS)|' \ -e 's|@debug@|$(DEBUG)|' \ $< > $@ $(AT)touch $@ diff --git a/depends/README.md b/depends/README.md index 1a4427e9..3a96a57e 100644 --- a/depends/README.md +++ b/depends/README.md @@ -83,7 +83,6 @@ The following can be set when running make: make FOO=bar 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_UPNP: Don't download/build/cache packages needed for enabling upnp - 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 diff --git a/depends/builders/darwin.mk b/depends/builders/darwin.mk index 9513b6c2..eb587fca 100644 --- a/depends/builders/darwin.mk +++ b/depends/builders/darwin.mk @@ -1,5 +1,5 @@ -build_darwin_CC:=clang -build_darwin_CXX:=clang++ +build_darwin_CC:=$(shell xcrun -f clang) +build_darwin_CXX:=$(shell xcrun -f clang++) build_darwin_AR:=$(shell xcrun -f ar) build_darwin_RANLIB:=$(shell xcrun -f ranlib) build_darwin_STRIP:=$(shell xcrun -f strip) diff --git a/depends/config.site.in b/depends/config.site.in index 87a33793..bb10f727 100644 --- a/depends/config.site.in +++ b/depends/config.site.in @@ -16,9 +16,6 @@ fi if test -z $with_qt_bindir && test -z "@no_qt@"; then with_qt_bindir=$depends_prefix/native/bin fi -if test -z $with_mpgen && test -n "@multiprocess@"; then - with_mpgen=$depends_prefix/native -fi if test -z $with_qrencode && test -n "@no_qr@"; then with_qrencode=no @@ -28,10 +25,6 @@ if test -z $enable_wallet && test -n "@no_wallet@"; then enable_wallet=no fi -if test -z $enable_multiprocess && test -n "@multiprocess@"; then - enable_multiprocess=yes -fi - if test -z $with_miniupnpc && test -n "@no_upnp@"; then with_miniupnpc=no fi diff --git a/depends/funcs.mk b/depends/funcs.mk index 23ad9b13..a4434b51 100644 --- a/depends/funcs.mk +++ b/depends/funcs.mk @@ -130,7 +130,6 @@ $(1)_config_env+=$($(1)_config_env_$(host_arch)_$(host_os)) $($(1)_config_env_$( $(1)_config_env+=PKG_CONFIG_LIBDIR=$($($(1)_type)_prefix)/lib/pkgconfig $(1)_config_env+=PKG_CONFIG_PATH=$($($(1)_type)_prefix)/share/pkgconfig -$(1)_config_env+=CMAKE_MODULE_PATH=$($($(1)_type)_prefix)/lib/cmake $(1)_config_env+=PATH=$(build_prefix)/bin:$(PATH) $(1)_build_env+=PATH=$(build_prefix)/bin:$(PATH) $(1)_stage_env+=PATH=$(build_prefix)/bin:$(PATH) diff --git a/depends/packages/boost.mk b/depends/packages/boost.mk index dc67c280..98c74cac 100644 --- a/depends/packages/boost.mk +++ b/depends/packages/boost.mk @@ -1,7 +1,7 @@ package=boost $(package)_version=1_70_0 $(package)_download_path=https://boostorg.jfrog.io/artifactory/main/release/1.70.0/source/ -$(package)_file_name=boost_$($(package)_version).tar.bz2 +$(package)_file_name=$(package)_$($(package)_version).tar.bz2 $(package)_sha256_hash=430ae8354789de4fd19ee52f3b1f739e1fba576f0aded0897c3c2bc00fb38778 define $(package)_set_vars diff --git a/depends/packages/capnp.mk b/depends/packages/capnp.mk deleted file mode 100644 index 360cedd6..00000000 --- a/depends/packages/capnp.mk +++ /dev/null @@ -1,17 +0,0 @@ -package=capnp -$(package)_version=$(native_$(package)_version) -$(package)_download_path=$(native_$(package)_download_path) -$(package)_file_name=$(native_$(package)_file_name) -$(package)_sha256_hash=$(native_$(package)_sha256_hash) - -define $(package)_config_cmds - $($(package)_autoconf) -endef - -define $(package)_build_cmds - $(MAKE) -endef - -define $(package)_stage_cmds - $(MAKE) DESTDIR=$($(package)_staging_dir) install -endef diff --git a/depends/packages/libmultiprocess.mk b/depends/packages/libmultiprocess.mk deleted file mode 100644 index 91798f67..00000000 --- a/depends/packages/libmultiprocess.mk +++ /dev/null @@ -1,18 +0,0 @@ -package=libmultiprocess -$(package)_version=$(native_$(package)_version) -$(package)_download_path=$(native_$(package)_download_path) -$(package)_file_name=$(native_$(package)_file_name) -$(package)_sha256_hash=$(native_$(package)_sha256_hash) -$(package)_dependencies=native_$(package) boost capnp - -define $(package)_config_cmds - cmake -DCMAKE_INSTALL_PREFIX=$($($(package)_type)_prefix) -endef - -define $(package)_build_cmds - $(MAKE) -endef - -define $(package)_stage_cmds - $(MAKE) DESTDIR=$($(package)_staging_dir) install -endef diff --git a/depends/packages/native_boost.mk b/depends/packages/native_boost.mk deleted file mode 100644 index b9e62537..00000000 --- a/depends/packages/native_boost.mk +++ /dev/null @@ -1,13 +0,0 @@ -package=native_boost -$(package)_version=$(boost_version) -$(package)_download_path=$(boost_download_path) -$(package)_file_name=$(boost_file_name) -$(package)_sha256_hash=$(boost_sha256_hash) - -define $(package)_config_cmds - ./bootstrap.sh --prefix=$($($(package)_type)_prefix) --with-libraries=headers -endef - -define $(package)_stage_cmds - ./b2 -d0 --prefix=$($(package)_staging_prefix_dir) install -endef diff --git a/depends/packages/native_capnp.mk b/depends/packages/native_capnp.mk deleted file mode 100644 index ed5a6dee..00000000 --- a/depends/packages/native_capnp.mk +++ /dev/null @@ -1,18 +0,0 @@ -package=native_capnp -$(package)_version=0.7.0 -$(package)_download_path=https://capnproto.org/ -$(package)_download_file=capnproto-c++-$($(package)_version).tar.gz -$(package)_file_name=capnproto-cxx-$($(package)_version).tar.gz -$(package)_sha256_hash=c9a4c0bd88123064d483ab46ecee777f14d933359e23bff6fb4f4dbd28b4cd41 - -define $(package)_config_cmds - $($(package)_autoconf) -endef - -define $(package)_build_cmds - $(MAKE) -endef - -define $(package)_stage_cmds - $(MAKE) DESTDIR=$($(package)_staging_dir) install -endef diff --git a/depends/packages/native_libmultiprocess.mk b/depends/packages/native_libmultiprocess.mk deleted file mode 100644 index 94da1377..00000000 --- a/depends/packages/native_libmultiprocess.mk +++ /dev/null @@ -1,18 +0,0 @@ -package=native_libmultiprocess -$(package)_version=1d630f536d43d1fdba028f2cfccf49bc27da92db -$(package)_download_path=https://github.com/chaincodelabs/libmultiprocess/archive -$(package)_file_name=$($(package)_version).tar.gz -$(package)_sha256_hash=f43183ccf59fa7596d113e56518563673f5823a721974b4058d8778ef53bd476 -$(package)_dependencies=native_boost native_capnp - -define $(package)_config_cmds - cmake -DCMAKE_INSTALL_PREFIX=$($($(package)_type)_prefix) -endef - -define $(package)_build_cmds - $(MAKE) -endef - -define $(package)_stage_cmds - $(MAKE) DESTDIR=$($(package)_staging_dir) install -endef diff --git a/depends/packages/packages.mk b/depends/packages/packages.mk index e348a63f..3bbea254 100644 --- a/depends/packages/packages.mk +++ b/depends/packages/packages.mk @@ -15,9 +15,6 @@ zmq_packages=zeromq upnp_packages=miniupnpc -multiprocess_packages = libmultiprocess capnp -multiprocess_native_packages = native_libmultiprocess native_boost native_capnp - darwin_native_packages = native_biplist native_ds_store native_mac_alias ifneq ($(build_os),darwin) From 58d662e7a371412ba98a2555807c61737040e758 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Fri, 20 Sep 2024 11:26:05 +0200 Subject: [PATCH 017/103] Bitcoin: 1e94a2bcbc5ff8ae61eed9f31317ea534649116 (depends: Add --sysroot option to mac os native compile flags). --- depends/builders/darwin.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/depends/builders/darwin.mk b/depends/builders/darwin.mk index eb587fca..69c394ec 100644 --- a/depends/builders/darwin.mk +++ b/depends/builders/darwin.mk @@ -1,5 +1,5 @@ -build_darwin_CC:=$(shell xcrun -f clang) -build_darwin_CXX:=$(shell xcrun -f clang++) +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) From b9e2b33045b4a82037c72051b6cace94e1faeee6 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Fri, 20 Sep 2024 11:29:24 +0200 Subject: [PATCH 018/103] Bitcoin: 603fd6a2e708c04ef6c9880f89d0a4cbaa6fc7c (depends: add MULTIPROCESS depends option). --- depends/Makefile | 8 ++++++++ depends/README.md | 1 + depends/config.site.in | 7 +++++++ depends/funcs.mk | 11 ++++++++++- depends/hosts/darwin.mk | 1 + depends/hosts/linux.mk | 1 + depends/hosts/mingw32.mk | 2 ++ depends/packages/boost.mk | 2 +- depends/packages/capnp.mk | 18 ++++++++++++++++++ depends/packages/libmultiprocess.mk | 18 ++++++++++++++++++ depends/packages/native_capnp.mk | 18 ++++++++++++++++++ depends/packages/native_libmultiprocess.mk | 18 ++++++++++++++++++ depends/packages/packages.mk | 3 +++ 13 files changed, 106 insertions(+), 2 deletions(-) create mode 100644 depends/packages/capnp.mk create mode 100644 depends/packages/libmultiprocess.mk create mode 100644 depends/packages/native_capnp.mk create mode 100644 depends/packages/native_libmultiprocess.mk diff --git a/depends/Makefile b/depends/Makefile index 888dddec..b3cf5873 100644 --- a/depends/Makefile +++ b/depends/Makefile @@ -13,6 +13,7 @@ NO_QR ?= NO_WALLET ?= NO_ZMQ ?= NO_UPNP ?= +MULTIPROCESS ?= FALLBACK_DOWNLOAD_PATH ?= https://bitcoincore.org/depends-sources BUILD = $(shell ./config.guess) @@ -102,6 +103,7 @@ qt_packages_$(NO_QT) = $(qt_packages) $(qt_$(host_os)_packages) $(qt_$(host_arch wallet_packages_$(NO_WALLET) = $(wallet_packages) upnp_packages_$(NO_UPNP) = $(upnp_packages) zmq_packages_$(NO_ZMQ) = $(zmq_packages) +multiprocess_packages_$(MULTIPROCESS) = $(multiprocess_packages) packages += $($(host_arch)_$(host_os)_packages) $($(host_os)_packages) $(qt_packages_) $(wallet_packages_) $(upnp_packages_) native_packages += $($(host_arch)_$(host_os)_native_packages) $($(host_os)_native_packages) @@ -110,6 +112,11 @@ ifneq ($(zmq_packages_),) packages += $(zmq_packages) endif +ifeq ($(multiprocess_packages_),) +packages += $(multiprocess_packages) +native_packages += $(multiprocess_native_packages) +endif + all_packages = $(packages) $(native_packages) meta_depends = Makefile funcs.mk builders/default.mk hosts/default.mk hosts/$(host_os).mk builders/$(build_os).mk @@ -150,6 +157,7 @@ $(host_prefix)/share/config.site : config.site.in $(host_prefix)/.stamp_$(final_ -e 's|@no_zmq@|$(NO_ZMQ)|' \ -e 's|@no_wallet@|$(NO_WALLET)|' \ -e 's|@no_upnp@|$(NO_UPNP)|' \ + -e 's|@multiprocess@|$(MULTIPROCESS)|' \ -e 's|@debug@|$(DEBUG)|' \ $< > $@ $(AT)touch $@ diff --git a/depends/README.md b/depends/README.md index 3a96a57e..1a4427e9 100644 --- a/depends/README.md +++ b/depends/README.md @@ -83,6 +83,7 @@ The following can be set when running make: make FOO=bar 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_UPNP: Don't download/build/cache packages needed for enabling upnp + 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 diff --git a/depends/config.site.in b/depends/config.site.in index bb10f727..87a33793 100644 --- a/depends/config.site.in +++ b/depends/config.site.in @@ -16,6 +16,9 @@ fi if test -z $with_qt_bindir && test -z "@no_qt@"; then with_qt_bindir=$depends_prefix/native/bin fi +if test -z $with_mpgen && test -n "@multiprocess@"; then + with_mpgen=$depends_prefix/native +fi if test -z $with_qrencode && test -n "@no_qr@"; then with_qrencode=no @@ -25,6 +28,10 @@ if test -z $enable_wallet && test -n "@no_wallet@"; then enable_wallet=no fi +if test -z $enable_multiprocess && test -n "@multiprocess@"; then + enable_multiprocess=yes +fi + if test -z $with_miniupnpc && test -n "@no_upnp@"; then with_miniupnpc=no fi diff --git a/depends/funcs.mk b/depends/funcs.mk index a4434b51..135ebba9 100644 --- a/depends/funcs.mk +++ b/depends/funcs.mk @@ -130,11 +130,11 @@ $(1)_config_env+=$($(1)_config_env_$(host_arch)_$(host_os)) $($(1)_config_env_$( $(1)_config_env+=PKG_CONFIG_LIBDIR=$($($(1)_type)_prefix)/lib/pkgconfig $(1)_config_env+=PKG_CONFIG_PATH=$($($(1)_type)_prefix)/share/pkgconfig +$(1)_config_env+=CMAKE_MODULE_PATH=$($($(1)_type)_prefix)/lib/cmake $(1)_config_env+=PATH=$(build_prefix)/bin:$(PATH) $(1)_build_env+=PATH=$(build_prefix)/bin:$(PATH) $(1)_stage_env+=PATH=$(build_prefix)/bin:$(PATH) $(1)_autoconf=./configure --host=$($($(1)_type)_host) --prefix=$($($(1)_type)_prefix) $$($(1)_config_opts) CC="$$($(1)_cc)" CXX="$$($(1)_cxx)" - ifneq ($($(1)_nm),) $(1)_autoconf += NM="$$($(1)_nm)" endif @@ -156,6 +156,15 @@ endif ifneq ($($(1)_ldflags),) $(1)_autoconf += LDFLAGS="$$($(1)_ldflags)" endif + +$(1)_cmake=cmake -DCMAKE_INSTALL_PREFIX=$($($(1)_type)_prefix) +ifneq ($($(1)_type),build) +ifneq ($(host),$(build)) +$(1)_cmake += -DCMAKE_SYSTEM_NAME=$($(host_os)_cmake_system) -DCMAKE_SYSROOT=$(host_prefix) +$(1)_cmake += -DCMAKE_C_COMPILER_TARGET=$(host) -DCMAKE_C_COMPILER=$(firstword $($($(1)_type)_CC)) -DCMAKE_C_FLAGS="$(wordlist 2,1000,$($($(1)_type)_CC))" +$(1)_cmake += -DCMAKE_CXX_COMPILER_TARGET=$(host) -DCMAKE_CXX_COMPILER=$(firstword $($($(1)_type)_CXX)) -DCMAKE_CXX_FLAGS="$(wordlist 2,1000,$($($(1)_type)_CXX))" +endif +endif endef define int_add_cmds diff --git a/depends/hosts/darwin.mk b/depends/hosts/darwin.mk index 1bc4fb81..82e086a3 100644 --- a/depends/hosts/darwin.mk +++ b/depends/hosts/darwin.mk @@ -14,3 +14,4 @@ darwin_debug_CFLAGS=-O1 darwin_debug_CXXFLAGS=$(darwin_debug_CFLAGS) darwin_native_toolchain=native_cctools +darwin_cmake_system=Darwin diff --git a/depends/hosts/linux.mk b/depends/hosts/linux.mk index b13a0f1a..8ab448ce 100644 --- a/depends/hosts/linux.mk +++ b/depends/hosts/linux.mk @@ -29,3 +29,4 @@ i686_linux_CXX=$(default_host_CXX) -m32 x86_64_linux_CC=$(default_host_CC) -m64 x86_64_linux_CXX=$(default_host_CXX) -m64 endif +linux_cmake_system=Linux diff --git a/depends/hosts/mingw32.mk b/depends/hosts/mingw32.mk index dbfb62fd..be5fec57 100644 --- a/depends/hosts/mingw32.mk +++ b/depends/hosts/mingw32.mk @@ -8,3 +8,5 @@ mingw32_debug_CFLAGS=-O1 mingw32_debug_CXXFLAGS=$(mingw32_debug_CFLAGS) mingw32_debug_CPPFLAGS=-D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC + +mingw_cmake_system=Windows diff --git a/depends/packages/boost.mk b/depends/packages/boost.mk index 98c74cac..dc67c280 100644 --- a/depends/packages/boost.mk +++ b/depends/packages/boost.mk @@ -1,7 +1,7 @@ package=boost $(package)_version=1_70_0 $(package)_download_path=https://boostorg.jfrog.io/artifactory/main/release/1.70.0/source/ -$(package)_file_name=$(package)_$($(package)_version).tar.bz2 +$(package)_file_name=boost_$($(package)_version).tar.bz2 $(package)_sha256_hash=430ae8354789de4fd19ee52f3b1f739e1fba576f0aded0897c3c2bc00fb38778 define $(package)_set_vars diff --git a/depends/packages/capnp.mk b/depends/packages/capnp.mk new file mode 100644 index 00000000..abeb2654 --- /dev/null +++ b/depends/packages/capnp.mk @@ -0,0 +1,18 @@ +package=capnp +$(package)_version=$(native_$(package)_version) +$(package)_download_path=$(native_$(package)_download_path) +$(package)_file_name=$(native_$(package)_file_name) +$(package)_sha256_hash=$(native_$(package)_sha256_hash) +$(package)_dependencies=native_$(package) + +define $(package)_config_cmds + $($(package)_autoconf) --with-external-capnp +endef + +define $(package)_build_cmds + $(MAKE) +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install +endef diff --git a/depends/packages/libmultiprocess.mk b/depends/packages/libmultiprocess.mk new file mode 100644 index 00000000..3e5cf5f1 --- /dev/null +++ b/depends/packages/libmultiprocess.mk @@ -0,0 +1,18 @@ +package=libmultiprocess +$(package)_version=$(native_$(package)_version) +$(package)_download_path=$(native_$(package)_download_path) +$(package)_file_name=$(native_$(package)_file_name) +$(package)_sha256_hash=$(native_$(package)_sha256_hash) +$(package)_dependencies=native_$(package) boost capnp + +define $(package)_config_cmds + $($(package)_cmake) +endef + +define $(package)_build_cmds + $(MAKE) +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install +endef diff --git a/depends/packages/native_capnp.mk b/depends/packages/native_capnp.mk new file mode 100644 index 00000000..ed5a6dee --- /dev/null +++ b/depends/packages/native_capnp.mk @@ -0,0 +1,18 @@ +package=native_capnp +$(package)_version=0.7.0 +$(package)_download_path=https://capnproto.org/ +$(package)_download_file=capnproto-c++-$($(package)_version).tar.gz +$(package)_file_name=capnproto-cxx-$($(package)_version).tar.gz +$(package)_sha256_hash=c9a4c0bd88123064d483ab46ecee777f14d933359e23bff6fb4f4dbd28b4cd41 + +define $(package)_config_cmds + $($(package)_autoconf) +endef + +define $(package)_build_cmds + $(MAKE) +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install +endef diff --git a/depends/packages/native_libmultiprocess.mk b/depends/packages/native_libmultiprocess.mk new file mode 100644 index 00000000..c50fdc3f --- /dev/null +++ b/depends/packages/native_libmultiprocess.mk @@ -0,0 +1,18 @@ +package=native_libmultiprocess +$(package)_version=5741d750a04e644a03336090d8979c6d033e32c0 +$(package)_download_path=https://github.com/chaincodelabs/libmultiprocess/archive +$(package)_file_name=$($(package)_version).tar.gz +$(package)_sha256_hash=ac848db49a6ed53e423c62d54bd87f1f08cbb0326254a8667e10bbfe5bf032a4 +$(package)_dependencies=native_capnp + +define $(package)_config_cmds + $($(package)_cmake) +endef + +define $(package)_build_cmds + $(MAKE) +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install +endef diff --git a/depends/packages/packages.mk b/depends/packages/packages.mk index 3bbea254..822a312d 100644 --- a/depends/packages/packages.mk +++ b/depends/packages/packages.mk @@ -15,6 +15,9 @@ zmq_packages=zeromq upnp_packages=miniupnpc +multiprocess_packages = libmultiprocess capnp +multiprocess_native_packages = native_libmultiprocess native_capnp + darwin_native_packages = native_biplist native_ds_store native_mac_alias ifneq ($(build_os),darwin) From 73d559f13aa4aa25b242afa466183b01cf7bebc3 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Fri, 20 Sep 2024 11:30:53 +0200 Subject: [PATCH 019/103] Bitcoin: 69bfcac27a83440092bc6e61904ded910ed4baf (gui: update Qt base translations for macOS release). --- Makefile.am | 2 +- depends/packages/qt.mk | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index cb35af86..abdd68c2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -42,7 +42,7 @@ OSX_DEPLOY_SCRIPT=$(top_srcdir)/contrib/macdeploy/macdeployqtplus OSX_FANCY_PLIST=$(top_srcdir)/contrib/macdeploy/fancy.plist OSX_INSTALLER_ICONS=$(top_srcdir)/src/qt/res/icons/auroracoin.icns OSX_PLIST=$(top_builddir)/share/qt/Info.plist #not installed -OSX_QT_TRANSLATIONS = da,de,es,hu,ru,uk,zh_CN,zh_TW +OSX_QT_TRANSLATIONS = ar,bg,ca,cs,da,de,es,fa,fi,fr,gd,gl,he,hu,it,ja,ko,lt,lv,pl,pt,ru,sk,sl,sv,uk,zh_CN,zh_TW DIST_DOCS = $(wildcard doc/*.md) $(wildcard doc/release-notes/*.md) DIST_CONTRIB = $(top_srcdir)/contrib/auroracoin-cli.bash-completion \ diff --git a/depends/packages/qt.mk b/depends/packages/qt.mk index 42f35302..90717ba5 100644 --- a/depends/packages/qt.mk +++ b/depends/packages/qt.mk @@ -10,6 +10,7 @@ $(package)_build_subdir=qtbase $(package)_qt_libs=corelib network widgets gui plugins testlib $(package)_patches=fix_qt_pkgconfig.patch mac-qmake.conf fix_configure_mac.patch fix_no_printer.patch fix_rcc_determinism.patch fix_riscv64_arch.patch xkb-default.patch no-xlib.patch qt_limits.patch qt_no_tagtouchinput.patch +# Update OSX_QT_TRANSLATIONS when this is updated $(package)_qttranslations_file_name=qttranslations-$($(package)_suffix) $(package)_qttranslations_sha256_hash=fb5a47799754af73d3bf501fe513342cfe2fc37f64e80df5533f6110e804220c From 425ffa59deff5251234f361ebec4f0dca1ef8eb7 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Fri, 20 Sep 2024 11:32:50 +0200 Subject: [PATCH 020/103] Bitcoin: 3d6603e340d6d461832f0aa204b04343d34af3d (depends: Propagate well-known vars into depends). --- depends/hosts/default.mk | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/depends/hosts/default.mk b/depends/hosts/default.mk index 144e5f88..258619a9 100644 --- a/depends/hosts/default.mk +++ b/depends/hosts/default.mk @@ -13,9 +13,18 @@ default_host_OTOOL = $(host_toolchain)otool default_host_NM = $(host_toolchain)nm define add_host_tool_func +ifneq ($(filter $(origin $1),undefined default),) +# Do not consider the well-known var $1 if it is undefined or is taking a value +# that is predefined by "make" (e.g. the make variable "CC" has a predefined +# value of "cc") $(host_os)_$1?=$$(default_host_$1) $(host_arch)_$(host_os)_$1?=$$($(host_os)_$1) $(host_arch)_$(host_os)_$(release_type)_$1?=$$($(host_os)_$1) +else +$(host_os)_$1=$(or $($1),$($(host_os)_$1),$(default_host_$1)) +$(host_arch)_$(host_os)_$1=$(or $($1),$($(host_arch)_$(host_os)_$1),$$($(host_os)_$1)) +$(host_arch)_$(host_os)_$(release_type)_$1=$(or $($1),$($(host_arch)_$(host_os)_$(release_type)_$1),$$($(host_os)_$1)) +endif host_$1=$$($(host_arch)_$(host_os)_$1) endef From 5c89e25ea29cf6a5109d44962671edf5d4fd706d Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Fri, 20 Sep 2024 11:35:10 +0200 Subject: [PATCH 021/103] Bitcoin: 2d4e48081382a58033ed5c3734a4ad810b56a96 (depends: boost: Specify toolset to bootstrap.sh). --- depends/packages/boost.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/depends/packages/boost.mk b/depends/packages/boost.mk index dc67c280..e939a55c 100644 --- a/depends/packages/boost.mk +++ b/depends/packages/boost.mk @@ -28,7 +28,7 @@ define $(package)_preprocess_cmds endef define $(package)_config_cmds - ./bootstrap.sh --without-icu --with-libraries=$($(package)_config_libraries) + ./bootstrap.sh --without-icu --with-libraries=$($(package)_config_libraries) --with-toolset=$($(package)_toolset_$(host_os)) endef define $(package)_build_cmds From f3f5224b27389021ff80de51d9b7691afb7574e2 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Fri, 20 Sep 2024 11:37:29 +0200 Subject: [PATCH 022/103] Bitcoin: 1ce74bcde341bbab538937544a0e4b4abccdc05 (depends: boost: Split target-os from toolset). --- depends/packages/boost.mk | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/depends/packages/boost.mk b/depends/packages/boost.mk index e939a55c..f40146fc 100644 --- a/depends/packages/boost.mk +++ b/depends/packages/boost.mk @@ -9,15 +9,15 @@ $(package)_config_opts_release=variant=release $(package)_config_opts_debug=variant=debug $(package)_config_opts=--layout=tagged --build-type=complete --user-config=user-config.jam $(package)_config_opts+=threading=multi link=static -sNO_BZIP2=1 -sNO_ZLIB=1 -$(package)_config_opts_linux=threadapi=pthread runtime-link=shared -$(package)_config_opts_darwin=--toolset=clang-darwin runtime-link=shared -$(package)_config_opts_mingw32=binary-format=pe target-os=windows threadapi=win32 runtime-link=static +$(package)_config_opts_linux=target-os=linux threadapi=pthread runtime-link=shared +$(package)_config_opts_darwin=target-os=darwin runtime-link=shared +$(package)_config_opts_mingw32=target-os=windows binary-format=pe threadapi=win32 runtime-link=static $(package)_config_opts_x86_64_mingw32=address-model=64 $(package)_config_opts_i686_mingw32=address-model=32 $(package)_config_opts_i686_linux=address-model=32 architecture=x86 $(package)_toolset_$(host_os)=gcc +$(package)_toolset_darwin=clang $(package)_archiver_$(host_os)=$($(package)_ar) -$(package)_toolset_darwin=clang-darwin $(package)_config_libraries=filesystem,system,thread,test $(package)_cxxflags=-std=c++11 -fvisibility=hidden $(package)_cxxflags_linux=-fPIC @@ -32,9 +32,9 @@ define $(package)_config_cmds endef define $(package)_build_cmds - ./b2 --ignore-site-config -d2 -j2 -d1 --prefix=$($(package)_staging_prefix_dir) $($(package)_config_opts) stage + ./b2 -d2 -j2 -d1 --prefix=$($(package)_staging_prefix_dir) $($(package)_config_opts) toolset=$($(package)_toolset_$(host_os)) stage endef define $(package)_stage_cmds - ./b2 --ignore-site-config -d0 -j4 --prefix=$($(package)_staging_prefix_dir) $($(package)_config_opts) install + ./b2 -d0 -j4 --prefix=$($(package)_staging_prefix_dir) $($(package)_config_opts) toolset=$($(package)_toolset_$(host_os)) install endef From e1a6464a35dad05afb8b4c5d74d03cd0f82a93e1 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Fri, 20 Sep 2024 11:38:28 +0200 Subject: [PATCH 023/103] Bitcoin: 0a33803f1c42c938cc7c6c5291ef1f9a1dfb491 (depends: boost: Use clang toolset if clang in CXX). --- depends/packages/boost.mk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/depends/packages/boost.mk b/depends/packages/boost.mk index f40146fc..95d1d5f8 100644 --- a/depends/packages/boost.mk +++ b/depends/packages/boost.mk @@ -17,6 +17,9 @@ $(package)_config_opts_i686_mingw32=address-model=32 $(package)_config_opts_i686_linux=address-model=32 architecture=x86 $(package)_toolset_$(host_os)=gcc $(package)_toolset_darwin=clang +ifneq (,$(findstring clang,$($(package)_cxx))) + $(package)_toolset_$(host_os)=clang +endif $(package)_archiver_$(host_os)=$($(package)_ar) $(package)_config_libraries=filesystem,system,thread,test $(package)_cxxflags=-std=c++11 -fvisibility=hidden From 40eee4ff7e02bd349a1bfb79baa9bd69be123515 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Fri, 20 Sep 2024 11:39:31 +0200 Subject: [PATCH 024/103] Bitcoin: f0d7ed10b48a6303d8b0cb6f2fc6b8652945bff (depends: Propagate only specific CLI variables to sub-makes). --- depends/Makefile | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/depends/Makefile b/depends/Makefile index b3cf5873..5225b3dd 100644 --- a/depends/Makefile +++ b/depends/Makefile @@ -4,6 +4,30 @@ print-%: @echo $* = $($*) +# When invoking a sub-make, keep only the command line variable definitions +# matching the pattern in the filter function. +# +# e.g. invoking: +# $ make A=1 C=1 print-MAKEOVERRIDES print-MAKEFLAGS +# +# with the following in the Makefile: +# MAKEOVERRIDES := $(filter A=% B=%,$(MAKEOVERRIDES)) +# +# will print: +# MAKEOVERRIDES = A=1 +# MAKEFLAGS = -- A=1 +# +# this is because as the GNU make manual says: +# The command line variable definitions really appear in the variable +# MAKEOVERRIDES, and MAKEFLAGS contains a reference to this variable. +# +# and since the GNU make manual also says: +# variables defined on the command line are passed to the sub-make through +# MAKEFLAGS +# +# this means that sub-makes will be invoked as if: +# $(MAKE) A=1 blah blah +MAKEOVERRIDES := $(filter V=%,$(MAKEOVERRIDES)) SOURCES_PATH ?= $(BASEDIR)/sources WORK_PATH = $(BASEDIR)/work BASE_CACHE ?= $(BASEDIR)/built From 3dd6a0368baec22548af041ba8ca7829b2f57dee Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Fri, 20 Sep 2024 13:22:23 +0200 Subject: [PATCH 025/103] Bitcoin: 3381e4a1892511d4d555853887c89badf4c940a (Adapt rest of tooling to new SDK naming scheme). --- ci/test/00_setup_env_mac.sh | 3 ++- ci/test/05_before_script.sh | 11 +++++++---- contrib/gitian-build.py | 2 +- contrib/gitian-descriptors/gitian-osx.yml | 4 ++-- depends/hosts/darwin.mk | 6 ++++-- 5 files changed, 16 insertions(+), 10 deletions(-) diff --git a/ci/test/00_setup_env_mac.sh b/ci/test/00_setup_env_mac.sh index cdd99daf..0ff28b4d 100644 --- a/ci/test/00_setup_env_mac.sh +++ b/ci/test/00_setup_env_mac.sh @@ -8,7 +8,8 @@ export LC_ALL=C.UTF-8 export HOST=x86_64-apple-darwin16 export PACKAGES="cmake imagemagick libcap-dev librsvg2-bin libz-dev libbz2-dev libtiff-tools python3-dev python3-setuptools" -export OSX_SDK=10.14 +export XCODE_VERSION=10.2.1 +export XCODE_BUILD_ID=10E1001 export RUN_UNIT_TESTS=false export RUN_FUNCTIONAL_TESTS=false export GOAL="deploy" diff --git a/ci/test/05_before_script.sh b/ci/test/05_before_script.sh index 8c0984fd..865b8a1a 100755 --- a/ci/test/05_before_script.sh +++ b/ci/test/05_before_script.sh @@ -10,11 +10,14 @@ DOCKER_EXEC echo \> \$HOME/.bitcoin # Make sure default datadir does not exist mkdir -p depends/SDKs depends/sdk-sources -if [ -n "$OSX_SDK" ] && [ ! -f depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz ]; then - curl --location --fail $SDK_URL/MacOSX${OSX_SDK}.sdk.tar.gz -o depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz +OSX_SDK_BASENAME="Xcode-${XCODE_VERSION}-${XCODE_BUILD_ID}-extracted-SDK-with-libcxx-headers.tar.gz" +OSX_SDK_PATH="${DEPENDS_DIR}/sdk-sources/${OSX_SDK_BASENAME}" + +if [ -n "$XCODE_VERSION" ] && [ ! -f "$OSX_SDK_PATH" ]; then + curl --location --fail "${SDK_URL}/${OSX_SDK_BASENAME}" -o "$OSX_SDK_PATH" fi -if [ -n "$OSX_SDK" ] && [ -f depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz ]; then - tar -C depends/SDKs -xf depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz +if [ -n "$XCODE_VERSION" ] && [ -f "$OSX_SDK_PATH" ]; then + DOCKER_EXEC tar -C "${DEPENDS_DIR}/SDKs" -xf "$OSX_SDK_PATH" fi if [[ $HOST = *-mingw32 ]]; then DOCKER_EXEC update-alternatives --set $HOST-g++ \$\(which $HOST-g++-posix\) diff --git a/contrib/gitian-build.py b/contrib/gitian-build.py index 0842ba59..05628169 100755 --- a/contrib/gitian-build.py +++ b/contrib/gitian-build.py @@ -207,7 +207,7 @@ def main(): args.macos = 'm' in args.os # Disable for MacOS if no SDK found - if args.macos and not os.path.isfile('gitian-builder/inputs/MacOSX10.14.sdk.tar.gz'): + if args.macos and not os.path.isfile('gitian-builder/inputs/Xcode-10.2.1-10E1001-extracted-SDK-with-libcxx-headers.tar.gz'): print('Cannot build for MacOS, SDK does not exist. Will build for other OSes') args.macos = False diff --git a/contrib/gitian-descriptors/gitian-osx.yml b/contrib/gitian-descriptors/gitian-osx.yml index ad78520c..4328969d 100644 --- a/contrib/gitian-descriptors/gitian-osx.yml +++ b/contrib/gitian-descriptors/gitian-osx.yml @@ -32,7 +32,7 @@ remotes: - "url": "https://github.com/aurarad/auroracoin.git" "dir": "auroracoin" files: -- "MacOSX10.14.sdk.tar.gz" +- "Xcode-10.2.1-10E1001-extracted-SDK-with-libcxx-headers.tar.gz" script: | set -e -o pipefail @@ -89,7 +89,7 @@ script: | BASEPREFIX=`pwd`/depends mkdir -p ${BASEPREFIX}/SDKs - tar -C ${BASEPREFIX}/SDKs -xf ${BUILD_DIR}/MacOSX10.14.sdk.tar.gz + tar -C ${BASEPREFIX}/SDKs -xf ${BUILD_DIR}/Xcode-10.2.1-10E1001-extracted-SDK-with-libcxx-headers.tar.gz # Build dependencies for each host for i in $HOSTS; do diff --git a/depends/hosts/darwin.mk b/depends/hosts/darwin.mk index 82e086a3..272b8230 100644 --- a/depends/hosts/darwin.mk +++ b/depends/hosts/darwin.mk @@ -1,6 +1,8 @@ OSX_MIN_VERSION=10.12 -OSX_SDK_VERSION=10.14 -OSX_SDK=$(SDK_PATH)/MacOSX$(OSX_SDK_VERSION).sdk +OSX_SDK_VERSION=10.14.4 +XCODE_VERSION=10.2.1 +XCODE_BUILD_ID=10E1001 +OSX_SDK=$(SDK_PATH)/Xcode-$(XCODE_VERSION)-$(XCODE_BUILD_ID)-extracted-SDK-with-libcxx-headers darwin_CC=clang -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) darwin_CXX=clang++ -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -stdlib=libc++ From aa9670312d9838024d5465954fe82dabe08a4c0c Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Fri, 20 Sep 2024 13:23:41 +0200 Subject: [PATCH 026/103] Bitcoin: fbcfcf695435c9587e9f9fd2809c4d5350b2558 (native_cctools: Don't use libc++ from pinned clang). --- depends/packages/native_cctools.mk | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/depends/packages/native_cctools.mk b/depends/packages/native_cctools.mk index 4195230b..b4957357 100644 --- a/depends/packages/native_cctools.mk +++ b/depends/packages/native_cctools.mk @@ -72,7 +72,5 @@ define $(package)_stage_cmds cp -P bin/clang++ $($(package)_staging_prefix_dir)/bin/ &&\ cp lib/libLTO.so $($(package)_staging_prefix_dir)/lib/ && \ cp -rf lib/clang/$($(package)_clang_version)/include/* $($(package)_staging_prefix_dir)/lib/clang/$($(package)_clang_version)/include/ && \ - cp bin/llvm-dsymutil $($(package)_staging_prefix_dir)/bin/$(host)-dsymutil && \ - if `test -d include/c++/`; then cp -rf include/c++/ $($(package)_staging_prefix_dir)/include/; fi && \ - if `test -d lib/c++/`; then cp -rf lib/c++/ $($(package)_staging_prefix_dir)/lib/; fi + cp bin/llvm-dsymutil $($(package)_staging_prefix_dir)/bin/$(host)-dsymutil endef From 0ab2c5485d74438d502e1b269b7a9dca4bae7ac9 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Fri, 20 Sep 2024 13:24:54 +0200 Subject: [PATCH 027/103] Bitcoin: 5c2c835433a80c204da1335daa51a014670c732 (depends: bump MacOS toolchain). --- depends/packages/native_cctools.mk | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/depends/packages/native_cctools.mk b/depends/packages/native_cctools.mk index b4957357..bdebd118 100644 --- a/depends/packages/native_cctools.mk +++ b/depends/packages/native_cctools.mk @@ -1,14 +1,14 @@ package=native_cctools -$(package)_version=3764b223c011574971ee3ae09ce968ba5dc2f00f +$(package)_version=4da2f3b485bcf4cef526f30c0b8c0bcda99cdbb4 $(package)_download_path=https://github.com/tpoechtrager/cctools-port/archive $(package)_file_name=$($(package)_version).tar.gz -$(package)_sha256_hash=3e35907bf376269a844df08e03cbb43e345c88125374f2228e03724b5f9a2a04 +$(package)_sha256_hash=a2d491c0981cef72fee2b833598f20f42a6c44a7614a61c439bda93d56446fec $(package)_build_subdir=cctools -$(package)_clang_version=6.0.1 +$(package)_clang_version=8.0.0 $(package)_clang_download_path=https://releases.llvm.org/$($(package)_clang_version) $(package)_clang_download_file=clang+llvm-$($(package)_clang_version)-x86_64-linux-gnu-ubuntu-14.04.tar.xz $(package)_clang_file_name=clang-llvm-$($(package)_clang_version)-x86_64-linux-gnu-ubuntu-14.04.tar.xz -$(package)_clang_sha256_hash=fa5416553ca94a8c071a27134c094a5fb736fe1bd0ecc5ef2d9bc02754e1bef0 +$(package)_clang_sha256_hash=9ef854b71949f825362a119bf2597f744836cb571131ae6b721cd102ffea8cd0 $(package)_libtapi_version=3efb201881e7a76a21e0554906cf306432539cef $(package)_libtapi_download_path=https://github.com/tpoechtrager/apple-libtapi/archive @@ -72,5 +72,5 @@ define $(package)_stage_cmds cp -P bin/clang++ $($(package)_staging_prefix_dir)/bin/ &&\ cp lib/libLTO.so $($(package)_staging_prefix_dir)/lib/ && \ cp -rf lib/clang/$($(package)_clang_version)/include/* $($(package)_staging_prefix_dir)/lib/clang/$($(package)_clang_version)/include/ && \ - cp bin/llvm-dsymutil $($(package)_staging_prefix_dir)/bin/$(host)-dsymutil + cp bin/dsymutil $($(package)_staging_prefix_dir)/bin/$(host)-dsymutil endef From af2b047a15baaac4021c8f6cd0a20428aa6d30ee Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Fri, 20 Sep 2024 13:28:48 +0200 Subject: [PATCH 028/103] Bitcoin: 2418f739f75824d6689369f326b960cec254cf5 (macos: Bump to xcode 11.3.1 and 10.15 SDK). --- ci/test/00_setup_env_mac.sh | 4 ++-- contrib/gitian-build.py | 2 +- contrib/gitian-descriptors/gitian-osx.yml | 4 ++-- contrib/macdeploy/README.md | 6 +++--- depends/hosts/darwin.mk | 6 +++--- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/ci/test/00_setup_env_mac.sh b/ci/test/00_setup_env_mac.sh index 0ff28b4d..f4b3cfae 100644 --- a/ci/test/00_setup_env_mac.sh +++ b/ci/test/00_setup_env_mac.sh @@ -8,8 +8,8 @@ export LC_ALL=C.UTF-8 export HOST=x86_64-apple-darwin16 export PACKAGES="cmake imagemagick libcap-dev librsvg2-bin libz-dev libbz2-dev libtiff-tools python3-dev python3-setuptools" -export XCODE_VERSION=10.2.1 -export XCODE_BUILD_ID=10E1001 +export XCODE_VERSION=11.3.1 +export XCODE_BUILD_ID=11C505 export RUN_UNIT_TESTS=false export RUN_FUNCTIONAL_TESTS=false export GOAL="deploy" diff --git a/contrib/gitian-build.py b/contrib/gitian-build.py index 05628169..9de99ec6 100755 --- a/contrib/gitian-build.py +++ b/contrib/gitian-build.py @@ -207,7 +207,7 @@ def main(): args.macos = 'm' in args.os # Disable for MacOS if no SDK found - if args.macos and not os.path.isfile('gitian-builder/inputs/Xcode-10.2.1-10E1001-extracted-SDK-with-libcxx-headers.tar.gz'): + if args.macos and not os.path.isfile('gitian-builder/inputs/Xcode-11.3.1-11C505-extracted-SDK-with-libcxx-headers.tar.gz'): print('Cannot build for MacOS, SDK does not exist. Will build for other OSes') args.macos = False diff --git a/contrib/gitian-descriptors/gitian-osx.yml b/contrib/gitian-descriptors/gitian-osx.yml index 4328969d..fed49c67 100644 --- a/contrib/gitian-descriptors/gitian-osx.yml +++ b/contrib/gitian-descriptors/gitian-osx.yml @@ -32,7 +32,7 @@ remotes: - "url": "https://github.com/aurarad/auroracoin.git" "dir": "auroracoin" files: -- "Xcode-10.2.1-10E1001-extracted-SDK-with-libcxx-headers.tar.gz" +- "Xcode-11.3.1-11C505-extracted-SDK-with-libcxx-headers.tar.gz" script: | set -e -o pipefail @@ -89,7 +89,7 @@ script: | BASEPREFIX=`pwd`/depends mkdir -p ${BASEPREFIX}/SDKs - tar -C ${BASEPREFIX}/SDKs -xf ${BUILD_DIR}/Xcode-10.2.1-10E1001-extracted-SDK-with-libcxx-headers.tar.gz + tar -C ${BASEPREFIX}/SDKs -xf ${BUILD_DIR}/Xcode-11.3.1-11C505-extracted-SDK-with-libcxx-headers.tar.gz # Build dependencies for each host for i in $HOSTS; do diff --git a/contrib/macdeploy/README.md b/contrib/macdeploy/README.md index a614322e..4bf21f70 100644 --- a/contrib/macdeploy/README.md +++ b/contrib/macdeploy/README.md @@ -34,7 +34,7 @@ pushd pbzx clang -llzma -lxar pbzx.c -o pbzx -Wl,-rpath=/usr/local/lib popd -xar -xf Xcode_10.2.1.xip -C . +xar -xf Xcode_10.3.1.xip -C . ./pbzx/pbzx -n Content | cpio -i @@ -44,7 +44,7 @@ find Xcode.app -type d -name MacOSX.sdk -execdir sh -c 'tar -c MacOSX.sdk/ | gzi on macOS the process is more straightforward: ```bash -xip -x Xcode_10.2.1.xip +xip -x Xcode_10.3.1.xip tar -C Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/ -czf MacOSX10.14.sdk.tar.gz MacOSX.sdk ``` @@ -87,7 +87,7 @@ and its `libLTO.so` rather than those from `llvmgcc`, as it was originally done To complicate things further, all builds must target an Apple SDK. These SDKs are free to download, but not redistributable. To obtain it, register for an Apple Developer Account, -then download [Xcode 10.2.1](https://download.developer.apple.com/Developer_Tools/Xcode_10.2.1/Xcode_10.2.1.xip). +then download [Xcode_11.3.1](https://download.developer.apple.com/Developer_Tools/Xcode_11.3.1/Xcode_11.3.1.xip). This file is many gigabytes in size, but most (but not all) of what we need is contained only in a single directory: diff --git a/depends/hosts/darwin.mk b/depends/hosts/darwin.mk index 272b8230..1302b428 100644 --- a/depends/hosts/darwin.mk +++ b/depends/hosts/darwin.mk @@ -1,7 +1,7 @@ OSX_MIN_VERSION=10.12 -OSX_SDK_VERSION=10.14.4 -XCODE_VERSION=10.2.1 -XCODE_BUILD_ID=10E1001 +OSX_SDK_VERSION=10.15.1 +XCODE_VERSION=11.3.1 +XCODE_BUILD_ID=11C505 OSX_SDK=$(SDK_PATH)/Xcode-$(XCODE_VERSION)-$(XCODE_BUILD_ID)-extracted-SDK-with-libcxx-headers darwin_CC=clang -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) darwin_CXX=clang++ -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -stdlib=libc++ From 847f559dd1a5ee579b1436750faf0641c37f2fc0 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Fri, 20 Sep 2024 13:30:03 +0200 Subject: [PATCH 029/103] Bitcoin: adf543d7144a44f8cd28a090a21c4e2a606862d (darwin: pass mlinker-version so that clang enables new features). --- depends/hosts/darwin.mk | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/depends/hosts/darwin.mk b/depends/hosts/darwin.mk index 1302b428..5f0bffa5 100644 --- a/depends/hosts/darwin.mk +++ b/depends/hosts/darwin.mk @@ -2,9 +2,11 @@ OSX_MIN_VERSION=10.12 OSX_SDK_VERSION=10.15.1 XCODE_VERSION=11.3.1 XCODE_BUILD_ID=11C505 +LD64_VERSION=530 + OSX_SDK=$(SDK_PATH)/Xcode-$(XCODE_VERSION)-$(XCODE_BUILD_ID)-extracted-SDK-with-libcxx-headers -darwin_CC=clang -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -darwin_CXX=clang++ -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -stdlib=libc++ +darwin_CC=clang -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -mlinker-version=$(LD64_VERSION) +darwin_CXX=clang++ -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -stdlib=libc++ -mlinker-version=$(LD64_VERSION) darwin_CFLAGS=-pipe darwin_CXXFLAGS=$(darwin_CFLAGS) From 9de790b4ed6612b516afe1e858c37a8041a43e75 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Fri, 20 Sep 2024 13:31:45 +0200 Subject: [PATCH 030/103] Bitcoin: 03e056edcd1a7f7197a29068c52fa33fce12f7d (depends: Patch libevent build to fix IPv6 -rpcbind on Windows). --- depends/packages/libevent.mk | 2 ++ .../libevent/0001-fix-windows-getaddrinfo.patch | 15 +++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 depends/patches/libevent/0001-fix-windows-getaddrinfo.patch diff --git a/depends/packages/libevent.mk b/depends/packages/libevent.mk index 7df3778f..b50b6106 100644 --- a/depends/packages/libevent.mk +++ b/depends/packages/libevent.mk @@ -3,8 +3,10 @@ $(package)_version=2.1.11-stable $(package)_download_path=https://github.com/libevent/libevent/archive/ $(package)_file_name=release-$($(package)_version).tar.gz $(package)_sha256_hash=229393ab2bf0dc94694f21836846b424f3532585bac3468738b7bf752c03901e +$(package)_patches=0001-fix-windows-getaddrinfo.patch define $(package)_preprocess_cmds + patch -p1 < $($(package)_patch_dir)/0001-fix-windows-getaddrinfo.patch && \ ./autogen.sh endef diff --git a/depends/patches/libevent/0001-fix-windows-getaddrinfo.patch b/depends/patches/libevent/0001-fix-windows-getaddrinfo.patch new file mode 100644 index 00000000..a98cd90b --- /dev/null +++ b/depends/patches/libevent/0001-fix-windows-getaddrinfo.patch @@ -0,0 +1,15 @@ +diff -ur libevent-2.1.8-stable.orig/configure.ac libevent-2.1.8-stable/configure.ac +--- libevent-2.1.8-stable.orig/configure.ac 2017-01-29 17:51:00.000000000 +0000 ++++ libevent-2.1.8-stable/configure.ac 2020-03-07 01:11:16.311335005 +0000 +@@ -389,6 +389,10 @@ + #ifdef HAVE_NETDB_H + #include + #endif ++#ifdef _WIN32 ++#include ++#include ++#endif + ]], + [[ + getaddrinfo; +Only in libevent-2.1.8-stable: configure.ac~ From ffa7f91196bfac5b8475218be13ed7881e19e7a0 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Fri, 20 Sep 2024 13:33:02 +0200 Subject: [PATCH 031/103] Bitcoin: a8d39b88406e2047746366355666b5f603105a2 (doc: explain why passing -mlinker-version is required). --- depends/hosts/darwin.mk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/depends/hosts/darwin.mk b/depends/hosts/darwin.mk index 5f0bffa5..0d4fab93 100644 --- a/depends/hosts/darwin.mk +++ b/depends/hosts/darwin.mk @@ -5,6 +5,9 @@ XCODE_BUILD_ID=11C505 LD64_VERSION=530 OSX_SDK=$(SDK_PATH)/Xcode-$(XCODE_VERSION)-$(XCODE_BUILD_ID)-extracted-SDK-with-libcxx-headers + +# When cross-compiling for Darwin using Clang, -mlinker-version must be passed to +# ensure that modern linker features are enabled. darwin_CC=clang -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -mlinker-version=$(LD64_VERSION) darwin_CXX=clang++ -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -stdlib=libc++ -mlinker-version=$(LD64_VERSION) From f827f7edc0ff54b2fb64e0f010a3fe58120426df Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Fri, 20 Sep 2024 13:35:43 +0200 Subject: [PATCH 032/103] Bitcoin: eb6b73540d1ee7ff5a6874dd0e35f9b30b68e3b (build: pass _WIN32_WINNT=0x0601 when building libevent for Windows). --- depends/packages/libevent.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/depends/packages/libevent.mk b/depends/packages/libevent.mk index b50b6106..b75b7c3c 100644 --- a/depends/packages/libevent.mk +++ b/depends/packages/libevent.mk @@ -10,11 +10,15 @@ define $(package)_preprocess_cmds ./autogen.sh endef +# When building for Windows, we set _WIN32_WINNT to target the same Windows +# version as we do in configure. Due to quirks in libevents build system, this +# is also required to enable support for ipv6. See #19375. define $(package)_set_vars $(package)_config_opts=--disable-shared --disable-openssl --disable-libevent-regress --disable-samples $(package)_config_opts += --disable-dependency-tracking --enable-option-checking $(package)_config_opts_release=--disable-debug-mode $(package)_config_opts_linux=--with-pic + $(package)_cppflags_mingw32=-D_WIN32_WINNT=0x0601 endef define $(package)_config_cmds From 1ed5ff3211fbe196a8f8014d168ce2e9fb8c487b Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Mon, 23 Sep 2024 13:39:10 +0200 Subject: [PATCH 033/103] Bitcoin: e6e5c8d6caccb4648fc580e5a01448857c2fdf1 (depends: Decouple toolchain + binutils). --- depends/Makefile | 10 ++++++---- depends/builders/darwin.mk | 1 + depends/funcs.mk | 4 ++-- depends/hosts/darwin.mk | 1 + 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/depends/Makefile b/depends/Makefile index 5225b3dd..55bdaaad 100644 --- a/depends/Makefile +++ b/depends/Makefile @@ -145,10 +145,12 @@ all_packages = $(packages) $(native_packages) meta_depends = Makefile funcs.mk builders/default.mk hosts/default.mk hosts/$(host_os).mk builders/$(build_os).mk +$(host_arch)_$(host_os)_native_binutils?=$($(host_os)_native_binutils) $(host_arch)_$(host_os)_native_toolchain?=$($(host_os)_native_toolchain) include funcs.mk +binutils_path=$($($(host_arch)_$(host_os)_native_binutils)_prefixbin) toolchain_path=$($($(host_arch)_$(host_os)_native_toolchain)_prefixbin) final_build_id_long+=$(shell $(build_SHA256SUM) config.site.in) final_build_id+=$(shell echo -n "$(final_build_id_long)" | $(build_SHA256SUM) | cut -c-$(HASH_LENGTH)) @@ -165,10 +167,10 @@ $(host_prefix)/share/config.site : config.site.in $(host_prefix)/.stamp_$(final_ $(AT)sed -e 's|@HOST@|$(host)|' \ -e 's|@CC@|$(toolchain_path)$(host_CC)|' \ -e 's|@CXX@|$(toolchain_path)$(host_CXX)|' \ - -e 's|@AR@|$(toolchain_path)$(host_AR)|' \ - -e 's|@RANLIB@|$(toolchain_path)$(host_RANLIB)|' \ - -e 's|@NM@|$(toolchain_path)$(host_NM)|' \ - -e 's|@STRIP@|$(toolchain_path)$(host_STRIP)|' \ + -e 's|@AR@|$(binutils_path)$(host_AR)|' \ + -e 's|@RANLIB@|$(binutils_path)$(host_RANLIB)|' \ + -e 's|@NM@|$(binutils_path)$(host_NM)|' \ + -e 's|@STRIP@|$(binutils_path)$(host_STRIP)|' \ -e 's|@build_os@|$(build_os)|' \ -e 's|@host_os@|$(host_os)|' \ -e 's|@CFLAGS@|$(strip $(host_CFLAGS) $(host_$(release_type)_CFLAGS))|' \ diff --git a/depends/builders/darwin.mk b/depends/builders/darwin.mk index 69c394ec..f4103fc1 100644 --- a/depends/builders/darwin.mk +++ b/depends/builders/darwin.mk @@ -19,4 +19,5 @@ 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= diff --git a/depends/funcs.mk b/depends/funcs.mk index 135ebba9..6fc20543 100644 --- a/depends/funcs.mk +++ b/depends/funcs.mk @@ -41,7 +41,7 @@ endef define int_get_build_id $(eval $(1)_dependencies += $($(1)_$(host_arch)_$(host_os)_dependencies) $($(1)_$(host_os)_dependencies)) -$(eval $(1)_all_dependencies:=$(call int_get_all_dependencies,$(1),$($($(1)_type)_native_toolchain) $($(1)_dependencies))) +$(eval $(1)_all_dependencies:=$(call int_get_all_dependencies,$(1),$($($(1)_type)_native_toolchain) $($($(1)_type)_native_binutils) $($(1)_dependencies))) $(foreach dep,$($(1)_all_dependencies),$(eval $(1)_build_id_deps+=$(dep)-$($(dep)_version)-$($(dep)_recipe_hash))) $(eval $(1)_build_id_long:=$(1)-$($(1)_version)-$($(1)_recipe_hash)-$(release_type) $($(1)_build_id_deps) $($($(1)_type)_id_string)) $(eval $(1)_build_id:=$(shell echo -n "$($(1)_build_id_long)" | $(build_SHA256SUM) | cut -c-$(HASH_LENGTH))) @@ -260,4 +260,4 @@ $(foreach package,$(all_packages),$(eval $(call int_config_attach_build_config,$ $(foreach package,$(all_packages),$(eval $(call int_add_cmds,$(package)))) #special exception: if a toolchain package exists, all non-native packages depend on it -$(foreach package,$(packages),$(eval $($(package)_unpacked): |$($($(host_arch)_$(host_os)_native_toolchain)_cached) )) +$(foreach package,$(packages),$(eval $($(package)_unpacked): |$($($(host_arch)_$(host_os)_native_toolchain)_cached) $($($(host_arch)_$(host_os)_native_binutils)_cached) )) diff --git a/depends/hosts/darwin.mk b/depends/hosts/darwin.mk index 0d4fab93..fcd4ef76 100644 --- a/depends/hosts/darwin.mk +++ b/depends/hosts/darwin.mk @@ -20,5 +20,6 @@ darwin_release_CXXFLAGS=$(darwin_release_CFLAGS) darwin_debug_CFLAGS=-O1 darwin_debug_CXXFLAGS=$(darwin_debug_CFLAGS) +darwin_native_binutils=native_cctools darwin_native_toolchain=native_cctools darwin_cmake_system=Darwin From 900f5f9491632353e2be6a25deafbf47c9c707fd Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Mon, 23 Sep 2024 13:40:24 +0200 Subject: [PATCH 034/103] Bitcoin: c9c572a367f08095a3e2c7c0723da9f6778b937 (depends: Allow building with system clang ). --- depends/Makefile | 4 +++ depends/hosts/darwin.mk | 9 +++++-- depends/packages/native_cctools.mk | 41 ++++++++++++++++++++++++++++-- 3 files changed, 50 insertions(+), 4 deletions(-) diff --git a/depends/Makefile b/depends/Makefile index 55bdaaad..8f6b1e4a 100644 --- a/depends/Makefile +++ b/depends/Makefile @@ -151,7 +151,11 @@ $(host_arch)_$(host_os)_native_toolchain?=$($(host_os)_native_toolchain) include funcs.mk binutils_path=$($($(host_arch)_$(host_os)_native_binutils)_prefixbin) +ifeq ($(strip $(FORCE_USE_SYSTEM_CLANG)),) toolchain_path=$($($(host_arch)_$(host_os)_native_toolchain)_prefixbin) +else +toolchain_path= +endif final_build_id_long+=$(shell $(build_SHA256SUM) config.site.in) final_build_id+=$(shell echo -n "$(final_build_id_long)" | $(build_SHA256SUM) | cut -c-$(HASH_LENGTH)) $(host_prefix)/.stamp_$(final_build_id): $(native_packages) $(packages) diff --git a/depends/hosts/darwin.mk b/depends/hosts/darwin.mk index fcd4ef76..fd32a9a6 100644 --- a/depends/hosts/darwin.mk +++ b/depends/hosts/darwin.mk @@ -8,8 +8,8 @@ OSX_SDK=$(SDK_PATH)/Xcode-$(XCODE_VERSION)-$(XCODE_BUILD_ID)-extracted-SDK-with- # When cross-compiling for Darwin using Clang, -mlinker-version must be passed to # ensure that modern linker features are enabled. -darwin_CC=clang -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -mlinker-version=$(LD64_VERSION) -darwin_CXX=clang++ -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -stdlib=libc++ -mlinker-version=$(LD64_VERSION) +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 darwin_CFLAGS=-pipe darwin_CXXFLAGS=$(darwin_CFLAGS) @@ -21,5 +21,10 @@ darwin_debug_CFLAGS=-O1 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 diff --git a/depends/packages/native_cctools.mk b/depends/packages/native_cctools.mk index bdebd118..072d3828 100644 --- a/depends/packages/native_cctools.mk +++ b/depends/packages/native_cctools.mk @@ -4,11 +4,13 @@ $(package)_download_path=https://github.com/tpoechtrager/cctools-port/archive $(package)_file_name=$($(package)_version).tar.gz $(package)_sha256_hash=a2d491c0981cef72fee2b833598f20f42a6c44a7614a61c439bda93d56446fec $(package)_build_subdir=cctools +ifeq ($(strip $(FORCE_USE_SYSTEM_CLANG)),) $(package)_clang_version=8.0.0 $(package)_clang_download_path=https://releases.llvm.org/$($(package)_clang_version) $(package)_clang_download_file=clang+llvm-$($(package)_clang_version)-x86_64-linux-gnu-ubuntu-14.04.tar.xz $(package)_clang_file_name=clang-llvm-$($(package)_clang_version)-x86_64-linux-gnu-ubuntu-14.04.tar.xz $(package)_clang_sha256_hash=9ef854b71949f825362a119bf2597f744836cb571131ae6b721cd102ffea8cd0 +endif $(package)_libtapi_version=3efb201881e7a76a21e0554906cf306432539cef $(package)_libtapi_download_path=https://github.com/tpoechtrager/apple-libtapi/archive @@ -16,15 +18,25 @@ $(package)_libtapi_download_file=$($(package)_libtapi_version).tar.gz $(package)_libtapi_file_name=$($(package)_libtapi_version).tar.gz $(package)_libtapi_sha256_hash=380c1ca37cfa04a8699d0887a8d3ee1ad27f3d08baba78887c73b09485c0fbd3 -$(package)_extra_sources=$($(package)_clang_file_name) -$(package)_extra_sources += $($(package)_libtapi_file_name) +$(package)_extra_sources=$($(package)_libtapi_file_name) +ifeq ($(strip $(FORCE_USE_SYSTEM_CLANG)),) +$(package)_extra_sources += $($(package)_clang_file_name) +endif +ifeq ($(strip $(FORCE_USE_SYSTEM_CLANG)),) define $(package)_fetch_cmds $(call fetch_file,$(package),$($(package)_download_path),$($(package)_download_file),$($(package)_file_name),$($(package)_sha256_hash)) && \ $(call fetch_file,$(package),$($(package)_clang_download_path),$($(package)_clang_download_file),$($(package)_clang_file_name),$($(package)_clang_sha256_hash)) && \ $(call fetch_file,$(package),$($(package)_libtapi_download_path),$($(package)_libtapi_download_file),$($(package)_libtapi_file_name),$($(package)_libtapi_sha256_hash)) endef +else +define $(package)_fetch_cmds +$(call fetch_file,$(package),$($(package)_download_path),$($(package)_download_file),$($(package)_file_name),$($(package)_sha256_hash)) && \ +$(call fetch_file,$(package),$($(package)_libtapi_download_path),$($(package)_libtapi_download_file),$($(package)_libtapi_file_name),$($(package)_libtapi_sha256_hash)) +endef +endif +ifeq ($(strip $(FORCE_USE_SYSTEM_CLANG)),) define $(package)_extract_cmds mkdir -p $($(package)_extract_dir) && \ echo "$($(package)_sha256_hash) $($(package)_source)" > $($(package)_extract_dir)/.$($(package)_file_name).hash && \ @@ -38,12 +50,28 @@ define $(package)_extract_cmds rm -f toolchain/lib/libc++abi.so* && \ tar --no-same-owner --strip-components=1 -xf $($(package)_source) endef +else +define $(package)_extract_cmds + mkdir -p $($(package)_extract_dir) && \ + echo "$($(package)_sha256_hash) $($(package)_source)" > $($(package)_extract_dir)/.$($(package)_file_name).hash && \ + echo "$($(package)_libtapi_sha256_hash) $($(package)_source_dir)/$($(package)_libtapi_file_name)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \ + $(build_SHA256SUM) -c $($(package)_extract_dir)/.$($(package)_file_name).hash && \ + mkdir -p libtapi && \ + tar --no-same-owner --strip-components=1 -C libtapi -xf $($(package)_source_dir)/$($(package)_libtapi_file_name) && \ + tar --no-same-owner --strip-components=1 -xf $($(package)_source) +endef +endif define $(package)_set_vars $(package)_config_opts=--target=$(host) --disable-lto-support --with-libtapi=$($(package)_extract_dir) $(package)_ldflags+=-Wl,-rpath=\\$$$$$$$$\$$$$$$$$ORIGIN/../lib + ifeq ($(strip $(FORCE_USE_SYSTEM_CLANG)),) $(package)_cc=$($(package)_extract_dir)/toolchain/bin/clang $(package)_cxx=$($(package)_extract_dir)/toolchain/bin/clang++ + else + $(package)_cc=clang + $(package)_cxx=clang++ + endif endef define $(package)_preprocess_cmds @@ -60,6 +88,7 @@ define $(package)_build_cmds $(MAKE) endef +ifeq ($(strip $(FORCE_USE_SYSTEM_CLANG)),) define $(package)_stage_cmds $(MAKE) DESTDIR=$($(package)_staging_dir) install && \ mkdir -p $($(package)_staging_prefix_dir)/lib/ && \ @@ -74,3 +103,11 @@ define $(package)_stage_cmds cp -rf lib/clang/$($(package)_clang_version)/include/* $($(package)_staging_prefix_dir)/lib/clang/$($(package)_clang_version)/include/ && \ cp bin/dsymutil $($(package)_staging_prefix_dir)/bin/$(host)-dsymutil endef +else +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install && \ + mkdir -p $($(package)_staging_prefix_dir)/lib/ && \ + cd $($(package)_extract_dir) && \ + cp lib/libtapi.so.6 $($(package)_staging_prefix_dir)/lib/ +endef +endif From 51a8cfbbccaa52025ff9a80e755915800e2b6260 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Mon, 23 Sep 2024 13:42:12 +0200 Subject: [PATCH 035/103] Bitcoin: 156b604203ef17b2b77ee9dacf15e375c809242 (depends: force a new host id string if FORCE_USE_SYSTEM_CLANG is in use). --- depends/Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/depends/Makefile b/depends/Makefile index 8f6b1e4a..aa152ac9 100644 --- a/depends/Makefile +++ b/depends/Makefile @@ -120,6 +120,11 @@ $(host_arch)_$(host_os)_id_string+=$(shell $(host_CXX) --version 2>/dev/null) $(host_arch)_$(host_os)_id_string+=$(shell $(host_RANLIB) --version 2>/dev/null) $(host_arch)_$(host_os)_id_string+=$(shell $(host_STRIP) --version 2>/dev/null) +ifneq ($(strip $(FORCE_USE_SYSTEM_CLANG)),) +build_id_string+=system_clang +$(host_arch)_$(host_os)_id_string+=system_clang +endif + qrencode_packages_$(NO_QR) = $(qrencode_packages) qt_packages_$(NO_QT) = $(qt_packages) $(qt_$(host_os)_packages) $(qt_$(host_arch)_$(host_os)_packages) $(qrencode_packages_) From dd468d73369bc0eab056c5b1fd418dfe2d80a320 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Mon, 23 Sep 2024 13:43:33 +0200 Subject: [PATCH 036/103] Bitcoin: 6b8e497eeaf38f272715c490f317fdc98a2174b (depends: specify libc++ header location for darwin). --- depends/hosts/darwin.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/depends/hosts/darwin.mk b/depends/hosts/darwin.mk index fd32a9a6..3cda45a2 100644 --- a/depends/hosts/darwin.mk +++ b/depends/hosts/darwin.mk @@ -9,7 +9,7 @@ OSX_SDK=$(SDK_PATH)/Xcode-$(XCODE_VERSION)-$(XCODE_BUILD_ID)-extracted-SDK-with- # When cross-compiling for Darwin using Clang, -mlinker-version must be passed to # ensure that modern linker features are enabled. 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 +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) From 2bc0a05b283e8a06cbe8f6c7afec4b49f0f820f9 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Mon, 23 Sep 2024 13:44:41 +0200 Subject: [PATCH 037/103] Bitcoin: 60c55b1b9bab8c1e143e2f4c26d729bfa0bbcf0 (depends: Add justifications for macOS clang flags). --- depends/hosts/darwin.mk | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/depends/hosts/darwin.mk b/depends/hosts/darwin.mk index 3cda45a2..6099fd4c 100644 --- a/depends/hosts/darwin.mk +++ b/depends/hosts/darwin.mk @@ -6,8 +6,28 @@ LD64_VERSION=530 OSX_SDK=$(SDK_PATH)/Xcode-$(XCODE_VERSION)-$(XCODE_BUILD_ID)-extracted-SDK-with-libcxx-headers -# When cross-compiling for Darwin using Clang, -mlinker-version must be passed to -# ensure that modern linker features are enabled. +# 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 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 From 0780a9f80d09efbd7ddf4f06b7612ca4f532b907 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Mon, 23 Sep 2024 13:48:11 +0200 Subject: [PATCH 038/103] Bitcoin: fe98999dcf87ac056d0a2c9231fb3160abdf341 (depends: Reformat make options as definition list). --- depends/README.md | 45 ++++++++++++++++++++++++++++++--------------- 1 file changed, 30 insertions(+), 15 deletions(-) diff --git a/depends/README.md b/depends/README.md index 1a4427e9..18d50911 100644 --- a/depends/README.md +++ b/depends/README.md @@ -72,21 +72,36 @@ RISC-V known issue: gcc-7.3.0 and gcc-7.3.1 result in a broken `test_auroracoin` 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_UPNP: Don't download/build/cache packages needed for enabling upnp - 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 +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_UPNP
+
Don't download/build/cache packages needed for enabling upnp
+
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
+
If some packages are not built, for example `make NO_WALLET=1`, the appropriate options will be passed to auroracoin's configure. In this case, `--disable-wallet`. From 5edeb21cd61bb0eef89c238a370f658b4c44a5f2 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Mon, 23 Sep 2024 13:49:18 +0200 Subject: [PATCH 039/103] Bitcoin: de4fedb6c3a45e6a23f1bccd28045d76b5830af (depends: Add documentation for FORCE_USE_SYSTEM_CLANG make flag). --- depends/README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/depends/README.md b/depends/README.md index 18d50911..7ce2ad52 100644 --- a/depends/README.md +++ b/depends/README.md @@ -101,6 +101,10 @@ The following can be set when running make: `make FOO=bar`
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
If some packages are not built, for example `make NO_WALLET=1`, the appropriate From e798441be7484ed96e1b8e7737a39351aca3bb1a Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Mon, 23 Sep 2024 13:51:02 +0200 Subject: [PATCH 040/103] Bitcoin: 6457361e90c0cf704d086c51d75f51dbdfd374d (qt: Fix QFileDialog for static builds). --- depends/packages/qt.mk | 1 - 1 file changed, 1 deletion(-) diff --git a/depends/packages/qt.mk b/depends/packages/qt.mk index 90717ba5..58c4ddfb 100644 --- a/depends/packages/qt.mk +++ b/depends/packages/qt.mk @@ -80,7 +80,6 @@ $(package)_config_opts += -no-feature-colordialog $(package)_config_opts += -no-feature-commandlineparser $(package)_config_opts += -no-feature-concurrent $(package)_config_opts += -no-feature-dial -$(package)_config_opts += -no-feature-filesystemwatcher $(package)_config_opts += -no-feature-fontcombobox $(package)_config_opts += -no-feature-ftp $(package)_config_opts += -no-feature-http From b0dd5fdd71a9a2ceb5bf9b6e5a10874b39f75335 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Mon, 23 Sep 2024 13:52:11 +0200 Subject: [PATCH 041/103] Bitcoin: 00d1ba7aaadbe881995ac1497633a012bc487bd (depends: enable lto support for Apple's ld64). --- depends/packages/native_cctools.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/depends/packages/native_cctools.mk b/depends/packages/native_cctools.mk index 072d3828..33e875a8 100644 --- a/depends/packages/native_cctools.mk +++ b/depends/packages/native_cctools.mk @@ -63,9 +63,10 @@ endef endif define $(package)_set_vars - $(package)_config_opts=--target=$(host) --disable-lto-support --with-libtapi=$($(package)_extract_dir) + $(package)_config_opts=--target=$(host) --with-libtapi=$($(package)_extract_dir) $(package)_ldflags+=-Wl,-rpath=\\$$$$$$$$\$$$$$$$$ORIGIN/../lib ifeq ($(strip $(FORCE_USE_SYSTEM_CLANG)),) + $(package)_config_opts+=--enable-lto-support --with-llvm-config=$($(package)_extract_dir)/toolchain/bin/llvm-config $(package)_cc=$($(package)_extract_dir)/toolchain/bin/clang $(package)_cxx=$($(package)_extract_dir)/toolchain/bin/clang++ else From 14e26901eda4bdb837fe8c9d2ca2561baabeb572 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Mon, 23 Sep 2024 13:53:29 +0200 Subject: [PATCH 042/103] Bitcoin: 5962522fbcb7b72c269fc271ac4463791a10391 (depends: bump native_cctools for fixed lto with external clang). --- depends/packages/native_cctools.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/depends/packages/native_cctools.mk b/depends/packages/native_cctools.mk index 33e875a8..5022ed98 100644 --- a/depends/packages/native_cctools.mk +++ b/depends/packages/native_cctools.mk @@ -1,8 +1,8 @@ package=native_cctools -$(package)_version=4da2f3b485bcf4cef526f30c0b8c0bcda99cdbb4 +$(package)_version=55562e4073dea0fbfd0b20e0bf69ffe6390c7f97 $(package)_download_path=https://github.com/tpoechtrager/cctools-port/archive $(package)_file_name=$($(package)_version).tar.gz -$(package)_sha256_hash=a2d491c0981cef72fee2b833598f20f42a6c44a7614a61c439bda93d56446fec +$(package)_sha256_hash=e51995a843533a3dac155dd0c71362dd471597a2d23f13dff194c6285362f875 $(package)_build_subdir=cctools ifeq ($(strip $(FORCE_USE_SYSTEM_CLANG)),) $(package)_clang_version=8.0.0 From a40fa02bb9f4ed58678598042b6e7441e00d8104 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Mon, 23 Sep 2024 13:55:21 +0200 Subject: [PATCH 043/103] Bitcoin: 6be3eebd74d01ff73677bb6e2fddee66a18ecc8 (doc: Update macOS cross compilation dependencies for Focal). --- depends/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/depends/README.md b/depends/README.md index 7ce2ad52..20a57bfe 100644 --- a/depends/README.md +++ b/depends/README.md @@ -39,7 +39,7 @@ No other options are needed, the paths are automatically configured. #### For macOS cross compilation - sudo apt-get install curl librsvg2-bin libtiff-tools bsdmainutils cmake imagemagick libcap-dev libz-dev libbz2-dev python3-setuptools + sudo apt-get install curl librsvg2-bin libtiff-tools bsdmainutils cmake imagemagick libcap-dev libz-dev libbz2-dev python3-setuptools libtinfo5 #### For Win64 cross compilation From aed4e27a38dae9e5d44f6c4b2c2b6e96384db6b4 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Mon, 23 Sep 2024 13:56:45 +0200 Subject: [PATCH 044/103] Bitcoin: 2a701a1c42c37e48aae70156692aa08aaae1108 (build: pass -fcommon when building genisoimage). --- depends/packages/native_cdrkit.mk | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/depends/packages/native_cdrkit.mk b/depends/packages/native_cdrkit.mk index 8243458e..14c37a0f 100644 --- a/depends/packages/native_cdrkit.mk +++ b/depends/packages/native_cdrkit.mk @@ -9,8 +9,10 @@ define $(package)_preprocess_cmds patch -p1 < $($(package)_patch_dir)/cdrkit-deterministic.patch endef +# Starting with 10.1, GCC defaults to -fno-common, resulting in linking errors. +# Pass -fcommon to retain the legacy behaviour. define $(package)_config_cmds - cmake -DCMAKE_INSTALL_PREFIX=$(build_prefix) + cmake -DCMAKE_INSTALL_PREFIX=$(build_prefix) -DCMAKE_C_FLAGS="-fcommon" endef define $(package)_build_cmds From 7b35db0326d13728f00ee55c4cd32e7ce111d6a8 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Mon, 23 Sep 2024 13:58:16 +0200 Subject: [PATCH 045/103] Bitcoin: e60ef21b8a0f62ebc2e0bdbb5943fa80cc4d98b (doc: Clang 8 or later is required with FORCE_USE_SYSTEM_CLANG). --- depends/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/depends/README.md b/depends/README.md index 20a57bfe..852e5124 100644 --- a/depends/README.md +++ b/depends/README.md @@ -102,9 +102,9 @@ The following can be set when running make: `make FOO=bar`
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
+
(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.
If some packages are not built, for example `make NO_WALLET=1`, the appropriate From addb3c0e53532468ea22289ac710f1da1e34bb8c Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Mon, 23 Sep 2024 13:59:39 +0200 Subject: [PATCH 046/103] Bitcoin: 8314c23d7b39fc36dde8b40b03b6efbe96f8569 ([depends] boost: patch unused variable in boost_process). --- depends/packages/boost.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/depends/packages/boost.mk b/depends/packages/boost.mk index 95d1d5f8..37816977 100644 --- a/depends/packages/boost.mk +++ b/depends/packages/boost.mk @@ -26,7 +26,9 @@ $(package)_cxxflags=-std=c++11 -fvisibility=hidden $(package)_cxxflags_linux=-fPIC endef +# Fix unused variable in boost_process, can be removed after upgrading to 1.72 define $(package)_preprocess_cmds + sed -i.old "s/int ret_sig = 0;//" boost/process/detail/posix/wait_group.hpp && \ echo "using $($(package)_toolset_$(host_os)) : : $($(package)_cxx) : \"$($(package)_cxxflags) $($(package)_cppflags)\" \"$($(package)_ldflags)\" \"$($(package)_archiver_$(host_os))\" \"$(host_STRIP)\" \"$(host_RANLIB)\" \"$(host_WINDRES)\" : ;" > user-config.jam endef From 93dd6b28f5386083c75b5441c31c7b068d38a77e Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Mon, 23 Sep 2024 14:02:38 +0200 Subject: [PATCH 047/103] Bitcoin: 3ecf0eca634601da216b06f091f95456c047f39 (depends: Use instead of cmake). --- depends/packages/native_cdrkit.mk | 2 +- depends/packages/native_libdmg-hfsplus.mk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/depends/packages/native_cdrkit.mk b/depends/packages/native_cdrkit.mk index 14c37a0f..7bdf2d7d 100644 --- a/depends/packages/native_cdrkit.mk +++ b/depends/packages/native_cdrkit.mk @@ -12,7 +12,7 @@ endef # Starting with 10.1, GCC defaults to -fno-common, resulting in linking errors. # Pass -fcommon to retain the legacy behaviour. define $(package)_config_cmds - cmake -DCMAKE_INSTALL_PREFIX=$(build_prefix) -DCMAKE_C_FLAGS="-fcommon" + $($(package)_cmake) -DCMAKE_C_FLAGS="$$($(1)_cflags) -fcommon" endef define $(package)_build_cmds diff --git a/depends/packages/native_libdmg-hfsplus.mk b/depends/packages/native_libdmg-hfsplus.mk index c0f0ce74..035b7671 100644 --- a/depends/packages/native_libdmg-hfsplus.mk +++ b/depends/packages/native_libdmg-hfsplus.mk @@ -12,7 +12,7 @@ define $(package)_preprocess_cmds endef define $(package)_config_cmds - cmake -DCMAKE_INSTALL_PREFIX:PATH=$(build_prefix) -DCMAKE_C_FLAGS="-Wl,--build-id=none" .. + $($(package)_cmake) -DCMAKE_C_FLAGS="$$($(1)_cflags) -Wl,--build-id=none" .. endef define $(package)_build_cmds From 0271e2868e6ef562c86d33854015765e9f934811 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Mon, 23 Sep 2024 14:03:42 +0200 Subject: [PATCH 048/103] Bitcoin: 8c7cd0c6d9f295bcb6913e3c69c9dac4ce2b25c (depends: More robust cmake invocation). --- depends/funcs.mk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/depends/funcs.mk b/depends/funcs.mk index 6fc20543..45f9603b 100644 --- a/depends/funcs.mk +++ b/depends/funcs.mk @@ -157,12 +157,12 @@ ifneq ($($(1)_ldflags),) $(1)_autoconf += LDFLAGS="$$($(1)_ldflags)" endif -$(1)_cmake=cmake -DCMAKE_INSTALL_PREFIX=$($($(1)_type)_prefix) +$(1)_cmake=env CC="$$($(1)_cc)" CXX="$$($(1)_cxx)" CFLAGS="$$($(1)_cflags)" CXXFLAGS="$$($(1)_cxxflags)" cmake -DCMAKE_INSTALL_PREFIX:PATH=$($($(1)_type)_prefix) ifneq ($($(1)_type),build) ifneq ($(host),$(build)) -$(1)_cmake += -DCMAKE_SYSTEM_NAME=$($(host_os)_cmake_system) -DCMAKE_SYSROOT=$(host_prefix) -$(1)_cmake += -DCMAKE_C_COMPILER_TARGET=$(host) -DCMAKE_C_COMPILER=$(firstword $($($(1)_type)_CC)) -DCMAKE_C_FLAGS="$(wordlist 2,1000,$($($(1)_type)_CC))" -$(1)_cmake += -DCMAKE_CXX_COMPILER_TARGET=$(host) -DCMAKE_CXX_COMPILER=$(firstword $($($(1)_type)_CXX)) -DCMAKE_CXX_FLAGS="$(wordlist 2,1000,$($($(1)_type)_CXX))" +$(1)_cmake += -DCMAKE_SYSTEM_NAME=$($(host_os)_cmake_system) +$(1)_cmake += -DCMAKE_C_COMPILER_TARGET=$(host) +$(1)_cmake += -DCMAKE_CXX_COMPILER_TARGET=$(host) endif endif endef From b9ac041b45e991ef86c38f0449754476b1522d6d Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Mon, 23 Sep 2024 14:05:22 +0200 Subject: [PATCH 049/103] Bitcoin: 47e2a35fac9951c125b784a9d14027338c56c75 (doc: Document ALLOW_HOST_PACKAGES dependency option). --- depends/README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/depends/README.md b/depends/README.md index 852e5124..1ef30ad6 100644 --- a/depends/README.md +++ b/depends/README.md @@ -93,6 +93,10 @@ The following can be set when running make: `make FOO=bar`
Don't download/build/cache libs needed to enable the wallet
NO_UPNP
Don't download/build/cache packages needed for enabling upnp
+
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
From 77640ab2aeb9b3faba2bc41e0740db4107e5ab11 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Mon, 23 Sep 2024 14:07:35 +0200 Subject: [PATCH 050/103] Bitcoin: 8e121e550953711cd03d7b6c221afd065c325c5 (depends: Cleanup CMake invocation). --- depends/funcs.mk | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/depends/funcs.mk b/depends/funcs.mk index 45f9603b..06cfdd47 100644 --- a/depends/funcs.mk +++ b/depends/funcs.mk @@ -157,7 +157,11 @@ ifneq ($($(1)_ldflags),) $(1)_autoconf += LDFLAGS="$$($(1)_ldflags)" endif -$(1)_cmake=env CC="$$($(1)_cc)" CXX="$$($(1)_cxx)" CFLAGS="$$($(1)_cflags)" CXXFLAGS="$$($(1)_cxxflags)" cmake -DCMAKE_INSTALL_PREFIX:PATH=$($($(1)_type)_prefix) +$(1)_cmake=env CC="$$($(1)_cc)" \ + CFLAGS="$$($(1)_cflags)" \ + CXX="$$($(1)_cxx)" \ + CXXFLAGS="$$($(1)_cxxflags)" \ + cmake -DCMAKE_INSTALL_PREFIX:PATH="$$($($(1)_type)_prefix)" ifneq ($($(1)_type),build) ifneq ($(host),$(build)) $(1)_cmake += -DCMAKE_SYSTEM_NAME=$($(host_os)_cmake_system) From af47bd103b0d41228e427b1f6148d61550779efc Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Mon, 23 Sep 2024 14:08:35 +0200 Subject: [PATCH 051/103] Bitcoin: b3f541f618fe1f3d44baf6a0dd4299173c81f75 (depends: Prepend CPPFLAGS to C{,XX}FLAGS for CMake). --- depends/funcs.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/depends/funcs.mk b/depends/funcs.mk index 06cfdd47..00289a0a 100644 --- a/depends/funcs.mk +++ b/depends/funcs.mk @@ -158,9 +158,9 @@ $(1)_autoconf += LDFLAGS="$$($(1)_ldflags)" endif $(1)_cmake=env CC="$$($(1)_cc)" \ - CFLAGS="$$($(1)_cflags)" \ + CFLAGS="$$($(1)_cppflags) $$($(1)_cflags)" \ CXX="$$($(1)_cxx)" \ - CXXFLAGS="$$($(1)_cxxflags)" \ + CXXFLAGS="$$($(1)_cppflags) $$($(1)_cxxflags)" \ cmake -DCMAKE_INSTALL_PREFIX:PATH="$$($($(1)_type)_prefix)" ifneq ($($(1)_type),build) ifneq ($(host),$(build)) From ffda89358e7b64fb155356b8e541474fc69bb3fe Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Mon, 23 Sep 2024 14:09:45 +0200 Subject: [PATCH 052/103] Bitcoin: b8936883573708059357a66f67fad9dc77a8bad (depends: Specify LDFLAGS to cmake as well). --- depends/funcs.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/depends/funcs.mk b/depends/funcs.mk index 00289a0a..81ecbedf 100644 --- a/depends/funcs.mk +++ b/depends/funcs.mk @@ -161,6 +161,7 @@ $(1)_cmake=env CC="$$($(1)_cc)" \ CFLAGS="$$($(1)_cppflags) $$($(1)_cflags)" \ CXX="$$($(1)_cxx)" \ CXXFLAGS="$$($(1)_cppflags) $$($(1)_cxxflags)" \ + LDFLAGS="$$($(1)_ldflags)" \ cmake -DCMAKE_INSTALL_PREFIX:PATH="$$($($(1)_type)_prefix)" ifneq ($($(1)_type),build) ifneq ($(host),$(build)) From c909b529b60ca08d0171c94a49125053385d9671 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Thu, 26 Sep 2024 11:21:55 +0200 Subject: [PATCH 053/103] Bitcoin: f36140d00c937b5059cd952d759a77e25330388 (build: use patch rather than sed in bdb package). --- depends/packages/bdb.mk | 4 +- depends/patches/bdb/clang_cxx_11.patch | 147 +++++++++++++++++++++++++ 2 files changed, 149 insertions(+), 2 deletions(-) create mode 100644 depends/patches/bdb/clang_cxx_11.patch diff --git a/depends/packages/bdb.mk b/depends/packages/bdb.mk index 0fc99991..49d400d2 100644 --- a/depends/packages/bdb.mk +++ b/depends/packages/bdb.mk @@ -4,6 +4,7 @@ $(package)_download_path=https://download.oracle.com/berkeley-db $(package)_file_name=db-$($(package)_version).NC.tar.gz $(package)_sha256_hash=76a25560d9e52a198d37a31440fd07632b5f1f8f9f2b6d5438f4bc3e7c9013ef $(package)_build_subdir=build_unix +$(package)_patches=clang_cxx_11.patch define $(package)_set_vars $(package)_config_opts=--disable-shared --enable-cxx --disable-replication --enable-option-checking @@ -14,8 +15,7 @@ $(package)_cppflags_mingw32=-DUNICODE -D_UNICODE endef define $(package)_preprocess_cmds - sed -i.old 's/__atomic_compare_exchange/__atomic_compare_exchange_db/' src/dbinc/atomic.h && \ - sed -i.old 's/atomic_init/atomic_init_db/' src/dbinc/atomic.h src/mp/mp_region.c src/mp/mp_mvcc.c src/mp/mp_fget.c src/mutex/mut_method.c src/mutex/mut_tas.c && \ + patch -p1 < $($(package)_patch_dir)/clang_cxx_11.patch && \ sed -i.old 's/WinIoCtl/winioctl/' src/dbinc/win_db.h && \ cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub dist endef diff --git a/depends/patches/bdb/clang_cxx_11.patch b/depends/patches/bdb/clang_cxx_11.patch new file mode 100644 index 00000000..58f7ddc7 --- /dev/null +++ b/depends/patches/bdb/clang_cxx_11.patch @@ -0,0 +1,147 @@ +commit 3311d68f11d1697565401eee6efc85c34f022ea7 +Author: fanquake +Date: Mon Aug 17 20:03:56 2020 +0800 + + Fix C++11 compatibility + +diff --git a/dbinc/atomic.h b/dbinc/atomic.h +index 0034dcc..7c11d4a 100644 +--- a/dbinc/atomic.h ++++ b/dbinc/atomic.h +@@ -70,7 +70,7 @@ typedef struct { + * These have no memory barriers; the caller must include them when necessary. + */ + #define atomic_read(p) ((p)->value) +-#define atomic_init(p, val) ((p)->value = (val)) ++#define atomic_init_db(p, val) ((p)->value = (val)) + + #ifdef HAVE_ATOMIC_SUPPORT + +@@ -144,7 +144,7 @@ typedef LONG volatile *interlocked_val; + #define atomic_inc(env, p) __atomic_inc(p) + #define atomic_dec(env, p) __atomic_dec(p) + #define atomic_compare_exchange(env, p, o, n) \ +- __atomic_compare_exchange((p), (o), (n)) ++ __atomic_compare_exchange_db((p), (o), (n)) + static inline int __atomic_inc(db_atomic_t *p) + { + int temp; +@@ -176,7 +176,7 @@ static inline int __atomic_dec(db_atomic_t *p) + * http://gcc.gnu.org/onlinedocs/gcc-4.1.0/gcc/Atomic-Builtins.html + * which configure could be changed to use. + */ +-static inline int __atomic_compare_exchange( ++static inline int __atomic_compare_exchange_db( + db_atomic_t *p, atomic_value_t oldval, atomic_value_t newval) + { + atomic_value_t was; +@@ -206,7 +206,7 @@ static inline int __atomic_compare_exchange( + #define atomic_dec(env, p) (--(p)->value) + #define atomic_compare_exchange(env, p, oldval, newval) \ + (DB_ASSERT(env, atomic_read(p) == (oldval)), \ +- atomic_init(p, (newval)), 1) ++ atomic_init_db(p, (newval)), 1) + #else + #define atomic_inc(env, p) __atomic_inc(env, p) + #define atomic_dec(env, p) __atomic_dec(env, p) +diff --git a/mp/mp_fget.c b/mp/mp_fget.c +index 5fdee5a..0b75f57 100644 +--- a/mp/mp_fget.c ++++ b/mp/mp_fget.c +@@ -617,7 +617,7 @@ alloc: /* Allocate a new buffer header and data space. */ + + /* Initialize enough so we can call __memp_bhfree. */ + alloc_bhp->flags = 0; +- atomic_init(&alloc_bhp->ref, 1); ++ atomic_init_db(&alloc_bhp->ref, 1); + #ifdef DIAGNOSTIC + if ((uintptr_t)alloc_bhp->buf & (sizeof(size_t) - 1)) { + __db_errx(env, +@@ -911,7 +911,7 @@ alloc: /* Allocate a new buffer header and data space. */ + MVCC_MPROTECT(bhp->buf, mfp->stat.st_pagesize, + PROT_READ); + +- atomic_init(&alloc_bhp->ref, 1); ++ atomic_init_db(&alloc_bhp->ref, 1); + MUTEX_LOCK(env, alloc_bhp->mtx_buf); + alloc_bhp->priority = bhp->priority; + alloc_bhp->pgno = bhp->pgno; +diff --git a/mp/mp_mvcc.c b/mp/mp_mvcc.c +index 34467d2..f05aa0c 100644 +--- a/mp/mp_mvcc.c ++++ b/mp/mp_mvcc.c +@@ -276,7 +276,7 @@ __memp_bh_freeze(dbmp, infop, hp, bhp, need_frozenp) + #else + memcpy(frozen_bhp, bhp, SSZA(BH, buf)); + #endif +- atomic_init(&frozen_bhp->ref, 0); ++ atomic_init_db(&frozen_bhp->ref, 0); + if (mutex != MUTEX_INVALID) + frozen_bhp->mtx_buf = mutex; + else if ((ret = __mutex_alloc(env, MTX_MPOOL_BH, +@@ -428,7 +428,7 @@ __memp_bh_thaw(dbmp, infop, hp, frozen_bhp, alloc_bhp) + #endif + alloc_bhp->mtx_buf = mutex; + MUTEX_LOCK(env, alloc_bhp->mtx_buf); +- atomic_init(&alloc_bhp->ref, 1); ++ atomic_init_db(&alloc_bhp->ref, 1); + F_CLR(alloc_bhp, BH_FROZEN); + } + +diff --git a/mp/mp_region.c b/mp/mp_region.c +index e6cece9..ddbe906 100644 +--- a/mp/mp_region.c ++++ b/mp/mp_region.c +@@ -224,7 +224,7 @@ __memp_init(env, dbmp, reginfo_off, htab_buckets, max_nreg) + MTX_MPOOL_FILE_BUCKET, 0, &htab[i].mtx_hash)) != 0) + return (ret); + SH_TAILQ_INIT(&htab[i].hash_bucket); +- atomic_init(&htab[i].hash_page_dirty, 0); ++ atomic_init_db(&htab[i].hash_page_dirty, 0); + } + + /* +@@ -269,7 +269,7 @@ __memp_init(env, dbmp, reginfo_off, htab_buckets, max_nreg) + hp->mtx_hash = (mtx_base == MUTEX_INVALID) ? MUTEX_INVALID : + mtx_base + i; + SH_TAILQ_INIT(&hp->hash_bucket); +- atomic_init(&hp->hash_page_dirty, 0); ++ atomic_init_db(&hp->hash_page_dirty, 0); + #ifdef HAVE_STATISTICS + hp->hash_io_wait = 0; + hp->hash_frozen = hp->hash_thawed = hp->hash_frozen_freed = 0; +diff --git a/mutex/mut_method.c b/mutex/mut_method.c +index 2588763..5c6d516 100644 +--- a/mutex/mut_method.c ++++ b/mutex/mut_method.c +@@ -426,7 +426,7 @@ atomic_compare_exchange(env, v, oldval, newval) + MUTEX_LOCK(env, mtx); + ret = atomic_read(v) == oldval; + if (ret) +- atomic_init(v, newval); ++ atomic_init_db(v, newval); + MUTEX_UNLOCK(env, mtx); + + return (ret); +diff --git a/mutex/mut_tas.c b/mutex/mut_tas.c +index f3922e0..e40fcdf 100644 +--- a/mutex/mut_tas.c ++++ b/mutex/mut_tas.c +@@ -46,7 +46,7 @@ __db_tas_mutex_init(env, mutex, flags) + + #ifdef HAVE_SHARED_LATCHES + if (F_ISSET(mutexp, DB_MUTEX_SHARED)) +- atomic_init(&mutexp->sharecount, 0); ++ atomic_init_db(&mutexp->sharecount, 0); + else + #endif + if (MUTEX_INIT(&mutexp->tas)) { +@@ -486,7 +486,7 @@ __db_tas_mutex_unlock(env, mutex) + F_CLR(mutexp, DB_MUTEX_LOCKED); + /* Flush flag update before zeroing count */ + MEMBAR_EXIT(); +- atomic_init(&mutexp->sharecount, 0); ++ atomic_init_db(&mutexp->sharecount, 0); + } else { + DB_ASSERT(env, sharecount > 0); + MEMBAR_EXIT(); From 8b81cf758f39aa52e23dc02e0acdabe1f87f53ac Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Thu, 26 Sep 2024 11:23:19 +0200 Subject: [PATCH 054/103] Bitcoin: 335bd7f8bc415d6419763e17b013f94e5f0e568 (build: use patch rather than sed in Boost package). --- depends/packages/boost.mk | 4 ++-- .../patches/boost/unused_var_in_process.patch | 22 +++++++++++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 depends/patches/boost/unused_var_in_process.patch diff --git a/depends/packages/boost.mk b/depends/packages/boost.mk index 37816977..3eae3815 100644 --- a/depends/packages/boost.mk +++ b/depends/packages/boost.mk @@ -3,6 +3,7 @@ $(package)_version=1_70_0 $(package)_download_path=https://boostorg.jfrog.io/artifactory/main/release/1.70.0/source/ $(package)_file_name=boost_$($(package)_version).tar.bz2 $(package)_sha256_hash=430ae8354789de4fd19ee52f3b1f739e1fba576f0aded0897c3c2bc00fb38778 +$(package)_patches=unused_var_in_process.patch define $(package)_set_vars $(package)_config_opts_release=variant=release @@ -26,9 +27,8 @@ $(package)_cxxflags=-std=c++11 -fvisibility=hidden $(package)_cxxflags_linux=-fPIC endef -# Fix unused variable in boost_process, can be removed after upgrading to 1.72 define $(package)_preprocess_cmds - sed -i.old "s/int ret_sig = 0;//" boost/process/detail/posix/wait_group.hpp && \ + patch -p1 < $($(package)_patch_dir)/unused_var_in_process.patch && \ echo "using $($(package)_toolset_$(host_os)) : : $($(package)_cxx) : \"$($(package)_cxxflags) $($(package)_cppflags)\" \"$($(package)_ldflags)\" \"$($(package)_archiver_$(host_os))\" \"$(host_STRIP)\" \"$(host_RANLIB)\" \"$(host_WINDRES)\" : ;" > user-config.jam endef diff --git a/depends/patches/boost/unused_var_in_process.patch b/depends/patches/boost/unused_var_in_process.patch new file mode 100644 index 00000000..722f7bb5 --- /dev/null +++ b/depends/patches/boost/unused_var_in_process.patch @@ -0,0 +1,22 @@ +commit dbd95cdaefdea95307d004f019a1c394cf9389f0 +Author: fanquake +Date: Mon Aug 17 20:15:17 2020 +0800 + + Remove unused variable in Boost Process + + This causes issues with our linters / CI. + + Can be removed once depends Boost is 1.71.0 or later. + +diff --git a/boost/process/detail/posix/wait_group.hpp b/boost/process/detail/posix/wait_group.hpp +index 9dc249803..2502d9772 100644 +--- a/boost/process/detail/posix/wait_group.hpp ++++ b/boost/process/detail/posix/wait_group.hpp +@@ -137,7 +137,6 @@ inline bool wait_until( + + do + { +- int ret_sig = 0; + int status; + if ((::waitpid(timeout_pid, &status, WNOHANG) != 0) + && (WIFEXITED(status) || WIFSIGNALED(status))) From 05a638d0f658958cb9c759794b91cf88c0a9607d Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Thu, 26 Sep 2024 11:24:39 +0200 Subject: [PATCH 055/103] Bitcoin: 865cb23a485d88be603c1d6bf8c32ef7a5edeaa (build: use patch rather than sed in fontconfig package). --- depends/packages/fontconfig.mk | 12 ++-- .../fontconfig/gperf_header_regen.patch | 24 +++++++ .../fontconfig/remove_char_width_usage.patch | 62 +++++++++++++++++++ 3 files changed, 92 insertions(+), 6 deletions(-) create mode 100644 depends/patches/fontconfig/gperf_header_regen.patch create mode 100644 depends/patches/fontconfig/remove_char_width_usage.patch diff --git a/depends/packages/fontconfig.mk b/depends/packages/fontconfig.mk index 67daf5bb..1bc93289 100644 --- a/depends/packages/fontconfig.mk +++ b/depends/packages/fontconfig.mk @@ -4,23 +4,23 @@ $(package)_download_path=https://www.freedesktop.org/software/fontconfig/release $(package)_file_name=$(package)-$($(package)_version).tar.bz2 $(package)_sha256_hash=b449a3e10c47e1d1c7a6ec6e2016cca73d3bd68fbbd4f0ae5cc6b573f7d6c7f3 $(package)_dependencies=freetype expat +$(package)_patches=remove_char_width_usage.patch gperf_header_regen.patch define $(package)_set_vars $(package)_config_opts=--disable-docs --disable-static --disable-libxml2 --disable-iconv $(package)_config_opts += --disable-dependency-tracking --enable-option-checking endef +define $(package)_preprocess_cmds + patch -p1 < $($(package)_patch_dir)/remove_char_width_usage.patch && \ + patch -p1 < $($(package)_patch_dir)/gperf_header_regen.patch +endef + define $(package)_config_cmds $($(package)_autoconf) endef -# 2.12.1 uses CHAR_WIDTH which is reserved and clashes with some glibc versions, but newer versions of fontconfig -# have broken makefiles which needlessly attempt to re-generate headers with gperf. -# Instead, change all uses of CHAR_WIDTH, and disable the rule that forces header re-generation. -# This can be removed once the upstream build is fixed. define $(package)_build_cmds - sed -i 's/CHAR_WIDTH/CHARWIDTH/g' fontconfig/fontconfig.h src/fcobjshash.gperf src/fcobjs.h src/fcobjshash.h && \ - sed -i 's/fcobjshash.h: fcobjshash.gperf/fcobjshash.h:/' src/Makefile && \ $(MAKE) endef diff --git a/depends/patches/fontconfig/gperf_header_regen.patch b/depends/patches/fontconfig/gperf_header_regen.patch new file mode 100644 index 00000000..7401b83d --- /dev/null +++ b/depends/patches/fontconfig/gperf_header_regen.patch @@ -0,0 +1,24 @@ +commit 7b6eb33ecd88768b28c67ce5d2d68a7eed5936b6 +Author: fanquake +Date: Tue Aug 25 14:34:53 2020 +0800 + + Remove rule that causes inadvertant header regeneration + + Otherwise the makefile will needlessly attempt to re-generate the + headers with gperf. This can be dropped once the upstream build is fixed. + + See #10851. + +diff --git a/src/Makefile.in b/src/Makefile.in +index f4626ad..4ae1b00 100644 +--- a/src/Makefile.in ++++ b/src/Makefile.in +@@ -903,7 +903,7 @@ fcobjshash.gperf: fcobjshash.gperf.h fcobjs.h + ' - > $@.tmp && \ + mv -f $@.tmp $@ || ( $(RM) $@.tmp && false ) + +-fcobjshash.h: fcobjshash.gperf ++fcobjshash.h: + $(AM_V_GEN) $(GPERF) -m 100 $< > $@.tmp && \ + mv -f $@.tmp $@ || ( $(RM) $@.tmp && false ) + diff --git a/depends/patches/fontconfig/remove_char_width_usage.patch b/depends/patches/fontconfig/remove_char_width_usage.patch new file mode 100644 index 00000000..9f690818 --- /dev/null +++ b/depends/patches/fontconfig/remove_char_width_usage.patch @@ -0,0 +1,62 @@ +commit 28165a9b078583dc8e9e5c344510e37582284cef +Author: fanquake +Date: Mon Aug 17 20:35:42 2020 +0800 + + Remove usage of CHAR_WIDTH + + CHAR_WIDTH which is reserved and clashes with glibc 2.25+ + + See #10851. + +diff --git a/fontconfig/fontconfig.h b/fontconfig/fontconfig.h +index 5c72b22..843c532 100644 +--- a/fontconfig/fontconfig.h ++++ b/fontconfig/fontconfig.h +@@ -128,7 +128,7 @@ typedef int FcBool; + #define FC_USER_CACHE_FILE ".fonts.cache-" FC_CACHE_VERSION + + /* Adjust outline rasterizer */ +-#define FC_CHAR_WIDTH "charwidth" /* Int */ ++#define FC_CHARWIDTH "charwidth" /* Int */ + #define FC_CHAR_HEIGHT "charheight"/* Int */ + #define FC_MATRIX "matrix" /* FcMatrix */ + +diff --git a/src/fcobjs.h b/src/fcobjs.h +index 1fc4f65..d27864b 100644 +--- a/src/fcobjs.h ++++ b/src/fcobjs.h +@@ -51,7 +51,7 @@ FC_OBJECT (DPI, FcTypeDouble, NULL) + FC_OBJECT (RGBA, FcTypeInteger, NULL) + FC_OBJECT (SCALE, FcTypeDouble, NULL) + FC_OBJECT (MINSPACE, FcTypeBool, NULL) +-FC_OBJECT (CHAR_WIDTH, FcTypeInteger, NULL) ++FC_OBJECT (CHARWIDTH, FcTypeInteger, NULL) + FC_OBJECT (CHAR_HEIGHT, FcTypeInteger, NULL) + FC_OBJECT (MATRIX, FcTypeMatrix, NULL) + FC_OBJECT (CHARSET, FcTypeCharSet, FcCompareCharSet) +diff --git a/src/fcobjshash.gperf b/src/fcobjshash.gperf +index 80a0237..eb4ad84 100644 +--- a/src/fcobjshash.gperf ++++ b/src/fcobjshash.gperf +@@ -44,7 +44,7 @@ int id; + "rgba",FC_RGBA_OBJECT + "scale",FC_SCALE_OBJECT + "minspace",FC_MINSPACE_OBJECT +-"charwidth",FC_CHAR_WIDTH_OBJECT ++"charwidth",FC_CHARWIDTH_OBJECT + "charheight",FC_CHAR_HEIGHT_OBJECT + "matrix",FC_MATRIX_OBJECT + "charset",FC_CHARSET_OBJECT +diff --git a/src/fcobjshash.h b/src/fcobjshash.h +index 5a4d1ea..4e66bb0 100644 +--- a/src/fcobjshash.h ++++ b/src/fcobjshash.h +@@ -284,7 +284,7 @@ FcObjectTypeLookup (register const char *str, register unsigned int len) + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str43,FC_CHARSET_OBJECT}, + {-1}, + #line 47 "fcobjshash.gperf" +- {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str45,FC_CHAR_WIDTH_OBJECT}, ++ {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str45,FC_CHARWIDTH_OBJECT}, + #line 48 "fcobjshash.gperf" + {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str46,FC_CHAR_HEIGHT_OBJECT}, + #line 55 "fcobjshash.gperf" From e9187f9b10fa763e334f7fe992f6e7c53e9eb0f7 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Thu, 26 Sep 2024 11:25:49 +0200 Subject: [PATCH 056/103] Bitcoin: cc107a3af17d821f66de9357efe73214a628803 (build: use patch rather than sed in native_cctools package). --- depends/packages/native_cctools.mk | 4 ++- .../ld64_disable_threading.patch | 26 +++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 depends/patches/native_cctools/ld64_disable_threading.patch diff --git a/depends/packages/native_cctools.mk b/depends/packages/native_cctools.mk index 5022ed98..d56b6366 100644 --- a/depends/packages/native_cctools.mk +++ b/depends/packages/native_cctools.mk @@ -4,6 +4,8 @@ $(package)_download_path=https://github.com/tpoechtrager/cctools-port/archive $(package)_file_name=$($(package)_version).tar.gz $(package)_sha256_hash=e51995a843533a3dac155dd0c71362dd471597a2d23f13dff194c6285362f875 $(package)_build_subdir=cctools +$(package)_patches=ld64_disable_threading.patch + ifeq ($(strip $(FORCE_USE_SYSTEM_CLANG)),) $(package)_clang_version=8.0.0 $(package)_clang_download_path=https://releases.llvm.org/$($(package)_clang_version) @@ -78,7 +80,7 @@ endef define $(package)_preprocess_cmds CC=$($(package)_cc) CXX=$($(package)_cxx) INSTALLPREFIX=$($(package)_extract_dir) ./libtapi/build.sh && \ CC=$($(package)_cc) CXX=$($(package)_cxx) INSTALLPREFIX=$($(package)_extract_dir) ./libtapi/install.sh && \ - sed -i.old "/define HAVE_PTHREADS/d" $($(package)_build_subdir)/ld64/src/ld/InputFiles.h + patch -p1 < $($(package)_patch_dir)/ld64_disable_threading.patch endef define $(package)_config_cmds diff --git a/depends/patches/native_cctools/ld64_disable_threading.patch b/depends/patches/native_cctools/ld64_disable_threading.patch new file mode 100644 index 00000000..d6c58c10 --- /dev/null +++ b/depends/patches/native_cctools/ld64_disable_threading.patch @@ -0,0 +1,26 @@ +commit 584668415039adeed073decee7e04de28248afd3 +Author: fanquake +Date: Tue Aug 18 01:20:24 2020 +0000 + + Disable threading to fix non-determinism + + A bug in the file parser can cause dependencies to be calculated + differently based on which files have already been parsed. This is more + likely to occur on systems with more CPUs. + + Just disable threading for now. There is no noticable slowdown. + + See #9891. + +diff --git a/cctools/ld64/src/ld/InputFiles.h b/cctools/ld64/src/ld/InputFiles.h +index ef9c756..90a70b6 100644 +--- a/cctools/ld64/src/ld/InputFiles.h ++++ b/cctools/ld64/src/ld/InputFiles.h +@@ -25,7 +25,6 @@ + #ifndef __INPUT_FILES_H__ + #define __INPUT_FILES_H__ + +-#define HAVE_PTHREADS 1 + + #include + #include From 3b062e5020091a86a2bfd35af84c52f0de3d4d1a Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Thu, 26 Sep 2024 11:27:06 +0200 Subject: [PATCH 057/103] Bitcoin: 4af59a407a207e7de327c1bb145d68ebc8ddedd (build: use patch rather than sed in zeromq package ). --- depends/packages/zeromq.mk | 5 ++-- .../patches/zeromq/remove_libstd_link.patch | 25 +++++++++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 depends/patches/zeromq/remove_libstd_link.patch diff --git a/depends/packages/zeromq.mk b/depends/packages/zeromq.mk index 8e6f1f16..41fb9e4c 100644 --- a/depends/packages/zeromq.mk +++ b/depends/packages/zeromq.mk @@ -3,6 +3,7 @@ $(package)_version=4.3.1 $(package)_download_path=https://github.com/zeromq/libzmq/releases/download/v$($(package)_version)/ $(package)_file_name=$(package)-$($(package)_version).tar.gz $(package)_sha256_hash=bcbabe1e2c7d0eec4ed612e10b94b112dd5f06fcefa994a0c79a45d835cd21eb +$(package)_patches=remove_libstd_link.patch define $(package)_set_vars $(package)_config_opts=--without-docs --disable-shared --disable-curve --disable-curve-keygen --disable-perf @@ -14,7 +15,8 @@ define $(package)_set_vars endef define $(package)_preprocess_cmds - cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub config + patch -p1 < $($(package)_patch_dir)/remove_libstd_link.patch && \ + cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub config endef define $(package)_config_cmds @@ -30,6 +32,5 @@ define $(package)_stage_cmds endef define $(package)_postprocess_cmds - sed -i.old "s/ -lstdc++//" lib/pkgconfig/libzmq.pc && \ rm -rf bin share lib/*.la endef diff --git a/depends/patches/zeromq/remove_libstd_link.patch b/depends/patches/zeromq/remove_libstd_link.patch new file mode 100644 index 00000000..ddf91e6a --- /dev/null +++ b/depends/patches/zeromq/remove_libstd_link.patch @@ -0,0 +1,25 @@ +commit 47d4cd12a2c051815ddda78adebdb3923b260d8a +Author: fanquake +Date: Tue Aug 18 14:45:40 2020 +0800 + + Remove needless linking against libstdc++ + + This is broken for a number of reasons, including: + - g++ understands "static-libstdc++ -lstdc++" to mean "link against + whatever libstdc++ exists, probably shared", which in itself is buggy. + - another stdlib (libc++ for example) may be in use + + See #11981. + +diff --git a/src/libzmq.pc.in b/src/libzmq.pc.in +index 233bc3a..3c2bf0d 100644 +--- a/src/libzmq.pc.in ++++ b/src/libzmq.pc.in +@@ -7,6 +7,6 @@ Name: libzmq + Description: 0MQ c++ library + Version: @VERSION@ + Libs: -L${libdir} -lzmq +-Libs.private: -lstdc++ @pkg_config_libs_private@ ++Libs.private: @pkg_config_libs_private@ + Requires.private: @pkg_config_names_private@ + Cflags: -I${includedir} @pkg_config_defines@ From af7439096b40814cdd1bb181f026ad8d43bebdd9 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Thu, 26 Sep 2024 11:28:10 +0200 Subject: [PATCH 058/103] Bitcoin: bf85eace1a594862c4baa375fd3c8b741948cc4 (build: remove no-longer needed qt configure workaround). --- depends/packages/qt.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/depends/packages/qt.mk b/depends/packages/qt.mk index 58c4ddfb..ef064fce 100644 --- a/depends/packages/qt.mk +++ b/depends/packages/qt.mk @@ -173,7 +173,7 @@ define $(package)_preprocess_cmds sed -i.old "s|updateqm.commands = \$$$$\$$$$LRELEASE|updateqm.commands = $($(package)_extract_dir)/qttools/bin/lrelease|" qttranslations/translations/translations.pro && \ sed -i.old "/updateqm.depends =/d" qttranslations/translations/translations.pro && \ sed -i.old "s/src_plugins.depends = src_sql src_network/src_plugins.depends = src_network/" qtbase/src/src.pro && \ - sed -i.old -e 's/if \[ "$$$$XPLATFORM_MAC" = "yes" \]; then xspecvals=$$$$(macSDKify/if \[ "$$$$BUILD_ON_MAC" = "yes" \]; then xspecvals=$$$$(macSDKify/' -e 's|/bin/pwd|pwd|' qtbase/configure && \ + sed -i.old -e 's|/bin/pwd|pwd|' qtbase/configure && \ mkdir -p qtbase/mkspecs/macx-clang-linux &&\ cp -f qtbase/mkspecs/macx-clang/Info.plist.lib qtbase/mkspecs/macx-clang-linux/ &&\ cp -f qtbase/mkspecs/macx-clang/Info.plist.app qtbase/mkspecs/macx-clang-linux/ &&\ From 1ee1abdc8f853ee30b502a7998bece7df351f804 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Thu, 26 Sep 2024 11:29:08 +0200 Subject: [PATCH 059/103] Bitcoin: 9d440f4e11f7d610f3bcf1fb587d71ed2581a6c (build: remove no-longer needed qt workaround). --- depends/packages/qt.mk | 1 - 1 file changed, 1 deletion(-) diff --git a/depends/packages/qt.mk b/depends/packages/qt.mk index ef064fce..1292a2a7 100644 --- a/depends/packages/qt.mk +++ b/depends/packages/qt.mk @@ -172,7 +172,6 @@ define $(package)_preprocess_cmds sed -i.old "s|FT_Get_Font_Format|FT_Get_X11_Font_Format|" qtbase/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp && \ sed -i.old "s|updateqm.commands = \$$$$\$$$$LRELEASE|updateqm.commands = $($(package)_extract_dir)/qttools/bin/lrelease|" qttranslations/translations/translations.pro && \ sed -i.old "/updateqm.depends =/d" qttranslations/translations/translations.pro && \ - sed -i.old "s/src_plugins.depends = src_sql src_network/src_plugins.depends = src_network/" qtbase/src/src.pro && \ sed -i.old -e 's|/bin/pwd|pwd|' qtbase/configure && \ mkdir -p qtbase/mkspecs/macx-clang-linux &&\ cp -f qtbase/mkspecs/macx-clang/Info.plist.lib qtbase/mkspecs/macx-clang-linux/ &&\ From fdc9d5a77c99d3ad8955e1f5ed655bd5f0961002 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Thu, 26 Sep 2024 11:31:30 +0200 Subject: [PATCH 060/103] Bitcoin: 3aaa39d436aa32489aa136d6b3d714220535ec1 (build: replace pwd sed in qt package with a patch). --- depends/packages/qt.mk | 6 +++-- depends/patches/qt/dont_hardcode_pwd.patch | 27 ++++++++++++++++++++++ 2 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 depends/patches/qt/dont_hardcode_pwd.patch diff --git a/depends/packages/qt.mk b/depends/packages/qt.mk index 1292a2a7..51e0cc09 100644 --- a/depends/packages/qt.mk +++ b/depends/packages/qt.mk @@ -8,7 +8,9 @@ $(package)_dependencies=zlib $(package)_linux_dependencies=freetype fontconfig libxcb $(package)_build_subdir=qtbase $(package)_qt_libs=corelib network widgets gui plugins testlib -$(package)_patches=fix_qt_pkgconfig.patch mac-qmake.conf fix_configure_mac.patch fix_no_printer.patch fix_rcc_determinism.patch fix_riscv64_arch.patch xkb-default.patch no-xlib.patch qt_limits.patch qt_no_tagtouchinput.patch +$(package)_patches=fix_qt_pkgconfig.patch mac-qmake.conf fix_configure_mac.patch fix_no_printer.patch +$(package)_patches+= fix_rcc_determinism.patch fix_riscv64_arch.patch xkb-default.patch no-xlib.patch +$(package)_patches+= fix_android_qmake_conf.patch fix_android_jni_static.patch dont_hardcode_pwd.patch # Update OSX_QT_TRANSLATIONS when this is updated $(package)_qttranslations_file_name=qttranslations-$($(package)_suffix) @@ -172,7 +174,7 @@ define $(package)_preprocess_cmds sed -i.old "s|FT_Get_Font_Format|FT_Get_X11_Font_Format|" qtbase/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp && \ sed -i.old "s|updateqm.commands = \$$$$\$$$$LRELEASE|updateqm.commands = $($(package)_extract_dir)/qttools/bin/lrelease|" qttranslations/translations/translations.pro && \ sed -i.old "/updateqm.depends =/d" qttranslations/translations/translations.pro && \ - sed -i.old -e 's|/bin/pwd|pwd|' qtbase/configure && \ + patch -p1 -i $($(package)_patch_dir)/dont_hardcode_pwd.patch &&\ mkdir -p qtbase/mkspecs/macx-clang-linux &&\ cp -f qtbase/mkspecs/macx-clang/Info.plist.lib qtbase/mkspecs/macx-clang-linux/ &&\ cp -f qtbase/mkspecs/macx-clang/Info.plist.app qtbase/mkspecs/macx-clang-linux/ &&\ diff --git a/depends/patches/qt/dont_hardcode_pwd.patch b/depends/patches/qt/dont_hardcode_pwd.patch new file mode 100644 index 00000000..a74e9cb0 --- /dev/null +++ b/depends/patches/qt/dont_hardcode_pwd.patch @@ -0,0 +1,27 @@ +commit 0e953866fc4672486e29e1ba6d83b4207e7b2f0b +Author: fanquake +Date: Tue Aug 18 15:09:06 2020 +0800 + + Don't hardcode pwd path + + Let a man use his builtins if he wants to! Also, removes the unnecessary + assumption that pwd lives under /bin/pwd. + + See #15581. + +diff --git a/qtbase/configure b/qtbase/configure +index 08b49a8d..faea5b55 100755 +--- a/qtbase/configure ++++ b/qtbase/configure +@@ -36,9 +36,9 @@ + relconf=`basename $0` + # the directory of this script is the "source tree" + relpath=`dirname $0` +-relpath=`(cd "$relpath"; /bin/pwd)` ++relpath=`(cd "$relpath"; pwd)` + # the current directory is the "build tree" or "object tree" +-outpath=`/bin/pwd` ++outpath=`pwd` + + WHICH="which" + From 2f14a9ebf646b5cb9d4a6fbaed6f05a6a40dabd0 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Thu, 26 Sep 2024 11:32:54 +0200 Subject: [PATCH 061/103] Bitcoin: c723e4176ee3c1c2391a7c43b094a315bdd3c72 (build: replace FreeType back-compat sed with a patch in qt package). --- depends/packages/qt.mk | 3 +- depends/patches/qt/freetype_back_compat.patch | 28 +++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 depends/patches/qt/freetype_back_compat.patch diff --git a/depends/packages/qt.mk b/depends/packages/qt.mk index 51e0cc09..f24bb9f2 100644 --- a/depends/packages/qt.mk +++ b/depends/packages/qt.mk @@ -11,6 +11,7 @@ $(package)_qt_libs=corelib network widgets gui plugins testlib $(package)_patches=fix_qt_pkgconfig.patch mac-qmake.conf fix_configure_mac.patch fix_no_printer.patch $(package)_patches+= fix_rcc_determinism.patch fix_riscv64_arch.patch xkb-default.patch no-xlib.patch $(package)_patches+= fix_android_qmake_conf.patch fix_android_jni_static.patch dont_hardcode_pwd.patch +$(package)_patches+= freetype_back_compat.patch # Update OSX_QT_TRANSLATIONS when this is updated $(package)_qttranslations_file_name=qttranslations-$($(package)_suffix) @@ -171,7 +172,7 @@ define $(package)_extract_cmds endef define $(package)_preprocess_cmds - sed -i.old "s|FT_Get_Font_Format|FT_Get_X11_Font_Format|" qtbase/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp && \ + patch -p1 -i $($(package)_patch_dir)/freetype_back_compat.patch && \ sed -i.old "s|updateqm.commands = \$$$$\$$$$LRELEASE|updateqm.commands = $($(package)_extract_dir)/qttools/bin/lrelease|" qttranslations/translations/translations.pro && \ sed -i.old "/updateqm.depends =/d" qttranslations/translations/translations.pro && \ patch -p1 -i $($(package)_patch_dir)/dont_hardcode_pwd.patch &&\ diff --git a/depends/patches/qt/freetype_back_compat.patch b/depends/patches/qt/freetype_back_compat.patch new file mode 100644 index 00000000..b0f1c98a --- /dev/null +++ b/depends/patches/qt/freetype_back_compat.patch @@ -0,0 +1,28 @@ +commit 14bc77db61bf9d56f9b6c8b84aa02573605c19c6 +Author: fanquake +Date: Tue Aug 18 15:15:08 2020 +0800 + + Fix backwards compatibility with older Freetype versions at runtime + + A few years ago, libfreetype introduced FT_Get_Font_Format() as an alias + for FT_Get_X11_Font_Format(), but FT_Get_X11_Font_Format() was kept for abi + backwards-compatibility. + + Qt 5.9 introduced a call to FT_Get_Font_Format(). Replace it with FT_Get_X11_Font_Format() + in order to remain compatibile with older freetype, which is still used by e.g. Ubuntu Trusty. + + See #14348. + +diff --git a/qtbase/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp b/qtbase/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp +index 3f543755..8ecc1c8c 100644 +--- a/qtbase/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp ++++ b/qtbase/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp +@@ -898,7 +898,7 @@ bool QFontEngineFT::init(FaceId faceId, bool antialias, GlyphFormat format, + } + } + #if defined(FT_FONT_FORMATS_H) +- const char *fmt = FT_Get_Font_Format(face); ++ const char *fmt = FT_Get_X11_Font_Format(face); + if (fmt && qstrncmp(fmt, "CFF", 4) == 0) { + FT_Bool no_stem_darkening = true; + FT_Error err = FT_Property_Get(qt_getFreetype(), "cff", "no-stem-darkening", &no_stem_darkening); From cf6d17e08bb9eadd798234dbc421ceda14e4a0de Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Thu, 26 Sep 2024 11:34:52 +0200 Subject: [PATCH 062/103] Bitcoin: bbc01a753d40488fa1469c87b31e7a12ddc8b32 (build: replace qtranslations lrelease sed with a patch in qt package). --- depends/packages/qt.mk | 4 ++-- .../patches/qt/drop_lrelease_dependency.patch | 20 +++++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 depends/patches/qt/drop_lrelease_dependency.patch diff --git a/depends/packages/qt.mk b/depends/packages/qt.mk index f24bb9f2..1ce4b79e 100644 --- a/depends/packages/qt.mk +++ b/depends/packages/qt.mk @@ -11,7 +11,7 @@ $(package)_qt_libs=corelib network widgets gui plugins testlib $(package)_patches=fix_qt_pkgconfig.patch mac-qmake.conf fix_configure_mac.patch fix_no_printer.patch $(package)_patches+= fix_rcc_determinism.patch fix_riscv64_arch.patch xkb-default.patch no-xlib.patch $(package)_patches+= fix_android_qmake_conf.patch fix_android_jni_static.patch dont_hardcode_pwd.patch -$(package)_patches+= freetype_back_compat.patch +$(package)_patches+= freetype_back_compat.patch drop_lrelease_dependency.patch # Update OSX_QT_TRANSLATIONS when this is updated $(package)_qttranslations_file_name=qttranslations-$($(package)_suffix) @@ -174,7 +174,7 @@ endef define $(package)_preprocess_cmds patch -p1 -i $($(package)_patch_dir)/freetype_back_compat.patch && \ sed -i.old "s|updateqm.commands = \$$$$\$$$$LRELEASE|updateqm.commands = $($(package)_extract_dir)/qttools/bin/lrelease|" qttranslations/translations/translations.pro && \ - sed -i.old "/updateqm.depends =/d" qttranslations/translations/translations.pro && \ + patch -p1 -i $($(package)_patch_dir)/drop_lrelease_dependency.patch && \ patch -p1 -i $($(package)_patch_dir)/dont_hardcode_pwd.patch &&\ mkdir -p qtbase/mkspecs/macx-clang-linux &&\ cp -f qtbase/mkspecs/macx-clang/Info.plist.lib qtbase/mkspecs/macx-clang-linux/ &&\ diff --git a/depends/patches/qt/drop_lrelease_dependency.patch b/depends/patches/qt/drop_lrelease_dependency.patch new file mode 100644 index 00000000..f6b2c9fc --- /dev/null +++ b/depends/patches/qt/drop_lrelease_dependency.patch @@ -0,0 +1,20 @@ +commit 67b3ed7406e1d0762188dbad2c44a06824ba0778 +Author: fanquake +Date: Tue Aug 18 15:24:01 2020 +0800 + + Drop dependency on lrelease + + Qts buildsystem insists on using the installed lrelease, but gets + confused about how to find it. Since we manually control the build + order, just drop the dependency. + + See #9469 + +diff --git a/qttranslations/translations/translations.pro b/qttranslations/translations/translations.pro +index 694544c..eff339d 100644 +--- a/qttranslations/translations/translations.pro ++++ b/qttranslations/translations/translations.pro +@@ -109,3 +109,2 @@ updateqm.commands = $$LRELEASE ${QMAKE_FILE_IN} -qm ${QMAKE_FILE_OUT} + silent:updateqm.commands = @echo lrelease ${QMAKE_FILE_IN} && $$updateqm.commands +-updateqm.depends = $$LRELEASE_EXE + updateqm.name = LRELEASE ${QMAKE_FILE_IN} From 4ecdb7ba730c80641950973c611949ff87b5c9d2 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Thu, 26 Sep 2024 11:36:09 +0200 Subject: [PATCH 063/103] Bitcoin: 3de365e4f15ddaaf6bdb5b3c31529156617d283 (build: replace wingenminiupnpcstrings sed with a patch in miniupnpc package). --- depends/packages/miniupnpc.mk | 3 ++- .../patches/miniupnpc/dont_use_wingen.patch | 26 +++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 depends/patches/miniupnpc/dont_use_wingen.patch diff --git a/depends/packages/miniupnpc.mk b/depends/packages/miniupnpc.mk index fdbe22cd..49a584e4 100644 --- a/depends/packages/miniupnpc.mk +++ b/depends/packages/miniupnpc.mk @@ -3,6 +3,7 @@ $(package)_version=2.0.20180203 $(package)_download_path=https://miniupnp.tuxfamily.org/files/ $(package)_file_name=$(package)-$($(package)_version).tar.gz $(package)_sha256_hash=90dda8c7563ca6cd4a83e23b3c66dbbea89603a1675bfdb852897c2c9cc220b7 +$(package)_patches=dont_use_wingen.patch define $(package)_set_vars $(package)_build_opts=CC="$($(package)_cc)" @@ -14,7 +15,7 @@ endef define $(package)_preprocess_cmds mkdir dll && \ sed -e 's|MINIUPNPC_VERSION_STRING \"version\"|MINIUPNPC_VERSION_STRING \"$($(package)_version)\"|' -e 's|OS/version|$(host)|' miniupnpcstrings.h.in > miniupnpcstrings.h && \ - sed -i.old "s|miniupnpcstrings.h: miniupnpcstrings.h.in wingenminiupnpcstrings|miniupnpcstrings.h: miniupnpcstrings.h.in|" Makefile.mingw + patch -p1 < $($(package)_patch_dir)/dont_use_wingen.patch endef define $(package)_build_cmds diff --git a/depends/patches/miniupnpc/dont_use_wingen.patch b/depends/patches/miniupnpc/dont_use_wingen.patch new file mode 100644 index 00000000..a1cc9b50 --- /dev/null +++ b/depends/patches/miniupnpc/dont_use_wingen.patch @@ -0,0 +1,26 @@ +commit e8077044df239bcf0d9e9980b0e1afb9f1f5c446 +Author: fanquake +Date: Tue Aug 18 20:50:19 2020 +0800 + + Don't use wingenminiupnpcstrings when generating miniupnpcstrings.h + + The wingenminiupnpcstrings tool is used on Windows to generate version + information. This information is irrelevant for us, and trying to use + wingenminiupnpcstrings would cause builds to fail, so just don't use it. + + We should be able to drop this once we are using 2.1 or later. See + upstream commit: 9663c55c61408fdcc39a82987d2243f816b22932. + +diff --git a/Makefile.mingw b/Makefile.mingw +index 574720e..fcc17bb 100644 +--- a/Makefile.mingw ++++ b/Makefile.mingw +@@ -74,7 +74,7 @@ wingenminiupnpcstrings: wingenminiupnpcstrings.o + + wingenminiupnpcstrings.o: wingenminiupnpcstrings.c + +-miniupnpcstrings.h: miniupnpcstrings.h.in wingenminiupnpcstrings ++miniupnpcstrings.h: miniupnpcstrings.h.in + wingenminiupnpcstrings $< $@ + + minixml.o: minixml.c minixml.h From beb21560556ad9d43ed402abed4201d1b1d2eb58 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Thu, 26 Sep 2024 11:38:10 +0200 Subject: [PATCH 064/103] Bitcoin: f07fb5a55e2d5d87f288c988a24ae8b9e3f827a (build: patch qt libpng to fix powerpc build). --- depends/packages/qt.mk | 3 ++- depends/patches/qt/fix_powerpc_libpng.patch | 23 +++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 depends/patches/qt/fix_powerpc_libpng.patch diff --git a/depends/packages/qt.mk b/depends/packages/qt.mk index 1ce4b79e..a6516b0e 100644 --- a/depends/packages/qt.mk +++ b/depends/packages/qt.mk @@ -11,7 +11,7 @@ $(package)_qt_libs=corelib network widgets gui plugins testlib $(package)_patches=fix_qt_pkgconfig.patch mac-qmake.conf fix_configure_mac.patch fix_no_printer.patch $(package)_patches+= fix_rcc_determinism.patch fix_riscv64_arch.patch xkb-default.patch no-xlib.patch $(package)_patches+= fix_android_qmake_conf.patch fix_android_jni_static.patch dont_hardcode_pwd.patch -$(package)_patches+= freetype_back_compat.patch drop_lrelease_dependency.patch +$(package)_patches+= freetype_back_compat.patch drop_lrelease_dependency.patch fix_powerpc_libpng.patch # Update OSX_QT_TRANSLATIONS when this is updated $(package)_qttranslations_file_name=qttranslations-$($(package)_suffix) @@ -173,6 +173,7 @@ endef define $(package)_preprocess_cmds patch -p1 -i $($(package)_patch_dir)/freetype_back_compat.patch && \ + patch -p1 -i $($(package)_patch_dir)/fix_powerpc_libpng.patch && \ sed -i.old "s|updateqm.commands = \$$$$\$$$$LRELEASE|updateqm.commands = $($(package)_extract_dir)/qttools/bin/lrelease|" qttranslations/translations/translations.pro && \ patch -p1 -i $($(package)_patch_dir)/drop_lrelease_dependency.patch && \ patch -p1 -i $($(package)_patch_dir)/dont_hardcode_pwd.patch &&\ diff --git a/depends/patches/qt/fix_powerpc_libpng.patch b/depends/patches/qt/fix_powerpc_libpng.patch new file mode 100644 index 00000000..d37b6c77 --- /dev/null +++ b/depends/patches/qt/fix_powerpc_libpng.patch @@ -0,0 +1,23 @@ +commit 6f9feb773a43c5abfa3455da2e324180e789285b +Author: fanquake +Date: Tue Sep 15 21:44:31 2020 +0800 + + Fix PowerPC build of libpng + + See https://bugreports.qt.io/browse/QTBUG-66388. + + Can be dropped when we are building qt 5.12.0 or later. + +diff --git a/qtbase/src/3rdparty/libpng/libpng.pro b/qtbase/src/3rdparty/libpng/libpng.pro +index 577b61d8..a2f56669 100644 +--- a/qtbase/src/3rdparty/libpng/libpng.pro ++++ b/qtbase/src/3rdparty/libpng/libpng.pro +@@ -10,7 +10,7 @@ MODULE_INCLUDEPATH = $$PWD + + load(qt_helper_lib) + +-DEFINES += PNG_ARM_NEON_OPT=0 ++DEFINES += PNG_ARM_NEON_OPT=0 PNG_POWERPC_VSX_OPT=0 + SOURCES += \ + png.c \ + pngerror.c \ From 0faf62db7a8c0f58c48ef4e44cfaaec59cc799de Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Thu, 26 Sep 2024 11:39:31 +0200 Subject: [PATCH 065/103] Bitcoin: 7a89f2e6c539a54bcaa24bff41aae3910244ad3 (build: Fix target name). --- depends/funcs.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/depends/funcs.mk b/depends/funcs.mk index 81ecbedf..58d882eb 100644 --- a/depends/funcs.mk +++ b/depends/funcs.mk @@ -265,4 +265,4 @@ $(foreach package,$(all_packages),$(eval $(call int_config_attach_build_config,$ $(foreach package,$(all_packages),$(eval $(call int_add_cmds,$(package)))) #special exception: if a toolchain package exists, all non-native packages depend on it -$(foreach package,$(packages),$(eval $($(package)_unpacked): |$($($(host_arch)_$(host_os)_native_toolchain)_cached) $($($(host_arch)_$(host_os)_native_binutils)_cached) )) +$(foreach package,$(packages),$(eval $($(package)_extracted): |$($($(host_arch)_$(host_os)_native_toolchain)_cached) $($($(host_arch)_$(host_os)_native_binutils)_cached) )) From 13bd660a547fd139c2a5ede8c9c2cdfcd236d759 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Thu, 26 Sep 2024 11:40:57 +0200 Subject: [PATCH 066/103] Bitcoin: 7d0271b5c30f86e4af175a5ab7df5e593cd8519 (depends: Set CMAKE_INSTALL_RPATH for native packages). --- depends/funcs.mk | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/depends/funcs.mk b/depends/funcs.mk index 58d882eb..5697bd6f 100644 --- a/depends/funcs.mk +++ b/depends/funcs.mk @@ -163,7 +163,9 @@ $(1)_cmake=env CC="$$($(1)_cc)" \ CXXFLAGS="$$($(1)_cppflags) $$($(1)_cxxflags)" \ LDFLAGS="$$($(1)_ldflags)" \ cmake -DCMAKE_INSTALL_PREFIX:PATH="$$($($(1)_type)_prefix)" -ifneq ($($(1)_type),build) +ifeq ($($(1)_type),build) +$(1)_cmake += -DCMAKE_INSTALL_RPATH:PATH="$$($($(1)_type)_prefix)/lib" +else ifneq ($(host),$(build)) $(1)_cmake += -DCMAKE_SYSTEM_NAME=$($(host_os)_cmake_system) $(1)_cmake += -DCMAKE_C_COMPILER_TARGET=$(host) From cc5c2edab6c3dd652decb8a0f81cbedddd3cc348 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Fri, 27 Sep 2024 09:56:35 +0200 Subject: [PATCH 067/103] Bitcoin: e87df8258090138d5c22ac46b8602b618620e8a (Add sqlite to travis and depends). --- contrib/gitian-descriptors/gitian-linux.yml | 2 +- contrib/gitian-descriptors/gitian-win.yml | 2 +- depends/Makefile | 5 +++- depends/README.md | 4 ++++ depends/packages/packages.mk | 3 ++- depends/packages/sqlite.mk | 26 +++++++++++++++++++++ 6 files changed, 38 insertions(+), 4 deletions(-) create mode 100644 depends/packages/sqlite.mk diff --git a/contrib/gitian-descriptors/gitian-linux.yml b/contrib/gitian-descriptors/gitian-linux.yml index 12fac52f..63374285 100644 --- a/contrib/gitian-descriptors/gitian-linux.yml +++ b/contrib/gitian-descriptors/gitian-linux.yml @@ -79,7 +79,7 @@ script: | echo "REAL=\`which -a ${i}-${prog}-8 | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\`" >> ${WRAP_DIR}/${i}-${prog} echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${i}-${prog} echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${i}-${prog} - echo "\$REAL \$@" >> $WRAP_DIR/${i}-${prog} + echo "\$REAL \"\$@\"" >> $WRAP_DIR/${i}-${prog} chmod +x ${WRAP_DIR}/${i}-${prog} fi diff --git a/contrib/gitian-descriptors/gitian-win.yml b/contrib/gitian-descriptors/gitian-win.yml index 8ad7fac2..93e71469 100644 --- a/contrib/gitian-descriptors/gitian-win.yml +++ b/contrib/gitian-descriptors/gitian-win.yml @@ -67,7 +67,7 @@ script: | echo "REAL=\`which -a ${i}-${prog} | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\`" >> ${WRAP_DIR}/${i}-${prog} echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${i}-${prog} echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${i}-${prog} - echo "\$REAL \$@" >> $WRAP_DIR/${i}-${prog} + echo "\$REAL \"\$@\"" >> $WRAP_DIR/${i}-${prog} chmod +x ${WRAP_DIR}/${i}-${prog} done done diff --git a/depends/Makefile b/depends/Makefile index aa152ac9..8e0da91c 100644 --- a/depends/Makefile +++ b/depends/Makefile @@ -129,7 +129,10 @@ qrencode_packages_$(NO_QR) = $(qrencode_packages) qt_packages_$(NO_QT) = $(qt_packages) $(qt_$(host_os)_packages) $(qt_$(host_arch)_$(host_os)_packages) $(qrencode_packages_) -wallet_packages_$(NO_WALLET) = $(wallet_packages) +bdb_packages_$(NO_BDB) = $(bdb_packages) +sqlite_packages_$(NO_SQLITE) = $(sqlite_packages) +wallet_packages_$(NO_WALLET) = $(bdb_packages_) $(sqlite_packages_) + upnp_packages_$(NO_UPNP) = $(upnp_packages) zmq_packages_$(NO_ZMQ) = $(zmq_packages) multiprocess_packages_$(MULTIPROCESS) = $(multiprocess_packages) diff --git a/depends/README.md b/depends/README.md index 1ef30ad6..5420a187 100644 --- a/depends/README.md +++ b/depends/README.md @@ -91,6 +91,10 @@ The following can be set when running make: `make FOO=bar`
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
ALLOW_HOST_PACKAGES
diff --git a/depends/packages/packages.mk b/depends/packages/packages.mk index 822a312d..438d28a9 100644 --- a/depends/packages/packages.mk +++ b/depends/packages/packages.mk @@ -9,7 +9,8 @@ qt_linux_packages:=qt expat libxcb xcb_proto libXau xproto freetype fontconfig qt_darwin_packages=qt qt_mingw32_packages=qt -wallet_packages=bdb +bdb_packages=bdb +sqlite_packages=sqlite zmq_packages=zeromq diff --git a/depends/packages/sqlite.mk b/depends/packages/sqlite.mk new file mode 100644 index 00000000..5b3a61b2 --- /dev/null +++ b/depends/packages/sqlite.mk @@ -0,0 +1,26 @@ +package=sqlite +$(package)_version=3320100 +$(package)_download_path=https://sqlite.org/2020/ +$(package)_file_name=sqlite-autoconf-$($(package)_version).tar.gz +$(package)_sha256_hash=486748abfb16abd8af664e3a5f03b228e5f124682b0c942e157644bf6fff7d10 + +define $(package)_set_vars +$(package)_config_opts=--disable-shared --disable-readline --disable-dynamic-extensions --enable-option-checking +$(package)_config_opts_linux=--with-pic +endef + +define $(package)_config_cmds + $($(package)_autoconf) +endef + +define $(package)_build_cmds + $(MAKE) libsqlite3.la +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install-libLTLIBRARIES install-includeHEADERS install-pkgconfigDATA +endef + +define $(package)_postprocess_cmds + rm lib/*.la +endef From 6e8c95140ddea11b98f8badbdbbe2c9811ab2960 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Fri, 27 Sep 2024 09:58:27 +0200 Subject: [PATCH 068/103] Bitcoin: d0a829e9632379e42f0be5c554e3b692f0d14a9 (build: fix mutex detection when building bdb on macOS). --- depends/packages/bdb.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/depends/packages/bdb.mk b/depends/packages/bdb.mk index 49d400d2..8f1d9a62 100644 --- a/depends/packages/bdb.mk +++ b/depends/packages/bdb.mk @@ -10,6 +10,7 @@ define $(package)_set_vars $(package)_config_opts=--disable-shared --enable-cxx --disable-replication --enable-option-checking $(package)_config_opts_mingw32=--enable-mingw $(package)_config_opts_linux=--with-pic +$(package)_cflags+=-Wno-error=implicit-function-declaration $(package)_cxxflags=-std=c++11 $(package)_cppflags_mingw32=-DUNICODE -D_UNICODE endef From e548851fa6cf7973e6ec09f53d2216619a0fd0aa Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Fri, 27 Sep 2024 10:00:12 +0200 Subject: [PATCH 069/103] Bitcoin: 6c7e8f067dcf4c5d793d162aeb84f074f9a1466 (depends: Allow relative CONFIG_SITE path env var). --- depends/config.site.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/depends/config.site.in b/depends/config.site.in index 87a33793..d6835a2d 100644 --- a/depends/config.site.in +++ b/depends/config.site.in @@ -1,4 +1,4 @@ -depends_prefix="`dirname ${ac_site_file}`/.." +depends_prefix="$(cd "$(dirname ${ac_site_file})/.." && pwd)" cross_compiling=maybe host_alias=@HOST@ From bf9db1f831e25cdb2f7f0f6598d4cf2c96dbac2a Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Fri, 27 Sep 2024 10:03:29 +0200 Subject: [PATCH 070/103] Bitcoin: 618cbd2c1a630a60bed9212718dce78fe5f5010 (lint: Also lint files with shellcheck directive). --- depends/config.site.in | 12 +++++++++++- test/lint/lint-shell.sh | 7 +++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/depends/config.site.in b/depends/config.site.in index d6835a2d..c39975ec 100644 --- a/depends/config.site.in +++ b/depends/config.site.in @@ -1,3 +1,13 @@ +# shellcheck shell=sh disable=SC2034 # Many variables set will be used in + # ./configure but shellcheck doesn't know + # that, hence: disable=SC2034 + +true # Dummy command because shellcheck treats all directives before first + # command as file-wide, and we only want to disable for one line. + # + # See: https://github.com/koalaman/shellcheck/wiki/Directive + +# shellcheck disable=SC2154 depends_prefix="$(cd "$(dirname ${ac_site_file})/.." && pwd)" cross_compiling=maybe @@ -50,7 +60,7 @@ if test x@host_os@ = xdarwin; then fi PATH=$depends_prefix/native/bin:$PATH -PKG_CONFIG="`which pkg-config` --static" +PKG_CONFIG="$(which pkg-config) --static" # These two need to remain exported because pkg-config does not see them # otherwise. That means they must be unexported at the end of configure.ac to diff --git a/test/lint/lint-shell.sh b/test/lint/lint-shell.sh index d7d7b535..9f489df4 100755 --- a/test/lint/lint-shell.sh +++ b/test/lint/lint-shell.sh @@ -27,5 +27,8 @@ disabled=( SC2086 # Double quote to prevent globbing and word splitting. SC2162 # read without -r will mangle backslashes. ) -shellcheck -e "$(IFS=","; echo "${disabled[*]}")" \ - $(git ls-files -- "*.sh" | grep -vE 'src/(secp256k1|univalue)/') + +SOURCED_FILES=$(git ls-files | xargs gawk '/^# shellcheck shell=/ {print FILENAME} {nextfile}') # Check shellcheck directive used for sourced files +if ! "${SHELLCHECK_CMD[@]}" "$EXCLUDE" $SOURCED_FILES $(git ls-files -- '*.sh' | grep -vE 'src/(leveldb|secp256k1|univalue)/'); then + EXIT_CODE=1 +fi \ No newline at end of file From c54c546032b1234f595c694e2581bf4ed25eb4fe Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Fri, 27 Sep 2024 10:04:46 +0200 Subject: [PATCH 071/103] Bitcoin: 46756a69877ab7d56f3b05f8c5a8899eb24d9ff (depends: Fix PYTHONPATH setting in config.site.in). --- depends/config.site.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/depends/config.site.in b/depends/config.site.in index c39975ec..f4531830 100644 --- a/depends/config.site.in +++ b/depends/config.site.in @@ -79,7 +79,7 @@ fi if test -n "@CXX@" -a -z "${CXX}"; then CXX="@CXX@" fi -PYTHONPATH=$depends_prefix/native/lib/python3/dist-packages:$PYTHONPATH +PYTHONPATH="${depends_prefix}/native/lib/python3/dist-packages${PYTHONPATH:+${PATH_SEPARATOR}}${PYTHONPATH}" if test -n "@AR@"; then AR=@AR@ From 709472b9b7e784adc51f3da7bd1a79bb7d37179a Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Fri, 27 Sep 2024 10:06:39 +0200 Subject: [PATCH 072/103] Bitcoin: 7087440894a9daa7de806c5aa42d83ad60759c6 (depends: native_ds_store 1.3.0). --- contrib/macdeploy/custom_dsstore.py | 3 +-- depends/packages/native_biplist.mk | 15 --------------- depends/packages/native_ds_store.mk | 5 ++--- depends/packages/packages.mk | 2 +- 4 files changed, 4 insertions(+), 21 deletions(-) delete mode 100644 depends/packages/native_biplist.mk diff --git a/contrib/macdeploy/custom_dsstore.py b/contrib/macdeploy/custom_dsstore.py index 6247e22d..0d05d06d 100755 --- a/contrib/macdeploy/custom_dsstore.py +++ b/contrib/macdeploy/custom_dsstore.py @@ -2,7 +2,6 @@ # Copyright (c) 2013-2018 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. -import biplist from ds_store import DSStore from mac_alias import Alias import sys @@ -47,7 +46,7 @@ alias.volume.disk_image_alias.target.carbon_path = 'Macintosh HD:Users:\x00auroracoinuser:\x00Documents:\x00auroracoin:\x00auroracoin:\x00' + package_name_ns + '.temp.dmg' alias.volume.disk_image_alias.target.posix_path = 'Users/auroracoinuser/Documents/auroracoin/auroracoin/' + package_name_ns + '.temp.dmg' alias.target.carbon_path = package_name_ns + ':.background:\x00background.tiff' -icvp['backgroundImageAlias'] = biplist.Data(alias.to_bytes()) +icvp['backgroundImageAlias'] = alias.to_bytes() ds['.']['icvp'] = icvp ds['.']['vSrn'] = ('long', 1) diff --git a/depends/packages/native_biplist.mk b/depends/packages/native_biplist.mk deleted file mode 100644 index c3054cbd..00000000 --- a/depends/packages/native_biplist.mk +++ /dev/null @@ -1,15 +0,0 @@ -package=native_biplist -$(package)_version=1.0.3 -$(package)_download_path=https://bitbucket.org/wooster/biplist/downloads -$(package)_file_name=biplist-$($(package)_version).tar.gz -$(package)_sha256_hash=4c0549764c5fe50b28042ec21aa2e14fe1a2224e239a1dae77d9e7f3932aa4c6 -$(package)_install_libdir=$(build_prefix)/lib/python3/dist-packages - -define $(package)_build_cmds - python3 setup.py build -endef - -define $(package)_stage_cmds - mkdir -p $($(package)_install_libdir) && \ - python3 setup.py install --root=$($(package)_staging_dir) --prefix=$(build_prefix) --install-lib=$($(package)_install_libdir) -endef diff --git a/depends/packages/native_ds_store.mk b/depends/packages/native_ds_store.mk index f99b689e..44108925 100644 --- a/depends/packages/native_ds_store.mk +++ b/depends/packages/native_ds_store.mk @@ -1,10 +1,9 @@ package=native_ds_store -$(package)_version=1.1.2 +$(package)_version=1.3.0 $(package)_download_path=https://github.com/al45tair/ds_store/archive/ $(package)_file_name=v$($(package)_version).tar.gz -$(package)_sha256_hash=3b3ecb7bf0a5157f5b6010bc3af7c141fb0ad3527084e63336220d22744bc20c +$(package)_sha256_hash=76b3280cd4e19e5179defa23fb594a9dd32643b0c80d774bd3108361d94fb46d $(package)_install_libdir=$(build_prefix)/lib/python3/dist-packages -$(package)_dependencies=native_biplist define $(package)_build_cmds python3 setup.py build diff --git a/depends/packages/packages.mk b/depends/packages/packages.mk index 438d28a9..3a2f6832 100644 --- a/depends/packages/packages.mk +++ b/depends/packages/packages.mk @@ -19,7 +19,7 @@ upnp_packages=miniupnpc multiprocess_packages = libmultiprocess capnp multiprocess_native_packages = native_libmultiprocess native_capnp -darwin_native_packages = native_biplist native_ds_store native_mac_alias +darwin_native_packages = native_ds_store native_mac_alias ifneq ($(build_os),darwin) darwin_native_packages += native_cctools native_cdrkit native_libdmg-hfsplus From 077e5d1844ecaee3d3cae656e86d08e7101d0297 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Fri, 27 Sep 2024 10:12:09 +0200 Subject: [PATCH 073/103] Bitcoin: 49473ef211343a25658d7c2de17c92e3123ab33 (build: convert 'echo' usage into a patch in qt package). --- depends/packages/qt.mk | 4 +-- .../patches/qt/fix_mingw_cross_compile.patch | 25 +++++++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 depends/patches/qt/fix_mingw_cross_compile.patch diff --git a/depends/packages/qt.mk b/depends/packages/qt.mk index a6516b0e..789dffb0 100644 --- a/depends/packages/qt.mk +++ b/depends/packages/qt.mk @@ -12,6 +12,7 @@ $(package)_patches=fix_qt_pkgconfig.patch mac-qmake.conf fix_configure_mac.patch $(package)_patches+= fix_rcc_determinism.patch fix_riscv64_arch.patch xkb-default.patch no-xlib.patch $(package)_patches+= fix_android_qmake_conf.patch fix_android_jni_static.patch dont_hardcode_pwd.patch $(package)_patches+= freetype_back_compat.patch drop_lrelease_dependency.patch fix_powerpc_libpng.patch +$(package)_patches+= fix_mingw_cross_compile.patch # Update OSX_QT_TRANSLATIONS when this is updated $(package)_qttranslations_file_name=qttranslations-$($(package)_suffix) @@ -196,8 +197,7 @@ define $(package)_preprocess_cmds patch -p1 -i $($(package)_patch_dir)/no-xlib.patch &&\ patch -p1 -i $($(package)_patch_dir)/qt_limits.patch &&\ patch -p1 -i $($(package)_patch_dir)/qt_no_tagtouchinput.patch &&\ - echo "QMAKE_LINK_OBJECT_MAX = 10" >> qtbase/mkspecs/win32-g++/qmake.conf &&\ - echo "QMAKE_LINK_OBJECT_SCRIPT = object_script" >> qtbase/mkspecs/win32-g++/qmake.conf &&\ + patch -p1 -i $($(package)_patch_dir)/fix_mingw_cross_compile.patch && \ sed -i.old "s|QMAKE_CFLAGS += |!host_build: QMAKE_CFLAGS = $($(package)_cflags) $($(package)_cppflags) |" qtbase/mkspecs/win32-g++/qmake.conf && \ sed -i.old "s|QMAKE_CXXFLAGS += |!host_build: QMAKE_CXXFLAGS = $($(package)_cxxflags) $($(package)_cppflags) |" qtbase/mkspecs/win32-g++/qmake.conf && \ sed -i.old "0,/^QMAKE_LFLAGS_/s|^QMAKE_LFLAGS_|!host_build: QMAKE_LFLAGS = $($(package)_ldflags)\n&|" qtbase/mkspecs/win32-g++/qmake.conf && \ diff --git a/depends/patches/qt/fix_mingw_cross_compile.patch b/depends/patches/qt/fix_mingw_cross_compile.patch new file mode 100644 index 00000000..67f76f1d --- /dev/null +++ b/depends/patches/qt/fix_mingw_cross_compile.patch @@ -0,0 +1,25 @@ +commit 5a992a549adfe5a587bbcd6cd2b2cee47d236e27 +Author: fanquake +Date: Fri Sep 4 08:13:44 2020 +0800 + + Work around broken mingw cross-compilation + + See upstream issues: + https://bugreports.qt.io/browse/QTBUG-63637 + https://bugreports.qt.io/browse/QTBUG-63659 + https://codereview.qt-project.org/q/8bebded9 + + We should be able to drop this once we are building qt 5.10.1 or later. + + Added in #12971. + +diff --git a/qtbase/mkspecs/win32-g++/qmake.conf b/qtbase/mkspecs/win32-g++/qmake.conf +index e071a0d1..ad229b10 100644 +--- a/qtbase/mkspecs/win32-g++/qmake.conf ++++ b/qtbase/mkspecs/win32-g++/qmake.conf +@@ -87,3 +87,5 @@ QMAKE_NM = $${CROSS_COMPILE}nm -P + include(../common/angle.conf) + + load(qt_config) ++QMAKE_LINK_OBJECT_MAX = 10 ++QMAKE_LINK_OBJECT_SCRIPT = object_script From adcc511a1d850f3901110bac289f7fb910623d06 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Fri, 27 Sep 2024 10:14:26 +0200 Subject: [PATCH 074/103] Bitcoin: fdde4c7ce624d4dbf72d38e9783c304d7043038 (build: pass XCODE_VERSION through to qt macOS cross compile conf). --- depends/packages/qt.mk | 1 + depends/patches/qt/mac-qmake.conf | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/depends/packages/qt.mk b/depends/packages/qt.mk index 789dffb0..79f50f79 100644 --- a/depends/packages/qt.mk +++ b/depends/packages/qt.mk @@ -125,6 +125,7 @@ $(package)_config_opts_darwin += -device-option MAC_SDK_VERSION=$(OSX_SDK_VERSIO $(package)_config_opts_darwin += -device-option CROSS_COMPILE="$(host)-" $(package)_config_opts_darwin += -device-option MAC_MIN_VERSION=$(OSX_MIN_VERSION) $(package)_config_opts_darwin += -device-option MAC_TARGET=$(host) +$(package)_config_opts_darwin += -device-option XCODE_VERSION=$(XCODE_VERSION) endif $(package)_config_opts_linux = -qt-xkbcommon-x11 diff --git a/depends/patches/qt/mac-qmake.conf b/depends/patches/qt/mac-qmake.conf index 4cd96df2..ca5d22ac 100644 --- a/depends/patches/qt/mac-qmake.conf +++ b/depends/patches/qt/mac-qmake.conf @@ -6,7 +6,7 @@ include(../common/gcc-base-mac.conf) include(../common/clang.conf) include(../common/clang-mac.conf) QMAKE_MAC_SDK_PATH=$${MAC_SDK_PATH} -QMAKE_XCODE_VERSION=4.3 +QMAKE_XCODE_VERSION = $${XCODE_VERSION} QMAKE_XCODE_DEVELOPER_PATH=/Developer QMAKE_MACOSX_DEPLOYMENT_TARGET = $${MAC_MIN_VERSION} QMAKE_MAC_SDK=macosx From 71e77fcb739ef29700448541dc7cc27520d68ddf Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Fri, 27 Sep 2024 10:15:29 +0200 Subject: [PATCH 075/103] Bitcoin: bfd7e33b4b255c3a5ba14993665e04349c6bdf0 (build: remove plugin_no_soname from mac qt qmake.conf). --- depends/patches/qt/mac-qmake.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/depends/patches/qt/mac-qmake.conf b/depends/patches/qt/mac-qmake.conf index ca5d22ac..18ff645c 100644 --- a/depends/patches/qt/mac-qmake.conf +++ b/depends/patches/qt/mac-qmake.conf @@ -1,5 +1,5 @@ MAKEFILE_GENERATOR = UNIX -CONFIG += app_bundle incremental global_init_link_order lib_version_first plugin_no_soname absolute_library_soname +CONFIG += app_bundle incremental global_init_link_order lib_version_first absolute_library_soname QMAKE_INCREMENTAL_STYLE = sublib include(../common/macx.conf) include(../common/gcc-base-mac.conf) From 7076d4a9fff6f096cb9d9eb631240500e35ab37d Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Fri, 27 Sep 2024 10:16:38 +0200 Subject: [PATCH 076/103] Bitcoin: bd5d9336d9e1c2345d72531adf2027bc4d099d1 (build: don't copy Info.plist.* into mkspec for macOS qt build). --- depends/packages/qt.mk | 2 -- 1 file changed, 2 deletions(-) diff --git a/depends/packages/qt.mk b/depends/packages/qt.mk index 79f50f79..5dec2359 100644 --- a/depends/packages/qt.mk +++ b/depends/packages/qt.mk @@ -180,8 +180,6 @@ define $(package)_preprocess_cmds patch -p1 -i $($(package)_patch_dir)/drop_lrelease_dependency.patch && \ patch -p1 -i $($(package)_patch_dir)/dont_hardcode_pwd.patch &&\ mkdir -p qtbase/mkspecs/macx-clang-linux &&\ - cp -f qtbase/mkspecs/macx-clang/Info.plist.lib qtbase/mkspecs/macx-clang-linux/ &&\ - cp -f qtbase/mkspecs/macx-clang/Info.plist.app qtbase/mkspecs/macx-clang-linux/ &&\ cp -f qtbase/mkspecs/macx-clang/qplatformdefs.h qtbase/mkspecs/macx-clang-linux/ &&\ cp -f $($(package)_patch_dir)/mac-qmake.conf qtbase/mkspecs/macx-clang-linux/qmake.conf && \ cp -r qtbase/mkspecs/linux-arm-gnueabi-g++ qtbase/mkspecs/auroracoin-linux-g++ && \ From 0dd06022379c3a172bfc8ec64d100a63480af012 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Fri, 27 Sep 2024 10:22:55 +0200 Subject: [PATCH 077/103] Bitcoin: 498fa16beabcbba0ef66acd4162e0f77de06426 (build: document preprocessing steps in qt package). --- depends/packages/qt.mk | 46 +++++++++++++++++++++++++++++++----------- 1 file changed, 34 insertions(+), 12 deletions(-) diff --git a/depends/packages/qt.mk b/depends/packages/qt.mk index 5dec2359..1a42a7ae 100644 --- a/depends/packages/qt.mk +++ b/depends/packages/qt.mk @@ -173,30 +173,52 @@ define $(package)_extract_cmds tar --no-same-owner --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qttools_file_name) -C qttools endef +# Preprocessing steps work as follows: +# +# 1. Apply our patches to the extracted source. See each patch for more info. +# +# 2. Point to lrelease in qttools/bin/lrelease; otherwise Qt will look for it in +# $(host)/native/bin/lrelease and not find it. +# +# 3. Create a macOS-Clang-Linux mkspec using our mac-qmake.conf. +# +# 4. After making a copy of the mkspec for the linux-arm-gnueabi host, named +# bitcoin-linux-g++, replace instances of linux-arm-gnueabi with $(host). This +# way we can generically support hosts like riscv64-linux-gnu, which Qt doesn't +# ship a mkspec for. See it's usage in config_opts_* above. +# +# 5. Put our C, CXX and LD FLAGS into gcc-base.conf. Only used for non-host builds. +# +# 6. Do similar for the win32-g++ mkspec. +# +# 7. In clang.conf, swap out clang & clang++, for our compiler + flags. See #17466. +# +# 8. Adjust a regex in toolchain.prf, to accomodate Guix's usage of +# CROSS_LIBRARY_PATH. See #15277. define $(package)_preprocess_cmds patch -p1 -i $($(package)_patch_dir)/freetype_back_compat.patch && \ patch -p1 -i $($(package)_patch_dir)/fix_powerpc_libpng.patch && \ - sed -i.old "s|updateqm.commands = \$$$$\$$$$LRELEASE|updateqm.commands = $($(package)_extract_dir)/qttools/bin/lrelease|" qttranslations/translations/translations.pro && \ patch -p1 -i $($(package)_patch_dir)/drop_lrelease_dependency.patch && \ - patch -p1 -i $($(package)_patch_dir)/dont_hardcode_pwd.patch &&\ + patch -p1 -i $($(package)_patch_dir)/dont_hardcode_pwd.patch && \ + patch -p1 -i $($(package)_patch_dir)/fix_qt_pkgconfig.patch && \ + patch -p1 -i $($(package)_patch_dir)/fix_configure_mac.patch && \ + patch -p1 -i $($(package)_patch_dir)/fix_no_printer.patch && \ + patch -p1 -i $($(package)_patch_dir)/fix_rcc_determinism.patch && \ + patch -p1 -i $($(package)_patch_dir)/xkb-default.patch && \ + patch -p1 -i $($(package)_patch_dir)/fix_riscv64_arch.patch && \ + patch -p1 -i $($(package)_patch_dir)/no-xlib.patch && \ + patch -p1 -i $($(package)_patch_dir)/fix_mingw_cross_compile.patch && \ + patch -p1 -i $($(package)_patch_dir)/qt_limits.patch &&\ + patch -p1 -i $($(package)_patch_dir)/qt_no_tagtouchinput.patch &&\ + sed -i.old "s|updateqm.commands = \$$$$\$$$$LRELEASE|updateqm.commands = $($(package)_extract_dir)/qttools/bin/lrelease|" qttranslations/translations/translations.pro && \ mkdir -p qtbase/mkspecs/macx-clang-linux &&\ cp -f qtbase/mkspecs/macx-clang/qplatformdefs.h qtbase/mkspecs/macx-clang-linux/ &&\ cp -f $($(package)_patch_dir)/mac-qmake.conf qtbase/mkspecs/macx-clang-linux/qmake.conf && \ cp -r qtbase/mkspecs/linux-arm-gnueabi-g++ qtbase/mkspecs/auroracoin-linux-g++ && \ sed -i.old "s/arm-linux-gnueabi-/$(host)-/g" qtbase/mkspecs/auroracoin-linux-g++/qmake.conf && \ - patch -p1 -i $($(package)_patch_dir)/fix_qt_pkgconfig.patch &&\ - patch -p1 -i $($(package)_patch_dir)/fix_configure_mac.patch &&\ - patch -p1 -i $($(package)_patch_dir)/fix_no_printer.patch &&\ - patch -p1 -i $($(package)_patch_dir)/fix_rcc_determinism.patch &&\ - patch -p1 -i $($(package)_patch_dir)/xkb-default.patch &&\ echo "!host_build: QMAKE_CFLAGS += $($(package)_cflags) $($(package)_cppflags)" >> qtbase/mkspecs/common/gcc-base.conf && \ echo "!host_build: QMAKE_CXXFLAGS += $($(package)_cxxflags) $($(package)_cppflags)" >> qtbase/mkspecs/common/gcc-base.conf && \ echo "!host_build: QMAKE_LFLAGS += $($(package)_ldflags)" >> qtbase/mkspecs/common/gcc-base.conf && \ - patch -p1 -i $($(package)_patch_dir)/fix_riscv64_arch.patch &&\ - patch -p1 -i $($(package)_patch_dir)/no-xlib.patch &&\ - patch -p1 -i $($(package)_patch_dir)/qt_limits.patch &&\ - patch -p1 -i $($(package)_patch_dir)/qt_no_tagtouchinput.patch &&\ - patch -p1 -i $($(package)_patch_dir)/fix_mingw_cross_compile.patch && \ sed -i.old "s|QMAKE_CFLAGS += |!host_build: QMAKE_CFLAGS = $($(package)_cflags) $($(package)_cppflags) |" qtbase/mkspecs/win32-g++/qmake.conf && \ sed -i.old "s|QMAKE_CXXFLAGS += |!host_build: QMAKE_CXXFLAGS = $($(package)_cxxflags) $($(package)_cppflags) |" qtbase/mkspecs/win32-g++/qmake.conf && \ sed -i.old "0,/^QMAKE_LFLAGS_/s|^QMAKE_LFLAGS_|!host_build: QMAKE_LFLAGS = $($(package)_ldflags)\n&|" qtbase/mkspecs/win32-g++/qmake.conf && \ From 447cb1c0b4fee12302fb8dafb2d72475b31bd9d9 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Fri, 27 Sep 2024 10:23:54 +0200 Subject: [PATCH 078/103] Bitcoin: e1f2553e1148de9bd57818b40b5fe9da7ff5e24 (build: remove global_init_link_order from mac qt qmake.conf). --- depends/patches/qt/mac-qmake.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/depends/patches/qt/mac-qmake.conf b/depends/patches/qt/mac-qmake.conf index 18ff645c..01426675 100644 --- a/depends/patches/qt/mac-qmake.conf +++ b/depends/patches/qt/mac-qmake.conf @@ -1,5 +1,5 @@ MAKEFILE_GENERATOR = UNIX -CONFIG += app_bundle incremental global_init_link_order lib_version_first absolute_library_soname +CONFIG += app_bundle incremental lib_version_first absolute_library_soname QMAKE_INCREMENTAL_STYLE = sublib include(../common/macx.conf) include(../common/gcc-base-mac.conf) From cd176d10f961ab3059602c2246499132cfdd217e Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Fri, 27 Sep 2024 10:30:45 +0200 Subject: [PATCH 079/103] Bitcoin: a52ecc936a267cae97c2f313743bf75d5af0770 (build: set minimum supported macOS to 10.14). --- ci/test/00_setup_env_mac.sh | 2 +- contrib/gitian-descriptors/gitian-osx.yml | 2 +- depends/README.md | 2 +- depends/hosts/darwin.mk | 2 +- doc/build-osx.md | 2 +- doc/release-notes.md | 4 ++-- share/qt/Info.plist.in | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ci/test/00_setup_env_mac.sh b/ci/test/00_setup_env_mac.sh index f4b3cfae..4e0053f4 100644 --- a/ci/test/00_setup_env_mac.sh +++ b/ci/test/00_setup_env_mac.sh @@ -6,7 +6,7 @@ export LC_ALL=C.UTF-8 -export HOST=x86_64-apple-darwin16 +export HOST=x86_64-apple-darwin18 export PACKAGES="cmake imagemagick libcap-dev librsvg2-bin libz-dev libbz2-dev libtiff-tools python3-dev python3-setuptools" export XCODE_VERSION=11.3.1 export XCODE_BUILD_ID=11C505 diff --git a/contrib/gitian-descriptors/gitian-osx.yml b/contrib/gitian-descriptors/gitian-osx.yml index fed49c67..c1ab8850 100644 --- a/contrib/gitian-descriptors/gitian-osx.yml +++ b/contrib/gitian-descriptors/gitian-osx.yml @@ -37,7 +37,7 @@ script: | set -e -o pipefail WRAP_DIR=$HOME/wrapped - HOSTS="x86_64-apple-darwin16" + HOSTS="x86_64-apple-darwin18" CONFIGFLAGS="--enable-reduce-exports --disable-bench --disable-gui-tests GENISOIMAGE=$WRAP_DIR/genisoimage" FAKETIME_HOST_PROGS="" FAKETIME_PROGS="ar ranlib date dmg genisoimage" diff --git a/depends/README.md b/depends/README.md index 5420a187..6b86397c 100644 --- a/depends/README.md +++ b/depends/README.md @@ -25,7 +25,7 @@ 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-darwin16` for macOS +- `x86_64-apple-darwin18` for 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) diff --git a/depends/hosts/darwin.mk b/depends/hosts/darwin.mk index 6099fd4c..e9faeba3 100644 --- a/depends/hosts/darwin.mk +++ b/depends/hosts/darwin.mk @@ -1,4 +1,4 @@ -OSX_MIN_VERSION=10.12 +OSX_MIN_VERSION=10.14 OSX_SDK_VERSION=10.15.1 XCODE_VERSION=11.3.1 XCODE_BUILD_ID=11C505 diff --git a/doc/build-osx.md b/doc/build-osx.md index 36caa0e7..7bcf023f 100644 --- a/doc/build-osx.md +++ b/doc/build-osx.md @@ -109,6 +109,6 @@ tail -f $HOME/Library/Application\ Support/Auroracoin/debug.log ``` ## Notes -* Tested on OS X 10.12 Sierra through macOS 10.15 Catalina on 64-bit Intel +* Tested on OS X 10.14 Mojave through macOS 11 Big Sur on 64-bit Intel processors only. * Building with downloaded Qt binaries is not officially supported. See the notes in [#7714](https://github.com/bitcoin/bitcoin/issues/7714). diff --git a/doc/release-notes.md b/doc/release-notes.md index 0a41448d..e276587e 100644 --- a/doc/release-notes.md +++ b/doc/release-notes.md @@ -48,13 +48,13 @@ Compatibility ============== Auroracoin is supported and extensively tested on operating systems using -the Linux kernel, macOS 10.12+, and Windows 7 and newer. It is not recommended +the Linux kernel, macOS 10.14+, and Windows 7 and newer. It is not recommended to use Auroracoin on unsupported systems. Auroracoin should also work on most other Unix-like systems but is not as frequently tested on them. -From Bitcoin Core 0.20.0 onwards, macOS versions earlier than 10.12 are no +From Bitcoin Core 0.20.0 onwards, macOS versions earlier than 10.14 are no longer supported. Additionally, Bitcoin Core does not yet change appearance when macOS "dark mode" is activated. diff --git a/share/qt/Info.plist.in b/share/qt/Info.plist.in index fbe9a420..12be8264 100644 --- a/share/qt/Info.plist.in +++ b/share/qt/Info.plist.in @@ -3,7 +3,7 @@ LSMinimumSystemVersion - 10.12.0 + 10.14.0 LSArchitecturePriority From 12cc67a74350a30dd38dce7a08f8d2701cca50e8 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Fri, 27 Sep 2024 10:40:06 +0200 Subject: [PATCH 080/103] Bitcoin: 8f7d1b39efbe65ab2747c593cc3560d4a449a33 (Fix QPainter non-determinism on macOS). --- depends/packages/qt.mk | 3 +- .../qt/fix_qpainter_non_determinism.patch | 63 +++++++++++++++++++ 2 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 depends/patches/qt/fix_qpainter_non_determinism.patch diff --git a/depends/packages/qt.mk b/depends/packages/qt.mk index 1a42a7ae..f605f5c1 100644 --- a/depends/packages/qt.mk +++ b/depends/packages/qt.mk @@ -12,7 +12,7 @@ $(package)_patches=fix_qt_pkgconfig.patch mac-qmake.conf fix_configure_mac.patch $(package)_patches+= fix_rcc_determinism.patch fix_riscv64_arch.patch xkb-default.patch no-xlib.patch $(package)_patches+= fix_android_qmake_conf.patch fix_android_jni_static.patch dont_hardcode_pwd.patch $(package)_patches+= freetype_back_compat.patch drop_lrelease_dependency.patch fix_powerpc_libpng.patch -$(package)_patches+= fix_mingw_cross_compile.patch +$(package)_patches+= fix_mingw_cross_compile.patch fix_qpainter_non_determinism.patch # Update OSX_QT_TRANSLATIONS when this is updated $(package)_qttranslations_file_name=qttranslations-$($(package)_suffix) @@ -208,6 +208,7 @@ define $(package)_preprocess_cmds patch -p1 -i $($(package)_patch_dir)/fix_riscv64_arch.patch && \ patch -p1 -i $($(package)_patch_dir)/no-xlib.patch && \ patch -p1 -i $($(package)_patch_dir)/fix_mingw_cross_compile.patch && \ + patch -p1 -i $($(package)_patch_dir)/fix_qpainter_non_determinism.patch &&\ patch -p1 -i $($(package)_patch_dir)/qt_limits.patch &&\ patch -p1 -i $($(package)_patch_dir)/qt_no_tagtouchinput.patch &&\ sed -i.old "s|updateqm.commands = \$$$$\$$$$LRELEASE|updateqm.commands = $($(package)_extract_dir)/qttools/bin/lrelease|" qttranslations/translations/translations.pro && \ diff --git a/depends/patches/qt/fix_qpainter_non_determinism.patch b/depends/patches/qt/fix_qpainter_non_determinism.patch new file mode 100644 index 00000000..3cfcc22f --- /dev/null +++ b/depends/patches/qt/fix_qpainter_non_determinism.patch @@ -0,0 +1,63 @@ +commit 2a8f7dc6ddfc414a66491522501c1574a1343ee1 +Author: Andrew Chow +Date: Sat Nov 21 01:11:04 2020 -0500 + + build: Fix determinism issue when building with Clang 8 + + When building Qt with LLVM/Clang 8 under -O3 (the default), we run into + a determinism issue in `qt_interset_spans`. The issue has been fixed for + LLVM/Clang 9, see + https://github.com/llvm/llvm-project/commit/db101864bdc938deb1d63fe4f7da761bd38e5cae + and https://reviews.llvm.org/D64601, however this fix was not backported + to 8.x. Once LLVM/Clang 9 is used, this patch can be dropped. + + The particular issue appears to be an optimization done by -O3 which + adds a temporary variable for `spans->y` in `qt_intersect_spans`. When + it does this, sometimes it chooses to use a 32-bit movs instruction + (movswl), and other times it chooses a 64-bit movs instruction (movswq). + By patching `qt_intersect_spans` to always make a temporary variable for + `spans->y`, we are able to sidestep this problem. + +diff --git a/qtbase/src/gui/painting/qpaintengine_raster.cpp b/qtbase/src/gui/painting/qpaintengine_raster.cpp +index 92ab6e8375..f018009e0b 100644 +--- a/qtbase/src/gui/painting/qpaintengine_raster.cpp ++++ b/qtbase/src/gui/painting/qpaintengine_raster.cpp +@@ -3971,22 +3971,23 @@ static const QSpan *qt_intersect_spans(const QClipData *clip, int *currentClip, + const QSpan *clipEnd = clip->m_spans + clip->count; + + while (available && spans < end ) { ++ const short spans_y = spans->y; + if (clipSpans >= clipEnd) { + spans = end; + break; + } +- if (clipSpans->y > spans->y) { ++ if (clipSpans->y > spans_y) { + ++spans; + continue; + } +- if (spans->y != clipSpans->y) { +- if (spans->y < clip->count && clip->m_clipLines[spans->y].spans) +- clipSpans = clip->m_clipLines[spans->y].spans; ++ if (spans_y != clipSpans->y) { ++ if (spans_y < clip->count && clip->m_clipLines[spans_y].spans) ++ clipSpans = clip->m_clipLines[spans_y].spans; + else + ++clipSpans; + continue; + } +- Q_ASSERT(spans->y == clipSpans->y); ++ Q_ASSERT(spans_y == clipSpans->y); + + int sx1 = spans->x; + int sx2 = sx1 + spans->len; +@@ -4005,7 +4006,7 @@ static const QSpan *qt_intersect_spans(const QClipData *clip, int *currentClip, + if (len) { + out->x = qMax(sx1, cx1); + out->len = qMin(sx2, cx2) - out->x; +- out->y = spans->y; ++ out->y = spans_y; + out->coverage = qt_div_255(spans->coverage * clipSpans->coverage); + ++out; + --available; + From e2b7500b36f1788fc15b6e4ebf37612619b898c8 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Fri, 27 Sep 2024 10:41:55 +0200 Subject: [PATCH 081/103] Bitcoin: 800655ff3199782b803e671f5baa77ff90a5591 (depends: boost: Refer to version in URL). --- depends/packages/boost.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/depends/packages/boost.mk b/depends/packages/boost.mk index 3eae3815..82f855a5 100644 --- a/depends/packages/boost.mk +++ b/depends/packages/boost.mk @@ -1,6 +1,6 @@ package=boost $(package)_version=1_70_0 -$(package)_download_path=https://boostorg.jfrog.io/artifactory/main/release/1.70.0/source/ +$(package)_download_path=https://dl.bintray.com/boostorg/release/$(subst _,.,$($(package)_version))/source/ $(package)_file_name=boost_$($(package)_version).tar.bz2 $(package)_sha256_hash=430ae8354789de4fd19ee52f3b1f739e1fba576f0aded0897c3c2bc00fb38778 $(package)_patches=unused_var_in_process.patch From 77b607a95dfa66e1e634274ee050b963b705cccf Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Fri, 27 Sep 2024 10:44:04 +0200 Subject: [PATCH 082/103] Bitcoin: 9cf2ee54d366c3f5fcfce96244988858599e7e9 (depends: boost: Split into non-/native packages). --- depends/packages/boost.mk | 7 ++++--- depends/packages/native_b2.mk | 20 ++++++++++++++++++++ depends/packages/packages.mk | 2 ++ 3 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 depends/packages/native_b2.mk diff --git a/depends/packages/boost.mk b/depends/packages/boost.mk index 82f855a5..05d47e88 100644 --- a/depends/packages/boost.mk +++ b/depends/packages/boost.mk @@ -3,6 +3,7 @@ $(package)_version=1_70_0 $(package)_download_path=https://dl.bintray.com/boostorg/release/$(subst _,.,$($(package)_version))/source/ $(package)_file_name=boost_$($(package)_version).tar.bz2 $(package)_sha256_hash=430ae8354789de4fd19ee52f3b1f739e1fba576f0aded0897c3c2bc00fb38778 +$(package)_dependencies=native_b2 $(package)_patches=unused_var_in_process.patch define $(package)_set_vars @@ -33,13 +34,13 @@ define $(package)_preprocess_cmds endef define $(package)_config_cmds - ./bootstrap.sh --without-icu --with-libraries=$($(package)_config_libraries) --with-toolset=$($(package)_toolset_$(host_os)) + ./bootstrap.sh --without-icu --with-libraries=$($(package)_config_libraries) --with-toolset=$($(package)_toolset_$(host_os)) --with-bjam=b2 endef define $(package)_build_cmds - ./b2 -d2 -j2 -d1 --prefix=$($(package)_staging_prefix_dir) $($(package)_config_opts) toolset=$($(package)_toolset_$(host_os)) stage + b2 -d2 -j2 -d1 --prefix=$($(package)_staging_prefix_dir) $($(package)_config_opts) toolset=$($(package)_toolset_$(host_os)) stage endef define $(package)_stage_cmds - ./b2 -d0 -j4 --prefix=$($(package)_staging_prefix_dir) $($(package)_config_opts) toolset=$($(package)_toolset_$(host_os)) install + b2 -d0 -j4 --prefix=$($(package)_staging_prefix_dir) $($(package)_config_opts) toolset=$($(package)_toolset_$(host_os)) install endef diff --git a/depends/packages/native_b2.mk b/depends/packages/native_b2.mk new file mode 100644 index 00000000..aaa37cdc --- /dev/null +++ b/depends/packages/native_b2.mk @@ -0,0 +1,20 @@ +package=native_b2 +$(package)_version=$(boost_version) +$(package)_download_path=$(boost_download_path) +$(package)_file_name=$(boost_file_name) +$(package)_sha256_hash=$(boost_sha256_hash) +$(package)_build_subdir=tools/build/src/engine +ifneq (,$(findstring clang,$($(package)_cxx))) +$(package)_toolset_$(host_os)=clang +else +$(package)_toolset_$(host_os)=gcc +endif + +define $(package)_build_cmds + CXX="$($(package)_cxx)" CXXFLAGS="$($(package)_cxxflags)" ./build.sh "$($(package)_toolset_$(host_os))" +endef + +define $(package)_stage_cmds + mkdir -p "$($(package)_staging_prefix_dir)"/bin/ && \ + cp b2 "$($(package)_staging_prefix_dir)"/bin/ +endef diff --git a/depends/packages/packages.mk b/depends/packages/packages.mk index 3a2f6832..27f41580 100644 --- a/depends/packages/packages.mk +++ b/depends/packages/packages.mk @@ -21,6 +21,8 @@ multiprocess_native_packages = native_libmultiprocess native_capnp darwin_native_packages = native_ds_store native_mac_alias +$(host_arch)_$(host_os)_native_packages += native_b2 + ifneq ($(build_os),darwin) darwin_native_packages += native_cctools native_cdrkit native_libdmg-hfsplus endif From c5a6ba3a1a7c6718873bc88fdf9b77dd67cf595b Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Fri, 27 Sep 2024 10:45:04 +0200 Subject: [PATCH 083/103] Bitcoin: d7048fa73fafaf0d89d891d98e51a251a64a149 (depends: boost: Disable all compression). --- depends/packages/boost.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/depends/packages/boost.mk b/depends/packages/boost.mk index 05d47e88..70f48c34 100644 --- a/depends/packages/boost.mk +++ b/depends/packages/boost.mk @@ -10,7 +10,7 @@ define $(package)_set_vars $(package)_config_opts_release=variant=release $(package)_config_opts_debug=variant=debug $(package)_config_opts=--layout=tagged --build-type=complete --user-config=user-config.jam -$(package)_config_opts+=threading=multi link=static -sNO_BZIP2=1 -sNO_ZLIB=1 +$(package)_config_opts+=threading=multi link=static -sNO_COMPRESSION=1 $(package)_config_opts_linux=target-os=linux threadapi=pthread runtime-link=shared $(package)_config_opts_darwin=target-os=darwin runtime-link=shared $(package)_config_opts_mingw32=target-os=windows binary-format=pe threadapi=win32 runtime-link=static From 1a41e483428127899fcacf49bff77cc414b04ce4 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Fri, 27 Sep 2024 10:47:34 +0200 Subject: [PATCH 084/103] Bitcoin: 86002e7e90d7c78d5a76a159bf17db48aec94f9 (depends: boost: Cleanup architecture/address-model). --- depends/packages/boost.mk | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/depends/packages/boost.mk b/depends/packages/boost.mk index 70f48c34..d38ff8d8 100644 --- a/depends/packages/boost.mk +++ b/depends/packages/boost.mk @@ -14,11 +14,12 @@ $(package)_config_opts+=threading=multi link=static -sNO_COMPRESSION=1 $(package)_config_opts_linux=target-os=linux threadapi=pthread runtime-link=shared $(package)_config_opts_darwin=target-os=darwin runtime-link=shared $(package)_config_opts_mingw32=target-os=windows binary-format=pe threadapi=win32 runtime-link=static -$(package)_config_opts_x86_64_mingw32=address-model=64 -$(package)_config_opts_i686_mingw32=address-model=32 -$(package)_config_opts_i686_linux=address-model=32 architecture=x86 $(package)_toolset_$(host_os)=gcc $(package)_toolset_darwin=clang +$(package)_config_opts_x86_64=architecture=x86 address-model=64 +$(package)_config_opts_i686=architecture=x86 address-model=32 +$(package)_config_opts_aarch64=address-model=64 +$(package)_config_opts_armv7a=address-model=32 ifneq (,$(findstring clang,$($(package)_cxx))) $(package)_toolset_$(host_os)=clang endif From 73cafb695d8cf63aba4d63d5f76f1ae652be5d7f Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Fri, 27 Sep 2024 10:48:29 +0200 Subject: [PATCH 085/103] Bitcoin: ab9e047cc2226198d22384c286cb30c4c7d51e8 (depends: boost: Cleanup toolset selection). --- depends/packages/boost.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/depends/packages/boost.mk b/depends/packages/boost.mk index d38ff8d8..2464e6e9 100644 --- a/depends/packages/boost.mk +++ b/depends/packages/boost.mk @@ -14,14 +14,14 @@ $(package)_config_opts+=threading=multi link=static -sNO_COMPRESSION=1 $(package)_config_opts_linux=target-os=linux threadapi=pthread runtime-link=shared $(package)_config_opts_darwin=target-os=darwin runtime-link=shared $(package)_config_opts_mingw32=target-os=windows binary-format=pe threadapi=win32 runtime-link=static -$(package)_toolset_$(host_os)=gcc -$(package)_toolset_darwin=clang $(package)_config_opts_x86_64=architecture=x86 address-model=64 $(package)_config_opts_i686=architecture=x86 address-model=32 $(package)_config_opts_aarch64=address-model=64 $(package)_config_opts_armv7a=address-model=32 ifneq (,$(findstring clang,$($(package)_cxx))) - $(package)_toolset_$(host_os)=clang +$(package)_toolset_$(host_os)=clang +else +$(package)_toolset_$(host_os)=gcc endif $(package)_archiver_$(host_os)=$($(package)_ar) $(package)_config_libraries=filesystem,system,thread,test From 8ae4af5219e2c5b3bbf5d45120884d86e3fa0f6b Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Fri, 27 Sep 2024 10:50:43 +0200 Subject: [PATCH 086/103] Bitcoin: b2328b7989997652af52295a4b2e988e68b8428 (depends: boost: Remove unnecessary _archiver_). --- depends/packages/boost.mk | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/depends/packages/boost.mk b/depends/packages/boost.mk index 2464e6e9..62030bc0 100644 --- a/depends/packages/boost.mk +++ b/depends/packages/boost.mk @@ -23,7 +23,6 @@ $(package)_toolset_$(host_os)=clang else $(package)_toolset_$(host_os)=gcc endif -$(package)_archiver_$(host_os)=$($(package)_ar) $(package)_config_libraries=filesystem,system,thread,test $(package)_cxxflags=-std=c++11 -fvisibility=hidden $(package)_cxxflags_linux=-fPIC @@ -31,7 +30,7 @@ endef define $(package)_preprocess_cmds patch -p1 < $($(package)_patch_dir)/unused_var_in_process.patch && \ - echo "using $($(package)_toolset_$(host_os)) : : $($(package)_cxx) : \"$($(package)_cxxflags) $($(package)_cppflags)\" \"$($(package)_ldflags)\" \"$($(package)_archiver_$(host_os))\" \"$(host_STRIP)\" \"$(host_RANLIB)\" \"$(host_WINDRES)\" : ;" > user-config.jam + echo "using $($(package)_toolset_$(host_os)) : : $($(package)_cxx) : \"$($(package)_cxxflags) $($(package)_cppflags)\" \"$($(package)_ldflags)\" \"$($(package)_ar)\" \"$(host_STRIP)\" \"$(host_RANLIB)\" \"$(host_WINDRES)\" : ;" > user-config.jam endef define $(package)_config_cmds From 7f948a33660b9930d5e9bc6ffef37f0d3339fa21 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Fri, 27 Sep 2024 10:52:50 +0200 Subject: [PATCH 087/103] Bitcoin: f190343c96520db254d6689f8f24c9eb36bead6 (depends: boost: Specify cflags+compileflags). --- depends/packages/boost.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/depends/packages/boost.mk b/depends/packages/boost.mk index 62030bc0..d1f96d76 100644 --- a/depends/packages/boost.mk +++ b/depends/packages/boost.mk @@ -30,7 +30,7 @@ endef define $(package)_preprocess_cmds patch -p1 < $($(package)_patch_dir)/unused_var_in_process.patch && \ - echo "using $($(package)_toolset_$(host_os)) : : $($(package)_cxx) : \"$($(package)_cxxflags) $($(package)_cppflags)\" \"$($(package)_ldflags)\" \"$($(package)_ar)\" \"$(host_STRIP)\" \"$(host_RANLIB)\" \"$(host_WINDRES)\" : ;" > user-config.jam + echo "using $($(package)_toolset_$(host_os)) : : $($(package)_cxx) : \"$($(package)_cflags)\" \"$($(package)_cxxflags)\" \"$($(package)_cppflags)\" \"$($(package)_ldflags)\" \"$($(package)_ar)\" \"$(host_STRIP)\" \"$(host_RANLIB)\" \"$(host_WINDRES)\" : ;" > user-config.jam endef define $(package)_config_cmds From a4331d729b1c6b8d95cd791412af08b1fcac42ee Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Fri, 27 Sep 2024 10:56:06 +0200 Subject: [PATCH 088/103] Bitcoin: a57b49856033f3de4a861367b70aba85aec58cf (depends: boost: Bump to 1.71.0). --- depends/packages/boost.mk | 6 ++--- .../patches/boost/unused_var_in_process.patch | 22 ------------------- 2 files changed, 2 insertions(+), 26 deletions(-) delete mode 100644 depends/patches/boost/unused_var_in_process.patch diff --git a/depends/packages/boost.mk b/depends/packages/boost.mk index d1f96d76..25c2073c 100644 --- a/depends/packages/boost.mk +++ b/depends/packages/boost.mk @@ -1,10 +1,9 @@ package=boost -$(package)_version=1_70_0 +$(package)_version=1_71_0 $(package)_download_path=https://dl.bintray.com/boostorg/release/$(subst _,.,$($(package)_version))/source/ $(package)_file_name=boost_$($(package)_version).tar.bz2 -$(package)_sha256_hash=430ae8354789de4fd19ee52f3b1f739e1fba576f0aded0897c3c2bc00fb38778 +$(package)_sha256_hash=d73a8da01e8bf8c7eda40b4c84915071a8c8a0df4a6734537ddde4a8580524ee $(package)_dependencies=native_b2 -$(package)_patches=unused_var_in_process.patch define $(package)_set_vars $(package)_config_opts_release=variant=release @@ -29,7 +28,6 @@ $(package)_cxxflags_linux=-fPIC endef define $(package)_preprocess_cmds - patch -p1 < $($(package)_patch_dir)/unused_var_in_process.patch && \ echo "using $($(package)_toolset_$(host_os)) : : $($(package)_cxx) : \"$($(package)_cflags)\" \"$($(package)_cxxflags)\" \"$($(package)_cppflags)\" \"$($(package)_ldflags)\" \"$($(package)_ar)\" \"$(host_STRIP)\" \"$(host_RANLIB)\" \"$(host_WINDRES)\" : ;" > user-config.jam endef diff --git a/depends/patches/boost/unused_var_in_process.patch b/depends/patches/boost/unused_var_in_process.patch deleted file mode 100644 index 722f7bb5..00000000 --- a/depends/patches/boost/unused_var_in_process.patch +++ /dev/null @@ -1,22 +0,0 @@ -commit dbd95cdaefdea95307d004f019a1c394cf9389f0 -Author: fanquake -Date: Mon Aug 17 20:15:17 2020 +0800 - - Remove unused variable in Boost Process - - This causes issues with our linters / CI. - - Can be removed once depends Boost is 1.71.0 or later. - -diff --git a/boost/process/detail/posix/wait_group.hpp b/boost/process/detail/posix/wait_group.hpp -index 9dc249803..2502d9772 100644 ---- a/boost/process/detail/posix/wait_group.hpp -+++ b/boost/process/detail/posix/wait_group.hpp -@@ -137,7 +137,6 @@ inline bool wait_until( - - do - { -- int ret_sig = 0; - int status; - if ((::waitpid(timeout_pid, &status, WNOHANG) != 0) - && (WIFEXITED(status) || WIFSIGNALED(status))) From eaabcde243a494625d47572e4481c96abc57f232 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Fri, 27 Sep 2024 11:00:30 +0200 Subject: [PATCH 089/103] Bitcoin: 2dde55702da30ea568cac8a1d1cbddd652d6958 (depends: build bdb with -std=c++17). --- depends/packages/bdb.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/depends/packages/bdb.mk b/depends/packages/bdb.mk index 8f1d9a62..a3281dc9 100644 --- a/depends/packages/bdb.mk +++ b/depends/packages/bdb.mk @@ -11,7 +11,7 @@ $(package)_config_opts=--disable-shared --enable-cxx --disable-replication --ena $(package)_config_opts_mingw32=--enable-mingw $(package)_config_opts_linux=--with-pic $(package)_cflags+=-Wno-error=implicit-function-declaration -$(package)_cxxflags=-std=c++11 +$(package)_cxxflags=-std=c++17 $(package)_cppflags_mingw32=-DUNICODE -D_UNICODE endef From 1608eadec6f57a98526a08f85904921ae5fb4b08 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Fri, 27 Sep 2024 11:01:58 +0200 Subject: [PATCH 090/103] Bitcoin: 2374f2fbef4359476fe3184e2402a2cc741cefa (depends: build Boost with -std=c++17). --- depends/packages/boost.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/depends/packages/boost.mk b/depends/packages/boost.mk index 25c2073c..95b074c5 100644 --- a/depends/packages/boost.mk +++ b/depends/packages/boost.mk @@ -23,7 +23,7 @@ else $(package)_toolset_$(host_os)=gcc endif $(package)_config_libraries=filesystem,system,thread,test -$(package)_cxxflags=-std=c++11 -fvisibility=hidden +$(package)_cxxflags=-std=c++17 -fvisibility=hidden $(package)_cxxflags_linux=-fPIC endef From 6ad52b2132e050cb2dfa3a5868f2f22502254f24 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Fri, 27 Sep 2024 11:03:40 +0200 Subject: [PATCH 091/103] Bitcoin: e2c500636cb767347ae2b913345788ad3c3e827 (depends: build zeromq with -std=c++17). --- depends/packages/zeromq.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/depends/packages/zeromq.mk b/depends/packages/zeromq.mk index 41fb9e4c..c733d275 100644 --- a/depends/packages/zeromq.mk +++ b/depends/packages/zeromq.mk @@ -11,7 +11,7 @@ define $(package)_set_vars $(package)_config_opts += --disable-libunwind --disable-radix-tree --without-gcov --disable-dependency-tracking $(package)_config_opts += --disable-Werror --disable-drafts --enable-option-checking $(package)_config_opts_linux=--with-pic - $(package)_cxxflags=-std=c++11 + $(package)_cxxflags=-std=c++17 endef define $(package)_preprocess_cmds From 9b4a3fd1f72aacc56e5c49c10ccaab09d611eaa4 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Fri, 27 Sep 2024 11:05:24 +0200 Subject: [PATCH 092/103] Bitcoin: 104e859c9755aee5708ea1934454d88b10c266f (builds: don't pass -silent to qt when building in debug mode). --- depends/packages/qt.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/depends/packages/qt.mk b/depends/packages/qt.mk index f605f5c1..36d1e318 100644 --- a/depends/packages/qt.mk +++ b/depends/packages/qt.mk @@ -26,6 +26,7 @@ $(package)_extra_sources += $($(package)_qttools_file_name) define $(package)_set_vars $(package)_config_opts_release = -release +$(package)_config_opts_release += -silent $(package)_config_opts_debug = -debug $(package)_config_opts += -bindir $(build_prefix)/bin $(package)_config_opts += -c++std c++11 @@ -77,7 +78,6 @@ $(package)_config_opts += -qt-pcre $(package)_config_opts += -qt-harfbuzz $(package)_config_opts += -system-zlib $(package)_config_opts += -static -$(package)_config_opts += -silent $(package)_config_opts += -v $(package)_config_opts += -no-feature-bearermanagement $(package)_config_opts += -no-feature-colordialog From 971ea2af1db626d531fe39fd3bb0a97e516656cc Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Fri, 27 Sep 2024 11:06:22 +0200 Subject: [PATCH 093/103] Bitcoin: 2f5dfe4a7ff12b6b57427374142cdf7e266b73b (depends: build qt in c++17 mode). --- depends/packages/qt.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/depends/packages/qt.mk b/depends/packages/qt.mk index 36d1e318..b5e78b5b 100644 --- a/depends/packages/qt.mk +++ b/depends/packages/qt.mk @@ -29,7 +29,7 @@ $(package)_config_opts_release = -release $(package)_config_opts_release += -silent $(package)_config_opts_debug = -debug $(package)_config_opts += -bindir $(build_prefix)/bin -$(package)_config_opts += -c++std c++11 +$(package)_config_opts += -c++std c++1z $(package)_config_opts += -confirm-license $(package)_config_opts += -hostprefix $(build_prefix) $(package)_config_opts += -no-compile-examples From d463b2dd34585355cfb48a6427e6ed052ec7cd60 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Fri, 27 Sep 2024 11:07:18 +0200 Subject: [PATCH 094/103] Bitcoin: c23f6f84efa2fe7e7168a5d41341f3a7c5598f7 (Add depends qt fix for ARM macs). --- depends/packages/qt.mk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/depends/packages/qt.mk b/depends/packages/qt.mk index b5e78b5b..7c65f996 100644 --- a/depends/packages/qt.mk +++ b/depends/packages/qt.mk @@ -128,6 +128,9 @@ $(package)_config_opts_darwin += -device-option MAC_TARGET=$(host) $(package)_config_opts_darwin += -device-option XCODE_VERSION=$(XCODE_VERSION) endif +# for macOS on Apple Silicon (ARM) see https://bugreports.qt.io/browse/QTBUG-85279 +$(package)_config_opts_arm_darwin += -device-option QMAKE_APPLE_DEVICE_ARCHS=arm64 + $(package)_config_opts_linux = -qt-xkbcommon-x11 $(package)_config_opts_linux += -qt-xcb $(package)_config_opts_linux += -no-xcb-xlib From 9d9a1d16994efa70ab364457cb170b993e2903b0 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Fri, 27 Sep 2024 11:13:48 +0200 Subject: [PATCH 095/103] Bitcoin: 4d70d3d7fe29db38a1f9c84a3a6167ca57b3847 (build: automatically determine macOS translations). --- Makefile.am | 5 +-- contrib/macdeploy/macdeployqtplus | 63 +++++++++++-------------------- depends/packages/qt.mk | 1 - 3 files changed, 23 insertions(+), 46 deletions(-) diff --git a/Makefile.am b/Makefile.am index abdd68c2..8cf60148 100644 --- a/Makefile.am +++ b/Makefile.am @@ -42,7 +42,6 @@ OSX_DEPLOY_SCRIPT=$(top_srcdir)/contrib/macdeploy/macdeployqtplus OSX_FANCY_PLIST=$(top_srcdir)/contrib/macdeploy/fancy.plist OSX_INSTALLER_ICONS=$(top_srcdir)/src/qt/res/icons/auroracoin.icns OSX_PLIST=$(top_builddir)/share/qt/Info.plist #not installed -OSX_QT_TRANSLATIONS = ar,bg,ca,cs,da,de,es,fa,fi,fr,gd,gl,he,hu,it,ja,ko,lt,lv,pl,pt,ru,sk,sl,sv,uk,zh_CN,zh_TW DIST_DOCS = $(wildcard doc/*.md) $(wildcard doc/release-notes/*.md) DIST_CONTRIB = $(top_srcdir)/contrib/auroracoin-cli.bash-completion \ @@ -121,7 +120,7 @@ osx_volname: if BUILD_DARWIN $(OSX_DMG): $(OSX_APP_BUILT) $(OSX_PACKAGING) $(OSX_BACKGROUND_IMAGE) - $(PYTHON) $(OSX_DEPLOY_SCRIPT) $(OSX_APP) -add-qt-tr $(OSX_QT_TRANSLATIONS) -translations-dir=$(QT_TRANSLATION_DIR) -dmg -fancy $(OSX_FANCY_PLIST) -verbose 2 -volname $(OSX_VOLNAME) + $(PYTHON) $(OSX_DEPLOY_SCRIPT) $(OSX_APP) -translations-dir=$(QT_TRANSLATION_DIR) -dmg -fancy $(OSX_FANCY_PLIST) -verbose 2 -volname $(OSX_VOLNAME) $(OSX_BACKGROUND_IMAGE).png: contrib/macdeploy/$(OSX_BACKGROUND_SVG) sed 's/PACKAGE_NAME/$(PACKAGE_NAME)/' < "$<" | $(RSVG_CONVERT) -f png -d 36 -p 36 -o $@ @@ -155,7 +154,7 @@ $(APP_DIST_DIR)/.DS_Store: $(OSX_DSSTORE_GEN) $(PYTHON) $< "$@" "$(OSX_VOLNAME)" $(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Auroracoin-Qt: $(OSX_APP_BUILT) $(OSX_PACKAGING) - INSTALLNAMETOOL=$(INSTALLNAMETOOL) OTOOL=$(OTOOL) STRIP=$(STRIP) $(PYTHON) $(OSX_DEPLOY_SCRIPT) $(OSX_APP) -translations-dir=$(QT_TRANSLATION_DIR) -add-qt-tr $(OSX_QT_TRANSLATIONS) -verbose 2 + INSTALLNAMETOOL=$(INSTALLNAMETOOL) OTOOL=$(OTOOL) STRIP=$(STRIP) $(PYTHON) $(OSX_DEPLOY_SCRIPT) $(OSX_APP) -translations-dir=$(QT_TRANSLATION_DIR) -verbose 2 deploydir: $(APP_DIST_EXTRAS) endif diff --git a/contrib/macdeploy/macdeployqtplus b/contrib/macdeploy/macdeployqtplus index 800e51da..1759de5a 100755 --- a/contrib/macdeploy/macdeployqtplus +++ b/contrib/macdeploy/macdeployqtplus @@ -17,8 +17,9 @@ # import subprocess, sys, re, os, shutil, stat, os.path, time -from string import Template from argparse import ArgumentParser +from pathlib import Path +from string import Template from typing import List, Optional # This is ported from the original macdeployqt with modifications @@ -526,8 +527,7 @@ ap.add_argument("-no-strip", dest="strip", action="store_false", default=True, h ap.add_argument("-sign", dest="sign", action="store_true", default=False, help="sign .app bundle with codesign tool") ap.add_argument("-dmg", nargs="?", const="", metavar="basename", help="create a .dmg disk image; if basename is not specified, a camel-cased version of the app name is used") ap.add_argument("-fancy", nargs=1, metavar="plist", default=[], help="make a fancy looking disk image using the given plist file with instructions; requires -dmg to work") -ap.add_argument("-add-qt-tr", nargs=1, metavar="languages", default=[], help="add Qt translation files to the bundle's resources; the language list must be separated with commas, not with whitespace") -ap.add_argument("-translations-dir", nargs=1, metavar="path", default=None, help="Path to Qt's translation files") +ap.add_argument("-translations-dir", nargs=1, metavar="path", default=None, help="Path to Qt's translations. Base translations will automatically be added to the bundle's resources.") ap.add_argument("-add-resources", nargs="+", metavar="path", default=[], help="list of additional files or folders to be copied into the bundle's resources; must be the last argument") ap.add_argument("-volname", nargs=1, metavar="volname", default=[], help="custom volume name for dmg") @@ -547,15 +547,6 @@ if not os.path.exists(app_bundle): app_bundle_name = os.path.splitext(os.path.basename(app_bundle))[0] # ------------------------------------------------ -translations_dir = None -if config.translations_dir and config.translations_dir[0]: - if os.path.exists(config.translations_dir[0]): - translations_dir = config.translations_dir[0] - else: - if verbose >= 1: - sys.stderr.write("Error: Could not find translation dir \"{}\"\n".format(translations_dir)) - sys.exit(1) -# ------------------------------------------------ for p in config.add_resources: if verbose >= 3: @@ -684,26 +675,24 @@ if config.plugins: # ------------------------------------------------ -if len(config.add_qt_tr) == 0: - add_qt_tr = [] -else: - if translations_dir is not None: - qt_tr_dir = translations_dir - else: - if deploymentInfo.qtPath is not None: - qt_tr_dir = os.path.join(deploymentInfo.qtPath, "translations") - else: - sys.stderr.write("Error: Could not find Qt translation path\n") - sys.exit(1) - add_qt_tr = ["qt_{}.qm".format(lng) for lng in config.add_qt_tr[0].split(",")] - for lng_file in add_qt_tr: - p = os.path.join(qt_tr_dir, lng_file) - if verbose >= 3: - print("Checking for \"{}\"...".format(p)) - if not os.path.exists(p): - if verbose >= 1: - sys.stderr.write("Error: Could not find Qt translation file \"{}\"\n".format(lng_file)) - sys.exit(1) +if config.translations_dir: + if not Path(config.translations_dir[0]).exists(): + sys.stderr.write("Error: Could not find translation dir \"{}\"\n".format(config.translations_dir[0])) + sys.exit(1) + +if verbose >= 2: + print("+ Adding Qt translations +") + +translations = Path(config.translations_dir[0]) + +regex = re.compile('qt_[a-z]*(.qm|_[A-Z]*.qm)') + +lang_files = [x for x in translations.iterdir() if regex.match(x.name)] + +for file in lang_files: + if verbose >= 3: + print(file.as_posix(), "->", os.path.join(applicationBundle.resourcesPath, file.name)) + shutil.copy2(file.as_posix(), os.path.join(applicationBundle.resourcesPath, file.name)) # ------------------------------------------------ @@ -715,16 +704,6 @@ with open(os.path.join(applicationBundle.resourcesPath, "qt.conf"), "wb") as f: # ------------------------------------------------ -if len(add_qt_tr) > 0 and verbose >= 2: - print("+ Adding Qt translations +") - -for lng_file in add_qt_tr: - if verbose >= 3: - print(os.path.join(qt_tr_dir, lng_file), "->", os.path.join(applicationBundle.resourcesPath, lng_file)) - shutil.copy2(os.path.join(qt_tr_dir, lng_file), os.path.join(applicationBundle.resourcesPath, lng_file)) - -# ------------------------------------------------ - if len(config.add_resources) > 0 and verbose >= 2: print("+ Adding additional resources +") diff --git a/depends/packages/qt.mk b/depends/packages/qt.mk index 7c65f996..ce424d1b 100644 --- a/depends/packages/qt.mk +++ b/depends/packages/qt.mk @@ -14,7 +14,6 @@ $(package)_patches+= fix_android_qmake_conf.patch fix_android_jni_static.patch d $(package)_patches+= freetype_back_compat.patch drop_lrelease_dependency.patch fix_powerpc_libpng.patch $(package)_patches+= fix_mingw_cross_compile.patch fix_qpainter_non_determinism.patch -# Update OSX_QT_TRANSLATIONS when this is updated $(package)_qttranslations_file_name=qttranslations-$($(package)_suffix) $(package)_qttranslations_sha256_hash=fb5a47799754af73d3bf501fe513342cfe2fc37f64e80df5533f6110e804220c From 9db170c4a74014b8fd0b4e435530070d074b8fd5 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Fri, 27 Sep 2024 11:14:59 +0200 Subject: [PATCH 096/103] Bitcoin: b685f60a08007e0ae8a5564ee68cd94f9015d89 (build: mac_alias 2.1.1). --- depends/packages/native_mac_alias.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/depends/packages/native_mac_alias.mk b/depends/packages/native_mac_alias.mk index e60b99dc..5fe027fb 100644 --- a/depends/packages/native_mac_alias.mk +++ b/depends/packages/native_mac_alias.mk @@ -1,8 +1,8 @@ package=native_mac_alias -$(package)_version=2.0.7 +$(package)_version=2.1.1 $(package)_download_path=https://github.com/al45tair/mac_alias/archive/ $(package)_file_name=v$($(package)_version).tar.gz -$(package)_sha256_hash=6f606d3b6bccd2112aeabf1a063f5b5ece87005a5d7e97c8faca23b916e88838 +$(package)_sha256_hash=c0ffceee14f7d04a6eb323fb7b8217dc3f373b346198d2ca42300a8362db7efa $(package)_install_libdir=$(build_prefix)/lib/python3/dist-packages define $(package)_build_cmds From f10f4174ae7aa2e43a232bfdf4319ff59d9cd0fe Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Fri, 27 Sep 2024 11:18:25 +0200 Subject: [PATCH 097/103] Bitcoin: c82d15b6d189983ebf82f35ade33d830870f25c (depends: Do not force Precompiled Headers (PCH) for building Qt on Linux). --- depends/packages/qt.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/depends/packages/qt.mk b/depends/packages/qt.mk index ce424d1b..6f535612 100644 --- a/depends/packages/qt.mk +++ b/depends/packages/qt.mk @@ -69,7 +69,6 @@ $(package)_config_opts += -nomake examples $(package)_config_opts += -nomake tests $(package)_config_opts += -opensource $(package)_config_opts += -optimized-tools -$(package)_config_opts += -pch $(package)_config_opts += -pkg-config $(package)_config_opts += -prefix $(host_prefix) $(package)_config_opts += -qt-libpng @@ -116,6 +115,7 @@ $(package)_config_opts += -no-feature-xml $(package)_config_opts_darwin = -no-dbus $(package)_config_opts_darwin += -no-opengl +$(package)_config_opts_darwin += -pch ifneq ($(build_os),darwin) $(package)_config_opts_darwin += -xplatform macx-clang-linux @@ -151,6 +151,7 @@ $(package)_config_opts_mingw32 = -no-opengl $(package)_config_opts_mingw32 += -no-dbus $(package)_config_opts_mingw32 += -xplatform win32-g++ $(package)_config_opts_mingw32 += -device-option CROSS_COMPILE="$(host)-" +$(package)_config_opts_mingw32 += -pch $(package)_build_env = QT_RCC_TEST=1 $(package)_build_env += QT_RCC_SOURCE_DATE_OVERRIDE=1 endef From 57a4a71b4f06a030612ad38a4226c33101aacfc3 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Sun, 6 Oct 2024 23:44:23 +0200 Subject: [PATCH 098/103] Bitcoin: a4118c6e200e02e7560f8bc213697aa2909d95b (Add patch to make codesign_allocate compatible with Apple's). --- depends/packages/native_cctools.mk | 5 +++-- depends/patches/native_cctools/segalign.patch | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 depends/patches/native_cctools/segalign.patch diff --git a/depends/packages/native_cctools.mk b/depends/packages/native_cctools.mk index d56b6366..33f69375 100644 --- a/depends/packages/native_cctools.mk +++ b/depends/packages/native_cctools.mk @@ -4,7 +4,7 @@ $(package)_download_path=https://github.com/tpoechtrager/cctools-port/archive $(package)_file_name=$($(package)_version).tar.gz $(package)_sha256_hash=e51995a843533a3dac155dd0c71362dd471597a2d23f13dff194c6285362f875 $(package)_build_subdir=cctools -$(package)_patches=ld64_disable_threading.patch +$(package)_patches=ld64_disable_threading.patch segalign.patch ifeq ($(strip $(FORCE_USE_SYSTEM_CLANG)),) $(package)_clang_version=8.0.0 @@ -80,7 +80,8 @@ endef define $(package)_preprocess_cmds CC=$($(package)_cc) CXX=$($(package)_cxx) INSTALLPREFIX=$($(package)_extract_dir) ./libtapi/build.sh && \ CC=$($(package)_cc) CXX=$($(package)_cxx) INSTALLPREFIX=$($(package)_extract_dir) ./libtapi/install.sh && \ - patch -p1 < $($(package)_patch_dir)/ld64_disable_threading.patch + patch -p1 < $($(package)_patch_dir)/ld64_disable_threading.patch && \ + patch -p1 < $($(package)_patch_dir)/segalign.patch endef define $(package)_config_cmds diff --git a/depends/patches/native_cctools/segalign.patch b/depends/patches/native_cctools/segalign.patch new file mode 100644 index 00000000..bcdbd67a --- /dev/null +++ b/depends/patches/native_cctools/segalign.patch @@ -0,0 +1,19 @@ +commit 7f2eb11ce6ebec7eb9b8e1429535e453054143e5 +Author: Pieter Wuille +Date: Sun Dec 13 11:34:21 2020 -0800 + + Make cctools_port's codesign_allocate compatible with Apple's + +diff --git a/cctools/libstuff/arch.c b/cctools/libstuff/arch.c +index 6f2332f..d85c25c 100644 +--- a/cctools/libstuff/arch.c ++++ b/cctools/libstuff/arch.c +@@ -134,7 +134,7 @@ static const struct cpu_entry cpu_entries[] = { + { CPU_TYPE_ARM, LITTLE_ENDIAN_BYTE_SEX, 0, 0x4000 }, + + /* desktop */ +- { CPU_TYPE_X86_64, LITTLE_ENDIAN_BYTE_SEX, 0x7fff5fc00000LL, 0x1000 }, ++ { CPU_TYPE_X86_64, LITTLE_ENDIAN_BYTE_SEX, 0x7fff5fc00000LL, 0x2000 /* Used to be 0x1000; changed to 0x2000 to match Apple's distributed codesign_allocate. */}, + { CPU_TYPE_I386, LITTLE_ENDIAN_BYTE_SEX, 0xc0000000, 0x1000 }, + { CPU_TYPE_POWERPC, BIG_ENDIAN_BYTE_SEX, 0xc0000000, 0x1000 }, + { CPU_TYPE_POWERPC64, BIG_ENDIAN_BYTE_SEX, 0x7ffff00000000LL, 0x1000 }, From f096e1719359b6ef22c6e81a709f54574fba23e2 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Sun, 6 Oct 2024 23:45:49 +0200 Subject: [PATCH 099/103] Bitcoin: 267f259c0dfbd348340d49e9a89b8684b994e22 (depends: Drop workaround for a fixed bug in Qt build system). --- depends/packages/qt.mk | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/depends/packages/qt.mk b/depends/packages/qt.mk index 6f535612..85b3d839 100644 --- a/depends/packages/qt.mk +++ b/depends/packages/qt.mk @@ -256,10 +256,7 @@ define $(package)_stage_cmds $(MAKE) -C src INSTALL_ROOT=$($(package)_staging_dir) $(addsuffix -install_subtargets,$(addprefix sub-,$($(package)_qt_libs))) && cd .. && \ $(MAKE) -C qttools/src/linguist/lrelease INSTALL_ROOT=$($(package)_staging_dir) install_target && \ $(MAKE) -C qttools/src/linguist/lupdate INSTALL_ROOT=$($(package)_staging_dir) install_target && \ - $(MAKE) -C qttranslations INSTALL_ROOT=$($(package)_staging_dir) install_subtargets && \ - if `test -f qtbase/src/plugins/platforms/xcb/xcb-static/libxcb-static.a`; then \ - cp qtbase/src/plugins/platforms/xcb/xcb-static/libxcb-static.a $($(package)_staging_prefix_dir)/lib; \ - fi + $(MAKE) -C qttranslations INSTALL_ROOT=$($(package)_staging_dir) install_subtargets endef define $(package)_postprocess_cmds From 1bb433a7c3908bfe3f120cdd7dc0d20741640cf1 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Sun, 6 Oct 2024 23:47:11 +0200 Subject: [PATCH 100/103] Bitcoin: bf35a8da6ec2791dedf36f459add69ac67b11ff (depends: Do not set build_subdir for qt package). --- depends/packages/qt.mk | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/depends/packages/qt.mk b/depends/packages/qt.mk index 85b3d839..7d6db970 100644 --- a/depends/packages/qt.mk +++ b/depends/packages/qt.mk @@ -6,7 +6,6 @@ $(package)_file_name=qtbase-$($(package)_suffix) $(package)_sha256_hash=9b9dec1f67df1f94bce2955c5604de992d529dde72050239154c56352da0907d $(package)_dependencies=zlib $(package)_linux_dependencies=freetype fontconfig libxcb -$(package)_build_subdir=qtbase $(package)_qt_libs=corelib network widgets gui plugins testlib $(package)_patches=fix_qt_pkgconfig.patch mac-qmake.conf fix_configure_mac.patch fix_no_printer.patch $(package)_patches+= fix_rcc_determinism.patch fix_riscv64_arch.patch xkb-default.patch no-xlib.patch @@ -235,6 +234,7 @@ define $(package)_config_cmds export PKG_CONFIG_SYSROOT_DIR=/ && \ export PKG_CONFIG_LIBDIR=$(host_prefix)/lib/pkgconfig && \ export PKG_CONFIG_PATH=$(host_prefix)/share/pkgconfig && \ + cd qtbase && \ ./configure $($(package)_config_opts) && \ echo "host_build: QT_CONFIG ~= s/system-zlib/zlib" >> mkspecs/qconfig.pri && \ echo "CONFIG += force_bootstrap" >> mkspecs/qconfig.pri && \ @@ -246,14 +246,14 @@ define $(package)_config_cmds endef define $(package)_build_cmds - $(MAKE) -C src $(addprefix sub-,$($(package)_qt_libs)) && \ - $(MAKE) -C ../qttools/src/linguist/lrelease && \ - $(MAKE) -C ../qttools/src/linguist/lupdate && \ - $(MAKE) -C ../qttranslations + $(MAKE) -C qtbase/src $(addprefix sub-,$($(package)_qt_libs)) && \ + $(MAKE) -C qttools/src/linguist/lrelease && \ + $(MAKE) -C qttools/src/linguist/lupdate && \ + $(MAKE) -C qttranslations endef define $(package)_stage_cmds - $(MAKE) -C src INSTALL_ROOT=$($(package)_staging_dir) $(addsuffix -install_subtargets,$(addprefix sub-,$($(package)_qt_libs))) && cd .. && \ + $(MAKE) -C qtbase/src INSTALL_ROOT=$($(package)_staging_dir) $(addsuffix -install_subtargets,$(addprefix sub-,$($(package)_qt_libs))) && \ $(MAKE) -C qttools/src/linguist/lrelease INSTALL_ROOT=$($(package)_staging_dir) install_target && \ $(MAKE) -C qttools/src/linguist/lupdate INSTALL_ROOT=$($(package)_staging_dir) install_target && \ $(MAKE) -C qttranslations INSTALL_ROOT=$($(package)_staging_dir) install_subtargets From c01cd1bc8cdf680d2be3e65937813ed0950213b1 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Sun, 6 Oct 2024 23:48:14 +0200 Subject: [PATCH 101/103] Bitcoin: 87fe104537eab5ccd8728321fe1c9ba39f7dda7 (depends: Use more legible qmake commands in qt package). --- depends/packages/qt.mk | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/depends/packages/qt.mk b/depends/packages/qt.mk index 7d6db970..fb0d284e 100644 --- a/depends/packages/qt.mk +++ b/depends/packages/qt.mk @@ -238,11 +238,12 @@ define $(package)_config_cmds ./configure $($(package)_config_opts) && \ echo "host_build: QT_CONFIG ~= s/system-zlib/zlib" >> mkspecs/qconfig.pri && \ echo "CONFIG += force_bootstrap" >> mkspecs/qconfig.pri && \ - $(MAKE) sub-src-clean && \ - cd ../qttranslations && ../qtbase/bin/qmake qttranslations.pro -o Makefile && \ - cd translations && ../../qtbase/bin/qmake translations.pro -o Makefile && cd ../.. && \ - cd qttools/src/linguist/lrelease/ && ../../../../qtbase/bin/qmake lrelease.pro -o Makefile && \ - cd ../lupdate/ && ../../../../qtbase/bin/qmake lupdate.pro -o Makefile && cd ../../../.. + cd .. && \ + $(MAKE) -C qtbase sub-src-clean && \ + qtbase/bin/qmake -o qttranslations/Makefile qttranslations/qttranslations.pro && \ + qtbase/bin/qmake -o qttranslations/translations/Makefile qttranslations/translations/translations.pro && \ + qtbase/bin/qmake -o qttools/src/linguist/lrelease/Makefile qttools/src/linguist/lrelease/lrelease.pro && \ + qtbase/bin/qmake -o qttools/src/linguist/lupdate/Makefile qttools/src/linguist/lupdate/lupdate.pro endef define $(package)_build_cmds From 134b4094ac9c39ae3003ae36a503fb68aa465a72 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Sun, 6 Oct 2024 23:49:17 +0200 Subject: [PATCH 102/103] Bitcoin: 7587d11ec959f15f469bd396d4ad2697729b4cc (build: remove cdrkit package from depends). --- depends/packages/native_cdrkit.mk | 28 ------ depends/packages/packages.mk | 2 +- .../native_cdrkit/cdrkit-deterministic.patch | 86 ------------------- 3 files changed, 1 insertion(+), 115 deletions(-) delete mode 100644 depends/packages/native_cdrkit.mk delete mode 100644 depends/patches/native_cdrkit/cdrkit-deterministic.patch diff --git a/depends/packages/native_cdrkit.mk b/depends/packages/native_cdrkit.mk deleted file mode 100644 index 7bdf2d7d..00000000 --- a/depends/packages/native_cdrkit.mk +++ /dev/null @@ -1,28 +0,0 @@ -package=native_cdrkit -$(package)_version=1.1.11 -$(package)_download_path=https://distro.ibiblio.org/fatdog/source/600/c -$(package)_file_name=cdrkit-$($(package)_version).tar.bz2 -$(package)_sha256_hash=b50d64c214a65b1a79afe3a964c691931a4233e2ba605d793eb85d0ac3652564 -$(package)_patches=cdrkit-deterministic.patch - -define $(package)_preprocess_cmds - patch -p1 < $($(package)_patch_dir)/cdrkit-deterministic.patch -endef - -# Starting with 10.1, GCC defaults to -fno-common, resulting in linking errors. -# Pass -fcommon to retain the legacy behaviour. -define $(package)_config_cmds - $($(package)_cmake) -DCMAKE_C_FLAGS="$$($(1)_cflags) -fcommon" -endef - -define $(package)_build_cmds - $(MAKE) genisoimage -endef - -define $(package)_stage_cmds - $(MAKE) DESTDIR=$($(package)_staging_dir) -C genisoimage install -endef - -define $(package)_postprocess_cmds - rm bin/isovfy bin/isoinfo bin/isodump bin/isodebug bin/devdump -endef diff --git a/depends/packages/packages.mk b/depends/packages/packages.mk index 27f41580..c3365fd8 100644 --- a/depends/packages/packages.mk +++ b/depends/packages/packages.mk @@ -24,5 +24,5 @@ darwin_native_packages = native_ds_store native_mac_alias $(host_arch)_$(host_os)_native_packages += native_b2 ifneq ($(build_os),darwin) -darwin_native_packages += native_cctools native_cdrkit native_libdmg-hfsplus +darwin_native_packages += native_cctools native_libdmg-hfsplus endif diff --git a/depends/patches/native_cdrkit/cdrkit-deterministic.patch b/depends/patches/native_cdrkit/cdrkit-deterministic.patch deleted file mode 100644 index 8ab0993d..00000000 --- a/depends/patches/native_cdrkit/cdrkit-deterministic.patch +++ /dev/null @@ -1,86 +0,0 @@ ---- cdrkit-1.1.11.old/genisoimage/tree.c 2008-10-21 19:57:47.000000000 -0400 -+++ cdrkit-1.1.11/genisoimage/tree.c 2013-12-06 00:23:18.489622668 -0500 -@@ -1139,8 +1139,9 @@ - scan_directory_tree(struct directory *this_dir, char *path, - struct directory_entry *de) - { -- DIR *current_dir; -+ int current_file; - char whole_path[PATH_MAX]; -+ struct dirent **d_list; - struct dirent *d_entry; - struct directory *parent; - int dflag; -@@ -1164,7 +1165,8 @@ - this_dir->dir_flags |= DIR_WAS_SCANNED; - - errno = 0; /* Paranoia */ -- current_dir = opendir(path); -+ //current_dir = opendir(path); -+ current_file = scandir(path, &d_list, NULL, alphasort); - d_entry = NULL; - - /* -@@ -1173,12 +1175,12 @@ - */ - old_path = path; - -- if (current_dir) { -+ if (current_file >= 0) { - errno = 0; -- d_entry = readdir(current_dir); -+ d_entry = d_list[0]; - } - -- if (!current_dir || !d_entry) { -+ if (current_file < 0 || !d_entry) { - int ret = 1; - - #ifdef USE_LIBSCHILY -@@ -1191,8 +1193,8 @@ - de->isorec.flags[0] &= ~ISO_DIRECTORY; - ret = 0; - } -- if (current_dir) -- closedir(current_dir); -+ if(d_list) -+ free(d_list); - return (ret); - } - #ifdef ABORT_DEEP_ISO_ONLY -@@ -1208,7 +1210,7 @@ - errmsgno(EX_BAD, "use Rock Ridge extensions via -R or -r,\n"); - errmsgno(EX_BAD, "or allow deep ISO9660 directory nesting via -D.\n"); - } -- closedir(current_dir); -+ free(d_list); - return (1); - } - #endif -@@ -1250,13 +1252,13 @@ - * The first time through, skip this, since we already asked - * for the first entry when we opened the directory. - */ -- if (dflag) -- d_entry = readdir(current_dir); -+ if (dflag && current_file >= 0) -+ d_entry = d_list[current_file]; - dflag++; - -- if (!d_entry) -+ if (current_file < 0) - break; -- -+ current_file--; - /* OK, got a valid entry */ - - /* If we do not want all files, then pitch the backups. */ -@@ -1348,7 +1350,7 @@ - insert_file_entry(this_dir, whole_path, d_entry->d_name); - #endif /* APPLE_HYB */ - } -- closedir(current_dir); -+ free(d_list); - - #ifdef APPLE_HYB - /* From d95f0fe6664ed8f745d1940aeee8f79e6683e2d1 Mon Sep 17 00:00:00 2001 From: Myckel Habets Date: Sun, 6 Oct 2024 23:51:32 +0200 Subject: [PATCH 103/103] Bitcoin: 7b6887e75aec7e0d5c25682c26943073b7a728e (doc: Convert depends options list from html to markdown). --- depends/README.md | 62 +++++++++++++++++------------------------------ 1 file changed, 22 insertions(+), 40 deletions(-) diff --git a/depends/README.md b/depends/README.md index 6b86397c..83ab00f5 100644 --- a/depends/README.md +++ b/depends/README.md @@ -72,48 +72,30 @@ RISC-V known issue: gcc-7.3.0 and gcc-7.3.1 result in a broken `test_auroracoin` 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
-
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.
-
+- `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 +- `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 +- `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. If some packages are not built, for example `make NO_WALLET=1`, the appropriate options will be passed to auroracoin's configure. In this case, `--disable-wallet`.