build: Bump g++ minimum supported version to 13 #36042

pull maflcko wants to merge 8 commits into bitcoin:master from maflcko:2608-gcc-13 changing 32 files +150 −110
  1. maflcko commented at 3:45 PM on August 20, 2026: member

    At some point, it may be fine to drop support for older vanilla systems not shipping with at least GCC 13.

    (For this bump, only C++20 std::format will become available, but this bump should also pave the way for C++23.)

    This patch will only be released in version 33.x, or later, next year (2027).

    For reference:

    On operating systems where the minimum GCC version is not shipped by default, the user would have to use Clang, or install GCC in a different way. For example:

    Obviously, downloading pre-compiled releases or compiling previous release branches is unaffected by this change.

  2. DrahtBot renamed this:
    build: Bump g++ minimum supported version to 13
    build: Bump g++ minimum supported version to 13
    on Aug 20, 2026
  3. DrahtBot added the label Build system on Aug 20, 2026
  4. maflcko marked this as a draft on Aug 20, 2026
  5. DrahtBot commented at 3:46 PM on August 20, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/36042.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline and AI policy for information on the review process.

    Type Reviewers
    Concept ACK hebasto

    If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #36036 (build: Bump clang minimum supported version to 19 by maflcko)
    • #36033 ([wip,nomerge,rfc] build: Require C++23 compiler by maflcko)
    • #35998 (wallet: Handle or explicitly ignore WalletBatch write failures by achow101)
    • #35957 (ci: Enable Boost.MultiIndex invariant-checking mode by hebasto)
    • #35468 (ci, iwyu: Request IPC file generation explicitly by hebasto)
    • #34931 (validation: abort on DB unreadable coins instead of treating them as missing by furszy)
    • #33593 (guix: Use UCRT runtime for Windows release binaries by hebasto)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  6. maflcko added this to the milestone Future on Aug 20, 2026
  7. maflcko force-pushed on Aug 20, 2026
  8. DrahtBot added the label CI failed on Aug 20, 2026
  9. DrahtBot commented at 3:48 PM on August 20, 2026: contributor

    <!--85328a0da195eb286784d51f73fa0af9-->

    🚧 At least one of the CI tasks failed. <sub>Task NetBSD Cross: https://github.com/bitcoin/bitcoin/actions/runs/32388090156/job/96487376676</sub> <sub>LLM reason (✨ experimental): CI failed because CMake’s try-compile for text formatting errored with fatal error: 'format' file not found (missing C++ <format> header).</sub>

    <details><summary>Hints</summary>

    Try to run the tests locally, according to the documentation. However, a CI failure may still happen due to a number of reasons, for example:

    • Possibly due to a silent merge conflict (the changes in this pull request being incompatible with the current code in the target branch). If so, make sure to rebase on the latest commit of the target branch.

    • A sanitizer issue, which can only be found by compiling with the sanitizer and running the affected test.

    • An intermittent issue.

    Leave a comment here, if you need help tracking down a confusing failure.

    </details>

  10. maflcko commented at 4:33 PM on August 20, 2026: member

    Hmm, looks like netbsd-cross is a CI blocker for this? Not sure how to proceed here, because netbsd ci coverage may be useful, but no real user is doing netbsd-cross (I expect all users are running on native netbsd). But native netbsd isn't an option for CI ... :man_shrugging:

  11. maflcko removed this from the milestone Future on Aug 20, 2026
  12. fanquake commented at 8:30 AM on August 21, 2026: member

    but no real user is doing netbsd-cross (I expect all users are running on native netbsd). But native netbsd isn't an option for CI ...

    Are you saying this does work natively on NetBSD? I'd expect it to fail the same way (given NetBSD 11 ships GCC 12.5.0 which doesn't support std::format), and the CI here is giving us the coverage we want (showing this would break compilation for native NetBSD users)?

  13. maflcko commented at 9:02 AM on August 21, 2026: member

    NetBSD also has recent GCC in packages, so it should work natively on NetBSD. But I don't really know an answer to the meta question, or how to proceed here, which is why this is in draft and removed from the milestone.

    References:

  14. fanquake commented at 9:29 AM on August 21, 2026: member

    I guess somebody (maybe @hebasto?) could test a newer version of GCC natively, to determine which compiler/flag combo is required for std::format, and then update the build instructions. Could be good to do in any case, if NetBSD users are currently using GCC 12.x.

  15. ci: refactor: Use printf %q quoting for BITCOIN_CONFIG
    This refactor turns a long manually formatted and quoted string into one
    formatted and quoted by printf.
    fa5c10acec
  16. ci: Doc: Move all config comments right next to the option they explain fa03706fde
  17. hebasto commented at 2:26 PM on August 22, 2026: member

    I guess somebody (maybe @hebasto?) could test a newer version of GCC natively, to determine which compiler/flag combo is required for std::format, and then update the build instructions. Could be good to do in any case, if NetBSD users are currently using GCC 12.x.

    Yes, it's possible to install a newer GCC compiler and configure the build system to use it (similar to what was documented prior to 9b85c9814d1d5b1ef9caedc25dc336dacb887dcc).

    For example, on my NetBSD 11.0 system:

    $ sudo pkgin install gcc15
    $ cmake --preset dev-mode -DCMAKE_C_COMPILER=/usr/pkg/gcc15/bin/gcc -DCMAKE_CXX_COMPILER=/usr/pkg/gcc15/bin/g++ -DWITH_USDT=OFF -DENABLE_IPC=OFF
    

    However, there is a minor issue caused by the base system and pkgsrc using different versions of libstdc++:

    /usr/bin/ld: warning: libstdc++.so.9, needed by /usr/pkg/lib/libzmq.so, may conflict with libstdc++.so.7
    

    and

    $ ldd build_dev_mode/bin/bitcoind
    build_dev_mode/bin/bitcoind:
    	-lzmq.5 => /usr/pkg/lib/libzmq.so.5
    	-lrt.1 => /usr/lib/librt.so.1
    	-lc.12 => /usr/lib/libc.so.12
    	-lpthread.1 => /usr/lib/libpthread.so.1
    	-lstdc++.9 => /usr/lib/libstdc++.so.9
    	-lm.0 => /usr/lib/libm.so.0
    	-lgcc_s.1 => /usr/pkg/gcc15/lib/./libgcc_s.so.1
    	/usr/pkg/lib/libsqlite3.so => /usr/pkg/lib/libsqlite3.so
    	-lstdc++.7 => /usr/pkg/gcc15/lib/./libstdc++.so.7
    
  18. maflcko commented at 2:29 PM on August 22, 2026: member

    However, there is a minor issue caused by the base system and pkgsrc using different versions of libstdc++:

    So the same issue previously existed on NetBSD 10? So the only way to compile on NetBSD is with depends (or self-compiling all deps)?

  19. hebasto commented at 2:50 PM on August 22, 2026: member

    However, there is a minor issue caused by the base system and pkgsrc using different versions of libstdc++:

    So the same issue previously existed on NetBSD 10?

    Yes.

    So the only way to compile on NetBSD is with depends (or self-compiling all deps)?

    Those linker warnings seem harmless, though.

    As for "self-compiling all deps", only the C++ deps from pkgsrc actually need to be rebuilt. For an example of this, see https://github.com/hebasto/bitcoin-core-nightly/pull/117.

  20. Merge commit 'fa03706fdef52e85b36b758c5867519acfc32a70' into HEAD 959d395139
  21. build: Bump g++ minimum supported version to 13 0fb039d7f6
  22. bench: refactor: tfm->std::format
    Make an example replacement to use std::format. New code can use this
    now, but old code can probably stay as-is for now.
    7b1c915e80
  23. ci: Drop -Werror now that CMAKE_COMPILE_WARNING_AS_ERROR is available 6169d4b79a
  24. doc: Remove redundant GCC 13 note in build-windows.md ceae7a7ba7
  25. ci: NetBSD-cross: Use libstdc++-14 8ce1b34c80
  26. maflcko force-pushed on Aug 24, 2026
  27. hebasto commented at 11:28 AM on August 24, 2026: member

    Concept ACK.

  28. DrahtBot removed the label CI failed on Aug 24, 2026

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-09-09 07:56 UTC