[Development] Proposing to move deploy tools to qtbase

Martin Storsjö martin at martin.st
Thu Nov 25 20:57:01 CET 2021


On Thu, 25 Nov 2021, Thiago Macieira wrote:

> macdeployqt is less of an issue because there's no good toolchain for cross-
> compiling to a Mac. Apple does not provide the sources for their ld64 linker, 
> for example.

They do provide sources for it, see e.g. 
https://opensource.apple.com/source/ld64/.

It is possible (although not very common) to do cross compilation to macOS 
- I maintain such a setup at https://github.com/mstorsjo/xcode-cross 
(based on repos where Thomas Pöchtrager maintain patched versions of 
cctools and ld64).

Cross compiling still requires a SDK root from Xcode (which afaik isn't 
redistributable), so my setup requires copying and stripping it down from 
a real Xcode install. (There are repos on github that provide the bare 
sysroots though, although I'm wouldn't bet on whether one can consider 
them redistributable like that - I haven't integrated scripts for making 
use of that.)

With this setup, I've successfully cross compiled at least Qt 5.x (I 
haven't tried with 6.x though). But I haven't used the qttools repo or the 
macdeployqt tool.

> I don't know if lld is a good replacement.

These days (last 6-12 months roughly) lld has become pretty mature for 
targeting macOS for x86_64 and aarch64 (AFAIK current release versions of 
Chrome are built with it), but I haven't tried hooking it up in my setups.

> Besides, they fork LLVM at an arbitrary point in the branch and may 
> patch it.

Yup. Apple's opensource releases usually lag 6-12 months behind their 
latest versions of Xcode, but it's not usually very important to have an 
exact match of the tools. (My cross compilation setup even uses vanilla 
llvm.org Clang instead of Apple'e version, and that works fine for the 
cases I've built so far.)

// Martin


More information about the Development mailing list