How to cross-compile Qt 6.5 for aarch64 (including tools)
-
I'd like to cross-compile Qt 6.5 so that I can use the Qt installation on an aarch64 system. I've found some tutorials for cross-compiling, but all of them only build the Qt libraries for aarch64. When I try to use the Qt installation on an aarch64 system, qmake is actually a script which executes the host qmake (x86_64). I need to cross-compile qmake and the other tools too.
I've followed this tutorial: https://wiki.qt.io/Cross-Compile_Qt_6_for_Raspberry_Pi
It builts Qt which can be used to cross-compile an application. However, I need to use the Qt I built on an aarch64 system. Is this possible? I need this in CI and I don't want to build Qt in aarch64 container using QEMU because it's too slow. -
@adazem009 said in How to cross-compile Qt 6.5 for aarch64 (including tools):
When I try to use the Qt installation on an aarch64 system, qmake is actually a script which executes the host qmake (x86_64)
That's the whole point of cross compilation: the libs are built for the target platform but the tools needed for building are built for host/development platform, because cross compilation is done on that platform, not on target platform. So, why do you need qmake on the target platform?
-
@jsulm said in How to cross-compile Qt 6.5 for aarch64 (including tools):
@adazem009 said in How to cross-compile Qt 6.5 for aarch64 (including tools):
When I try to use the Qt installation on an aarch64 system, qmake is actually a script which executes the host qmake (x86_64)
That's the whole point of cross compilation: the libs are built for the target platform but the tools needed for building are built for host/development platform, because cross compilation is done on that platform, not on target platform. So, why do you need qmake on the target platform?
I want to build an AppImage for aarch64 using linuxdeploy and linuxdeploy-plugin-qt. However, it uses qmake, probably to determine the Qt modules my application uses. I've already tried to point linuxdeploy to the cross-compilation toolchain (it uses tools such as
strip
), but the x86_64 qmake couldn't determine any Qt modules from the executable. -
@adazem009 said in How to cross-compile Qt 6.5 for aarch64 (including tools):
but the x86_64 qmake couldn't determine any Qt modules from the executable
You have to use qmake from your cross compiled Qt