Build our own cctools for macOS cross-compilation
Ray Donnelly has been working on merging his OSX cross compiler patches into the crosstools-ng project, which should allow us to more easily build his compilers from source instead of relying on a binary blob.
Jotting down Ray's instructions in case anyone wants to try this:
On Linux it is possible now to build the equivalent of what toolchain4 provided (for OSX only - iOS still has some build issues)
You should be able to clone: https://github.com/diorcety/crosstool-ng.git
.. checkout the cctools-llvm branch, and enter:
./configure --prefix=<SOMEWHERE>/ct-ng-build
make
make install
export PATH="${PATH}":<SOMEWHERE>/ct-ng-build
mkdir <SOMEWHEREELSE>/ct-ng-final
cd <SOMEWHEREELSE>/ct-ng-final
ct-ng list-samples
ct-ng i686-apple-darwin11 (or i686-apple-darwin10)
Check the differences between samples/i686-apple-darwin11 and samples/i686-apple-darwin10 too, the main one being that 10 copies the sysroot into the final build whereas 11 doesn't. This means you need to pass --sysroot to the compilers built with 11 but in theory don't need to for the 10 ones (of course 10 is set up to use MacOSX10.6.sdk while 11 is set up to use MacOSX10.7.sdk).
We've been adding clang to the project most recently which has caused us to disabled llvm-gcc for now and the addition of clang isn't ready yet (it is nearly there but I am going on holiday for 2 weeks after this week so I'm not sure if we will get it finished before then - likely not).
So, all the above instructions are still valid; go with commit 7d555f284b6977e64640a30bcec77597580d3049 if you can. Any problems give me a shout. FWIW, llvm/clang is only now coming on-line for Darwin software anyway, and vanilla gcc-4.2 (i.e. not even llvm-gcc-4.2) is much more reliable for building OSX software. Seems Apple focussed more on iOS than OSX for clang.
Let me know how it goes. We've started to submit some patches upstream to crosstool-ng this last week, but I have a feeling it could be a drawn out process. We will regularly merge the other way the meantime though.