Skip to content

Conversation

@hebasto
Copy link
Member

@hebasto hebasto commented Mar 2, 2021

Fix #19772.

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

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

Copy link
Member

@fanquake fanquake left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@hebasto
Copy link
Member Author

hebasto commented Mar 3, 2021

Rebased 99a1523 -> f2b7ea4 (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.

@fanquake
Copy link
Member

fanquake commented Mar 4, 2021

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

@hebasto
Copy link
Member Author

hebasto commented Mar 8, 2021

@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 (a22653a) -- the same error as above

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

$ 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

@hebasto hebasto mentioned this pull request Mar 10, 2021
@hebasto hebasto changed the title build: Fix libbitcoinconsensus cross-compiling for Windows with DEBUG=1 build: Fix libbitcoinconsensus cross-compiling for Windows/macOS with DEBUG=1 Mar 22, 2021
@hebasto hebasto changed the title build: Fix libbitcoinconsensus cross-compiling for Windows/macOS with DEBUG=1 build: Fix libbitcoinconsensus cross-compiling for Windows with DEBUG=1 Mar 22, 2021
Copy link
Member

@luke-jr luke-jr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

It's called LIBTOOL_APP_LDFLAGS for a reason ;)

@hebasto
Copy link
Member Author

hebasto commented Mar 22, 2021

@luke-jr

Won't this produce the wrong output?

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

Closing.

@hebasto hebasto closed this Mar 22, 2021
@hebasto hebasto deleted the 210302-debug branch November 27, 2021 14:33
@bitcoin bitcoin locked and limited conversation to collaborators Nov 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

build: Cross-compiling libbitcoinconsensus for Windows fails with DEBUG=1

4 participants