Opened 4 years ago

Closed 4 years ago

#60944 closed enhancement (fixed)

qt5: Support arm64

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: michaelld (Michael Dickens), ctreleaven (Craig Treleaven)
Port: qt5

Description

The qt5 port includes the qt5-1.0 portgroup which says:

    default supported_archs x86_64

Can you investigate adding support for arm64?

Change History (13)

comment:1 Changed 4 years ago by michaelld (Michael Dickens)

Need to update to qt 5.15.1 ... then add "arm64" to that line in the PG. At least some of the components build without other modification.

comment:2 Changed 4 years ago by michaelld (Michael Dickens)

Cc: michaelld added

comment:3 Changed 4 years ago by michaelld (Michael Dickens)

With assimp's .pc file fixed, it looks like for basic ARM64 support there's just a slight tweak to qt5-qtbase required under 5.15.1. I don't know who well Qt5 works, but it builds and all of the binaries register as ARM64 ... so, that's progress!

comment:4 Changed 4 years ago by ctreleaven (Craig Treleaven)

Cc: ctreleaven added

comment:5 Changed 4 years ago by kencu (Ken)

coming along:

% port -v installed | grep qt5
  qt5 @5.15.2_0 (active) platform='darwin 20' archs='noarch' date='2020-12-20T02:51:37-0500'
  qt5-qt3d @5.15.2_0 (active) platform='darwin 20' archs='arm64' date='2020-12-20T02:42:11-0500'
  qt5-qtbase @5.15.2_0+openssl (active) platform='darwin 20' archs='arm64' date='2020-12-20T01:14:56-0500'
  qt5-qtconnectivity @5.15.2_0 (active) platform='darwin 20' archs='arm64' date='2020-12-20T02:50:52-0500'
  qt5-qtdeclarative @5.15.2_0 (active) platform='darwin 20' archs='arm64' date='2020-12-20T01:19:58-0500'
  qt5-qtgamepad @5.15.2_0 (active) platform='darwin 20' archs='arm64' date='2020-12-20T01:34:47-0500'
  qt5-qtgraphicaleffects @5.15.2_0 (active) platform='darwin 20' archs='arm64' date='2020-12-20T01:24:01-0500'
  qt5-qtimageformats @5.15.2_0 (active) platform='darwin 20' archs='arm64' date='2020-12-20T01:24:17-0500'
  qt5-qtlocation @5.15.2_0 (active) platform='darwin 20' archs='arm64' date='2020-12-20T01:30:48-0500'
  qt5-qtmacextras @5.15.2_0 (active) platform='darwin 20' archs='arm64' date='2020-12-20T01:26:56-0500'
  qt5-qtmultimedia @5.15.2_0 (active) platform='darwin 20' archs='arm64' date='2020-12-20T01:33:48-0500'
  qt5-qtnetworkauth @5.15.2_0 (active) platform='darwin 20' archs='arm64' date='2020-12-20T01:33:56-0500'
  qt5-qtquickcontrols @5.15.2_0 (active) platform='darwin 20' archs='arm64' date='2020-12-20T01:27:38-0500'
  qt5-qtquickcontrols2 @5.15.2_0 (active) platform='darwin 20' archs='arm64' date='2020-12-20T01:25:55-0500'
  qt5-qtremoteobjects @5.15.2_0 (active) platform='darwin 20' archs='arm64' date='2020-12-20T01:34:17-0500'
  qt5-qtscript @5.15.2_0 (active) platform='darwin 20' archs='arm64' date='2021-01-06T11:00:04-0500'
  qt5-qtscxml @5.15.2_0 (active) platform='darwin 20' archs='arm64' date='2020-12-20T01:34:35-0500'
  qt5-qtsensors @5.15.2_0 (active) platform='darwin 20' archs='arm64' date='2020-12-20T01:26:31-0500'
  qt5-qtserialbus @5.15.2_0 (active) platform='darwin 20' archs='arm64' date='2020-12-20T01:32:41-0500'
  qt5-qtserialport @5.15.2_0 (active) platform='darwin 20' archs='arm64' date='2020-12-20T01:26:03-0500'
  qt5-qtspeech @5.15.2_0 (active) platform='darwin 20' archs='arm64' date='2020-12-20T02:51:02-0500'
  qt5-qtsvg @5.15.2_0 (active) platform='darwin 20' archs='arm64' date='2020-12-20T01:15:18-0500'
  qt5-qttools @5.15.2_0 (active) platform='darwin 20' archs='arm64' date='2020-12-20T01:23:23-0500'
  qt5-qttranslations @5.15.2_0 (active) platform='darwin 20' archs='noarch' date='2020-12-20T02:51:21-0500'
  qt5-qtwebchannel @5.15.2_0 (active) platform='darwin 20' archs='arm64' date='2020-12-20T01:26:50-0500'
  qt5-qtwebsockets @5.15.2_0 (active) platform='darwin 20' archs='arm64' date='2020-12-20T01:26:42-0500'
  qt5-qtxmlpatterns @5.15.2_0 (active) platform='darwin 20' archs='arm64' date='2020-12-20T01:32:22-0500'
  qt5-sqlite-plugin @5.15.2_0 (active) platform='darwin 20' archs='arm64' date='2020-12-20T02:51:36-0500'
