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

    0$ 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
    1$ ./autogen.sh
    2$ CONFIG_SITE=$PWD/depends/x86_64-w64-mingw32/share/config.site ./configure --disable-wallet --disable-tests --disable-bench --without-utils --without-daemon --without-gui
    3$ make clean
    4$ make
    5...
    
  2. DrahtBot added the label Build system on Mar 3, 2021
  3. 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.
  4. build: Fix libbitcoinconsensus cross-compiling for Windows with DEBUG=1 f2b7ea4432
  5. hebasto force-pushed on Mar 3, 2021
  6. 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.

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

    0# Using brew installed Mingw-w64 v8.0.0 (based  on GCC 10.2).
    1
    2  CXXLD    libbitcoinconsensus.la
    3/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':
    4/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
    5collect2: error: ld returned 1 exit status
    
  8. 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:

    0# Using brew installed Mingw-w64 v8.0.0 (based  on GCC 10.2).
    1
    2  CXXLD    libbitcoinconsensus.la
    3/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':
    4/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
    5collect2: 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):

    0$ make -C depends HOST=x86_64-w64-mingw32 NO_QT=1
    1$ ./autogen.sh
    2$ CONFIG_SITE=$PWD/depends/x86_64-w64-mingw32/share/config.site ./configure
    3$ make
    
  9. 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
  10. 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
  11. luke-jr changes_requested
  12. 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 ;)

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

  14. hebasto closed this on Mar 22, 2021

  15. hebasto deleted the branch on Nov 27, 2021
  16. DrahtBot 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: 2024-12-19 03:12 UTC

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