I have a jailbroken (evasi0n) 4th generation iPad, with iOS 6.1 firmware.
Through Cydia I've installed Mobile Terminal, version 520-2.
Then, following this tutorial, I've downloaded and installed CSU, Link Identify Editor, LibGCC, GCC and Headers/Libraries.
During installation there were not any problems.
The tutorial and the project are updated respectively to Feb 15, 2012 and Feb 18, 2012, so they work fine till iOS 5.x (I've tested the procedure on my iPhone 4S, iOS 5.1.1 and it works, so I can compile and execute C code on the device)
But in Mobile Terminal, on iPad (iOS 6.1) when I type
$ gcc
I get
Illegal instruction: 4
I searched a lot during these days, but I can't find anything about GCC on iOS 6.x, since the last recent discussion about that is updated at Oct 12, 2012, while evasi0n jailbreak procedure has been possible starting from Feb 4, 2013.
Thanks for any help.
UPDATE
It seems (from the answers) that the problem is not related to iOS 6.x firmware, but to A6/A6X Chip, respectively on iPhone 5 and iPad 4th generation.
Some software must be rebuilt with ARMv7s support. GCC is one of them.
To recompile with ARMv7 you have to run gcc with the -arch ARMv7
option and use latest SDK (6.0 or 6.1, I don't think it will work with old SDK versions but you can try). Next, create a fat binary using lipo
so it will work on multiple architectures.
[This issue in official iphone-gcc-full page] (http://code.google.com/p/iphone-gcc-full/issues/detail?id=6)