Build OSX crosstools for Linux
From PdaXrom embedded
The Build system include rules to create crosscompiler for OSX 10.5+ x86 and x86-64 architectures.
- Install the build system Getting the build system components
- Get appletv bsp sources
svn co http://pdaxrom.svn.sourceforge.net/svnroot/pdaxrom/trunk/pdaXrom-ng-bsp/appletv
- Build crosscompiler
cd pdaXrom-ng sudo ./build.sh ../appletv/build-crosstools-darwin.sh
- Cleanup sources
sudo ./build.sh ../appletv/build-crosstools-darwin.sh clean
- Compile hello world
cat >hello.c<<EOF
#include <stdio.h>
int main(int argc, char *argv[])
{
printf("Hello, World!\n");
return 0;
}
EOF
/opt/i686-apple-darwin10/toolchain/bin/i686-apple-darwin10-gcc hello.c -o hello
/opt/i686-apple-darwin10/toolchain/bin/i686-apple-darwin10-gcc hello.c -o hello-64 -m64
- Check the binaries
file hello hello-64 hello: Mach-O executable i386 hello-64: Mach-O 64-bit executable
- Show used shared libraries
/opt/i686-apple-darwin10/toolchain/bin/i686-apple-darwin10-otool -L ./hello ./hello-64 ./hello: /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 123.0.0) ./hello-64: /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 123.0.0)

