[Development] Darwin (OSX and iOS) cross compilers for Linux and Windows (and Darwin).

Ray Donnelly mingw.android at gmail.com
Fri May 4 10:44:10 CEST 2012


First of all, I hope this isn't too off topic for this list; I'll be
looking to use qbs with these compilers to build Necessitas Qt Creator
fwiw. If cross posting to both the qbs and qt developers mailing lists
is frowned upon then accept my apologies.. Having said that, I
would've posted this to the qt-interest list too if I'd proved that I
can build qt apps on Linux targeting OS X, but I won't get round to
that until I've finished some Android NDK work using these

I've been busying myself lately with some cross compilers targeting
Darwin. I've compiled both gcc and llvmgcc and am fairly up to date
with Apple's releases. Here are the links:


..release notes with changelog can be found at:


Both i686 and x86_64 (+multiarch) works for OS X, and both armv6 and
armv7 (+multiarch) works for iOS. I've expended a reasonable amount of
effort to make sure that the toolchains are relocatable, so you should
be able to put them where you want (provided you maintain the relative
layout of course)

You also need to provide your own MacOSX10.7.sdk or iPhone4.3.sdk as I
can't legally distribute these. I haven't tested with any other
versions but most like they'll work fine.

The compiler driver programs (which enable multiple -arch flags) are
in the apple-osx/bin and apple-ios/bin folders and their names follow
the pattern:


..where {-llvm} is optional.

It's not necessary to add apple-osx/bin or apple-ios/bin to your PATH,
though for some configury scripts this will be required.

To pass the SDK location, use --sysroot $somewhere/MacOSX10.7.sdk or
..for OS X, you should add (something like) -mmacosx-version-min=10.5
..and for iOS you should add (something like) -miphoneos-version-min=2.0

I've tested these far as as compiling and executing the entire Google
Android NDK (build machine was GNU/Linux x86) and as far as compiling
and executing "Hello World", both C and C++ on iPhone (build machine
was Win32).

The executables are 32bit for all 3 hosts.

Bug reports to mingw.android at gmail dot com would be very welcome.

Best regards,

Ray Donnelly.

More information about the Development mailing list