-
Notifications
You must be signed in to change notification settings - Fork 38.7k
build, qt: Fix cross-compiling detection on M1-based macOS (aarch64) #22487
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
| @@ -0,0 +1,16 @@ | |||
| To cross compile for the x86_64-darwin host on aarch64-darwin, | |||
| passing QMAKE_APPLE_DEVICE_ARCHS=arm64 to the configure script | |||
| does not work for some reasons. | |||
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 would prefer if we could document the reason it doesn't work. And any possible information on how/when/what circumstances this patch could be dropped
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 would prefer if we could document the reason it doesn't work.
I failed to track this bug down, unfortunately.
And any possible information on how/when/what circumstances this patch could be dropped
As this is an ad-hoc hack, we should try to drop it while bumping Qt version in the future.
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 think the #23583 is the correct solution for this problem.
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.
Concept ACK, thanks for fixing this. One concern: https://github.com/bitcoin/bitcoin/pull/22487/files#r671973286
Tested on an M1 Machine. Confirming that with this change we can drop the recommendation to install rosseta.
master:
a) native depends:
Configure summary:
Building on: macx-clang (x86_64, CPU features: cx16 mmx sse sse2 sse3 ssse3 sse4.1)
Building for: macx-clang (arm64, CPU features: neon crc32)
Target compiler: clang (Apple) 12.0.5
Configuration: cross_compile largefile neon precompile_header silent release c++11 c++14 c++1z reduce_exports static stl
b) building for x64:
Configure summary:
Build type: macx-clang (x86_64, CPU features: cx16 mmx sse sse2 sse3 ssse3 sse4.1)
Compiler: clang (Apple) 12.0.5
Configuration: sse2 aesni sse3 ssse3 sse4_1 sse4_2 avx avx2 avx512f avx512bw avx512cd avx512dq avx512er avx512ifma avx512pf avx512vbmi avx512vl f16c largefile precompile_header rdrnd shani silent x86SimdAlways release c++11 c++14 c++1z reduce_exports static stl
pr:
a) native depends:
Configure summary:
Build type: macx-clang (arm64, CPU features: neon crc32)
Compiler: clang (Apple) 12.0.5
Configuration: largefile neon precompile_header silent release c++11 c++14 c++1z reduce_exports static stl
b) building for x64:
Configure summary:
Building on: macx-clang (arm64, CPU features: neon crc32)
Building for: macx-clang (x86_64, CPU features: cx16 mmx sse sse2 sse3 ssse3 sse4.1)
Target compiler: clang (Apple) 12.0.5
Configuration: cross_compile sse2 aesni sse3 ssse3 sse4_1 sse4_2 avx avx2 avx512f avx512bw avx512cd avx512dq avx512er avx512ifma avx512pf avx512vbmi avx512vl f16c largefile precompile_header rdrnd shani silent x86SimdAlways release c++11 c++14 c++1z reduce_exports static stl
While here
I noticed the following line in the output when building qt through depends, how much of a concern can this be?:
> main.cpp:5:12: fatal error: 'linux/input.h' file not found
> # include <linux/input.h>
> ^~~~~~~~~~~~~~~
> 1 error generated.
> make[1]: *** [main.o] Error 1
test config.qtbase_gui.tests.evdev FAILED
It's not a concern. Output like that is expected while Qt is running it's feature checks. |
promag
left a comment
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.
Tested ACK 5a55ba9.
However, I tried the following (hardcoded) and it worked fine:
$(package)_config_opts_darwin += -device-option QMAKE_APPLE_DEVICE_ARCHS=x86_64
make -C depends qt_configured HOST=x86_64-apple-darwin18
$(package)_config_opts_darwin += -device-option QMAKE_APPLE_DEVICE_ARCHS=arm64
make -C depends qt_configured
Note that it doesn't use _config_opts_x86_64_darwin or _config_opts_aarch64_darwin.
What is your Qt Configure summary? UPDATE:
The |
fanquake
left a comment
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.
Does configuring with qt, for a x86-64 cross-compile, on an M1, using this PR, currently work?
|
Updated 5a55ba9 -> 8edac79 (pr22487.01 -> pr22487.02):
|
Yes, it does, after the recent update. |
|
Rebased 8edac79 -> d660e80 (pr22487.02 -> pr22487.03) due to the conflict with #22526. |
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
This reverts commit cdb41d5. It is no longer required because of the previous commit.
|
Rebased d660e80 -> 85888b5 (pr22487.03 -> pr22487.04) due to the conflict with #22448. |
|
GUIX hashes |
Guix builds: |
|
I'm closing this for now. In favour of #23583. |
#20641 made building of the
qtpackage in depends more structured, and, particularly, fixed cross-compiling detection on Intel-based macOS (x86_64).However, a similar issue still present on M1-based macOS (arm64):
Note an unexpected
cross_compile.Note that the build system failed to detect cross compiling.
In both cases building the configured
qtpackage fails without installed Rosetta 2 (see #22402).This PR:
With this PR:
This PR is based on #22506.