Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backport: merge bitcoin#23060, #24164, #23565, #24337, #27682, #29208, #29091, #29165, #29934, #30261, partial bitcoin#27662, #28210, #28348, #30263 (bump minimum compiler) #6389

Draft
wants to merge 16 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ task:
FILE_ENV: "./ci/test/00_setup_env_win64.sh"

task:
name: '32-bit + dash [gui] [CentOS 8]'
name: '32-bit + dash [gui] [CentOS 9]'
<< : *GLOBAL_TASK_TEMPLATE
container:
image: centos:8
image: centos:9
env:
PACKAGE_MANAGER_INSTALL: "yum install -y"
FILE_ENV: "./ci/test/00_setup_env_i686_centos.sh"
Expand Down
42 changes: 0 additions & 42 deletions build-aux/m4/bitcoin_runtime_lib.m4

This file was deleted.

47 changes: 0 additions & 47 deletions build-aux/m4/l_filesystem.m4

This file was deleted.

4 changes: 2 additions & 2 deletions ci/test/04_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ if [ -n "$DPKG_ADD_ARCH" ]; then
fi

if [[ $DOCKER_NAME_TAG == centos* ]]; then
${CI_RETRY_EXE} DOCKER_EXEC yum -y install epel-release
${CI_RETRY_EXE} DOCKER_EXEC yum -y install "$DOCKER_PACKAGES" "$PACKAGES"
DOCKER_EXEC yum -y install epel-release
DOCKER_EXEC yum -y install "$DOCKER_PACKAGES" "$PACKAGES"
elif [ "$CI_USE_APT_INSTALL" != "no" ]; then
${CI_RETRY_EXE} DOCKER_EXEC apt-get update
${CI_RETRY_EXE} DOCKER_EXEC apt-get install --no-install-recommends --no-upgrade -y "$PACKAGES" "$DOCKER_PACKAGES"
Expand Down
5 changes: 1 addition & 4 deletions ci/test/05_before_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@ if [[ $HOST = *-mingw32 ]]; then
fi
if [ -z "$NO_DEPENDS" ]; then
if [[ $DOCKER_NAME_TAG == centos* ]]; then
# CentOS has problems building the depends if the config shell is not explicitly set
# (i.e. for libevent a Makefile with an empty SHELL variable is generated, leading to
# an error as the first command is executed)
SHELL_OPTS="LC_ALL=en_US.UTF-8 CONFIG_SHELL=/bin/bash"
SHELL_OPTS="CONFIG_SHELL=/bin/bash"
else
SHELL_OPTS="CONFIG_SHELL="
fi
Expand Down
45 changes: 17 additions & 28 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,6 @@ else
AX_CXX_COMPILE_STDCXX([20], [noext], [mandatory])
fi

dnl check if additional link flags are required for std::filesystem
CHECK_FILESYSTEM

