Monday, June 7, 2010

iPhone gcc for SDK 3.2 & iPad

iPhone gcc for SDK 3.2
(1) Install iphone gcc installed in your jailbroken iPad with firmware 3.2

iPhone gcc is available in Cydia. To install it in you need to do these


# assume you have installed APT 0.6 Transitional and Aptitude and wget in Cydia, so that you can use the command apt-get
# if libgcc is broken in Cydia, you have to install it manually before iphone-gcc
wget http://apt.saurik.com/debs/libgcc_4.2-20080410-1-6_iphoneos-arm.deb
dpkg -i libgcc_4.2-20080410-1-6_iphoneos-arm.deb
# install iphone-gcc
apt-get install iphone-gcc


Moreover, install these utilities via apt-get as well


apt-get install make ldid zip unzip wget


for editor in iPad you could use vim or nano

(2) Header files for toolchain and SDK 3.2

the header files for SDK 3.2 is available in one zipped tar file (sys32.tgz). You can download it (about 147M) here

(3) copy and untar the required headers and libraries (first copy to /var/mobile/sys32.tgz) and install it in iPad say

mkdir -p /var/toolchain/
cd /var/toolchain/
tar -xzvf /var/mobile/sys32.tgz


(4) Use this sample TabBarSample.zip and unzip it to test.

This TabBar sample source code is compatible with iPad and iPhone gcc, with auto-rotation and auto-resizing support.

http://apiexplorer.googlecode.com/files/TabBarSample.zip

wget http://apiexplorer.googlecode.com/files/TabBarSample.zip
unzip TabBarSample.zip
cd TabBarSample
make install





The package includes a new command line utility called appinstall, it is used to install compiled app to /var/mobile/Applications/* directory for iPad, it simulates the app install process via XCode.
.
.
.

8 comments:

Anonymous said...

works great ! thanks !

minor things I had to do to make it work :
1) install 'make' with cyndia on my ipad
2) install 'ldid' with 'apt-get install ldid'
3) downloading with safari sys32.tgz automaticly transform the file to sys32.tar after the end of the dowload. so on my mac, i had to do 'gzip -f sys32.tar' that produce a 'sys32.tar.gz' file that i transfered on the ipad with Cyberduck.

i think that's all. ilboued !

Kenn said...

Well, this works really good, but I've got problem if I try compiling any other app, like Apple Code Examples. I edit Makefile (projectname, resources and so on), rename files and everything. Compilation and installation of app goes well, but if I run app, it just loads and everything I see is black screen. And this really pissing me, cause this is first example I've been able to compile on my iPhone.

javacom said...

You have to remove or change the source code as well.
This compiler does not support Interface builder (xib) files.

See this example on how to change the source code
http://code.google.com/p/apiexplorer/source/detail?r=17

Andy Dam said...

Where can I get the source code for appinstall?

I'm really curious about it.

Shawn said...

I'm getting bus error with the tab sample...any clue? I'm running iPad 3.2.1
#uname
iPad 10.3.1 Darwin Kernel Version 10.3.1: Fri May 28 16:46:17 PDT 2010; root:xnu-1504.2.50~4/RELEASE_ARM_S5L8930X iPad1,1 arm K48AP Darwin
# make
arm-apple-darwin9-gcc -v --include TabBarSample_Prefix.pch -c -I"/var/toolchain/sys32/usr/include" -O0 -g0 -std=gnu99 -Diphoneos_version_min=3.2 -Wno-attributes -Wno-trigraphs -Wreturn-type -Wunused-variable -I./Classes -DDEBUGOFF Classes/ListViewController.m -o Classes/ListViewController.o
Using built-in specs.
Target: arm-apple-darwin9
Configured with: ../llvm-gcc-4.2/configure darwin9
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5555)
/usr/libexec/gcc/arm-apple-darwin9/4.2.1/cc1obj -quiet -v -I/var/toolchain/sys32/usr/include -I./Classes -D__DYNAMIC__ -Diphoneos_version_min=3.2 -DDEBUGOFF -include TabBarSample_Prefix.pch Classes/ListViewController.m -fPIC -fno-builtin-strcat -fno-builtin-strcpy -quiet -dumpbase ListViewController.m -maspen-version-min=2.0 -auxbase-strip Classes/ListViewController.o -g0 -O0 -Wno-attributes -Wno-trigraphs -Wreturn-type -Wunused-variable -std=gnu99 -version -o /var/tmp//cconlOeP.s
arm-apple-darwin9-gcc: Internal error: Bus error (program cc1obj)
Please submit a full bug report.
See for instructions.
make: *** [Classes/ListViewController.o] Error 1
# dpkg -l|grep gcc
ii iphone-gcc 4.2-20090304-1-9 a native c compiler _on_ the phone
ii libgcc 4.2-20080410-1-6 core library used by everything

Anonymous said...

The link for the header files is dead.

Leafy said...

Thank you, I had no problem installing and running using your code.

I have a question though, what did you develop the code on? Certainly not in MobileTerminal on your iPhone? Do you use XCode on a Mac, or is there some other IDE available (I'm using Ubuntu Linux, unfortunately). Any help or insight appreciated.

truehybridx said...

Hey can you make a sys40 or sys41?? or point out and easi(er) way to make it myself plz??