<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>DoK - Where Dreams Come From &#187; iphone</title>
	<atom:link href="http://ansani.it/tag/iphone/feed/" rel="self" type="application/rss+xml" />
	<link>http://ansani.it</link>
	<description>C'è chi vede il bicchiere mezzo pieno e chi lo vede mezzo vuoto... Per me, l'acqua che manca, è traboccata fuori ;)</description>
	<lastBuildDate>Mon, 22 Aug 2011 14:48:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
<image>
<link>http://ansani.it</link>
<url>http://ansani.it/wp-content/plugins/maxblogpress-favicon/icons/favicon-21.ico</url>
<title>DoK - Where Dreams Come From</title>
</image>
		<item>
		<title>ansani.it is finally iPhone ready :)</title>
		<link>http://ansani.it/2008/12/16/ansaniit-is-finally-iphone-ready/</link>
		<comments>http://ansani.it/2008/12/16/ansaniit-is-finally-iphone-ready/#comments</comments>
		<pubDate>Tue, 16 Dec 2008 11:15:34 +0000</pubDate>
		<dc:creator>Salvatore Ansani</dc:creator>
				<category><![CDATA[Personale]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[iPod]]></category>

		<guid isPermaLink="false">http://ansani.it/?p=908</guid>
		<description><![CDATA[Hi guys, thanks to WPTouch plugin my blog site is iPhone / iPod Touch ready Look @ screenshot !!!]]></description>
			<content:encoded><![CDATA[<p>Hi guys,</p>
<p>thanks to <a href="http://www.bravenewcode.com/wptouch/" target="_blank">WPTouch</a> plugin my blog site is iPhone / iPod Touch ready <img src='http://ansani.it/wp-includes/images/smilies/icon_wink.gif' alt="icon wink ansani.it is finally iPhone ready :)" class='wp-smiley' title="ansani.it is finally iPhone ready :)" /> </p>
<p>Look @ screenshot !!!</p>
<p><img class="alignnone size-full wp-image-909" title="ansani.it Screenshoot from iPhone" src="http://ansani.it/wp-content/uploads/2008/12/iphonescrsht.jpg" alt="iphonescrsht ansani.it is finally iPhone ready :)" width="320" height="480" /></p>
]]></content:encoded>
			<wfw:commentRss>http://ansani.it/2008/12/16/ansaniit-is-finally-iphone-ready/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Build the toolchain for iPhone 2.0.x on MacOSX 10.5.x</title>
		<link>http://ansani.it/2008/08/12/build-the-toolchain-for-iphone-20x-on-macosx-105x/</link>
		<comments>http://ansani.it/2008/08/12/build-the-toolchain-for-iphone-20x-on-macosx-105x/#comments</comments>
		<pubDate>Tue, 12 Aug 2008 13:09:33 +0000</pubDate>
		<dc:creator>Salvatore Ansani</dc:creator>
				<category><![CDATA[Tech Tips]]></category>
		<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://ansani.it/?p=576</guid>
		<description><![CDATA[Hi guys !!! this is another (!?!?!?!) document on how to compile a toolchain for iPhone (with firmware 2.0.x) on MaxOSX 10.5.x. First of all, why a new document ?!?!?!? Simple question and simple response: &#8220;Because other documents I found on Internet don&#8217;t work for me, so I decided to mix infoz from the NET [...]]]></description>
			<content:encoded><![CDATA[<p>Hi guys !!!<br />
this is another (!?!?!?!) document on how to compile a toolchain for iPhone (with firmware 2.0.x) on MaxOSX 10.5.x. First of all, why a new document ?!?!?!? Simple question and simple response: &#8220;Because other documents I found on Internet don&#8217;t work for me, so I decided to mix infoz from the NET and try to make my toolchain&#8230; <img src='http://ansani.it/wp-includes/images/smilies/icon_smile.gif' alt="icon smile Build the toolchain for iPhone 2.0.x on MacOSX 10.5.x" class='wp-smiley' title="Build the toolchain for iPhone 2.0.x on MacOSX 10.5.x" />  and&#8230; finally it works !!!!!&#8221;</p>
<p>Most info about toolchain compilation I get from <a href="http://wikee.iphwn.org/howto:toolchain_on_leopard_aspen" target="_blank">this</a> good article from Saurik, NerveGas and Drudge.</p>
<p>First of all, you need terminal access to your Mac. If you don&#8217;t known how made an ssh/shell access, well&#8230; go away <img src='http://ansani.it/wp-includes/images/smilies/icon_wink.gif' alt="icon wink Build the toolchain for iPhone 2.0.x on MacOSX 10.5.x" class='wp-smiley' title="Build the toolchain for iPhone 2.0.x on MacOSX 10.5.x" /> <br />
Now, I hope you have installed bison, flex and a svn client&#8230; It&#8217;s OK ?!?!? Do you have ?!?!? OK&#8230; let&#8217;s go !!</p>
<p>Create a new directory iPhoneDevel and go on with llvm.<br />
Now, from shell:</p>

<div class="wp_codebox"><table><tr id="p57612"><td class="code" id="p576code12"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">svn</span> <span style="color: #c20cb9; font-weight: bold;">co</span> http:<span style="color: #000000; font-weight: bold;">//</span>llvm.org<span style="color: #000000; font-weight: bold;">/</span>svn<span style="color: #000000; font-weight: bold;">/</span>llvm-project<span style="color: #000000; font-weight: bold;">/</span>llvm<span style="color: #000000; font-weight: bold;">/</span>trunk llvm-svn <span style="color: #660033;">-r</span> <span style="color: #000000;">42498</span>
<span style="color: #7a0874; font-weight: bold;">pushd</span> llvm-svn
.<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--enable-optimized</span>
<span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #007800;">ENABLE_OPTIMIZED</span>=<span style="color: #000000;">1</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span>
<span style="color: #007800;">LLVMOBJDIR</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">pwd</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #7a0874; font-weight: bold;">popd</span></pre></td></tr></table></div>

<p>If you want to known why you&#8217;re still relegate to release 42498 of llvm, you need to read <a href="http://code.google.com/p/iphone-dev/issues/detail?id=70" target="_blank">these</a>.</p>
<p>Now, it&#8217;s time to checkout some iPhone devel tools:</p>

<div class="wp_codebox"><table><tr id="p57613"><td class="code" id="p576code13"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">svn</span> checkout http:<span style="color: #000000; font-weight: bold;">//</span>iphone-dev.googlecode.com<span style="color: #000000; font-weight: bold;">/</span>svn<span style="color: #000000; font-weight: bold;">/</span>trunk<span style="color: #000000; font-weight: bold;">/</span> iphone-dev
<span style="color: #7a0874; font-weight: bold;">pushd</span> iphone-dev
<span style="color: #7a0874; font-weight: bold;">pushd</span> include
<span style="color: #c20cb9; font-weight: bold;">svn</span> switch http:<span style="color: #000000; font-weight: bold;">//</span>iphone-dev.googlecode.com<span style="color: #000000; font-weight: bold;">/</span>svn<span style="color: #000000; font-weight: bold;">/</span>branches<span style="color: #000000; font-weight: bold;">/</span>include-<span style="color: #000000;">1.2</span>-sdk
<span style="color: #7a0874; font-weight: bold;">popd</span>
<span style="color: #7a0874; font-weight: bold;">pushd</span> odcctools
<span style="color: #c20cb9; font-weight: bold;">svn</span> switch http:<span style="color: #000000; font-weight: bold;">//</span>iphone-dev.googlecode.com<span style="color: #000000; font-weight: bold;">/</span>svn<span style="color: #000000; font-weight: bold;">/</span>branches<span style="color: #000000; font-weight: bold;">/</span>odcctools-<span style="color: #000000;">9.2</span>-ld
<span style="color: #7a0874; font-weight: bold;">popd</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>arm-apple-darwin
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> build<span style="color: #000000; font-weight: bold;">/</span>odcctools
<span style="color: #7a0874; font-weight: bold;">pushd</span> build<span style="color: #000000; font-weight: bold;">/</span>odcctools
..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>odcctools<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--target</span>=arm-apple-darwin <span style="color: #660033;">--disable-ld64</span></pre></td></tr></table></div>

<p>I compile for arm-apple-darwin platform, you can safely change this target with whatever you want <img src='http://ansani.it/wp-includes/images/smilies/icon_wink.gif' alt="icon wink Build the toolchain for iPhone 2.0.x on MacOSX 10.5.x" class='wp-smiley' title="Build the toolchain for iPhone 2.0.x on MacOSX 10.5.x" /> .<br />
Now, check if you have MacOSX 10.4u SDK (if not, simply download iphone SDK from Apple Site and install everything). If so, simply write this on shell:</p>

<div class="wp_codebox"><table><tr id="p57614"><td class="code" id="p576code14"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">INCPRIVEXT</span>=<span style="color: #ff0000;">&quot;-isysroot /Developer/SDKs/MacOSX10.4u.sdk&quot;</span></pre></td></tr></table></div>

<p>Now, compile party <img src='http://ansani.it/wp-includes/images/smilies/icon_smile.gif' alt="icon smile Build the toolchain for iPhone 2.0.x on MacOSX 10.5.x" class='wp-smiley' title="Build the toolchain for iPhone 2.0.x on MacOSX 10.5.x" /> </p>

<div class="wp_codebox"><table><tr id="p57615"><td class="code" id="p576code15"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">make</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span>
<span style="color: #7a0874; font-weight: bold;">popd</span></pre></td></tr></table></div>

<p>Ok, first BIG step is gone. Now it&#8217;s time to get iPhone FileSystem and mount to /usr/local/share/iphone-filesystem. If you don&#8217;t known how to obtain correct File System, simply read <a href="http://www.hackthatphone.com/20/decrypt_2_0_firmware.html" target="_blank">this</a> document.<br />
I assume you mounted correctly undecrypted dmg image so, go on mounting iPhone FS and compiling toolchain.</p>

<div class="wp_codebox"><table><tr id="p57616"><td class="code" id="p576code16"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>Volumes<span style="color: #000000; font-weight: bold;">/</span>BigBear5A347.M68OS <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>iphone-filesystem
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">HEAVENLY</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>iphone-filesystem
<span style="color: #7a0874; font-weight: bold;">pushd</span> include
.<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--with-macosx-sdk</span>=<span style="color: #000000; font-weight: bold;">/</span>Developer<span style="color: #000000; font-weight: bold;">/</span>SDKs<span style="color: #000000; font-weight: bold;">/</span>MacOSX10.4u.sdk
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">bash</span> install-headers.sh
<span style="color: #7a0874; font-weight: bold;">popd</span>
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> build<span style="color: #000000; font-weight: bold;">/</span>csu
<span style="color: #7a0874; font-weight: bold;">pushd</span> build<span style="color: #000000; font-weight: bold;">/</span>csu
..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>csu<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--host</span>=arm-apple-darwin
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span>
<span style="color: #7a0874; font-weight: bold;">popd</span></pre></td></tr></table></div>

<p>By now I tried successfully to compile gcc 4.0 with MacOSX 10.4u headers, so document I wrote assume you have downloaded and correctly installed these. I try to compile gcc 4.2 with 10.5.x headers and, if all was ok, I update this guide&#8230; stay tuneeeeeeeeeeeeeeed <img src='http://ansani.it/wp-includes/images/smilies/icon_smile.gif' alt="icon smile Build the toolchain for iPhone 2.0.x on MacOSX 10.5.x" class='wp-smiley' title="Build the toolchain for iPhone 2.0.x on MacOSX 10.5.x" /> </p>
<p>Let&#8217;s go:</p>

<div class="wp_codebox"><table><tr id="p57617"><td class="code" id="p576code17"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mv</span> llvm-gcc-<span style="color: #000000;">4.0</span>-iphone<span style="color: #000000; font-weight: bold;">/</span>configure llvm-gcc-<span style="color: #000000;">4.0</span>-iphone<span style="color: #000000; font-weight: bold;">/</span>configure.old
<span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">'s/^FLAGS_FOR_TARGET=$/FLAGS_FOR_TARGET=${FLAGS_FOR_TARGET-}/g'</span> llvm-gcc-<span style="color: #000000;">4.0</span>-iphone<span style="color: #000000; font-weight: bold;">/</span>configure.old <span style="color: #000000; font-weight: bold;">&gt;</span> llvm-gcc-<span style="color: #000000;">4.0</span>-iphone<span style="color: #000000; font-weight: bold;">/</span>configure
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>arm-apple-darwin<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>crt1.o \<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>arm-apple-darwin<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>crt1.10.5.o
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> build<span style="color: #000000; font-weight: bold;">/</span>llvm-gcc-<span style="color: #000000;">4.0</span>-iphone
<span style="color: #7a0874; font-weight: bold;">pushd</span> build<span style="color: #000000; font-weight: bold;">/</span>llvm-gcc-<span style="color: #000000;">4.0</span>-iphone
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">FLAGS_FOR_TARGET</span>=<span style="color: #ff0000;">&quot;-mmacosx-version-min=10.1&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">sh</span> ..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>llvm-gcc-<span style="color: #000000;">4.0</span>-iphone<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--enable-llvm</span>=<span style="color: #000000; font-weight: bold;">`</span>llvm-config --obj-root<span style="color: #000000; font-weight: bold;">`</span> \
<span style="color: #660033;">--enable-languages</span>=c,<span style="color: #c20cb9; font-weight: bold;">c++</span>,objc,obj-c++ <span style="color: #660033;">--target</span>=arm-apple-darwin <span style="color: #660033;">--enable-sjlj-exceptions</span> \
<span style="color: #660033;">--with-heavenly</span>=<span style="color: #007800;">$HEAVENLY</span> <span style="color: #660033;">--with-as</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>arm-apple-darwin-as \
<span style="color: #660033;">--with-ld</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>arm-apple-darwin-ld</pre></td></tr></table></div>

<p>Now, it&#8217;s time to patch <img src='http://ansani.it/wp-includes/images/smilies/icon_smile.gif' alt="icon smile Build the toolchain for iPhone 2.0.x on MacOSX 10.5.x" class='wp-smiley' title="Build the toolchain for iPhone 2.0.x on MacOSX 10.5.x" /> <br />
If you don&#8217;t patch, you receive a lot of garbage errors like these:</p>

<div class="wp_codebox"><table><tr id="p57618"><td class="code" id="p576code18"><pre class="bash" style="font-family:monospace;">..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>llvm-gcc-<span style="color: #000000;">4.0</span>-iphone<span style="color: #000000; font-weight: bold;">/</span>gcc<span style="color: #000000; font-weight: bold;">/</span>config<span style="color: #000000; font-weight: bold;">/</span>arm<span style="color: #000000; font-weight: bold;">/</span>lib1funcs.asm:<span style="color: #000000;">670</span>:garbage following instruction <span style="color: #660033;">--</span> <span style="color: #000000; font-weight: bold;">`</span>bls 11f<span style="color: #ff0000;">'
../../../llvm-gcc-4.0-iphone/gcc/config/arm/lib1funcs.asm:672:garbage following instruction -- `beq 12f'</span>
<span style="color: #c20cb9; font-weight: bold;">make</span><span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">2</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: <span style="color: #000000; font-weight: bold;">***</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>libgcc<span style="color: #000000; font-weight: bold;">/</span>.<span style="color: #000000; font-weight: bold;">/</span>_udivsi3_s.o<span style="color: #7a0874; font-weight: bold;">&#93;</span> Error <span style="color: #000000;">1</span></pre></td></tr></table></div>

<p>Why you obtain these errors ?????? Read <a href="http://code.google.com/p/iphone-dev/issues/detail?id=145" target="_blank">this</a> page about issue #145.<br />
How you can correct error ?!?!? Simply download <a href="http://iphone-dev.googlecode.com/issues/attachment?aid=-4811806783580725987&amp;name=lib1funcs.asm.diff" target="_blank">this</a> file and save it on iPhoneDevel directory and:</p>

<div class="wp_codebox"><table><tr id="p57619"><td class="code" id="p576code19"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">patch</span> ..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>llvm-gcc-<span style="color: #000000;">4.0</span>-iphone<span style="color: #000000; font-weight: bold;">/</span>gcc<span style="color: #000000; font-weight: bold;">/</span>config<span style="color: #000000; font-weight: bold;">/</span>arm<span style="color: #000000; font-weight: bold;">/</span>lib1funcs.asm ..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>lib1funcs.asm.diff</pre></td></tr></table></div>

<p>Now, final step <img src='http://ansani.it/wp-includes/images/smilies/icon_smile.gif' alt="icon smile Build the toolchain for iPhone 2.0.x on MacOSX 10.5.x" class='wp-smiley' title="Build the toolchain for iPhone 2.0.x on MacOSX 10.5.x" /> </p>

<div class="wp_codebox"><table><tr id="p57620"><td class="code" id="p576code20"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #007800;">LLVM_VERSION_INFO</span>=<span style="color: #000000;">2.0</span>-svn-iphone-dev-<span style="color: #000000;">0.3</span>-svn
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></td></tr></table></div>

<p>OKOKOKOKOKOKOKKOKOK <img src='http://ansani.it/wp-includes/images/smilies/icon_smile.gif' alt="icon smile Build the toolchain for iPhone 2.0.x on MacOSX 10.5.x" class='wp-smiley' title="Build the toolchain for iPhone 2.0.x on MacOSX 10.5.x" /> </p>
<p>Now all it&#8217;s OK with toolchain. All files are installed on /usr/local/arm-apple-darwin/ and you can safely compile all sources you want.</p>
<p>Before you go out, some little tips <img src='http://ansani.it/wp-includes/images/smilies/icon_smile.gif' alt="icon smile Build the toolchain for iPhone 2.0.x on MacOSX 10.5.x" class='wp-smiley' title="Build the toolchain for iPhone 2.0.x on MacOSX 10.5.x" /> </p>
<p>If you want to run your app on iPhone, you need to run &#8220;ldid -S YourApp&#8221; on your iPhone, otherwise you obtain &#8220;Killed&#8221; because your app need to be signed.</p>
<p>If you obtain a &#8220;Segmentation fault&#8221; error, a &#8220;Bus error&#8221; or a trap error on your iPhone when you try to launch your app, something went wrong with your main method. Remember, you need to use something like thah when you create your app:</p>

<div class="wp_codebox"><table><tr id="p57621"><td class="code" id="p576code21"><pre class="c" style="font-family:monospace;"><span style="color: #993333;">int</span> main<span style="color: #009900;">&#40;</span><span style="color: #993333;">int</span> argc<span style="color: #339933;">,</span> <span style="color: #993333;">char</span> <span style="color: #339933;">*</span>argv<span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
NSAutoreleasePool<span style="color: #339933;">*</span> pool <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span> <span style="color: #009900;">&#91;</span> NSAutoreleasePool alloc <span style="color: #009900;">&#93;</span> init <span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #993333;">int</span> AppReturn<span style="color: #339933;">;</span>
AppReturn <span style="color: #339933;">=</span> UIApplicationMain<span style="color: #009900;">&#40;</span> argc<span style="color: #339933;">,</span> argv<span style="color: #339933;">,</span> <span style="color: #009900;">&#91;</span>YourAppLicationName class<span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">return</span> AppReturn<span style="color: #339933;">;</span>
<span style="color: #009900;">&#91;</span> pool release <span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Finally, I suggest a Makefile like that when you try to compile <img src='http://ansani.it/wp-includes/images/smilies/icon_smile.gif' alt="icon smile Build the toolchain for iPhone 2.0.x on MacOSX 10.5.x" class='wp-smiley' title="Build the toolchain for iPhone 2.0.x on MacOSX 10.5.x" /> </p>

<div class="wp_codebox"><table><tr id="p57622"><td class="code" id="p576code22"><pre class="bash" style="font-family:monospace;">CC = <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>arm-apple-darwin-gcc-4.0.1
CFLAGS =  \
<span style="color: #660033;">-I</span><span style="color: #ff0000;">&quot;/usr/local/arm-apple-darwin/include/&quot;</span>  \
<span style="color: #660033;">-I</span><span style="color: #ff0000;">&quot;/usr/local/lib/gcc/arm-apple-darwin/4.0.1/include/&quot;</span> \
<span style="color: #660033;">-fobjc-abi-version</span>=<span style="color: #000000;">2</span> \
&nbsp;
<span style="color: #007800;">LD</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span>CC<span style="color: #7a0874; font-weight: bold;">&#41;</span>
LDFLAGS = \
<span style="color: #660033;">-fobjc-abi-version</span>=<span style="color: #000000;">2</span> \
<span style="color: #660033;">-lobjc</span>  -lstdc++.6 <span style="color: #660033;">-licucore</span> <span style="color: #660033;">-llockdown</span> -lz.1 -lxml2.2 \
<span style="color: #660033;">-framework</span> CoreFoundation       \
<span style="color: #660033;">-framework</span> Foundation   \
<span style="color: #660033;">-framework</span> UIKit        \
<span style="color: #660033;">-L</span><span style="color: #ff0000;">&quot;/usr/local/share/iphone-filesystem/usr/lib/&quot;</span> \
<span style="color: #660033;">-F</span><span style="color: #ff0000;">&quot;/usr/local/share/iphone-filesystem/System/Library/Frameworks/&quot;</span>       \
-bind_at_load
&nbsp;
<span style="color: #007800;">App</span>=YourAppName
&nbsp;
all:    $<span style="color: #7a0874; font-weight: bold;">&#40;</span>App<span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
$<span style="color: #7a0874; font-weight: bold;">&#40;</span>App<span style="color: #7a0874; font-weight: bold;">&#41;</span>: main.o YourAppName.o
$<span style="color: #7a0874; font-weight: bold;">&#40;</span>LD<span style="color: #7a0874; font-weight: bold;">&#41;</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span>LDFLAGS<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #660033;">-o</span> $<span style="color: #000000; font-weight: bold;">@</span> $^
&nbsp;
<span style="color: #000000; font-weight: bold;">%</span>.o:    <span style="color: #000000; font-weight: bold;">%</span>.m
$<span style="color: #7a0874; font-weight: bold;">&#40;</span>CC<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #660033;">-c</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span>CFLAGS<span style="color: #7a0874; font-weight: bold;">&#41;</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span>CPPFLAGS<span style="color: #7a0874; font-weight: bold;">&#41;</span> $<span style="color: #000000; font-weight: bold;">&lt;</span> <span style="color: #660033;">-o</span> $<span style="color: #000000; font-weight: bold;">@</span>
&nbsp;
clean:
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-f</span> <span style="color: #000000; font-weight: bold;">*</span>.o $<span style="color: #7a0874; font-weight: bold;">&#40;</span>App<span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></td></tr></table></div>

<p>Now, it&#8217;s all <img src='http://ansani.it/wp-includes/images/smilies/icon_smile.gif' alt="icon smile Build the toolchain for iPhone 2.0.x on MacOSX 10.5.x" class='wp-smiley' title="Build the toolchain for iPhone 2.0.x on MacOSX 10.5.x" /> </p>
<p>Good compiling <img src='http://ansani.it/wp-includes/images/smilies/icon_smile.gif' alt="icon smile Build the toolchain for iPhone 2.0.x on MacOSX 10.5.x" class='wp-smiley' title="Build the toolchain for iPhone 2.0.x on MacOSX 10.5.x" /> </pre>
]]></content:encoded>
			<wfw:commentRss>http://ansani.it/2008/08/12/build-the-toolchain-for-iphone-20x-on-macosx-105x/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Salvatore vs. iPhone 1 &#8211; 0 :)</title>
		<link>http://ansani.it/2008/08/12/salvatore-vs-iphone-1-0/</link>
		<comments>http://ansani.it/2008/08/12/salvatore-vs-iphone-1-0/#comments</comments>
		<pubDate>Tue, 12 Aug 2008 09:56:05 +0000</pubDate>
		<dc:creator>Salvatore Ansani</dc:creator>
				<category><![CDATA[Tech Tips]]></category>
		<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://ansani.it/?p=574</guid>
		<description><![CDATA[Ebbene si, sono emozionatissimo !!!! Dopo mille mila ore dedite al coding matto e disperato, sono riuscito finalmente a compilare correttamente la toolchain nativa per iPhone su MacOSX 10.5.x  e, cosa ancora più incommensurabilmente incommensurabile, a compilare, a linkare ed a far girare (GULP!!!!!) il primo programma su quel coso fetuso di iPhone 2.0.1 Ovviamente, [...]]]></description>
			<content:encoded><![CDATA[<p>Ebbene si, sono emozionatissimo !!!!</p>
<p>Dopo mille mila ore dedite al coding matto e disperato, sono riuscito finalmente a compilare correttamente la toolchain nativa per iPhone su MacOSX 10.5.x  e, cosa ancora più incommensurabilmente incommensurabile, a compilare, a linkare ed a far girare (GULP!!!!!) il primo programma su quel coso fetuso di iPhone 2.0.1 <img src='http://ansani.it/wp-includes/images/smilies/icon_smile.gif' alt="icon smile Salvatore vs. iPhone 1   0 :)" class='wp-smiley' title="Salvatore vs. iPhone 1   0 :)" /> </p>
<p>Ovviamente, fra qualche ora aggiornerò il post con i comandi utilizzati per il toolchain ed i tips (una marea&#8230;) per &#8220;correggere&#8221; le applicazioni in modo che non diano mille mila trap error sul &#8220;melacosino&#8221;&#8230; <img src='http://ansani.it/wp-includes/images/smilies/icon_smile.gif' alt="icon smile Salvatore vs. iPhone 1   0 :)" class='wp-smiley' title="Salvatore vs. iPhone 1   0 :)" /> </p>
<p>Stay TUNED !!!!!</p>
]]></content:encoded>
			<wfw:commentRss>http://ansani.it/2008/08/12/salvatore-vs-iphone-1-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPhone 2.0 and Killed message&#8230; A solution :)</title>
		<link>http://ansani.it/2008/07/30/iphone-20-and-killed-message-a-solution/</link>
		<comments>http://ansani.it/2008/07/30/iphone-20-and-killed-message-a-solution/#comments</comments>
		<pubDate>Wed, 30 Jul 2008 05:30:58 +0000</pubDate>
		<dc:creator>Salvatore Ansani</dc:creator>
				<category><![CDATA[Tech Tips]]></category>
		<category><![CDATA[devel]]></category>
		<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://ansani.it/?p=544</guid>
		<description><![CDATA[So, you wrote your first application on iPhone, you compiled without any error, you downloaded on PDA and&#8230; a strange Killed message appear&#8230; GRRRRRRRR &#8220;/(&#38;(/&#8221;$!)&#8221;$!)&#8221;$()!&#8221;)$&#8221;. I tried lot of ancestrals rites before solution [Tech Mode On] You need to sign your app before iPhone can run it If you, like me, are still waiting damn [...]]]></description>
			<content:encoded><![CDATA[<p>So, you wrote your first application on iPhone, you compiled without any error, you downloaded on PDA and&#8230; a strange Killed message appear&#8230; GRRRRRRRR &#8220;/(&amp;(/&#8221;$!)&#8221;$!)&#8221;$()!&#8221;)$&#8221;.</p>
<p>I tried lot of ancestrals rites before solution <img src='http://ansani.it/wp-includes/images/smilies/icon_smile.gif' alt="icon smile iPhone 2.0 and Killed message... A solution :)" class='wp-smiley' title="iPhone 2.0 and Killed message... A solution :)" /> </p>
<p><strong>[Tech Mode On]</strong> You need to sign your app before iPhone can run it <img src='http://ansani.it/wp-includes/images/smilies/icon_sad.gif' alt="icon sad iPhone 2.0 and Killed message... A solution :)" class='wp-smiley' title="iPhone 2.0 and Killed message... A solution :)" />  If you, like me, are still waiting damn Apple certs, you can use <em>ldid </em>(install it with <strong><em>apt-get install ldid</em></strong> directly on your iPhone). Syntax is very very very simple: <em><strong>ldid -S YourUnsignedAppt</strong></em>.</p>
<p>Enjoy iPhone <img src='http://ansani.it/wp-includes/images/smilies/icon_smile.gif' alt="icon smile iPhone 2.0 and Killed message... A solution :)" class='wp-smiley' title="iPhone 2.0 and Killed message... A solution :)" /> </p>
]]></content:encoded>
			<wfw:commentRss>http://ansani.it/2008/07/30/iphone-20-and-killed-message-a-solution/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

