#36193 guix: pass `--disable-wchar_t` to (non-GUI) libstdc++
https://github.com/bitcoin/bitcoin/pull/36193 · · +335/-275 in 7 files, 4 commits · labels: Build system · draft
Goal
- Reduce Linux release binary size by about 0.5 MB for bitcoind, bitcoin-cli, and other non-GUI utilities
- Eliminate unused wide-character formatting and zoneinfo routines bundled into libstdc++
Configures libstdc++ in Guix Linux toolchains for non-GUI binaries with `--disable-wchar_t` and `--with-libstdcxx-zoneinfo=no`. Also patches Boost Test in depends to avoid unresolved `std::wcrtomb` symbols when wchar_t support is removed.
Problem: Release Linux binaries bundle unused wide-character formatting and zoneinfo routines in libstdc++, adding roughly 0.5 MB of unnecessary size to bitcoind, bitcoin-cli, and other non-GUI utilities.
Category: Build and CI (#13 of 55)
P3 · cleanup
- P3 because it trims roughly 0.5 MB of dead code from Linux non-GUI binaries
- Modest binary size savings that is clean but safe to defer
Reduces non-GUI release binary sizes by approximately 0.5 MB across Linux release binaries by stripping unused libstdc++ functionality. The benefit is measurable and clean, though reasonably deferrable.
Membership: Modifies Guix toolchain definitions, build manifests, and depends packages for Boost.
Factors: security/stability 0, bug 0, performance 1, user value 1, leverage 0
Reviewability: Ready: Review #36272 first
- Review #36272 first
- Ready for review
The PR is stacked on #36272, which isolates the toolchain definition refactor. Reviews can proceed directly or start with the base.
Author status: Active, recently rebased and addressed feedback by splitting out prerequisite PR 36272.
Resolved concerns:
- Whether Boost.MultiIndex or Boost Test would break without wchar_t; author added a patch for Boost Test and hebasto noted Boost auto-detects missing wchar_t defines.
- Toolchain separation logic was split into PR 36272 at reviewer request.
Agreement: Positive
- Concept approval after verifying Boost macro compatibility and toolchain splitting (hebasto)
- Verified reproducible Guix build outputs across multiple architectures (willcl-ark, rustaceanrob)
Concept ACK and verified Guix reproducible builds; toolchain split concern addressed
hebasto provided a Concept ACK after verifying the Boost macro interaction, and multiple contributors confirmed matching Guix build hashes across architectures.
- hebasto posted 'Concept ACK.' after discussing Boost defines and toolchain splitting.
- willcl-ark and rustaceanrob posted identical matching Guix build outputs for multiple targets.
Review verdicts (DrahtBot): 0
- Concept ACK: hebasto
Dependencies
Depends on: #36272
Files
588 lines under test/bench/ci.
- contrib/guix/toolchains.scm +289/-0
- contrib/guix/manifest_build.scm +2/-273
- depends/patches/boost/drop_wcrtomb_wchar_t.patch +17/-0
- contrib/guix/guix-build +9/-1
- contrib/guix/linux_static.scm +8/-0
- contrib/guix/manifest_gui.scm +5/-1
- depends/packages/boost.mk +5/-0
Card
This PR configures libstdc++ in Guix Linux release builds to disable wchar_t and zoneinfo for non-GUI binaries, accompanied by a small Boost Test patch. This reduces the binary footprint of bitcoind, bitcoin-cli, and other command-line tools by roughly 0.5 MB each. Multiple reviewers have verified reproducible Guix build outputs across architectures, and hebasto Concept ACKed the change. The PR is stacked on #36272.