Here’s a quick how-to for people wondering how they can install the iPhone toolchain and try out their own command-line programs.
1. Jailbreak your iPhone and install ssh. You need full access to your iPhone’s file system.
2. Download a copy of the binary toolchain and unpack it onto your i386 Macintosh.
3. Copy arm-cc-specs to your home folder as .arm-cc-specs
4. Move the entire build (local-toolchain) into /usr/local/. (I don’t recommend breaking it out any further so you keep the entire install together.)
5. Edit .arm-cc-specs to match the location of your toolchain, e.g. /usr/local/local-toolchain/share/
6. Edit your path to include /usr/local/local.toolchain/bin and start a new window so the path matches up.
7. Create a new, standard helloworld.c
8. Attempt to compile it using arm-apple-darwin-cc, which will now be in your path. This will fail.
And now we come to the hard part. You either have to edit your system headers, which Apple made read-only for a reason, or load pre-updated headers, which you’ll have to google for. Editing headers basically goes like this: Whenever your compile fails, add || defined(__arm__) to any line that includes if or elif defined (__i386__). Repeat as needed until your hello world compiles. Then, copy your executable to your iPhone and test it there.