-
Notifications
You must be signed in to change notification settings - Fork 37.7k
build, qt: Fix Windows cross-compiling with Qt 5.15 #24131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Correct. But PR #22093 branch was not rebased on top of #23489: bitcoin/depends/packages/qt.mk Line 2 in 2fda0c7
I apologize for that.
|
This change allows to drop the `update-alternatives` step if the `g++-mingw-w64-x86-64` package has been installed.
Rebased 9ab1eca -> 9796dca (pr24131.01 -> pr24131.02) due to the conflict with #24212. |
@@ -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)'" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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:
CC = @echo compiling $< && x86_64-w64-mingw32-gcc
CXX = @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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 9796dca
I tested that make -C depends HOST=x86_64-w64-mingw32
builds Qt with mingw32 sucessfully.
9796dca doc: Install only "-posix" MinGW compiler when possible (Hennadii Stepanov) 0bbae23 ci: Drop no longer needed `update-alternatives` (Hennadii Stepanov) 01d1845 build, qt: Specify QMAKE_CXX explicitly (Hennadii Stepanov) Pull request description: While changes introduced in 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 bitcoin#22093 (comment)). ACKs for top commit: prusnak: ACK 9796dca Tree-SHA512: 0dc46c5dfab85bd6d2901052cd630e86f9b4e09c08ef87136b44ddecb1783cdf3cd0a6e67b95ac7a78da24cd7adedc88745f61f9a8d9993fbff26d33bf88d874
While changes introduced in #22093 worked fine with Qt 5.12, after bumping Qt up to 5.15 the cross-compiling of
qt
package for Windows fails witherror: ‘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 (comment)).