diff --git a/libbitcoinkernel-sys/bitcoin/.github/workflows/ci.yml b/libbitcoinkernel-sys/bitcoin/.github/workflows/ci.yml index 3801c187..d4336462 100644 --- a/libbitcoinkernel-sys/bitcoin/.github/workflows/ci.yml +++ b/libbitcoinkernel-sys/bitcoin/.github/workflows/ci.yml @@ -510,7 +510,7 @@ jobs: timeout-minutes: 240 file-env: './ci/test/00_setup_env_native_fuzz_with_valgrind.sh' - - name: 'previous releases, depends DEBUG' + - name: 'previous releases' cirrus-runner: 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-md' fallback-runner: 'ubuntu-24.04' timeout-minutes: 120 diff --git a/libbitcoinkernel-sys/bitcoin/CMakeLists.txt b/libbitcoinkernel-sys/bitcoin/CMakeLists.txt index 3749cf7c..2d21f6e1 100644 --- a/libbitcoinkernel-sys/bitcoin/CMakeLists.txt +++ b/libbitcoinkernel-sys/bitcoin/CMakeLists.txt @@ -463,6 +463,8 @@ else() try_append_cxx_flags("-Wself-assign" TARGET warn_interface SKIP_LINK) try_append_cxx_flags("-Wbidi-chars=any" TARGET warn_interface SKIP_LINK) try_append_cxx_flags("-Wundef" TARGET warn_interface SKIP_LINK) + try_append_cxx_flags("-Wleading-whitespace=spaces" TARGET warn_interface SKIP_LINK) + try_append_cxx_flags("-Wtrailing-whitespace=any" TARGET warn_interface SKIP_LINK) # Some compilers (gcc) ignore unknown -Wno-* options, but warn about all # unknown options if any other warning is produced. Test the -Wfoo case, and @@ -493,8 +495,8 @@ try_append_cxx_flags("-fmacro-prefix-map=A=B" TARGET core_interface SKIP_LINK IF_CHECK_PASSED "-fmacro-prefix-map=${PROJECT_SOURCE_DIR}/src=." ) -# Currently all versions of gcc are subject to a class of bugs, see the -# gccbug_90348 test case (only reproduces on GCC 11 and earlier) and +# GCC versions 13.2 (and earlier) are subject to a class of bugs, see +# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90348 and the meta bug # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111843. To work around that, set # -fstack-reuse=none for all gcc builds. (Only gcc understands this flag). try_append_cxx_flags("-fstack-reuse=none" TARGET core_interface) diff --git a/libbitcoinkernel-sys/bitcoin/ci/lint/01_install.sh b/libbitcoinkernel-sys/bitcoin/ci/lint/01_install.sh index 0d8cca98..fc422675 100755 --- a/libbitcoinkernel-sys/bitcoin/ci/lint/01_install.sh +++ b/libbitcoinkernel-sys/bitcoin/ci/lint/01_install.sh @@ -18,7 +18,8 @@ ${CI_RETRY_EXE} apt-get update # - curl/xz-utils (to install shellcheck) # - git (used in many lint scripts) # - gpg (used by verify-commits) -${CI_RETRY_EXE} apt-get install -y cargo curl xz-utils git gpg +# - moreutils (used by scripted-diff) +${CI_RETRY_EXE} apt-get install -y cargo curl xz-utils git gpg moreutils PYTHON_PATH="/python_build" if [ ! -d "${PYTHON_PATH}/bin" ]; then diff --git a/libbitcoinkernel-sys/bitcoin/ci/test/00_setup_env_arm.sh b/libbitcoinkernel-sys/bitcoin/ci/test/00_setup_env_arm.sh index d5b2bb4b..12ec71b8 100755 --- a/libbitcoinkernel-sys/bitcoin/ci/test/00_setup_env_arm.sh +++ b/libbitcoinkernel-sys/bitcoin/ci/test/00_setup_env_arm.sh @@ -19,10 +19,7 @@ export GOAL="install" export CI_LIMIT_STACK_SIZE=1 # -Wno-psabi is to disable ABI warnings: "note: parameter passing for argument of type ... changed in GCC 7.1" # This could be removed once the ABI change warning does not show up by default -# -# -Wno-error=dangling-reference helps to work around a GCC 13.1 false-positive, -# fixed in later versions. export BITCOIN_CONFIG=" \ -DREDUCE_EXPORTS=ON \ - -DCMAKE_CXX_FLAGS='-Wno-psabi -Wno-error=dangling-reference -Wno-error=maybe-uninitialized' \ + -DCMAKE_CXX_FLAGS='-Wno-psabi -Wno-error=maybe-uninitialized' \ " diff --git a/libbitcoinkernel-sys/bitcoin/ci/test/00_setup_env_native_previous_releases.sh b/libbitcoinkernel-sys/bitcoin/ci/test/00_setup_env_native_previous_releases.sh index d9f8d3bf..a44a51c3 100755 --- a/libbitcoinkernel-sys/bitcoin/ci/test/00_setup_env_native_previous_releases.sh +++ b/libbitcoinkernel-sys/bitcoin/ci/test/00_setup_env_native_previous_releases.sh @@ -8,15 +8,16 @@ export LC_ALL=C.UTF-8 export CONTAINER_NAME=ci_native_previous_releases export CI_IMAGE_NAME_TAG="mirror.gcr.io/ubuntu:22.04" -# Use minimum supported python3.10 and gcc-11, see doc/dependencies.md -export PACKAGES="gcc-11 g++-11 python3-zmq" -export DEP_OPTS="CC=gcc-11 CXX=g++-11" +# Use minimum supported python3.10 and gcc-12, see doc/dependencies.md +export PACKAGES="gcc-12 g++-12 python3-zmq" +export DEP_OPTS="CC=gcc-12 CXX=g++-12" export TEST_RUNNER_EXTRA="--previous-releases --coverage --extended --exclude feature_dbcrash" # Run extended tests so that coverage does not fail, but exclude the very slow dbcrash export GOAL="install" export CI_LIMIT_STACK_SIZE=1 export DOWNLOAD_PREVIOUS_RELEASES="true" export BITCOIN_CONFIG="\ - -DWITH_ZMQ=ON -DBUILD_GUI=ON -DREDUCE_EXPORTS=ON \ + --preset=dev-mode \ + -DREDUCE_EXPORTS=ON \ -DCMAKE_BUILD_TYPE=Debug \ -DCMAKE_C_FLAGS='-funsigned-char' \ -DCMAKE_C_FLAGS_DEBUG='-g2 -O2' \ diff --git a/libbitcoinkernel-sys/bitcoin/ci/test/00_setup_env_win64.sh b/libbitcoinkernel-sys/bitcoin/ci/test/00_setup_env_win64.sh index 06134457..110db1a8 100755 --- a/libbitcoinkernel-sys/bitcoin/ci/test/00_setup_env_win64.sh +++ b/libbitcoinkernel-sys/bitcoin/ci/test/00_setup_env_win64.sh @@ -13,8 +13,6 @@ export PACKAGES="g++-mingw-w64-x86-64-posix nsis" export RUN_UNIT_TESTS=false export RUN_FUNCTIONAL_TESTS=false export GOAL="deploy" -# -Wno-error=dangling-reference helps to work around a GCC 13.1 false-positive, -# fixed in later versions. export BITCOIN_CONFIG="-DREDUCE_EXPORTS=ON -DBUILD_GUI_TESTS=OFF -DBUILD_KERNEL_LIB=ON -DBUILD_KERNEL_TEST=ON \ - -DCMAKE_CXX_FLAGS='-Wno-error=dangling-reference -Wno-error=maybe-uninitialized' \ + -DCMAKE_CXX_FLAGS='-Wno-error=maybe-uninitialized' \ " diff --git a/libbitcoinkernel-sys/bitcoin/contrib/guix/libexec/build.sh b/libbitcoinkernel-sys/bitcoin/contrib/guix/libexec/build.sh index 16e12d56..09cc058e 100755 --- a/libbitcoinkernel-sys/bitcoin/contrib/guix/libexec/build.sh +++ b/libbitcoinkernel-sys/bitcoin/contrib/guix/libexec/build.sh @@ -225,10 +225,15 @@ esac # LDFLAGS case "$HOST" in - *linux*) HOST_LDFLAGS="-Wl,--as-needed -Wl,--dynamic-linker=$glibc_dynamic_linker -static-libstdc++ -Wl,-O2" ;; + *linux*) HOST_LDFLAGS="-Wl,--as-needed -Wl,--dynamic-linker=$glibc_dynamic_linker -Wl,-O2" ;; *mingw*) HOST_LDFLAGS="-Wl,--no-insert-timestamp" ;; esac +# EXE FLAGS +case "$HOST" in + *linux*) CMAKE_EXE_LINKER_FLAGS="-DCMAKE_EXE_LINKER_FLAGS=${HOST_LDFLAGS} -static-libstdc++ -static-libgcc" ;; +esac + mkdir -p "$DISTSRC" ( cd "$DISTSRC" @@ -243,7 +248,8 @@ mkdir -p "$DISTSRC" --toolchain "${BASEPREFIX}/${HOST}/toolchain.cmake" \ -DWITH_CCACHE=OFF \ -Werror=dev \ - ${CONFIGFLAGS} + ${CONFIGFLAGS} \ + "${CMAKE_EXE_LINKER_FLAGS}" # Build Bitcoin Core cmake --build build -j "$JOBS" ${V:+--verbose} diff --git a/libbitcoinkernel-sys/bitcoin/contrib/guix/manifest.scm b/libbitcoinkernel-sys/bitcoin/contrib/guix/manifest.scm index 3670fcec..011ba0de 100644 --- a/libbitcoinkernel-sys/bitcoin/contrib/guix/manifest.scm +++ b/libbitcoinkernel-sys/bitcoin/contrib/guix/manifest.scm @@ -99,10 +99,10 @@ chain for " target " development.")) (define* (make-bitcoin-cross-toolchain target #:key - (base-gcc-for-libc linux-base-gcc) + (base-gcc-for-libc (gcc-libgcc-patches linux-base-gcc)) (base-kernel-headers base-linux-kernel-headers) (base-libc glibc-2.31) - (base-gcc linux-base-gcc)) + (base-gcc (gcc-libgcc-patches linux-base-gcc))) "Convenience wrapper around MAKE-CROSS-TOOLCHAIN with default values desirable for building Bitcoin Core release binaries." (make-cross-toolchain target @@ -111,7 +111,7 @@ desirable for building Bitcoin Core release binaries." base-libc base-gcc)) -(define (gcc-mingw-patches gcc) +(define (gcc-libgcc-patches gcc) (package-with-extra-patches gcc (search-our-patches "gcc-remap-guix-store.patch"))) @@ -128,10 +128,10 @@ desirable for building Bitcoin Core release binaries." (let* ((xbinutils (binutils-mingw-patches (cross-binutils target))) (machine (substring target 0 (string-index target #\-))) (pthreads-xlibc (winpthreads-patches (make-mingw-w64 machine - #:xgcc (cross-gcc target #:xgcc (gcc-mingw-patches base-gcc)) + #:xgcc (cross-gcc target #:xgcc (gcc-libgcc-patches base-gcc)) #:with-winpthreads? #t))) (pthreads-xgcc (cross-gcc target - #:xgcc (gcc-mingw-patches mingw-w64-base-gcc) + #:xgcc (gcc-libgcc-patches mingw-w64-base-gcc) #:xbinutils xbinutils #:libc pthreads-xlibc))) ;; Define a meta-package that propagates the resulting XBINUTILS, XLIBC, and diff --git a/libbitcoinkernel-sys/bitcoin/contrib/guix/patches/gcc-remap-guix-store.patch b/libbitcoinkernel-sys/bitcoin/contrib/guix/patches/gcc-remap-guix-store.patch index a8b41d48..4144bcd8 100644 --- a/libbitcoinkernel-sys/bitcoin/contrib/guix/patches/gcc-remap-guix-store.patch +++ b/libbitcoinkernel-sys/bitcoin/contrib/guix/patches/gcc-remap-guix-store.patch @@ -1,4 +1,4 @@ -Without ffile-prefix-map, the debug symbols will contain paths for the +Without -ffile-prefix-map, the debug symbols will contain paths for the guix store which will include the hashes of each package. However, the hash for the same package will differ when on different architectures. In order to be reproducible regardless of the architecture used to build @@ -6,7 +6,7 @@ the package, map all guix store prefixes to something fixed, e.g. /usr. --- a/libgcc/Makefile.in +++ b/libgcc/Makefile.in -@@ -854,7 +854,7 @@ endif +@@ -857,7 +857,7 @@ endif # libgcc_eh.a, only LIB2ADDEH matters. If we do, only LIB2ADDEHSTATIC and # LIB2ADDEHSHARED matter. (Usually all three are identical.) @@ -15,6 +15,15 @@ the package, map all guix store prefixes to something fixed, e.g. /usr. ifeq ($(enable_shared),yes) +@@ -880,7 +880,7 @@ endif + # Build LIBUNWIND. Use -fno-exceptions so that the unwind library does + # not generate calls to __gcc_personality_v0. + +-c_flags := -fno-exceptions ++c_flags := -fno-exceptions $(shell find /gnu/store -maxdepth 1 -mindepth 1 -type d -exec echo -n " -ffile-prefix-map={}=/usr" \;) + + libunwind-objects += $(addsuffix $(objext),$(basename $(notdir $(LIBUNWIND)))) + -- 2.37.0 diff --git a/libbitcoinkernel-sys/bitcoin/contrib/guix/symbol-check.py b/libbitcoinkernel-sys/bitcoin/contrib/guix/symbol-check.py index 464b33cf..249c53a2 100755 --- a/libbitcoinkernel-sys/bitcoin/contrib/guix/symbol-check.py +++ b/libbitcoinkernel-sys/bitcoin/contrib/guix/symbol-check.py @@ -16,23 +16,18 @@ # Debian 11 (Bullseye) EOL: 2026. https://wiki.debian.org/LTS # -# - libgcc version 10.2.1 (https://packages.debian.org/bullseye/libgcc-s1) # - libc version 2.31 (https://packages.debian.org/source/bullseye/glibc) # # Ubuntu 20.04 (Focal) EOL: 2030. https://wiki.ubuntu.com/ReleaseTeam # -# - libgcc version 10.5.0 (https://packages.ubuntu.com/focal/libgcc1) # - libc version 2.31 (https://packages.ubuntu.com/focal/libc6) # # CentOS Stream 9 EOL: 2027. https://www.centos.org/cl-vs-cs/#end-of-life # -# - libgcc version 12.2.1 (https://mirror.stream.centos.org/9-stream/AppStream/x86_64/os/Packages/) # - libc version 2.34 (https://mirror.stream.centos.org/9-stream/AppStream/x86_64/os/Packages/) # -# See https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html for more info. MAX_VERSIONS = { -'GCC': (7,0,0), 'GLIBC': { lief.ELF.ARCH.X86_64: (2,31), lief.ELF.ARCH.ARM: (2,31), @@ -40,7 +35,6 @@ lief.ELF.ARCH.PPC64: (2,31), lief.ELF.ARCH.RISCV: (2,31), }, -'LIBATOMIC': (1,0), 'V': (0,5,0), # xkb (bitcoin-qt only) } @@ -93,11 +87,9 @@ # Allowed NEEDED libraries ELF_ALLOWED_LIBRARIES = { # bitcoind and bitcoin-qt -'libgcc_s.so.1', # GCC base support 'libc.so.6', # C library 'libpthread.so.0', # threading 'libm.so.6', # math library -'libatomic.so.1', 'ld-linux-x86-64.so.2', # 64-bit dynamic linker 'ld-linux.so.2', # 32-bit dynamic linker 'ld-linux-aarch64.so.1', # 64-bit ARM dynamic linker diff --git a/libbitcoinkernel-sys/bitcoin/depends/packages/qt.mk b/libbitcoinkernel-sys/bitcoin/depends/packages/qt.mk index 9ac4088e..ad958b7b 100644 --- a/libbitcoinkernel-sys/bitcoin/depends/packages/qt.mk +++ b/libbitcoinkernel-sys/bitcoin/depends/packages/qt.mk @@ -12,7 +12,6 @@ $(package)_freebsd_dependencies := $($(package)_linux_dependencies) $(package)_patches_path := $(qt_details_patches_path) $(package)_patches := dont_hardcode_pwd.patch $(package)_patches += qtbase-moc-ignore-gcc-macro.patch -$(package)_patches += qtbase_avoid_native_float16.patch $(package)_patches += qtbase_avoid_qmain.patch $(package)_patches += qtbase_platformsupport.patch $(package)_patches += qtbase_plugins_cocoa.patch @@ -257,7 +256,6 @@ endif define $(package)_preprocess_cmds patch -p1 -i $($(package)_patch_dir)/dont_hardcode_pwd.patch && \ patch -p1 -i $($(package)_patch_dir)/qtbase-moc-ignore-gcc-macro.patch && \ - patch -p1 -i $($(package)_patch_dir)/qtbase_avoid_native_float16.patch && \ patch -p1 -i $($(package)_patch_dir)/qtbase_avoid_qmain.patch && \ patch -p1 -i $($(package)_patch_dir)/qtbase_platformsupport.patch && \ patch -p1 -i $($(package)_patch_dir)/qtbase_plugins_cocoa.patch && \ diff --git a/libbitcoinkernel-sys/bitcoin/depends/patches/qt/qtbase_avoid_native_float16.patch b/libbitcoinkernel-sys/bitcoin/depends/patches/qt/qtbase_avoid_native_float16.patch deleted file mode 100644 index ec03d140..00000000 --- a/libbitcoinkernel-sys/bitcoin/depends/patches/qt/qtbase_avoid_native_float16.patch +++ /dev/null @@ -1,37 +0,0 @@ -Avoid using native float16 types in Qt's qfloat16 - -Using native float16 types may introduce compatibility issues -in release binaries for Linux platforms. - -See: https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=e42d2d2a20f2bb59928bc895ec9f46503a1b5c73 - -This patch can be dropped once the minimum required libgcc version -is updated to 12.x or newer. - - ---- a/qtbase/src/corelib/global/qtypes.h -+++ b/qtbase/src/corelib/global/qtypes.h -@@ -258,23 +258,8 @@ using qsizetype = QIntegerForSizeof::Signed; - - // Define a native float16 type - namespace QtPrivate { --#if defined(__STDCPP_FLOAT16_T__) --# define QFLOAT16_IS_NATIVE 1 --using NativeFloat16Type = std::float16_t; --#elif defined(Q_CC_CLANG) && defined(__FLT16_MAX__) && 0 --// disabled due to https://github.com/llvm/llvm-project/issues/56963 --# define QFLOAT16_IS_NATIVE 1 --using NativeFloat16Type = decltype(__FLT16_MAX__); --#elif defined(Q_CC_GNU_ONLY) && defined(__FLT16_MAX__) && defined(__ARM_FP16_FORMAT_IEEE) --# define QFLOAT16_IS_NATIVE 1 --using NativeFloat16Type = __fp16; --#elif defined(Q_CC_GNU_ONLY) && defined(__FLT16_MAX__) && defined(__SSE2__) --# define QFLOAT16_IS_NATIVE 1 --using NativeFloat16Type = _Float16; --#else - # define QFLOAT16_IS_NATIVE 0 - using NativeFloat16Type = void; --#endif - } // QtPrivate - - #endif // __cplusplus diff --git a/libbitcoinkernel-sys/bitcoin/doc/build-unix.md b/libbitcoinkernel-sys/bitcoin/doc/build-unix.md index d9bbb350..e499aa9b 100644 --- a/libbitcoinkernel-sys/bitcoin/doc/build-unix.md +++ b/libbitcoinkernel-sys/bitcoin/doc/build-unix.md @@ -46,10 +46,14 @@ Finally, clang (often less resource hungry) can be used instead of gcc, which is #### Dependency Build Instructions -Build requirements: +Build requirements for the latest Debian "stable" release, or the latest Ubuntu LTS release: sudo apt-get install build-essential cmake pkgconf python3 +For Debian "oldstable", or earlier Ubuntu LTS releases, you may need to pick a +later compiler version, according to the [dependencies](/doc/dependencies.md) +documentation. + Now, you can either build from self-compiled [depends](#dependencies) or install the required dependencies: sudo apt-get install libevent-dev libboost-dev diff --git a/libbitcoinkernel-sys/bitcoin/doc/dependencies.md b/libbitcoinkernel-sys/bitcoin/doc/dependencies.md index 77391f74..3ff306f8 100644 --- a/libbitcoinkernel-sys/bitcoin/doc/dependencies.md +++ b/libbitcoinkernel-sys/bitcoin/doc/dependencies.md @@ -11,7 +11,7 @@ Bitcoin Core requires one of the following compilers. | Dependency | Minimum required | | --- | --- | | [Clang](https://clang.llvm.org) | [17.0](https://github.com/bitcoin/bitcoin/pull/33555) | -| [GCC](https://gcc.gnu.org) | [11.1](https://github.com/bitcoin/bitcoin/pull/29091) | +| [GCC](https://gcc.gnu.org) | [12.1](https://github.com/bitcoin/bitcoin/pull/33842) | ## Required diff --git a/libbitcoinkernel-sys/bitcoin/doc/release-notes-33842.md b/libbitcoinkernel-sys/bitcoin/doc/release-notes-33842.md new file mode 100644 index 00000000..ad15f50b --- /dev/null +++ b/libbitcoinkernel-sys/bitcoin/doc/release-notes-33842.md @@ -0,0 +1,4 @@ +Build System +------------ + +- The minimum supported GCC compiler version has been raised to 12.1 (#33842). diff --git a/libbitcoinkernel-sys/bitcoin/src/bench/connectblock.cpp b/libbitcoinkernel-sys/bitcoin/src/bench/connectblock.cpp index 3746ea29..9ea50601 100644 --- a/libbitcoinkernel-sys/bitcoin/src/bench/connectblock.cpp +++ b/libbitcoinkernel-sys/bitcoin/src/bench/connectblock.cpp @@ -9,6 +9,7 @@ #include