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

pull hebasto wants to merge 3 commits into bitcoin:master from hebasto:220123-mingw changing 3 files +11 −4
  1. hebasto commented at 2:16 pm on January 23, 2022: member

    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 #22093 (review)).

  2. laanwj added the label Build system on Jan 23, 2022
  3. fanquake commented at 6:57 am on January 25, 2022: member

    after bumping Qt up to 5.15 the cross-compiling of

    We bumped to Qt 5.15 (#23489) more than a month before #22093 was merged. Seems like that PR needed more testing given this isn’t the only issue its caused, i.e #24056.

  4. hebasto commented at 9:12 am on January 25, 2022: member

    after bumping Qt up to 5.15 the cross-compiling of

    We bumped to Qt 5.15 (#23489) more than a month before #22093 was merged.

    Correct. But PR #22093 branch was not rebased on top of #23489: https://github.com/bitcoin/bitcoin/blob/2fda0c785188ae94fba921c1b8f6f2c005faf1d4/depends/packages/qt.mk#L2

    I apologize for that.


    Seems like that PR needed more testing given this isn’t the only issue its caused, i.e #24056.

    ~Sure. Btw, I still not able to reproduce #24056.~

  5. laanwj added this to the milestone 23.0 on Jan 27, 2022
  6. DrahtBot added the label Needs rebase on Feb 1, 2022
  7. build, qt: Specify QMAKE_CXX explicitly
    This change allows to drop the `update-alternatives` step if the
    `g++-mingw-w64-x86-64` package has been installed.
    01d1845a80
  8. ci: Drop no longer needed `update-alternatives` 0bbae237a8
  9. doc: Install only "-posix" MinGW compiler when possible 9796dcacdc
  10. hebasto force-pushed on Feb 2, 2022
  11. hebasto commented at 5:31 pm on February 2, 2022: member
    Rebased 9ab1eca63ca954b28e0f8cc9b26e2aa53fcb96e7 -> 9796dcacdc3841ab6e3359bd5ca67a5f634bf176 (pr24131.01 -> pr24131.02) due to the conflict with #24212.
  12. MarcoFalke added the label DrahtBot Guix build requested on Feb 2, 2022
  13. in depends/packages/qt.mk:166 in 9796dcacdc
    162@@ -163,6 +163,7 @@ $(package)_config_opts_mingw32 += -no-dbus
    163 $(package)_config_opts_mingw32 += -no-freetype
    164 $(package)_config_opts_mingw32 += -xplatform win32-g++
    165 $(package)_config_opts_mingw32 += "QMAKE_CFLAGS = '$($(package)_cflags) $($(package)_cppflags)'"
    166+$(package)_config_opts_mingw32 += "QMAKE_CXX = '$($(package)_cxx)'"
    


    prusnak commented at 7:03 pm on February 2, 2022:

    I confirm this single line fixes the Qt build issue with Mingw for me. The rest of the PR is not required for the fix, but still worth merging in.

    However, when I inspect Makefile.Release files created by qmake I see the following:

    0CC            = [@echo](/bitcoin-bitcoin/contributor/echo/) compiling $< && x86_64-w64-mingw32-gcc
    1CXX           = [@echo](/bitcoin-bitcoin/contributor/echo/) compiling $< && x86_64-w64-mingw32-g++-posix
    

    I feel we should do the same for CC so this won’t explode in the future. What do you think?


    hebasto commented at 7:38 pm on February 2, 2022:

    Yes, I’ve noticed this as well when was working on this PR.

    I’m not aware of difference between x86_64-w64-mingw32-gcc-posix and x86_64-w64-mingw32-gcc-win32.

    Anyway, on the master branch we actually use the latter. So it was not my intention to change the status quo in this PR.

  14. DrahtBot removed the label Needs rebase on Feb 2, 2022
  15. prusnak approved
  16. prusnak commented at 7:43 pm on February 2, 2022: contributor

    ACK 9796dca

    I tested that make -C depends HOST=x86_64-w64-mingw32 builds Qt with mingw32 sucessfully.

  17. fanquake merged this on Feb 3, 2022
  18. fanquake closed this on Feb 3, 2022

  19. MarcoFalke removed the label DrahtBot Guix build requested on Feb 3, 2022
  20. sidhujag referenced this in commit 531ea19dfd on Feb 3, 2022
  21. hebasto deleted the branch on Feb 3, 2022
  22. DrahtBot locked this on Feb 3, 2023


hebasto fanquake prusnak

Labels
Build system

Milestone
23.0


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-11-17 00:12 UTC

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