#36042 build: Bump g++ minimum supported version to 13
https://github.com/bitcoin/bitcoin/pull/36042 · · +150/-110 in 32 files, 8 commits · labels: Build system, Needs rebase · draft
Goal
- Bump minimum supported compiler to GCC 13.1, dropping unsupported GCC 12
- Enables modern C++ features across the codebase such as std::format and eventual C++23 adoption
Bumps the minimum required GCC version to 13.1 in doc/dependencies.md and CMake. Adds a CMake check for C++20 std::format, updates CI images and configuration scripts to GCC 13+ (including NetBSD cross-compilation setup), and converts an example benchmark to std::format.
Problem: Bitcoin Core cannot currently use C++20 std::format or advance to C++23 because supported compiler toolchains still include GCC 12 (which is now EOL upstream and lacks std::format).
Category: Build and CI (#28 of 55)
P3 · unblocks #36033
- P3 because it unblocks C++20 std::format and future C++23 adoption across the codebase
- Targeted for v33.x making the toolchain bump deferrable
Raises minimum toolchain requirements to GCC 13.1, dropping unsupported GCC 12 and unblocking C++20 std::format and C++23 PRs (#36033). However, the author explicitly noted this is targeted for v33.x next year, making the work reasonably deferrable.
Membership: Directly changes compiler version requirements in CMake, doc/dependencies.md, and CI build scripts.
Factors: security/stability 0, bug 0, performance 0, user value 0, leverage 2
Reviewability: Stale: Needs rebase
- Review #36052 first
- Needs rebase due to merge conflicts with master
The PR has merge conflicts with master (mergeable_state is dirty) and has the Needs rebase label.
Author status: active, last force-pushed on 2026-08-24
Resolved concerns:
- NetBSD cross-compilation CI compatibility resolved by downloading NetBSD gcc14 packages for libstdc++-14 headers and runtime.
Agreement: Strong
- Concept approval and verified native GCC package behavior on NetBSD (hebasto)
- No objections raised during discussion on compiler support (fanquake, maflcko)
Strong support: Concept ACK and NetBSD native verification from hebasto without objection.
hebasto verified native GCC 15 package behavior on NetBSD 11.0 and provided a Concept ACK; no objections have been raised.
- hebasto tested native NetBSD GCC package compilation and posted 'Concept ACK.' on 2026-08-24.
- fanquake and maflcko discussed compiler support on NetBSD without disagreement on the goal.
Review verdicts (DrahtBot): 0
- Concept ACK: hebasto
Dependencies
Files
235 lines under test/bench/ci.
- ci/test/00_setup_env_native_previous_releases.sh +11/-12
- cmake/module/CheckCXXFeatures.cmake +18/-0
- ci/test/00_setup_env_netbsd_cross.sh +11/-5
- ci/test/00_setup_env_native_asan.sh +7/-7
- ci/test/00_setup_env_native_fuzz_with_msan.sh +6/-7
- ci/test/00_setup_env_native_msan.sh +6/-7
- ci/test/01_base_install.sh +12/-0
- ci/test/00_setup_env_arm.sh +5/-5
- ci/test/00_setup_env_native_valgrind.sh +4/-5
- ci/test/00_setup_env_native_fuzz.sh +4/-4
- ci/test/00_setup_env_native_tidy.sh +4/-4
- ci/test/00_setup_env_riscv_bare_cross.sh +4/-3
- ci/test/00_setup_env_freebsd_cross.sh +3/-3
- ci/test/00_setup_env_i686_no_ipc.sh +3/-3
- ci/test/00_setup_env_mac_cross.sh +3/-3
- ci/test/00_setup_env_mac_cross_intel.sh +3/-3
- ci/test/00_setup_env_mac_native.sh +3/-3
- ci/test/00_setup_env_mac_native_fuzz.sh +5/-1
- ci/test/00_setup_env_native_alpine_musl.sh +3/-3
- ci/test/00_setup_env_native_chimera_lto.sh +3/-3
- ci/test/00_setup_env_native_fuzz_with_valgrind.sh +3/-3
- ci/test/00_setup_env_native_iwyu.sh +3/-3
- ci/test/00_setup_env_native_nowallet.sh +3/-3
- ci/test/00_setup_env_native_tsan.sh +3/-3
- ci/test/00_setup_env_openbsd_cross.sh +3/-3
- ci/test/00_setup_env_s390x.sh +3/-3
- ci/test/00_setup_env_win64.sh +3/-3
- ci/test/00_setup_env_win64_msvcrt.sh +3/-3
- src/bench/wallet_migration.cpp +3/-3
- doc/release-notes-36042.md +4/-0
- doc/dependencies.md +1/-1
- doc/build-windows.md +0/-1
Card
PR 36042 raises the minimum supported GCC compiler version from 12.1 to 13.1 in CMake and updates CI test images and configurations accordingly. This change enables the project to use C++20 std::format and lays groundwork for requiring C++23 in a future release cycle (targeted for v33.x in 2027). hebasto verified NetBSD compatibility and gave a Concept ACK. The PR currently has merge conflicts and is awaiting a rebase.