build: Fix libbitcoinconsensus cross-compiling for Windows with DEBUG=1 #21344

pull hebasto wants to merge 1 commits into bitcoin:master from hebasto:210302-debug changing 1 files +1 −1
  1. hebasto commented at 10:37 PM on March 2, 2021: member

    Fix #19772.

    Steps to reproduce the bug on master (4f223e93e9c097c96a1655f9125aec463892da9c):

    $ make -C depends HOST=x86_64-w64-mingw32 DEBUG=1 NO_QT=1 NO_QR=1 NO_ZMQ=1 NO_WALLET=1 NO_UPNP=1 NO_NATPMP=1
    $ ./autogen.sh
    $ CONFIG_SITE=$PWD/depends/x86_64-w64-mingw32/share/config.site ./configure --disable-wallet --disable-tests --disable-bench --without-utils --without-daemon --without-gui
    $ make clean
    $ make
    ...
    
  2. hebasto cross-referenced this on Mar 2, 2021 from issue build: Cross-compiling libbitcoinconsensus for Windows fails with DEBUG=1 by hebasto
  3. DrahtBot added the label Build system on Mar 3, 2021
  4. fanquake commented at 3:25 AM on March 3, 2021: member

    Concept ACK. Please rebase this, and remove/trim the link error output from the PR description. There's no need to have all of that pasted in there.

  5. build: Fix libbitcoinconsensus cross-compiling for Windows with DEBUG=1 f2b7ea4432
  6. hebasto force-pushed on Mar 3, 2021
  7. hebasto commented at 7:01 AM on March 3, 2021: member

    Rebased 99a1523ff38dd01c7758ab0ce43566c1e1770e98 -> f2b7ea4432eb2dab7351c502cd90fa8a6cf2cde1 (pr21344.01 -> pr21344.02) due to the conflict with #21339. @fanquake

    Please rebase this, and remove/trim the link error output from the PR description. There's no need to have all of that pasted in there.

    Done.

  8. fanquake commented at 6:31 AM on March 4, 2021: member

    Looks like this might also fix the issue of cross compiling libbitcoinconsensus for windows when building on macOS:

    # Using brew installed Mingw-w64 v8.0.0 (based  on GCC 10.2).
    
      CXXLD    libbitcoinconsensus.la
    /usr/local/Cellar/mingw-w64/8.0.0_3/toolchain-x86_64/bin/x86_64-w64-mingw32-ld: /usr/local/Cellar/mingw-w64/8.0.0_3/toolchain-x86_64/x86_64-w64-mingw32/lib/libssp.a(ssp.o): in function `__stack_chk_fail':
    /private/tmp/mingw-w64-20210210-85400-sa28mi/mingw-w64-v8.0.0/gcc/build-x86_64/x86_64-w64-mingw32/libssp/../../../libssp/ssp.c:183: multiple definition of `__stack_chk_fail'; /usr/local/Cellar/mingw-w64/8.0.0_3/toolchain-x86_64/x86_64-w64-mingw32/lib/../lib/libssp.dll.a(d000007.o):(.text+0x0): first defined here
    collect2: error: ld returned 1 exit status
    
  9. hebasto commented at 2:58 PM on March 8, 2021: member

    @fanquake

    Looks like this might also fix the issue of cross compiling libbitcoinconsensus for windows when building on macOS:

    # Using brew installed Mingw-w64 v8.0.0 (based  on GCC 10.2).
    
      CXXLD    libbitcoinconsensus.la
    /usr/local/Cellar/mingw-w64/8.0.0_3/toolchain-x86_64/bin/x86_64-w64-mingw32-ld: /usr/local/Cellar/mingw-w64/8.0.0_3/toolchain-x86_64/x86_64-w64-mingw32/lib/libssp.a(ssp.o): in function `__stack_chk_fail':
    /private/tmp/mingw-w64-20210210-85400-sa28mi/mingw-w64-v8.0.0/gcc/build-x86_64/x86_64-w64-mingw32/libssp/../../../libssp/ssp.c:183: multiple definition of `__stack_chk_fail'; /usr/local/Cellar/mingw-w64/8.0.0_3/toolchain-x86_64/x86_64-w64-mingw32/lib/../lib/libssp.dll.a(d000007.o):(.text+0x0): first defined here
    collect2: error: ld returned 1 exit status
    

    You are right. Tested on macOS Mojave 10.14.6 (18G8022) with Homebrew's make:

    • master (a22653a636e8dfc1b898ef8dd18a77f2d31082a5) -- the same error as above

    • this PR, merged into the current master (a22653a636e8dfc1b898ef8dd18a77f2d31082a5):

    $ make -C depends HOST=x86_64-w64-mingw32 NO_QT=1
    $ ./autogen.sh
    $ CONFIG_SITE=$PWD/depends/x86_64-w64-mingw32/share/config.site ./configure
    $ make
    
  10. hebasto cross-referenced this on Mar 10, 2021 from issue depends: Qt 5.12.10 by fanquake
  11. hebasto renamed this:
    build: Fix libbitcoinconsensus cross-compiling for Windows with DEBUG=1
    build: Fix libbitcoinconsensus cross-compiling for Windows/macOS with DEBUG=1
    on Mar 22, 2021
  12. hebasto renamed this:
    build: Fix libbitcoinconsensus cross-compiling for Windows/macOS with DEBUG=1
    build: Fix libbitcoinconsensus cross-compiling for Windows with DEBUG=1
    on Mar 22, 2021
  13. luke-jr changes_requested
  14. luke-jr commented at 6:38 PM on March 22, 2021: member

    Won't this produce the wrong output? ie, a static library instead of shared?

    It's called LIBTOOL_APP_LDFLAGS for a reason ;)

  15. hebasto commented at 9:42 PM on March 22, 2021: member

    @luke-jr

    Won't this produce the wrong output?

    You're right. The libbitcoinconsensus-0.dll is not produced with this PR.

    Closing.

  16. hebasto closed this on Mar 22, 2021

  17. hebasto cross-referenced this on Nov 27, 2021 from issue build: Fix cross compiling with DEBUG=1 for Windows by hebasto
  18. hebasto deleted the branch on Nov 27, 2021
  19. CodeIsTheKey cross-referenced this on Mar 19, 2022 from issue Windows Build by CodeIsTheKey
  20. bitcoin locked this on Nov 27, 2022

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-05-19 06:53 UTC