dnl Unless the user specified OBJCXX, force it to be the same as CXX. This ensures
dnl that we get the same -std flags for both.
m4_ifdef([AC_PROG_OBJCXX],[
Expand Down Expand Up @@ -481,10 +478,7 @@ if test "x$enable_werror" = "xyes"; then

AX_CHECK_COMPILE_FLAG([-Werror=conditional-uninitialized],[ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror=conditional-uninitialized"],,[[$CXXFLAG_WERROR]])
AX_CHECK_COMPILE_FLAG([-Werror=sign-compare],[ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror=sign-compare"],,[[$CXXFLAG_WERROR]])
dnl -Wsuggest-override is broken with GCC before 9.2
dnl https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78010
AX_CHECK_COMPILE_FLAG([-Werror=suggest-override],[ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror=suggest-override"],,[[$CXXFLAG_WERROR]],
[AC_LANG_SOURCE([[struct A { virtual void f(); }; struct B : A { void f() final; };]])])
AX_CHECK_COMPILE_FLAG([-Wsuggest-override], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wsuggest-override"], [], [$CXXFLAG_WERROR])
AX_CHECK_COMPILE_FLAG([-Werror=unreachable-code-loop-increment],[ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror=unreachable-code-loop-increment"],,[[$CXXFLAG_WERROR]])
AX_CHECK_COMPILE_FLAG([-Werror=mismatched-tags], [ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror=mismatched-tags"], [], [$CXXFLAG_WERROR])
AX_CHECK_COMPILE_FLAG([-Werror=implicit-fallthrough], [ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror=implicit-fallthrough"], [], [$CXXFLAG_WERROR])
Expand Down Expand Up @@ -1363,22 +1357,6 @@ if test "x$enable_fuzz" = "xyes"; then
enable_fuzz_binary=yes

AX_CHECK_PREPROC_FLAG([-DABORT_ON_FAILED_ASSUME],[[DEBUG_CPPFLAGS="$DEBUG_CPPFLAGS -DABORT_ON_FAILED_ASSUME"]],,[[$CXXFLAG_WERROR]])

AC_MSG_CHECKING([whether main function is needed for fuzz binary])
AX_CHECK_LINK_FLAG(
[[-fsanitize=$use_sanitizers]],
[AC_MSG_RESULT([no])],
[AC_MSG_RESULT([yes])
CORE_CPPFLAGS="$CORE_CPPFLAGS -DPROVIDE_FUZZ_MAIN_FUNCTION"],
[],
[AC_LANG_PROGRAM([[
#include <cstdint>
#include <cstddef>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { return 0; }
/* comment to remove the main function ...
]],[[
*/ int not_main() {
]])])
else
BITCOIN_QT_INIT

Expand All @@ -1392,8 +1370,23 @@ else
QT_DBUS_INCLUDES=SUPPRESS_WARNINGS($QT_DBUS_INCLUDES)
QT_TEST_INCLUDES=SUPPRESS_WARNINGS($QT_TEST_INCLUDES)
fi
fi

CORE_CPPFLAGS="$CORE_CPPFLAGS -DPROVIDE_FUZZ_MAIN_FUNCTION"
if test x$enable_fuzz_binary = xyes; then
AC_MSG_CHECKING([whether main function is needed for fuzz binary])
AX_CHECK_LINK_FLAG(
[],
[AC_MSG_RESULT([no])],
[AC_MSG_RESULT([yes]); CORE_CPPFLAGS="$CORE_CPPFLAGS -DPROVIDE_FUZZ_MAIN_FUNCTION"],
[$SANITIZER_LDFLAGS],
[AC_LANG_PROGRAM([[
#include <cstdint>
#include <cstddef>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { return 0; }
/* comment to remove the main function ...
]],[[
*/ int not_main() {
]])])
fi

if test x$enable_wallet != xno; then
Expand Down Expand Up @@ -1817,10 +1810,6 @@ if test x$build_bitcoin_wallet$build_bitcoin_cli$build_bitcoin_tx$build_bitcoind
AC_MSG_ERROR([No targets! Please specify at least one of: --with-utils --with-libs --with-daemon --with-gui --enable-bench or --enable-tests])
fi

if test x$enable_fuzz_binary = xyes; then
CHECK_RUNTIME_LIB
fi

AM_CONDITIONAL([TARGET_DARWIN], [test x$TARGET_OS = xdarwin])
AM_CONDITIONAL([BUILD_DARWIN], [test x$BUILD_OS = xdarwin])
AM_CONDITIONAL([TARGET_LINUX], [test x$TARGET_OS = xlinux])
Expand Down
40 changes: 10 additions & 30 deletions doc/build-freebsd.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,6 @@

This guide describes how to build dashd, command-line utilities, and GUI on FreeBSD.

## Dependencies

The following dependencies are **required**:

Library | Purpose | Description
----------------------------------------------------------------------|------------|----------------------
[autoconf](https://svnweb.freebsd.org/ports/head/devel/autoconf/) | Build | Automatically configure software source code
[automake](https://svnweb.freebsd.org/ports/head/devel/automake/) | Build | Generate makefile (requires autoconf)
[libtool](https://svnweb.freebsd.org/ports/head/devel/libtool/) | Build | Shared library support
[pkgconf](https://svnweb.freebsd.org/ports/head/devel/pkgconf/) | Build | Configure compiler and linker flags
[git](https://svnweb.freebsd.org/ports/head/devel/git/) | Clone | Version control system
[gmake](https://svnweb.freebsd.org/ports/head/devel/gmake/) | Compile | Generate executables
[boost-libs](https://svnweb.freebsd.org/ports/head/devel/boost-libs/) | Utility | Library for threading, data structures, etc
[libevent](https://svnweb.freebsd.org/ports/head/devel/libevent/) | Networking | OS independent asynchronous networking


The following dependencies are **optional**:

Library | Purpose | Description
---------------------------------------------------------------------------|------------------|----------------------
[db5](https://svnweb.freebsd.org/ports/head/databases/db5/) | Berkeley DB | Wallet storage (only needed when wallet enabled)
[qt5](https://svnweb.freebsd.org/ports/head/devel/qt5/) | GUI | GUI toolkit (only needed when GUI enabled)
[gmp](https://svnweb.freebsd.org/ports/head/math/gmp/) | Optimized math routines | Arbitrary precision arithmetic library
[libqrencode](https://svnweb.freebsd.org/ports/head/graphics/libqrencode/) | QR codes in GUI | Generating QR codes (only needed when GUI enabled)
[libzmq4](https://svnweb.freebsd.org/ports/head/net/libzmq4/) | ZMQ notification | Allows generating ZMQ notifications (requires ZMQ version >= 4.0.0)
[sqlite3](https://svnweb.freebsd.org/ports/head/databases/sqlite3/) | SQLite DB | Wallet storage (only needed when wallet enabled)
[python3](https://svnweb.freebsd.org/ports/head/lang/python3/) | Testing | Python Interpreter (only needed when running the test suite)

See [dependencies.md](dependencies.md) for a complete overview.

## Preparation

### 1. Install Required Dependencies
Expand All @@ -44,6 +14,8 @@ pkg install autoconf automake boost-libs git gmake libevent libtool pkgconf

```

See [dependencies.md](dependencies.md) for a complete overview.

### 2. Clone Dash Repo
Now that `git` and all the required dependencies are installed, let's clone the Dash Core repository to a directory. All build scripts and commands will run from this directory.
``` bash
Expand Down Expand Up @@ -91,6 +63,14 @@ pkg install libqrencode
```
---

#### Notifications
###### ZeroMQ

Dash Core can provide notifications via ZeroMQ. If the package is installed, support will be compiled in.
```bash
pkg install libzmq4
```

#### Test Suite Dependencies
There is an included test suite that is useful for testing code changes when developing.
To run the test suite (recommended), you will need to have Python 3 installed:
Expand Down
51 changes: 16 additions & 35 deletions doc/build-osx.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,41 +6,6 @@ This guide describes how to build dashd, command-line utilities, and GUI on macO

**Note:** The following is for Intel Macs only!

## Dependencies

The following dependencies are **required**:

Library | Purpose | Description
-----------------------------------------------------------|------------|----------------------
[automake](https://formulae.brew.sh/formula/automake) | Build | Generate makefile
[libtool](https://formulae.brew.sh/formula/libtool) | Build | Shared library support
[pkg-config](https://formulae.brew.sh/formula/pkg-config) | Build | Configure compiler and linker flags
[boost](https://formulae.brew.sh/formula/boost) | Utility | Library for threading, data structures, etc
[libevent](https://formulae.brew.sh/formula/libevent) | Networking | OS independent asynchronous networking

The following dependencies are **optional**:

Library | Purpose | Description
--------------------------------------------------------------- |------------------|----------------------
[berkeley-db@4](https://formulae.brew.sh/formula/berkeley-db@4) | Berkeley DB | Wallet storage (only needed when wallet enabled)
[qt@5](https://formulae.brew.sh/formula/qt@5) | GUI | GUI toolkit (only needed when GUI enabled)
[qrencode](https://formulae.brew.sh/formula/qrencode) | QR codes in GUI | Generating QR codes (only needed when GUI enabled)
[zeromq](https://formulae.brew.sh/formula/zeromq) | ZMQ notification | Allows generating ZMQ notifications (requires ZMQ version >= 4.0.0)
[sqlite](https://formulae.brew.sh/formula/sqlite) | SQLite DB | Wallet storage (only needed when wallet enabled)
[miniupnpc](https://formulae.brew.sh/formula/miniupnpc) | UPnP Support | Firewall-jumping support (needed for port mapping support)
[libnatpmp](https://formulae.brew.sh/formula/libnatpmp) | NAT-PMP Support | Firewall-jumping support (needed for port mapping support)
[python3](https://formulae.brew.sh/formula/[email protected]) | Testing | Python Interpreter (only needed when running the test suite)

The following dependencies are **optional** packages required for deploying:

Library | Purpose | Description
----------------------------------------------------|------------------|----------------------
[librsvg](https://formulae.brew.sh/formula/librsvg) | Deploy Dependency| Library to render SVG files
[ds_store](https://pypi.org/project/ds-store/) | Deploy Dependency| Examine and modify .DS_Store files
[mac_alias](https://pypi.org/project/mac-alias/) | Deploy Dependency| Generate/Read binary alias and bookmark records

See [dependencies.md](dependencies.md) for a complete overview.

## Preparation

The commands in this guide should be executed in a Terminal application.
Expand Down Expand Up @@ -81,10 +46,26 @@ The first step is to download the required dependencies.
These dependencies represent the packages required to get a barebones installation up and running.
To install, run the following from your terminal:

See [dependencies.md](dependencies.md) for a complete overview.

``` bash
brew install automake libtool boost gmp pkg-config libevent
```

For macOS 11 (Big Sur) and 12 (Monterey) you need to install a more recent version of llvm.

``` bash
brew install llvm
```

And append the following to the configure commands below:

``` bash
CC=$(brew --prefix llvm)/bin/clang CXX=$(brew --prefix llvm)/bin/clang++
```

Try `llvm@17` if compilation fails with the default version of llvm.

### 4. Clone Dash repository

`git` should already be installed by default on your system.
Expand Down
26 changes: 1 addition & 25 deletions doc/build-unix.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,31 +28,7 @@ make install # optional

This will build dash-qt as well, if the dependencies are met.

Dependencies
---------------------

These dependencies are required:

Library | Purpose | Description
------------|------------------|----------------------
libboost | Utility | Library for threading, data structures, etc
libevent | Networking | OS independent asynchronous networking

Optional dependencies:

Library | Purpose | Description
------------|------------------|----------------------
gmp | Optimized math routines | Arbitrary precision arithmetic library
miniupnpc | UPnP Support | Firewall-jumping support
libnatpmp | NAT-PMP Support | Firewall-jumping support
libdb4.8 | Berkeley DB | Wallet storage (only needed when legacy wallet enabled)
qt | GUI | GUI toolkit (only needed when GUI enabled)
libqrencode | QR codes in GUI | QR code generation (only needed when GUI enabled)
libzmq3 | ZMQ notification | ZMQ notifications (requires ZMQ version >= 4.0.0)
sqlite3 | SQLite DB | Wallet storage (only needed when descriptor wallet enabled)
systemtap | Tracing (USDT) | Statically defined tracepoints

For the versions used, see [dependencies.md](dependencies.md)
See [dependencies.md](dependencies.md) for a complete overview.

Memory Requirements
--------------------
Expand Down
Loading
Loading