guix: don't unset darwin CFLAGS #35541

pull fanquake wants to merge 1 commits into bitcoin:master from fanquake:dont_unset_flags changing 1 files +0 −1
  1. fanquake commented at 1:09 PM on June 16, 2026: member

    I don't know why we are unsetting these, and a Guix build works with this change.

  2. guix: don't unset darwin CFLAGS f9436bc31e
  3. DrahtBot added the label Build system on Jun 16, 2026
  4. fanquake removed the label Build system on Jun 16, 2026
  5. fanquake added the label DrahtBot Guix build requested on Jun 16, 2026
  6. DrahtBot commented at 1:09 PM on June 16, 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/35541.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    Approach NACK 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:

    • #35537 (guix: split builds into Linux, Linux GUI and macOS/Windows by fanquake)

    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-->

  7. fanquake assigned fanquake on Jun 16, 2026
  8. fanquake unassigned fanquake on Jun 16, 2026
  9. fanquake added the label Build system on Jun 16, 2026
  10. fanquake commented at 4:52 PM on June 16, 2026: member

    Guix build (aarch64):

    02fb2ae8a4c9fcecd2047a7f2ed88aabdae61b74ef31557bbd3796c24060e95d  guix-build-f9436bc31e06/output/aarch64-linux-gnu/SHA256SUMS.part
    cd8b124fcb359a23794996760f22db4f3590d6cb145bd424ac78481a3a83f2f7  guix-build-f9436bc31e06/output/aarch64-linux-gnu/bitcoin-f9436bc31e06-aarch64-linux-gnu-debug.tar.gz
    94eb9c098acaddd1a5f3ffbc2e499be80efb1d485b6bbb0a752179baaee3223d  guix-build-f9436bc31e06/output/aarch64-linux-gnu/bitcoin-f9436bc31e06-aarch64-linux-gnu.tar.gz
    9ce6a250a73f7b994362340ee1bae73793b6dbc3e68aa5eb7be4e1aeeb37475e  guix-build-f9436bc31e06/output/arm-linux-gnueabihf/SHA256SUMS.part
    0abfb53adaad6943345ae30c991b82b39bb62357820f16bcea797064e8580d21  guix-build-f9436bc31e06/output/arm-linux-gnueabihf/bitcoin-f9436bc31e06-arm-linux-gnueabihf-debug.tar.gz
    fdf19d523dbbcb7195d5d83d4d221475377e94e4a7b018fd8c5de2cc2150dcbe  guix-build-f9436bc31e06/output/arm-linux-gnueabihf/bitcoin-f9436bc31e06-arm-linux-gnueabihf.tar.gz
    d501ad8ad10cd40713ae2a11b0290d1dd2f0f003d17e4b9027912c52484b0b7b  guix-build-f9436bc31e06/output/arm64-apple-darwin/SHA256SUMS.part
    ade00b28a7fc8af4be87ceafe467bc9e32c26236ae3c1f56494b791471e6b7f9  guix-build-f9436bc31e06/output/arm64-apple-darwin/bitcoin-f9436bc31e06-arm64-apple-darwin-codesigning.tar.gz
    3a5bff9301c083c27ee70753c855de14e189f0cad7603931d9ae0edb255626f5  guix-build-f9436bc31e06/output/arm64-apple-darwin/bitcoin-f9436bc31e06-arm64-apple-darwin-unsigned.tar.gz
    96e0b9d9cb6cd19ae116911fa8052a7f1073bfb366661a79cd1e7591887e8b29  guix-build-f9436bc31e06/output/arm64-apple-darwin/bitcoin-f9436bc31e06-arm64-apple-darwin-unsigned.zip
    6e5fd56662ed22726028969d6e75e65a78f6d0176b6743f527d3197c887de302  guix-build-f9436bc31e06/output/dist-archive/bitcoin-f9436bc31e06.tar.gz
    bb5defdd3b52e38b3292526971efeac00ca19026cca9ac164a8d11201d1fefd3  guix-build-f9436bc31e06/output/powerpc64-linux-gnu/SHA256SUMS.part
    30ed749c71dc63ccac1c2ed1a91071dfcc1c55ca38ba761c7cd0f7fe5aea22d4  guix-build-f9436bc31e06/output/powerpc64-linux-gnu/bitcoin-f9436bc31e06-powerpc64-linux-gnu-debug.tar.gz
    ee6ace1a9656fc10cc110ca3da43eabdc25c7925e7ddc6eb942b02c82c643e37  guix-build-f9436bc31e06/output/powerpc64-linux-gnu/bitcoin-f9436bc31e06-powerpc64-linux-gnu.tar.gz
    8bbbe72556830e2db77ed67273d32360664e249a46c5739a76204e51a7658790  guix-build-f9436bc31e06/output/riscv64-linux-gnu/SHA256SUMS.part
    7a46bf6679b6b842b3715c66d7b00e9ea3b7e2b7c6a597ea71b1b44476b19c83  guix-build-f9436bc31e06/output/riscv64-linux-gnu/bitcoin-f9436bc31e06-riscv64-linux-gnu-debug.tar.gz
    03f7e9152aa2f4866ebff75e6f03b0cbdccb59694263701bf49c90041a36a795  guix-build-f9436bc31e06/output/riscv64-linux-gnu/bitcoin-f9436bc31e06-riscv64-linux-gnu.tar.gz
    7a929d4e03d74da8f409679cd16dfcf45cfe0d112332a3eedc93f7a9157fa76f  guix-build-f9436bc31e06/output/x86_64-apple-darwin/SHA256SUMS.part
    b860aeffc22a68c6a504157999b96a1a3ebae77d8cd19bab0cbbbbeef55f0e3f  guix-build-f9436bc31e06/output/x86_64-apple-darwin/bitcoin-f9436bc31e06-x86_64-apple-darwin-codesigning.tar.gz
    a7fb82bd6ab60bc3afff26d336734eb5ac0d50fce69681ed9dee7f0f6c6ffb31  guix-build-f9436bc31e06/output/x86_64-apple-darwin/bitcoin-f9436bc31e06-x86_64-apple-darwin-unsigned.tar.gz
    7258fbabcc6fdf78a1104664411ac2dfa59e10751ea1d93766da980358566e68  guix-build-f9436bc31e06/output/x86_64-apple-darwin/bitcoin-f9436bc31e06-x86_64-apple-darwin-unsigned.zip
    de718a5e8b2151659e39fd5638ac915b2af24225df3d1e1d147feebbcb489a50  guix-build-f9436bc31e06/output/x86_64-linux-gnu/SHA256SUMS.part
    9ec91f4184c37c52e98afc233d105bfc4d72ddee58a63e030084d1ec67219fa5  guix-build-f9436bc31e06/output/x86_64-linux-gnu/bitcoin-f9436bc31e06-x86_64-linux-gnu-debug.tar.gz
    3efc8bb77c007c76ce02df529c8e0bf801ead070e117c2aa02e7b51e5764369e  guix-build-f9436bc31e06/output/x86_64-linux-gnu/bitcoin-f9436bc31e06-x86_64-linux-gnu.tar.gz
    6097765156a12f794ea23328ee79f7fff188cc50e1195cf05058008b7159cbf0  guix-build-f9436bc31e06/output/x86_64-w64-mingw32/SHA256SUMS.part
    b01ed7db29b418b97b5499b38f38bde83486a9e02befdb28d6d80dddd493fed7  guix-build-f9436bc31e06/output/x86_64-w64-mingw32/bitcoin-f9436bc31e06-win64-codesigning.tar.gz
    cd91b21d88f0ebdca22235847b24adccc25552124f1990c85d1f0d05996cafe6  guix-build-f9436bc31e06/output/x86_64-w64-mingw32/bitcoin-f9436bc31e06-win64-debug.zip
    b6473821c0a46d5ef1a1c47e1eda726792210b4d680901330a79fa867e6f0430  guix-build-f9436bc31e06/output/x86_64-w64-mingw32/bitcoin-f9436bc31e06-win64-setup-unsigned.exe
    a00294bcc0f52d2f5f752a396537da367ab6c240d324e580f2742392098e4ecf  guix-build-f9436bc31e06/output/x86_64-w64-mingw32/bitcoin-f9436bc31e06-win64-unsigned.zip
    
  11. maflcko commented at 5:57 PM on June 16, 2026: member

    I don't have macOS, so I can't test this, but will this change anything about logging, or debugging? Ref: https://github.com/bitcoin/bitcoin/issues/34414

  12. fanquake commented at 6:31 AM on June 18, 2026: member

    but will this change anything about logging, or debugging?

    I built and diffed master, and this PR, for arm64-apple-darwin bitcoind, and the only difference in the binaries was:

    @@ -11502,15 +11502,15 @@
     AutoFile::ignore: end of file
     AutoFile::ignore: fread failed
     AutoFile::write: file handle is nullptr
     AutoFile::write: write failed
     AutoFile::write_buffer: file handle is nullptr
     AutoFile::write_buffer: obfuscation position unknown
     AutoFile::write_buffer: write failed
    -v31.99.0-g0136e17c0a963e82bf47c223d41f4d5c009520c0
    +v31.99.0-gf9436bc31e062c671a4d027f07ed8c14ec359789
     /%s:%s%s/
     %d.%d.%d
     Division by zero
     GetCompact
     arith_uint256.cpp
     (nCompact & ~0x007fffffU) == 0
     nSize < 256
    
    @@ -1840882,15 +1840882,15 @@
     0000000100706bc8	adrp	x0, 1269 ; 0x100bfb000
     0000000100706bcc	add	x0, x0, [#0](/bitcoin-bitcoin/0/)x740
     0000000100706bd0	bl	0x100830204 ; symbol stub for: ___cxa_guard_acquire
     0000000100706bd4	cbz	w0, 0x100706b44
     0000000100706bd8	adrp	x0, 1269 ; 0x100bfb000
     0000000100706bdc	add	x0, x0, [#0](/bitcoin-bitcoin/0/)x728
     0000000100706be0	adrp	x1, 1184 ; 0x100ba6000
    -0000000100706be4	add	x1, x1, [#0](/bitcoin-bitcoin/0/)x538 ; literal pool for: "v31.99.0-g0136e17c0a963e82bf47c223d41f4d5c009520c0"
    +0000000100706be4	add	x1, x1, [#0](/bitcoin-bitcoin/0/)x538 ; literal pool for: "v31.99.0-gf9436bc31e062c671a4d027f07ed8c14ec359789"
     0000000100706be8	bl	0x1000028e0
     0000000100706bec	adrp	x0, 1218 ; 0x100bc8000
     0000000100706bf0	ldr	x0, [x0, [#0](/bitcoin-bitcoin/0/)x3d0] ; literal pool symbol address: __ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED1Ev
     0000000100706bf4	adrp	x1, 1269 ; 0x100bfb000
     0000000100706bf8	add	x1, x1, [#0](/bitcoin-bitcoin/0/)x728
     0000000100706bfc	adrp	x2, -1798 ; 0x100000000
     0000000100706c00	add	x2, x2, [#0](/bitcoin-bitcoin/0/)x0
    

    so there should be no change in behaviour here.

  13. maflcko commented at 7:03 AM on June 18, 2026: member

    Ok, I see. So the macro-prefix-map was probably correctly set by the default in CMakeList.txt? Not sure how debugging works on macOS, so I wonder why there is no difference here. Maybe someone can check that gdb (or whatever) works, but not a blocker, since this doesn't seem to change the binary.

  14. fanquake requested review from hebasto on Jun 19, 2026
  15. hebasto commented at 11:15 AM on June 19, 2026: member

    I don't know why we are unsetting these...

    It seems plausible that c9eb4cf3a0f81bfd72f06fd43b5610f0a4f5e804 followed the logic of contrib/gitian-descriptors/gitian-osx.yml.

    ... and a Guix build works with this change.

    This change adds the following flags to {C,CXX}FLAGS:

    1. -O2 -g. This is effectively a noop, as CMake overrides them with CMAKE_<LANG>_FLAGS_RELWITHDEBINFO. If the goal is to explicitly set these flags for all hosts, -O2 -g should be passed via CMAKE_<LANG>_FLAGS_RELWITHDEBINFO instead.

    2. Guix environment-specific -ffile-prefix-map=<path>=/usr. This does not affect the resulting output because macOS binaries are stripped.

    3. -fdebug-prefix-map=${DISTSRC}/src=.. Same as point 2. Additionally, we do not ship debug symbols for macOS.

    Changes 2 and 3 are unnecessary and clutter the configure output.

    Approach NACK from me.

    I'd prefer something like this:

    --- a/contrib/guix/libexec/build.sh
    +++ b/contrib/guix/libexec/build.sh
    @@ -124,8 +124,20 @@ esac
     # CONFIGFLAGS
     CONFIGFLAGS="-DREDUCE_EXPORTS=ON -DBUILD_BENCH=OFF -DBUILD_GUI_TESTS=OFF -DBUILD_FUZZ_BINARY=OFF -DCMAKE_SKIP_RPATH=TRUE"
     
    +case "$HOST" in
    +    *darwin*)
    +        CONFIGFLAGS+=" -DCMAKE_C_FLAGS_RELWITHDEBINFO='-O2'"
    +        CONFIGFLAGS+=" -DCMAKE_CXX_FLAGS_RELWITHDEBINFO='-O2'"
    +        CONFIGFLAGS+=" -DCMAKE_OBJCXX_FLAGS_RELWITHDEBINFO='-O2'"
    +        ;;
    +    *)
    +        CONFIGFLAGS+=" -DCMAKE_C_FLAGS_RELWITHDEBINFO='-O2 -g'"
    +        CONFIGFLAGS+=" -DCMAKE_CXX_FLAGS_RELWITHDEBINFO='-O2 -g'"
    +        ;;
    +esac
    +
     # CFLAGS
    -HOST_CFLAGS="-O2 -g"
    +HOST_CFLAGS=""
     HOST_CFLAGS+=$(find /gnu/store -maxdepth 1 -mindepth 1 -type d -exec echo -n " -ffile-prefix-map={}=/usr" \;)
     HOST_CFLAGS+=" -fdebug-prefix-map=${DISTSRC}/src=."
     case "$HOST" in
    
  16. fanquake commented at 11:22 AM on June 19, 2026: member

    It seems plausible that https://github.com/bitcoin/bitcoin/commit/c9eb4cf3a0f81bfd72f06fd43b5610f0a4f5e804 followed the logic of contrib/gitian-descriptors/gitian-osx.yml.

    I don't follow. What do you mean?

    This is effectively a noop, as CMake overrides them with CMAKE_<LANG>FLAGS_RELWITHDEBINFO. If the goal is to explicitly set these flags for all hosts, -O2 -g should be passed via CMAKE<LANG>_FLAGS_RELWITHDEBINFO instead.

    I'm aware this change is a no-op (see the binary diff above), and there is no goal to change or set any other flags. The point is to remove undocumented, platform specific code, which is a no-op; partly related to #35537.

  17. hebasto commented at 11:35 AM on June 19, 2026: member

    It seems plausible that c9eb4cf followed the logic of contrib/gitian-descriptors/gitian-osx.yml.

    I don't follow. What do you mean?

    $ git checkout c9eb4cf3a0f81bfd72f06fd43b5610f0a4f5e804
    $ git grep HOST_C contrib/gitian-descriptors/gitian-linux.yml
    contrib/gitian-descriptors/gitian-linux.yml:  HOST_CFLAGS="-O2 -g"
    contrib/gitian-descriptors/gitian-linux.yml:  HOST_CXXFLAGS="-O2 -g"
    contrib/gitian-descriptors/gitian-linux.yml:    CONFIG_SITE=${BASEPREFIX}/${i}/share/config.site ./configure --prefix=/ --disable-ccache --disable-maintainer-mode --disable-dependency-tracking ${CONFIGFLAGS} CFLAGS="${HOST_CFLAGS}" CXXFLAGS="${HOST_CXXFLAGS}" LDFLAGS="${HOST_LDFLAGS}"
    $ git grep HOST_C contrib/gitian-descriptors/gitian-osx.yml | wc -l
    0
    $ git grep HOST_C contrib/gitian-descriptors/gitian-win.yml
    contrib/gitian-descriptors/gitian-win.yml:  HOST_CFLAGS="-O2 -g -fno-ident"
    contrib/gitian-descriptors/gitian-win.yml:  HOST_CXXFLAGS="-O2 -g -fno-ident"
    contrib/gitian-descriptors/gitian-win.yml:    CONFIG_SITE=${BASEPREFIX}/${i}/share/config.site ./configure --prefix=/ --disable-ccache --disable-maintainer-mode --disable-dependency-tracking ${CONFIGFLAGS} CFLAGS="${HOST_CFLAGS}" CXXFLAGS="${HOST_CXXFLAGS}"
    

    The point is to remove undocumented, platform specific code, which is a no-op...

    I agree. But could this be accomplished without cluttering the configure summary with useless flags?

  18. fanquake commented at 12:26 PM on June 19, 2026: member

    The flags could just be dropped entirely as part of #35537.

  19. fanquake commented at 2:56 PM on June 19, 2026: member

    Will just close given it's effectively part of #35537.

  20. fanquake closed this on Jun 19, 2026

  21. DrahtBot commented at 10:44 AM on June 20, 2026: contributor

    <!--9cd9c72976c961c55c7acef8f6ba82cd-->

    Guix builds (on x86_64) [untrusted test-only build, possibly unsafe, not for production use]

    File commit 341360964a6fef725825639edc507c275f8ad0b2<br>(master) commit afb32b7330bdc54533865a97c9aed71a254db333<br>(pull/35541/merge)
    *-aarch64-linux-gnu-debug.tar.gz 03253a4531c902a5... 50782b0ff00304c5...
    *-aarch64-linux-gnu.tar.gz b158b7c963d5b7cc... a24d5dd90fe302e6...
    *-arm-linux-gnueabihf-debug.tar.gz 4ebe3f77e6b281c4... acaf24620ba23207...
    *-arm-linux-gnueabihf.tar.gz e797727a955ce634... 49d8514a32d66ea5...
    *-arm64-apple-darwin-codesigning.tar.gz 275ade22295ddc33... ad9ffdde1acb8bb4...
    *-arm64-apple-darwin-unsigned.tar.gz d323d28e96a91873... 0ee0e8747ae7fa1c...
    *-arm64-apple-darwin-unsigned.zip d1dd528b58999573... 2a0fa6d44f284f2b...
    *-powerpc64-linux-gnu-debug.tar.gz 671e22e5ad8a1089... ab13b67da5f048fd...
    *-powerpc64-linux-gnu.tar.gz 687518b3bd489064... 20870d6880f1bca3...
    *-riscv64-linux-gnu-debug.tar.gz afdfb49209a0bad5... 5d1df9e9e8c94aab...
    *-riscv64-linux-gnu.tar.gz 261dc8a53fa2aa56... 26a203c8bc640958...
    *-win64-codesigning.tar.gz 2dc2ee6d4d50e3e2... fecb1dac1f22237a...
    *-win64-debug.zip ab7daacb39165c3d... 4062d19fe42a662f...
    *-win64-setup-unsigned.exe c11c7a411afcbcd6... 7f220aaa1c5da32f...
    *-win64-unsigned.zip 024da19d27552f3f... 92edafb2da0c7c67...
    *-x86_64-apple-darwin-codesigning.tar.gz 500bb5f53d06f678... cb0fe323ac01f82a...
    *-x86_64-apple-darwin-unsigned.tar.gz ef083843108d2497... a3357d1b0e1bb857...
    *-x86_64-apple-darwin-unsigned.zip d7d4179afe126be3... 2f1c66c18114efdc...
    *-x86_64-linux-gnu-debug.tar.gz 45c47e66624c1778... 15ba9d263b6f053b...
    *-x86_64-linux-gnu.tar.gz 2e97637ed1894c00... 7efffb25eba3ac4d...
    *.tar.gz ffef1304bef7a334... 5b10cdd5149518e0...
    SHA256SUMS.part 63cecf79f3457c2c... 2373111f3f66e3cc...
    guix_build.log a589bf322ab607b5... ac087fcfa0f50df4...
    guix_build.log.diff 925152ebebeb7291...
  22. DrahtBot removed the label DrahtBot Guix build requested on Jun 20, 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-06-20 23:51 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me