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
qt5 PortGroup: support arm64 #9686
Conversation
at present only on qt5.15.x and above universal builds not tested as yet closes: https://trac.macports.org/ticket/60944
Michael -- there was one more edit I made manually in the config files installed on the arm64 Mac by qt5-base:
before we build qt5-qtbase for arm64, I/we should find some way to make sure that fix is incorporated into the build of qt5-qtbase, otherwise we'll just have to fix it soon afterwards. |
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.
Makes sense to me; thanks!
Yup I remember having to do that too. Can you add on a commit to fix this in Qt5 for ARM64 to this PR? Best to keep them together IMHO & it's a simple -- but critical -- fix! |
So I was just looking at that issue this morning. In the build of qt5-qtbase, Marcus makes a bunch of modifications to the mkspecs to allow things to build properly, but then -- it appears -- he undoes them all and restores the original qt5 mkspecs, in the hope of keeping qt5 "stock" for building projects unrelated to MacPorts, it seems. His notes indicate that he intends to override those stock mkspecs during Macports builds with environment variables instead (and I think that is what happens in the qmake5 portgroup). SO -- I'm just at the point of deciding whether this particular mkspec has to be installed modified in this particular case on an arm64 machine -- which is what I did above -- or whether we should look at adding some more variables to the qmake5 PG to overcome this issue on arm (assuming they are not already there). |
On the arm Mac, these are the changes that are made in the mkspecs for the build (that are later reverted and restored at the end of the build):
Of these changes, only the ones in So I think we should install the modified It's a trivial enough fix in the qt5-qttools part of the qt5 Portfile. I had to do something similar in the qt53-qttools installation to accommodate our 10.6.8 using libc++. Just a conditional in the qt5-qttools logic to keep that particular configuration file if we're installing on an arm mac should do it. |
Noted that this will make it probably impossible to build a universal version of qt5-qttools, however, as the x86_64 and arm64 versions of |
What would happen, I wonder, if we just removed those two envvars from that conf file on BigSur and above?
Perhaps qt5 would then just let the compiler set the MACOSX_DEPLOYMENT_TARGET and ARCHS, and if so, that might work out just nicely, perhaps...for a universal build of qt5... |
Removing the force seems to be exactly what upstream decided to do: |
and we have this https://codereview.qt-project.org/c/qt/qtbase/+/327649 and this https://raw.githubusercontent.com/Homebrew/formula-patches/9dc732/qt/qt-split-arch.patch as well to consider. This is what homebrew went with. |
this patch uses the current upstream changes to allow alternative archs to x86_64 for builds. qt/qtbase@9082cc8 there could be further upstream changes and patches -- and indeed almost certainly there will be -- but for now this meets the needs of allowing an arm64 build of qt5 that functions
the upstream commit seems to work just fine. All the qt5 apps build and run, including the gui apps. There are a few qt5 apps that I can't build arm64 just yet -- qt5-qtcreator needs llvm10, and sigil and others need qt5-qtwebengine. So I'll have to work on those for arm. But the others I have tried are building and running as expected. I'm just running WireShark 3 now as an arm64 GUI application on the Apple Silicon system, and it loks great adn seems to work normally. |
at present only on qt5.15.x and above
universal builds not tested as yet
closes: https://trac.macports.org/ticket/60944