Merge bitcoin/bitcoin#24131: build, qt: Fix Windows cross-compiling with Qt 5.15

9796dcacdc doc: Install only "-posix" MinGW compiler when possible (Hennadii Stepanov)
0bbae237a8 ci: Drop no longer needed `update-alternatives` (Hennadii Stepanov)
01d1845a80 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
This commit is contained in:
fanquake 2022-02-03 10:52:15 +08:00
commit c194293883
No known key found for this signature in database
GPG Key ID: 2EEB9F5CC09526C1
3 changed files with 11 additions and 4 deletions

View File

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

View File

@ -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)-"

View File

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