iPhone Toolchain for Leopard – Version 0.30
By popular demand…
Here’s a script to make your Apple OS X Leopard 10.5.1-based toolchain setup easier. Be sure your iPhone (Heavenly) directory is extracted to /usr/local/share/iphone-filesystem before using the script.
Move the script to the directory of your choice, and in that directory try:
sudo bash ./leopard_toolchain.sh
If you’re feeling lucky, run the script straight from this website:
curl http://kevinchiu.org/leopard_toolchain.sh|sudo bash
Here’s a repository that you’re welcome to contribute changes to: http://github.com/kevinchiu/iPhone-Toolchain/tree/master
MalloxCast » [How To] Développer des applications pour l’iPhone/iPod Touch sous Leopard 6:27 am on January 26, 2008 Permalink
[...] Une fois ceci fait, j’ai utilisé le script de Kevin Chiu, qui automatise l’installation du reste de la toochain (étapes qui sont [...]
wolf 10:50 pm on January 27, 2008 Permalink
Hey Kevin,
thanks a lot for providing this. It seems like the combination of Mac OS X 10.5.1 and the toolchain do not allow anymore to compile C++ programs.
From what I understand the sjlj exception handling is not supported by LLVM … this did not show up with XCode 2.5 and Mac OS X 10.4.11 … strange.
wolf 11:30 pm on January 27, 2008 Permalink
so it turns out the workaround is to specify
CFLAGS= -DDEBUG -Wall -fno-exceptions
in the makefile
Milan 3:53 am on January 31, 2009 Permalink
Hello, thank you for the tool. Unfortunately I just managed to compile the toolchain on my own :). I am a bit confused though, because theiphonewiki.com mentions TWO toolchains. One named “toolchain” is made this way from scratch, the other one being named “toolchain 2.0″ and only available by using iPhone SDK. Does that mean this toolchain is not preferred / good for building binaries on iPhone OS 2.x ?
Kevin Chiu 2:50 pm on February 1, 2009 Permalink
Hi Milan,
This tool chain was created before the existence of the iPhone SDK; so, I’m not sure if it’s compatible with iPhone OS 2.0. I suggest using the official SDK if you can spare the $99.
cycologist 6:40 am on June 29, 2009 Permalink
I tried to build using Sauriks description, and your script and fixes here.
Both ways I get stuck with an error message when linking, using a vfdecrypted iphone-filesystem from version 3.0: The error message says:…
…
BUILD_PREFIX=”" \
BUILD_PREFIX_1=”loser-” \
LANGUAGES=”" \
LIBGCC2_CFLAGS=”-O2 -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-pro
totypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fPIC -
pipe -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED ” \
MULTILIB_CFLAGS=”" T= crt3.o
make[3]: `crt3.o’ is up to date.
/Users/matthias/home/iphone-dev/iphone-dev/build/llvm-gcc-4.0-iphone/gcc/xgcc -B
/Users/matthias/home/iphone-dev/iphone-dev/build/llvm-gcc-4.0-iphone/gcc/ -mmaco
sx-version-min=10.1 -B/usr/local/arm-apple-darwin/bin/ -B/usr/local/arm-apple-da
rwin/lib/ -isystem /usr/local/arm-apple-darwin/include -isystem /usr/local/arm-a
pple-darwin/sys-include -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-proto
types -Wmissing-prototypes -Wold-style-definition -isystem ./include -fPIC -pi
pe -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -dynamiclib -no
defaultlibs -install_name /usr/lib/libgcc_s`if test . = ppc64 ; then echo _. ; f
i`.1.dylib -single_module -o ./libgcc_s.1.dylib.tmp -Wl,-exported_symbols_list,l
ibgcc/./libgcc.map -compatibility_version 1 -current_version 1.0 libgcc/./_udiv
si3_s.o libgcc/./_divsi3_s.o libgcc/./_umodsi3_s.o libgcc/./_modsi3_s.o libgcc/.
/_dvmd_tls_s.o libgcc/./_muldi3_s.o libgcc/./_negdi2_s.o libgcc/./_lshrdi3_s.o l
ibgcc/./_ashldi3_s.o libgcc/./_ashrdi3_s.o libgcc/./_cmpdi2_s.o libgcc/./_ucmpdi
2_s.o libgcc/./_floatdidf_s.o libgcc/./_floatdisf_s.o libgcc/./_fixunsdfsi_s.o l
ibgcc/./_fixunssfsi_s.o libgcc/./_fixunsdfdi_s.o libgcc/./_fixdfdi_s.o libgcc/./
_fixunssfdi_s.o libgcc/./_fixsfdi_s.o libgcc/./_fixxfdi_s.o libgcc/./_fixunsxfdi
_s.o libgcc/./_floatdixf_s.o libgcc/./_fixunsxfsi_s.o libgcc/./_fixtfdi_s.o libg
cc/./_fixunstfdi_s.o libgcc/./_floatditf_s.o libgcc/./_clear_cache_s.o libgcc/./
_enable_execute_stack_s.o libgcc/./_trampoline_s.o libgcc/./__main_s.o libgcc/./
_absvsi2_s.o libgcc/./_absvdi2_s.o libgcc/./_addvsi3_s.o libgcc/./_addvdi3_s.o l
ibgcc/./_subvsi3_s.o libgcc/./_subvdi3_s.o libgcc/./_mulvsi3_s.o libgcc/./_mulvd
i3_s.o libgcc/./_negvsi2_s.o libgcc/./_negvdi2_s.o libgcc/./_ctors_s.o libgcc/./
_ffssi2_s.o libgcc/./_ffsdi2_s.o libgcc/./_clz_s.o libgcc/./_clzsi2_s.o libgcc/.
/_clzdi2_s.o libgcc/./_ctzsi2_s.o libgcc/./_ctzdi2_s.o libgcc/./_popcount_tab_s.
o libgcc/./_popcountsi2_s.o libgcc/./_popcountdi2_s.o libgcc/./_paritysi2_s.o li
bgcc/./_paritydi2_s.o libgcc/./_powisf2_s.o libgcc/./_powidf2_s.o libgcc/./_powi
xf2_s.o libgcc/./_powitf2_s.o libgcc/./_mulsc3_s.o libgcc/./_muldc3_s.o libgcc/.
/_mulxc3_s.o libgcc/./_multc3_s.o libgcc/./_divsc3_s.o libgcc/./_divdc3_s.o libg
cc/./_divxc3_s.o libgcc/./_divtc3_s.o libgcc/./_divdi3_s.o libgcc/./_moddi3_s.o
libgcc/./_udivdi3_s.o libgcc/./_umoddi3_s.o libgcc/./_udiv_w_sdiv_s.o libgcc/./_
udivmoddi4_s.o libgcc/./unwind-dw2_s.o libgcc/./unwind-dw2-fde-darwin_s.o libgcc
/./unwind-sjlj_s.o libgcc/./unwind-c_s.o -lc
/usr/local/bin/arm-apple-darwin-ld: /usr/local/share/iphone-filesystem/usr/lib/l
ibc.dylib unknown flags (type) of section 4 (__TEXT,__dof_magmalloc) in load com
mand 0
collect2: ld returned 1 exit status
make[2]: *** [libgcc_s.dylib] Error 1
make[1]: *** [stmp-multilib] Error 2
make: *** [install-gcc] Error 2
Kevin Chiu 1:51 am on June 30, 2009 Permalink
@cycologist
You should probably just install XCode. It’s free now.
palav 7:44 am on July 8, 2009 Permalink
@cycologist,
R u able to solve the issue?
I am also getting same error (I have already installed XCode)
ole2 3:38 am on August 21, 2009 Permalink
hello Kevin
you’ve forgot to mention to extract MacOSX10.4.Universal.pkg/Payload into /Developer folder before running your script too.
Kevin 4:00 am on August 21, 2009 Permalink
@ole2
Thanks for the reminder. I must have already had that in place for some reason.
ole2 5:15 am on August 21, 2009 Permalink
hello Kevin
thanks for keeping interest on feedbacks on your helpful script.
I have another suggestion is to remove sudo out of your script.
it’s better to have it executed like:
sudo bash ./leopard_toolchain.sh
cause some systems (like cygwin for ex.) do not own/handle sudo properly
I’m testing cygwin based builds of your script, also going to run it against MacOSX10.4u.sdk as well as MacOSX10.5.sdk.
I’ll let you know what else was missing.
Kevin Chiu 4:42 pm on August 21, 2009 Permalink
@ole2
I’ve created a repository (I added a link at the bottom of the article), and I’d be grateful for any updates you’d like to provide.
ole2 9:14 am on August 22, 2009 Permalink
hello Kevin
here is cygwin edition of build script:
git://gist.github.com/172795.git
no problem if you put or merge it with yours.
I basically reached the point, described by cycologist and see no way to bypass it yet.
if you’ll find the way, please inform.
thanks
ole2 9:23 am on August 22, 2009 Permalink
actually this link will be probably better one:
http://gist.github.com/172795#
I’d like to hear review feedback from you first before doing any merges and may be good to be able to exchange e-mails about.
Kevin Chiu 10:47 pm on August 23, 2009 Permalink
When I built this script – iPhone 3.0 wasn’t out yet – I’ll check in a bit.