diff options
author | fanquake <fanquake@gmail.com> | 2022-02-03 10:52:15 +0800 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2022-02-03 10:52:58 +0800 |
commit | c194293883fbb656779102309b2cb3e60889feff (patch) | |
tree | 4af9368d1033e681af47d84c852d03f42a98b9f4 | |
parent | 0f43fb5d874581a3a8bd54f2050817af3fe2999e (diff) | |
parent | 9796dcacdc3841ab6e3359bd5ca67a5f634bf176 (diff) |
Merge bitcoin/bitcoin#24131: build, qt: Fix Windows cross-compiling with Qt 5.15
9796dcacdc3841ab6e3359bd5ca67a5f634bf176 doc: Install only "-posix" MinGW compiler when possible (Hennadii Stepanov)
0bbae237a8e0122b97c5c71bc85bc845e26d5b47 ci: Drop no longer needed `update-alternatives` (Hennadii Stepanov)
01d1845a80ae48d741deea695ddce95d940ab0d8 build, qt: Specify QMAKE_CXX explicitly (Hennadii Stepanov)
Pull request description:
While changes introduced in bitcoin/bitcoin#22093 worked fine with Qt 5.12, after bumping Qt up to 5.15 the cross-compiling of `qt` package for Windows fails with `error: ‘mutex’ in namespace ‘std’ does not name a type`.
The first commit fixes this bug.
The second commit cleans up a related CI script.
The third commit improves related docs (see https://github.com/bitcoin/bitcoin/pull/22093#discussion_r680911586).
ACKs for top commit:
prusnak:
ACK 9796dca
Tree-SHA512: 0dc46c5dfab85bd6d2901052cd630e86f9b4e09c08ef87136b44ddecb1783cdf3cd0a6e67b95ac7a78da24cd7adedc88745f61f9a8d9993fbff26d33bf88d874
-rwxr-xr-x | ci/test/05_before_script.sh | 3 | ||||
-rw-r--r-- | depends/packages/qt.mk | 1 | ||||
-rw-r--r-- | doc/build-windows.md | 11 |
3 files changed, 11 insertions, 4 deletions
diff --git a/ci/test/05_before_script.sh b/ci/test/05_before_script.sh index 1d67355d27..8f75fbd1fa 100755 --- a/ci/test/05_before_script.sh +++ b/ci/test/05_before_script.sh @@ -43,9 +43,6 @@ if [[ ${USE_MEMORY_SANITIZER} == "true" ]]; then CI_EXEC "contrib/install_db4.sh \$(pwd) --enable-umrw CC=clang CXX=clang++ CFLAGS='${MSAN_FLAGS}' CXXFLAGS='${MSAN_AND_LIBCXX_FLAGS}'" fi -if [[ $HOST = *-mingw32 ]]; then - CI_EXEC update-alternatives --set "${HOST}-g++" \$\(which "${HOST}-g++-posix"\) -fi if [ -z "$NO_DEPENDS" ]; then if [[ $DOCKER_NAME_TAG == *centos* ]]; then # CentOS has problems building the depends if the config shell is not explicitly set diff --git a/depends/packages/qt.mk b/depends/packages/qt.mk index 6b71a9abda..313b22218c 100644 --- a/depends/packages/qt.mk +++ b/depends/packages/qt.mk @@ -163,6 +163,7 @@ $(package)_config_opts_mingw32 += -no-dbus $(package)_config_opts_mingw32 += -no-freetype $(package)_config_opts_mingw32 += -xplatform win32-g++ $(package)_config_opts_mingw32 += "QMAKE_CFLAGS = '$($(package)_cflags) $($(package)_cppflags)'" +$(package)_config_opts_mingw32 += "QMAKE_CXX = '$($(package)_cxx)'" $(package)_config_opts_mingw32 += "QMAKE_CXXFLAGS = '$($(package)_cflags) $($(package)_cppflags)'" $(package)_config_opts_mingw32 += "QMAKE_LFLAGS = '$($(package)_ldflags)'" $(package)_config_opts_mingw32 += -device-option CROSS_COMPILE="$(host)-" diff --git a/doc/build-windows.md b/doc/build-windows.md index 657865795c..e35d3bcbd0 100644 --- a/doc/build-windows.md +++ b/doc/build-windows.md @@ -48,8 +48,17 @@ Acquire the source in the usual way: ## Building for 64-bit Windows The first step is to install the mingw-w64 cross-compilation tool chain: + - on modern systems (Ubuntu 21.04 Hirsute Hippo or newer, Debian 11 Bullseye or newer): - sudo apt install g++-mingw-w64-x86-64 +```sh +sudo apt install g++-mingw-w64-x86-64-posix +``` + + - on older systems: + +```sh +sudo apt install g++-mingw-w64-x86-64 +``` Once the toolchain is installed the build steps are common: |