Last edited 4 years ago by kencu (Ken) (previous) (diff)

comment:6 Changed 4 years ago by kencu (Ken)

so it looks like to make all that happen, Michael did this little tweak:

% git diff  _resources/port1.0/group/qt5-1.0.tcl
diff --git a/_resources/port1.0/group/qt5-1.0.tcl b/_resources/port1.0/group/qt5-1.0.tcl
index 25b454e2cd5..2b909b2e2e6 100644
--- a/_resources/port1.0/group/qt5-1.0.tcl
+++ b/_resources/port1.0/group/qt5-1.0.tcl
@@ -662,7 +662,7 @@ compiler.blacklist-append *gcc*
 
 if {[vercmp ${qt5.version} 5.10]>=0} {
     # see https://bugreports.qt.io/browse/QTBUG-58401
-    default supported_archs x86_64
+    default supported_archs "x86_64 arm64"
 } else {
     # no PPC support in Qt 5
     #     see http://lists.qt-project.org/pipermail/interest/2012-December/005038.html

I suppose I should go ahead and push that through.

comment:7 Changed 4 years ago by kencu (Ken)

No -- it can't just be all the qt5 versions > 5.10 that build on arm64.

The only ones that we know of that build on arm64 (so far) are > 5.15. I will add a new chunk to the decision tree for that, until such time as we know different (if anyone ever cares whether an old version of qt5 builds on arm64 enough to investigate it).

comment:8 Changed 4 years ago by kencu (Ken)

we're also going to have the fix up the default universal_archs_supported in this bit if we want to try to build qt5 universal for arm64/x86_64

    proc universal_setup {args} {
        if {[variant_exists universal]} {
            ui_debug "universal variant already exists, so not adding the default one"
        } elseif {[exists universal_variant] && ![option universal_variant]} {
            ui_debug "universal_variant is false, so not adding the default universal variant"
        } elseif {[exists use_xmkmf] && [option use_xmkmf]} {
            ui_debug "using xmkmf, so not adding the default universal variant"
        } elseif {![exists os.universal_supported] || ![option os.universal_supported]} {
            ui_debug "OS doesn't support universal builds, so not adding the default universal variant"
        } elseif {[llength [option supported_archs]] == 1} {
            ui_debug "only one arch supported, so not adding the default universal variant"
        } else {
            ui_debug "adding universal variant via PortGroup muniversal"
            uplevel "PortGroup muniversal 1.0"
            uplevel "default universal_archs_supported {\"i386 x86_64\"}"
        }
    }

comment:9 Changed 4 years ago by kencu (Ken)

this is an attempt to get this right <https://github.com/macports/macports-ports/pull/9686>

comment:10 in reply to:  6 Changed 4 years ago by michaelld (Michael Dickens)

Replying to kencu:

so it looks like to make all that happen, Michael did this little tweak:

Yeah that was a quick and dirty test to see if it would allow Qt5.15 on ARM64 ... and it did! Not a robust solution, as you note!

comment:11 in reply to:  8 Changed 4 years ago by michaelld (Michael Dickens)

What's going on here that needs fixing? I'm not familiar with this code at all ... so looking at it as a total N00B :)

Replying to kencu:

we're also going to have the fix up the default universal_archs_supported in this bit if we want to try to build qt5 universal for arm64/x86_64

    proc universal_setup {args} {
        if {[variant_exists universal]} {
            ui_debug "universal variant already exists, so not adding the default one"
        } elseif {[exists universal_variant] && ![option universal_variant]} {
            ui_debug "universal_variant is false, so not adding the default universal variant"
        } elseif {[exists use_xmkmf] && [option use_xmkmf]} {
            ui_debug "using xmkmf, so not adding the default universal variant"
        } elseif {![exists os.universal_supported] || ![option os.universal_supported]} {
            ui_debug "OS doesn't support universal builds, so not adding the default universal variant"
        } elseif {[llength [option supported_archs]] == 1} {
            ui_debug "only one arch supported, so not adding the default universal variant"
        } else {
            ui_debug "adding universal variant via PortGroup muniversal"
            uplevel "PortGroup muniversal 1.0"
            uplevel "default universal_archs_supported {\"i386 x86_64\"}"
        }
    }

comment:12 Changed 4 years ago by kencu (Ken)

Well, first, I guess we have to decide if we want to make an attempt to even build qt5 +universal for arm64/X86_64 at all -- but I guess we probably do.

This bit of code in the qt5 PortGroup is trying to force universal to work -- and down at the end, using the muniversal PG (which we may or may not be relegated to use) it forces i386/x86_64 as forever, those were the only universal archs anyone cared about.

So this is going to be a project, possibly, to get it building universal... baby steps :>

comment:13 Changed 4 years ago by kencu (Ken)

Resolution: fixed
Status: assignedclosed

In a2c52834ba289e4c7dfef7548a868258014efdda/macports-ports (master):

qt5 PortGroup: support arm64

at present only on qt5.15.x and above
universal builds not tested as yet

closes: #60944

Note: See TracTickets for help on using tickets.