diff --git a/ci/test/00_setup_env_arm.sh b/ci/test/00_setup_env_arm.sh index 0d05877b6cf..f4ad97d2cc2 100755 --- a/ci/test/00_setup_env_arm.sh +++ b/ci/test/00_setup_env_arm.sh @@ -10,7 +10,7 @@ export HOST=arm-linux-gnueabihf export DPKG_ADD_ARCH="armhf" export PACKAGES="python3-zmq g++-arm-linux-gnueabihf libc6:armhf libstdc++6:armhf libfontconfig1:armhf libxcb1:armhf" export CONTAINER_NAME=ci_arm_linux -export CI_IMAGE_NAME_TAG="mirror.gcr.io/ubuntu:24.04" # Check that https://packages.ubuntu.com/noble/g++-arm-linux-gnueabihf (version 13.x, similar to guix) can cross-compile +export CI_IMAGE_NAME_TAG="mirror.gcr.io/debian:trixie" # Check that https://packages.debian.org/trixie/g++-arm-linux-gnueabihf (version 14.x, similar to guix) can cross-compile export CI_IMAGE_PLATFORM="linux/arm64" export GOAL="install" export CI_LIMIT_STACK_SIZE=1 diff --git a/ci/test/00_setup_env_i686_no_ipc.sh b/ci/test/00_setup_env_i686_no_ipc.sh index c32e68cb75b..dca0486fb60 100755 --- a/ci/test/00_setup_env_i686_no_ipc.sh +++ b/ci/test/00_setup_env_i686_no_ipc.sh @@ -8,7 +8,7 @@ export LC_ALL=C.UTF-8 export HOST=i686-pc-linux-gnu export CONTAINER_NAME=ci_i686_no_multiprocess -export CI_IMAGE_NAME_TAG="mirror.gcr.io/ubuntu:24.04" +export CI_IMAGE_NAME_TAG="mirror.gcr.io/debian:trixie" export CI_IMAGE_PLATFORM="linux/amd64" export PACKAGES="llvm clang g++-multilib" export DEP_OPTS="DEBUG=1 NO_IPC=1" diff --git a/ci/test/00_setup_env_native_fuzz_with_valgrind.sh b/ci/test/00_setup_env_native_fuzz_with_valgrind.sh index f1d99f81819..d8b0f5f1b5b 100755 --- a/ci/test/00_setup_env_native_fuzz_with_valgrind.sh +++ b/ci/test/00_setup_env_native_fuzz_with_valgrind.sh @@ -6,7 +6,7 @@ export LC_ALL=C.UTF-8 -export CI_IMAGE_NAME_TAG="mirror.gcr.io/ubuntu:24.04" +export CI_IMAGE_NAME_TAG="mirror.gcr.io/debian:trixie" export CONTAINER_NAME=ci_native_fuzz_valgrind export PACKAGES="libevent-dev libboost-dev libsqlite3-dev valgrind libcapnp-dev capnproto" export NO_DEPENDS=1 diff --git a/ci/test/00_setup_env_native_valgrind.sh b/ci/test/00_setup_env_native_valgrind.sh index 3e23a580dae..30c84bf4874 100755 --- a/ci/test/00_setup_env_native_valgrind.sh +++ b/ci/test/00_setup_env_native_valgrind.sh @@ -6,7 +6,7 @@ export LC_ALL=C.UTF-8 -export CI_IMAGE_NAME_TAG="mirror.gcr.io/ubuntu:24.04" +export CI_IMAGE_NAME_TAG="mirror.gcr.io/debian:trixie" export CONTAINER_NAME=ci_native_valgrind export PACKAGES="valgrind python3-zmq libevent-dev libboost-dev libzmq3-dev libsqlite3-dev libcapnp-dev capnproto python3-pip" export PIP_PACKAGES="--break-system-packages pycapnp" diff --git a/ci/test/00_setup_env_s390x.sh b/ci/test/00_setup_env_s390x.sh index 93031dcca4c..d1e34070ca9 100755 --- a/ci/test/00_setup_env_s390x.sh +++ b/ci/test/00_setup_env_s390x.sh @@ -9,7 +9,7 @@ export LC_ALL=C.UTF-8 export HOST=s390x-linux-gnu export PACKAGES="python3-zmq" export CONTAINER_NAME=ci_s390x -export CI_IMAGE_NAME_TAG="mirror.gcr.io/ubuntu:24.04" +export CI_IMAGE_NAME_TAG="mirror.gcr.io/debian:trixie" export CI_IMAGE_PLATFORM="linux/s390x" # bind tests excluded for now, see https://github.com/bitcoin/bitcoin/issues/17765#issuecomment-602068547 export TEST_RUNNER_EXTRA="--exclude rpc_bind --exclude feature_bind_extra" diff --git a/ci/test/00_setup_env_win64_msvcrt.sh b/ci/test/00_setup_env_win64_msvcrt.sh index 86e0ea9c80d..6c948aeb351 100755 --- a/ci/test/00_setup_env_win64_msvcrt.sh +++ b/ci/test/00_setup_env_win64_msvcrt.sh @@ -7,7 +7,7 @@ export LC_ALL=C.UTF-8 export CONTAINER_NAME=ci_win64_msvcrt -export CI_IMAGE_NAME_TAG="mirror.gcr.io/ubuntu:24.04" # Check that https://packages.ubuntu.com/noble/g++-mingw-w64-x86-64-posix (version 13.x, similar to guix) can cross-compile +export CI_IMAGE_NAME_TAG="mirror.gcr.io/debian:trixie" # Check that https://packages.debian.org/trixie/g++-mingw-w64-x86-64-posix (version 14.x, similar to guix) can cross-compile export HOST=x86_64-w64-mingw32 export PACKAGES="g++-mingw-w64-x86-64-posix nsis" export RUN_UNIT_TESTS=false diff --git a/contrib/guix/manifest.scm b/contrib/guix/manifest.scm index b7146477d1e..ea1ffe5d983 100644 --- a/contrib/guix/manifest.scm +++ b/contrib/guix/manifest.scm @@ -94,7 +94,17 @@ chain for " target " development.")) (home-page (package-home-page xgcc)) (license (package-license xgcc))))) -(define base-gcc gcc-13) ;; 13.3.0 +(define base-gcc + (package + (inherit gcc-14) ;; 14.2.0 + (version "14.3.0") + (source (origin + (method url-fetch) + (uri (string-append "mirror://gnu/gcc/gcc-" + version "/gcc-" version ".tar.xz")) + (sha256 + (base32 + "0fna78ly417g69fdm4i5f3ms96g8xzzjza8gwp41lqr5fqlpgp70")))))) (define base-linux-kernel-headers linux-libre-headers-6.1) @@ -114,7 +124,7 @@ desirable for building Bitcoin Core release binaries." (define (gcc-libgcc-patches gcc) (package-with-extra-patches gcc - (search-our-patches "gcc-remap-guix-store.patch"))) + (search-our-patches "gcc-remap-guix-store.patch" "gcc-ssa-generation.patch"))) (define (binutils-mingw-patches binutils) (package-with-extra-patches binutils @@ -432,7 +442,9 @@ inspecting signatures in Mach-O binaries.") ;; https://gcc.gnu.org/install/configure.html (list "--enable-threads=posix", "--enable-default-ssp=yes", + "--enable-host-bind-now=yes", "--disable-gcov", + "--disable-libgomp", building-on))))))) (define-public linux-base-gcc @@ -446,9 +458,13 @@ inspecting signatures in Mach-O binaries.") (list "--enable-initfini-array=yes", "--enable-default-ssp=yes", "--enable-default-pie=yes", + "--enable-host-bind-now=yes", "--enable-standard-branch-protection=yes", "--enable-cet=yes", + "--enable-gprofng=no", "--disable-gcov", + "--disable-libgomp", + "--disable-libquadmath", "--disable-libsanitizer", building-on))) ((#:phases phases) @@ -555,7 +571,7 @@ inspecting signatures in Mach-O binaries.") gzip xz ;; Build tools - gcc-toolchain-13 + gcc-toolchain-14 cmake-minimal gnu-make ninja @@ -575,7 +591,7 @@ inspecting signatures in Mach-O binaries.") ((string-contains target "-linux-") (list bison pkg-config - (list gcc-toolchain-13 "static") + (list gcc-toolchain-14 "static") (make-bitcoin-cross-toolchain target))) ((string-contains target "darwin") (list clang-toolchain-19 diff --git a/contrib/guix/patches/gcc-ssa-generation.patch b/contrib/guix/patches/gcc-ssa-generation.patch new file mode 100644 index 00000000000..2e5a600230e --- /dev/null +++ b/contrib/guix/patches/gcc-ssa-generation.patch @@ -0,0 +1,49 @@ +commit b46614ebfc57ccca8a050668ad0e8ba5968c5943 +Author: Jakub Jelinek +Date: Tue Jan 6 08:36:20 2026 +0100 + + tree-object-size: Deterministic SSA generation [PR123351] + + The order of evaluation of function arguments is unspecified in C++. + The function object_sizes_set_temp called object_sizes_set with two + calls to make_ssa_name() as arguments. Since make_ssa_name() has the + side effect of incrementing the global SSA version counter, different + architectures of the same compiler evaluated these calls in different + orders. + + This resulted in non-deterministic SSA version numbering between + x86_64 and aarch64 hosts during cross-compilation, leading to + divergent object files. + + Sequencing the calls into separate statements ensures deterministic + evaluation order. + + https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123351 + https://gcc.gnu.org/pipermail/gcc-patches/2026-January/704817.html + + 2026-01-06 Jakub Jelinek + Marco Falke + + PR tree-optimization/123351 + * tree-object-size.cc (object_sizes_set_temp): Separate calls to + make_ssa_name to ensure deterministic execution order. + +diff --git a/gcc/tree-object-size.cc b/gcc/tree-object-size.cc +index 018fbc30cbb..24e7d710371 100644 +--- a/gcc/tree-object-size.cc ++++ b/gcc/tree-object-size.cc +@@ -319,9 +319,11 @@ object_sizes_set_temp (struct object_size_info *osi, unsigned varno) + tree val = object_sizes_get (osi, varno); + + if (size_initval_p (val, osi->object_size_type)) +- object_sizes_set (osi, varno, +- make_ssa_name (sizetype), +- make_ssa_name (sizetype)); ++ { ++ val = make_ssa_name (sizetype); ++ tree wholeval = make_ssa_name (sizetype); ++ object_sizes_set (osi, varno, val, wholeval); ++ } + } + + /* Initialize OFFSET_LIMIT variable. */