|
Installation
Installation of the toolchain
Building the ToolchainThe toolchain version does not necessarily need to coincide with the running firmware on your target iPhone. For example, 2.2 software can run on a 2.1 iPhone and 2.1 software can run on a 2.2.1 iPhone and so on (this is a very general statement; software relying on private frameworks or certain version-specific features may require an exact version). You may also use any new version of the SDK to build older versions of the toolchain, for instance the 2.2.1 SDK can still be used to build the 2.1 toolchain (just change TOOLCHAIN_VERSION in the script). All that being said, the instructions below indicate how to build a toolchain specific to each recent major iPhone firmware version. Toolchain for firmware 3.0Before startingWe switched now to firmware 3.0. If you are interested in older firmwares see below. The firmware 3.0 support is very fresh. If you have some troubles please leave a comment or an issue. We are busy and don't have much time to maintain the toolchain.sh script. If you think you could help please drop a note. Checkout and get the filesFirst create a project directory and check out the latest copy of the toolchain builder. For Example: mkdir -p ~/Projects/iphone/ cd ~/Projects/iphone/toolchain svn checkout http://iphonedevonlinux.googlecode.com/svn/trunk/ ./ You will need to download the iPhone SDK 3.0 from Apple, which can be found here: http://developer.apple.com/iphone/ You can also choose to download the 3.0 or 3.0.1 firmware from Apple at this stage. If you do not, the script will download the firmware automatically (Firmare 3.0 iPhone(3G)). You can now copy the SDK and Firmware (if you have it) to the toolchain builder's directory: cd ~/Projects/iphone/toolchain mkdir -p files/firmware mv /path/to/iphone_sdk_3.0__leopard__9m2736__final.dmg files/ mv /path/to/iPhone1,2_3.0_7A341_Restore.ipsw files/firmware Packages needed to compile the toolchainBefore you start to build the firmware you need some packages installed on your system. Building the toolchain with gcc-4.2 on my debian amd64 failed. I use gcc-4.3. Here we provide a list of packages for Debian/Ubuntu apt-get install \ automake \ bison \ cpio \ flex \ g++ \ g++-4.3 \ g++-4.3-multilib \ gawk \ gcc-4.3 \ git-core \ gobjc-4.3 \ gzip \ libbz2-dev \ libcurl4-openssl-dev \ libssl-dev \ make \ mount \ subversion \ sudo \ tar \ unzip \ uuid \ uuid-dev \ wget \ xar \ zlib1g-dev \ If you are on 64 bit please install: apt-get install g++-4.3-multilib gcc-4.3-multilib gobjc-4.3-multilib Startup and buildNow the environment is set up, you can start the script with: chmod u+x toolchain.sh ./toolchain.sh all After all steps, the toolchain is in ./toolchain with the binaries in ./toolchain/pre/bin and the system in ./toolchain/sys/ After a rebuild you may get patch warnings/errors. Ignore them because the build tries to patch already patched files. With the newest version of the toolchain.sh script you can control the behaviour and the filesystem places of the toolchain file with environment vars: BUILD_DIR:
Build the binaries (gcc, otool etc.) in this dir.
Default: $TOOLCHAIN/bld
PREFIX:
Create the ./bin ./lib dir for the toolchain executables
under the prefix.
Default: $TOOLCHAIN/pre
SRC_DIR:
Store the sources (gcc etc.) in this dir.
Default: $TOOLCHAIN/src
SYS_DIR:
Put the toolchain sys files (the iphone root system) under this dir.
Default: $TOOLCHAIN/sys
example:
sudo BUILD_DIR="/tmp/bld" SRC_DIR="/tmp/src" PREFIX="/usr/local" SYS_DIR=/usr/local/iphone_sdk_3.0 ./toolchain.sh allToolchain for firmware 2.2 / 2.2.1The toolchain 2.2 is outdated. This is for historical reasons. First create a project directory and check out the latest copy of the toolchain builder. For Example: mkdir -p ~/Projects/iphone/ cd ~/Projects/iphone/toolchain svn checkout http://iphonedevonlinux.googlecode.com/svn/branches/2.2 ./ You will need to download the iPhone SDK 2.2.1 from Apple, which can be found here: http://developer.apple.com/iphone/ You can also choose to download the 2.2.1 firmware from Apple at this stage. If you do not, the script will download the firmware automatically. You can now copy the SDK and Firmware (if you have it) to the toolchain builder's directory: cd ~/Projects/iphone/toolchain mkdir -p files/firmware mv /path/to/iphone_sdk_2.2.1_file files/ mv /path/to/firmware2.2.1_file files/firmware Now the environment is set up, you can start the script with: chmod u+x toolchain.sh ./toolchain.sh all After all steps, the toolchain is in ./toolchain with the binaries in ./toolchain/pre/bin and the system in ./toolchain/sys/ Toolchain for firmware 2.1Support also exists for firmware 2.1. You can build it in much the same way as the instructions for 2.2 above, with the only variation being in the first command block: mkdir -p ~/Projects/iphone/ cd ~/Projects/iphone/toolchain svn checkout http://iphonedevonlinux.googlecode.com/svn/branches/2.1/ ./ Note: If you are supplying your own ipsw, it must be for firmware 2.1. However it is okay to use iPhone SDK 2.2, which can be downloaded from here: http://developer.apple.com/iphone/ as this still contains the required components. Testing the ToolchainIn the subversion repository is a directory called "apps" which contains a test application you can build and deploy for the iPhone. Regardless of whether you built a 2.1, 2.2 or 3.0 toolchain, the instructions for testing are the same. You will need an iPhone connected to your local network to do this. Navigate to the apps/HelloToolchain directory and run the following commands, noting that you must set "IP" to the address of your iPhone and change the path as appropriate: cd ~/Projects/iphone/apps/HelloToolchain IP=xxx.xxx.xxx.xxx PATH=../../toolchain/pre/bin/:$PATH make deploy After running the above commands successfully, your iPhone should respring and you should see a HelloToolchain icon on the home screen. Run it and it should display "HelloToolchain" on the screen on a white background. This should indicate that the toolchain has successfully compiled an application for your iPhone. Happy coding! Manual StepsThe instructions above recommend building the toolchain using the command: ./toolchain.sh all This command encompasses all stages of building the toolchain. If for any reason you need to repeat a part of the process or perform it in components, you may call the script in other ways. For example, the "all" action is equivalent to running: ./toolchain.sh headers ./toolchain.sh firmware ./toolchain.sh darwin_sources ./toolchain.sh build ./toolchain.sh clean A brief overview of the available actions and what they do, is available by running: ./toolchain.sh usage |
Sign in to add a comment
Hello, how i can install the package xar. I can't find it. Please help me!
somoro: what is your linux distribution?
My linux distrubtion is debian 4 r6.
Have you tried 'apt-get install xar'? I use ubuntu, which is based on debian, and it has such package. Also check your /etc/apt/sources.list
OK in which source is the package xar???
Does this work if one is using Cygwin as well?
Using Kubuntu 8.10 or similar:
If you get an error compiling dmg2img saying "Make sure you have libbz2 and libssl"
You need these packages:
sudo apt-get install zlib1g-dev sudo apt-get install libssl-dev sudo apt-get install libcurl4-openssl-dev
You may get much further after installing those packages.
Next you want:
sudo apt-get install gobjc sudo apt-get install g++
Thank you it works but where i can get code examples?
I think it would be nice if we could collect some open examples here. We only provide a simple HelloToolchainApp? (you should have seen it in the folder apps of the toolchain script).
I wrote a little introduction to an example from developer.apple.com (UICatalog) here: http://iphonedevlinux.wordpress.com/2009/02/23/how-to-compile-the-uicatalog-example-from-developerapplecom/. That example helped me a lot understanding the UI-elements.
Thanks this works great! The only issue I had on Ubuntu 8.10/bash was getting the HelloToolchain? project to work. Simply exporting IP=xxx.xxx.xxx.xxx and then running make deploy didn't work for me. I had to create a variable in the Makefile called IP. Once I did that the 'scp' and 'ssh' commands in the 'deploy' target worked.
CoreLocation? headers are missing after install. I copied them manually from the SDK dmg.
If added CoreLocation? to current trunk and branches/unstable. Thanks for your info.
Hi :) The script has worked perfectly up until the build part! (other than a failed mv earlier: mv: cannot move Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.2.1.sdk' to /home/matthew/Projects/iphone/toolchain/sdks/iPhoneOS2.2.1.sdk': Directory not empty , I'm not sure how important that is).
Output from ./toolchain.sh build ... Building cctools-iphone... Build progress logged to: toolchain/bld/cctools-iphone/make.log Build & install failed. Check make.log and install.log
make.log - nothing to be done for everything (I think I managed to get it to work by manually ./configure'ing and make'ing)
install.log - http://devhat.pastebin.com/f2a473227
Thanks in advance, Matt
Hello matthew3walker,
could you please give us some more information? Do you have some files in /home/matthew/Projects/iphone/toolchain/sdks/iPhoneOS2.2.1.sdk ? Did it compile if you tried it manually? Could you compile HelloToolchain? (see: Testing the toolchain above)? If I interpret the install.log you pasted at pastebin.com right compiling ar failed.
Regards, toelooper
Sorry, please ignore me. I did something stupid. I managed to get everything to compile by deleting the config.cache's which are in the repos (I think, it hasn't failed yet!). I submitted an issue :) Thanks for your wonderful tool! Matt.
Just thought i would add that this is a brilliant guide and is much simpler and easier than the other guides out there. Just a heads up, I have Ubuntu 8.10 on a HP Pavilion dv7 and i had to install git, gawk and xar. When i had done that it still didn't want to set up the environment so i installed a package called git-core which seemed to do the trick. Also i installed the packages 31337one suggested whilst i was downloading the firmware and that seemed to work also. Next i had ssh issues whereby i kept getting the message about the rsa key not being recognized. To overcome this i just deleted this file HomeFolder?/.ssh/known_hosts which allowed ssh to create a new one with the new key inside. Deployment was a bit buggy, i had to edit the makefile with the IP variable as louis_hi...@yahoo.com mentioned. So all in all this pretty much worked compiled fine and so did the UICatalog from the link above. The only small issue, no biggy, is the fact that i have to type in my password loads of times. Im not really a ssh or makefile expert but i wondered if there were any changes that i could do to this? Below ive posted the terminal output:
keegy@keegy-laptop:~/Projects/iphone/toolchain/apps/HelloToolchain?$ make deploy arm-apple-darwin9-gcc -c src/HelloToolchain?.m -o HelloToolchain?.o arm-apple-darwin9-gcc -lobjc -bind_at_load -framework Foundation -framework CoreFoundation? -framework UIKit -w -o HelloToolchain? HelloToolchain?.o root@192.168.2.246's password: sh: line 0: cd: /Applications/HelloToolchain?.app: No such file or directory not found root@192.168.2.246's password: HelloToolchain? 100% 61 0.1KB/s 00:00 icon.png 100% 1073 1.1KB/s 00:00 Info.plist 100% 746 0.7KB/s 00:00 HelloToolchain? 100% 14KB 13.6KB/s 00:00 root@192.168.2.246's password: keegy@keegy-laptop:~/Projects/iphone/toolchain/apps/HelloToolchain?$ make deploy arm-apple-darwin9-gcc -c src/HelloToolchain?.m -o HelloToolchain?.o arm-apple-darwin9-gcc -lobjc -bind_at_load -framework Foundation -framework CoreFoundation? -framework UIKit -w -o HelloToolchain? HelloToolchain?.o root@192.168.2.246's password: sh: line 0: cd: /Applications/HelloToolchain?.app: No such file or directory not found root@192.168.2.246's password: HelloToolchain? 100% 61 0.1KB/s 00:00 icon.png 100% 1073 1.1KB/s 00:00 Info.plist 100% 746 0.7KB/s 00:00 HelloToolchain? 100% 14KB 13.6KB/s 00:00 root@192.168.2.246's password: keegy@keegy-laptop:~/Projects/iphone/toolchain/apps/HelloToolchain?$
thanks, Kevin
To those having issues with the IP or PATH variables. You did copy/paste the command from the guide? It is strange that it did not work for you. Anyways, glad you got it working and putting the variables into the makefile will actually make it easier in the future since you won't have to specify it every time. Good luck and I hope to see some more examples :)
For me, the sample application installed itself in /Applications, but didn't show up on the springboard.
Apparently (this is according to some other webpage) because my iPhone is firmware 2.2.1, "killall SpringBoard?" is not enough - the Springboard caches application data so you must rebuild the cache.
If you have BossPrefs? installed you can do that by running /Applications/BossPrefs?.app/Respring. Surely there's some way to do it without third-party apps... anyone?
Hints for Ubuntu (probably apply to other Debian-based distros also) -- run the following before running the toolchain script:
sudo apt-get install git git-core gobjc
The script will inform you that you need 'git'. There's a package called git, but the 'git' application itself is located in another package called 'git-core'. Install both.
Additionally, you need the GNU Objective-C compiler installed, package 'gobjc'. The script won't inform you of this.
Otherwise the script is great, the whole process is painless, and this is the only one of three different methods I've tried that actually completes successfully and gives me a working build environment! Many thanks to the developer!
This is an awesome script... I did find a problem though in the firmware decryption key download. The web page link needs updating for the 2.x firmware. It's located here now:
http://www.theiphonewiki.com/wiki/index.php?title=VFDecrypt_Keys:_2.x
FYI, I updated the link in the script and it worked.
Another helpful hint...
On 64-bit systems you must install the 32-bit gcc...this will clear up any build problems with the scripts.
# apt-get install gcc-multilib
link: http://code.google.com/p/iphone-dev/issues/detail?id=14
Running the toolchain, it failed when mounting the decrypted image. It needed -t hfsplus added to the sudo mount line.
Had to change: IPHONEWIKI_KEY_URL="http://www.theiphonewiki.com/wiki/index.php?title=VFDecrypt_Keys" to: IPHONEWIKI_KEY_URL="http://www.theiphonewiki.com/wiki/index.php?title=VFDecrypt_Keys:_2.x"
In order for the script to find my 2.x decrypt key. Should set this URL based on first number of FW_PRODUCT_VERSION instead.
Built the toolchain on AMD64 (Debian), using gcc-multilib.
With firmware 2.2.1, the test application HelloToolchain? will only show up after executing the following (not part of build deploy script):
If you do not want to type your password every time you deploy, try this: http://www.twiphone.com/2008/08/07/how-to-login-into-your-iphone-via-ssh-with-no-password-but-with-key-authentification/
i successfully compiled the chain and the hellotoolchain sample runs on my ipod touch. now i am trying to make an opengles app, but it cannot find the <OpenGLES/gl.h> include... are there any further steps to make this work? where is e.g. the #import <UIKit/UIFont.h> and why does it work, but no opengles? greets
console output: Building cctools-iphone... Build progress logged to: toolchain/bld/cctools-iphone/make.log Build & install failed. Check make.log and install.log I getting too this message can anyone tell what should I do ?
Also modified IPHONEWIKI_KEY_URL="http://www.theiphonewiki.com/wiki/index.php?title=VFDecrypt_Keys:_2.x" in the script with success.
For the list of files to download from "darwin-tools.list", here is a list of alternative URLs that appear to be the same however do not require an Apple ID to download.
http://www.opensource.apple.com/tarballs/cctools/cctools-667.8.0.tar.gz
http://www.opensource.apple.com/tarballs/libsecurity_authorization/libsecurity_authorization-32564.tar.gz
http://www.opensource.apple.com/tarballs/libsecurity_cdsa_client/libsecurity_cdsa_client-32432.tar.gz
http://www.opensource.apple.com/tarballs/libsecurity_cdsa_utilities/libsecurity_cdsa_utilities-33506.tar.gz
http://www.opensource.apple.com/tarballs/libsecurity_cms/libsecurity_cms-32521.tar.gz
http://www.opensource.apple.com/tarballs/libsecurity_codesigning/libsecurity_codesigning-33803.tar.gz
http://www.opensource.apple.com/tarballs/libsecurity_cssm/libsecurity_cssm-32993.tar.gz
http://www.opensource.apple.com/tarballs/libsecurity_keychain/libsecurity_keychain-34101.tar.gz
http://www.opensource.apple.com/tarballs/libsecurity_mds/libsecurity_mds-32820.tar.gz
http://www.opensource.apple.com/tarballs/libsecurity_ssl/libsecurity_ssl-32463.tar.gz
http://www.opensource.apple.com/tarballs/libsecurity_utilities/libsecurity_utilities-32820.tar.gz
http://www.opensource.apple.com/tarballs/libsecurityd/libsecurityd-33470.tar.gz
http://www.opensource.apple.com/tarballs/DiskArbitration/DiskArbitration-183.tar.gz
http://www.opensource.apple.com/tarballs/IOKitUser/IOKitUser-388.2.1.tar.gz
http://www.opensource.apple.com/tarballs/IOGraphics/IOGraphics-193.2.tar.gz
http://www.opensource.apple.com/tarballs/IOHIDFamily/IOHIDFamily-258.3.tar.gz
http://www.opensource.apple.com/tarballs/IOStorageFamily/IOStorageFamily-88.tar.gz
http://www.opensource.apple.com/tarballs/IOCDStorageFamily/IOCDStorageFamily-39.tar.gz
http://www.opensource.apple.com/tarballs/IODVDStorageFamily/IODVDStorageFamily-26.tar.gz
http://www.opensource.apple.com/tarballs/WebCore/WebCore-351.9.tar.gz
http://www.opensource.apple.com/tarballs/CF/CF-476.14.tar.gz
http://www.opensource.apple.com/tarballs/configd/configd-210.tar.gz
http://www.opensource.apple.com/tarballs/xnu/xnu-1228.7.58.tar.gz
http://www.opensource.apple.com/tarballs/xnu/xnu-1228.3.13.tar.gz
http://www.opensource.apple.com/tarballs/Libc/Libc-498.tar.gz
http://www.opensource.apple.com/tarballs/launchd/launchd-258.1.tar.gz
http://www.opensource.apple.com/tarballs/DirectoryService/DirectoryService-514.23.tar.gz
http://www.opensource.apple.com/tarballs/JavaScriptCore/JavaScriptCore-466.1.tar.gz
Hey,
Is OpenGLES not installed with this script. It seems to be a pre-req for using QuartzCore? which is where CoreAnimation? lives.
Does anyone have any info on how to get QuartzCore? or CoreAnimation? to work?
Kevin kboylo(a--t)hotmail.com
hi, would you like to update this toolchain to IPHONE FW3.0? I really need it
hi, i too need toolchain for 3.0
This tutorial also works if you want to develop for FW3.0. But of course, you will only be restricted to the 2.2 API..
um... it cant find the decrypter file for the 2.2.1 firmware. help?
Worked perfectly for 2.1! I just had to change the following line in toolchain.sh:
IPHONEWIKI_KEY_URL="http://www.theiphonewiki.com/wiki/index.php?title=VFDecrypt_Keys:_2.x"
I had to append :_2.x to the URL.
Thank you very much for the hard work!
The script doesn't install the OpenGL ES headers, as others pointed out. Just adding something like
# OpenGLES echo "OpenGLES" mkdir -p OpenGLES cp -R -pf "${IPHONE_SDK_LIBS}"/OpenGLES.framework/Headers/* OpenGLES... somewhere in the toolchain_build function should take care of it.
in case you get this error: Make sure you have libbz2 and libssl available on your system
add: sudo apt-get install libbz2-dev
works a treat on ubuntu using the 3.0SDK and 3.0 3GS firmware.
Are there any tools or tutorials for porting unix commandline tools to the iPhone.
i imagine i need to get ./configure to use the toolchain instead of the native ubuntu tools, any tips?
thanks
Does anyone have a direct link to the iphone 3.0 SDK.
I have tried http://developer.apple.com/iphone/ which only seems to allow access to the 3.1 SDK.
Unfortunately this does not appear to work with the current toolchain.sh script
try this:
http://iphonesdkdev.blogspot.com/2009/06/use-xcode-312-to-build-sdk-30-app-to-30.html
Yep! It's worked!
Just wanted to say thank you! It is about time an up-to-date tool-chain was released for us non-mac users! :-) If you need any help with the 3.1.2 tool-chain please tell me as I am looking forward to it and hope you are still working on it!
Thanks again!!
Hi, I'm trying to build the toolchain for the 3.1.2 SDK with the 3.1 firmware, currently at the "Building gcc-4.2-iphone..." stage. Here are the modifications I made to toolchain.sh so far (in diff format) :
28c28 < TOOLCHAIN_VERSION="3.0" --- > TOOLCHAIN_VERSION="3.1.2" 124c124 < IPHONE_SDK="iphone_sdk_*_final.dmg" --- > IPHONE_SDK="iphone_sdk_*.dmg" 202c202 < if ! ${TOOLS_DIR}/vfdecrypt -i $1 -o $TMP_DECRYPTED -k $3 &> /dev/null; then --- > if ! ${TOOLS_DIR}/vfdecrypt -i $1 -o $TMP_DECRYPTED -k B9CD10DD88AB615C1963E8AA04950B12DD64E0E5B11EA63C79A02AF6DB62334C710D21DA &> /dev/null; then 354d353 < if [ "${TOOLCHAIN_VERSION}" == "3.0" ] ; then 356,360d354 < elif [[ "`vercmp $SDK_VERSION $TOOLCHAIN_VERSION`" == "newer" ]]; then < PACKAGE="iPhoneSDK`echo $TOOLCHAIN_VERSION | sed 's/\./_/g' `.pkg" < else < PACKAGE="iPhoneSDKHeadersAndLibs.pkg" < fi 415a410,411 > FW_FILE="/home/frederic/Projects/iphone/files/firmware/iPhone2,1_3.1_7C144_Restore.ipsw" >Comment by frederic...@free.fr, Oct 18 (2 days ago) Hi, I'm trying to build the toolchain for the 3.1.2 SDK with the 3.1 firmware, currently at the "Building gcc-4.2-iphone..." stage. Here are the modifications I made to toolchain.sh so far (in diff format) : 28c28 < TOOLCHAIN_VERSION="3.0" --- > TOOLCHAIN_VERSION="3.1.2" 124c124 < IPHONE_SDK="iphone_sdk_*_final.dmg" --- > IPHONE_SDK="iphone_sdk_*.dmg" 202c202 < if ! ${TOOLS_DIR}/vfdecrypt -i $1 -o $TMP_DECRYPTED -k $3 &> /dev/null; then --- > if ! ${TOOLS_DIR}/vfdecrypt -i $1 -o $TMP_DECRYPTED -k B9CD10DD88AB615C1963E8AA04950B12DD64E0E5B11EA63C79A02AF6DB62334C710D21DA &> /dev/null; then 354d353 < if [ "${TOOLCHAIN_VERSION}" == "3.0" ] ; then 356,360d354 < elif [[ "`vercmp $SDK_VERSION $TOOLCHAIN_VERSION`" == "newer" ]]; then < PACKAGE="iPhoneSDK`echo $TOOLCHAIN_VERSION | sed 's/\./_/g' `.pkg" < else < PACKAGE="iPhoneSDKHeadersAndLibs.pkg" < fi 415a410,411 > FW_FILE="/home/frederic/Projects/iphone/files/firmware/iPhone2,1_3.1_7C144_Restore.ipsw" >I tried with the 3.12 firmware, and changed this:
if ! ${TOOLS_DIR}/vfdecrypt -i $1 -o $TMP_DECRYPTED -k a8a886d56011d2d98b190d0a498f6fcac719467047639cd601fd53a4a1d93c24e1b2ddc6 &> /dev/null; thenhi , it reports error while trying make. the error msg logged into make.log:
I am try to build the toolchain for the 3.1.2 SDK with the 3.1.2 firmware, and it happens at the "Configuring gcc-4.2-iphone..." stage. Following is my pc:
frederic:
I believe the toolchain version should be rounded to 3.1 instead of putting in 3.1.2. I haven't tested this though.
I am experiencing the same problem as kvnkong. When compiling gcc-4.2-iphone I get the following error.
Here is some information about my environment:
Thanks!
Reported an issue: http://code.google.com/p/iphonedevonlinux/issues/detail?id=23
The MediaPlayer? headers aren't copied over from the toolchain adding MediaPlayer? to the for loop on line 745 should fix :)
I'm getting some weird behavior here. I got the HelloToolchain? application to install and run perfectly, but i cannot get any other to run normally, even not modyfing any code. (i.e HelloToolchain? renamed to HelloToolchain2?, changed in plist, changed object called in main(), etc etc).
The app compiles, links properly and appears in springboard, but it closes as soon as i open it. Something insteresting is that if i open the App over ssh on my cygwin console, and then open it on the phone, it will open properly and even toss the stdout to my cygwin console, which is something really useful. But i still don't know why the app doesn't run normally :S. Any tips with this?
fer662, fake codesign the app.
get LDID from cydia, then in morbileterminal, cd /(exectuabledir)/, ldid -S executable
-S = capital.
NVM, i got it working, somehow my apps were uploading with the wrong permissions, i just added a chmod in my makefile and my apps started appearing fine on springboard and loading :). How do people usually debug this stuff? I have been using the legit SDK at work since it was released and even if xCode is really crappy and crashes all the time it helps a bit to have a debugger. Or will printf's have to suffice?
Hi I just finished building the toolchain for the 3.1.2 SDK, and I deployed HelloToolchain?? :) this is my diff if anyone's interested:
28c28 < TOOLCHAIN_VERSION="3.1.2" --- > TOOLCHAIN_VERSION="3.0" 124c124 < IPHONE_SDK="iphone_sdk*.dmg" --- > IPHONE_SDK="iphone_sdk_*_final.dmg" 354c354 < if [ "${TOOLCHAIN_VERSION}" == "3.1.2" ] ; then --- > if [ "${TOOLCHAIN_VERSION}" == "3.0" ] ; then 521,531c521,529 < #DECRYPTION_KEY_SYSTEM=$( wget --quiet -O - $IPHONEWIKI_KEY_URL | awk '\ < # BEGIN { IGNORECASE = 1; } < # /name="3.0_.28Build_7A341.29"/ { found_3_0 = 1; } < # /name="Root_Filesystem"/ && found_3_0 { found_root = 1; } < # /title="'${HW_BOARD_CONFIG}'"/ && found_root { found_phone = 1; } < # /.*<pre>.*$/ && found_phone { < # sub(/.*<pre>/,"", $0); < # print toupper($0); exit; } < # ') < < DECRYPTION_KEY_SYSTEM="a8a886d56011d2d98b190d0a498f6fcac719467047639cd601fd53a4a1d93c24e1b2ddc6" --- > DECRYPTION_KEY_SYSTEM=$( wget --quiet -O - $IPHONEWIKI_KEY_URL | awk '\ > BEGIN { IGNORECASE = 1; } > /name="3.0_.28Build_7A341.29"/ { found_3_0 = 1; } > /name="Root_Filesystem"/ && found_3_0 { found_root = 1; } > /title="'${HW_BOARD_CONFIG}'"/ && found_root { found_phone = 1; } > /.*<pre>.*$/ && found_phone { > sub(/.*<pre>/,"", $0); > print toupper($0); exit; } > ')Freelance.c,
Which gcc version are you using? I am using 4.3 with Ubuntu 9.10 and 3.1.2 SDK and 3.1.2 FW and I still get the 'library not found for -lc' error. I've also tried gcc 4.2 and same result.
eddy
gcc (Ubuntu 4.3.2-1ubuntu12) 4.3.2
But I still had to copy libc.dylib to make it work because it's a symlink to libSystem.B.dylib
cp sdks/iPhoneOS3.1.2.sdk/usr/lib/libSystem.B.dylib toolchain/bld/gcc-4.2-iphone/gcc/libc.dylib
Thanks! That did it. I also found that if I place libc.dylib in toolchain/bld/sys/usr/lib, it works too.
Thanks to all the instructions listed above, I have my toolchain successfully compiled. However, when I tried to "make" in apps/HelloWorldFirst? I got this error:
>$ make >path/to/arm-apple-darwin9-g++ -I/path/to/toolchain/toolchain/sys/usr/include -lobjc -bind_at_load -w HelloWorldFirst?.c -o HelloWorldFirst? >ld: library not found for -lobjc >collect2: ld returned 1 exit status >make: HelloWorldFirst? Error 1
I googled and learnt that is caused by library of objective c (I am a newbie to objective c), but since everybody else seems to have proceeded smoothly, I am wondering the reason of this error as well as the solution to this problem. Any suggestion is appreciated. _
sorry, I forget my system info. OS: Fedora 10 GCC: gcc version 4.3.2 20081105 (Red Hat 4.3.2-7) (GCC)
lerrytang
Judging from this 'path/to/arm-apple-darwin9-g++ -I/path/to/toolchain/toolchain/sys/usr/include' it looks like you haven't changed the paths to where the sdk is located. Open up up the Makefile and change the CC variable to the location of the toolchain. For example on my setup i have copied the sdk to /usr/local/iphone so my path would be '/usr/local/iphone/pre/bin/arm-apple-darwin9-g++'. Alternatively you could add the toolchain path to the $PATH environment variable and leave the location in the Makefile as just 'arm-apple-darwin9-g++', doing this way would mean you do not have to modify the Makefile for each new project.
Thanks for the reply. I changed the path to the compiler, sorry for the ambiguity in my post. I rebuilt the environment and it magically worked correctly. Guess it was some error with library copying.
Hi all, I've successfully built "HelloToolChain?" and deployed it on my iphone 3.1.2. But it quits almost immediately, any suggestion? Thanks.
Plus, "HelloWorldFirst?" is also successfully built and can be run in MobileTerminal?, but the same problem occurs when it is deployed in /Application.
Hi all, i have a question when i ./toolchain.sh all, i get a error that ERROR: dmg image is corrupted In order to extract 018-5301-002.dmg, I am going to mount it. This needs to be done as root. mount: wrong fs type, bad option, bad superblock on /dev/loop0, missing codepage or helper program, or other error (could this be the IDE device where you in fact use ide-scsi so that sr0 or sda or so is needed?) In some cases useful info is found in syslog - try dmesg | tail or so
Failed to mount 018-5301-002.dmg. any suggeston? Thanks!!!
I recently upgraded my system to Ubuntu 9.10 and now the toolchain wont compile. The cctools fails with something to do with ld64. Seeing as my system is 32 bit i removed --enable-ld64 from the config and got rid of the lines making ld64 the default linker. Now cctools compiles but iphone-gcc complains that it can't find the linker. I don't know what to do i didn't have any of these problems when i was on 9.04.
Now i fixed the problem of it not finding the linker but now im getting problems with libgcc_s.dylib.
error building HelloToolchain?. it complains about objc library?