What's new? | Help | Directory | Sign in
Google
iphone-dev
iPhone development tools
  
  
  
  
    
Search
for
Updated Mar 11, 2008 by saurik
Labels: Featured, Phase-Deploy
Building  
How to build the toolchain.

Please note that these instructions are subject to change. Before updating your toolchain installation, you should always check the newest version of this page. You should also check Portability to see whether there are any special instructions for your particular platform.

FILE BUG REPORTS TO REPORT BUGS INSTEAD OF LEAVING BUGS AS COMMENTS ON THIS PAGE! THIS MEANS THAT IF THE TOOLCHAIN DOES NOT BUILD FOR YOU, DO NOT LEAVE A COMMENT HERE!

HOWTO build the toolchain

HOWTO obtain the Mac OS X headers on Linux or Windows

Gotchas


Comment by PhireN, Sep 09, 2007

An easy way to to extract the archive from the current dmg in linux is this:

dd if=xcode_2.4.1_8m1910_6936315.dmg skip=323904 | gunzip | pax -r

For other versions of the sdk you will need to find the offset of the correct Archive.pax.gz. You can do this with these 2 commands:

od -t x1 xcode.dmg | grep '^[0-7]*000 1f 8b' > offsets.txt
awk '{ print $1 }' offsets.txt | while read x; do dd if=xcode.dmg skip=$((0$x / 512)) count=1 | gunzip | cpio -t | grep -q MacOSX10.4u.sdk && echo $((0$x / 512)); done 2>/dev/null

Note: will need to put the proper file name of the xcode archive instead of 'xcode.dmg'

If you are worried about download size, it should be possible, using the range http header to download only the required part of the archive

Comment by mikelikespie, Sep 10, 2007

I was having issues building llvm, there's something wrong with the configure script (at least on my system). try putting --with-gxx-include-dir=/usr/local/arm-apple-darwin/include/c++/4.0.0 at the end when running ./configure

Comment by d...@linuxprogrammer.org, Sep 11, 2007

While doing the following sequence:

$ pushd csu
$ ./configure --host=arm-apple-darwin
$ sudo make install

I had to rerun aclocal before the sudo make install because I have autogen-1.9.6 on my system instead of 1.9.4 that was used to generate the aclocal.m4 file that is in the repo.

So the for me I had to do the following:

$ pushd csu
$ ./configure --host=arm-apple-darwin
$ sudo aclocal
$ sudo make install

-r2

Comment by roxfan, Sep 11, 2007

HFSExplorer can be used to extract .dmg files. Works on Windows, no idea about Linux. http://hem.bredband.net/catacombae/hfsx.html

Comment by nightwatch41, Sep 11, 2007

File bug reports, please. I can much better respond to them when they're bug reports and not comments here. Thanks!

Comment by onitake, Sep 12, 2007

If you want a relocatable SDK (like I do), add -isysroot /Your/SDK/Path to your CFLAGS and LDFLAGS.

-Wl,-syslibroot,/Your/SDK/Path does not work, but llvm-gcc will transform -isysroot to -syslibroot and override the one that's hardcoded into the binary.

Comment by jwriteclub, Sep 12, 2007

When it comes time to get the iPhone filesystem (the "HEAVENLY" step) be aware:

The 'premade' dmg on the linked page is missing some of the libraries and the tools cannot be built using it.

~ Christopher

Comment by noespamporfavor, Sep 12, 2007

Installed it now where the heck is the compiler? Anyone point me at a sample project/Makefile that shows where arm-apple-darwin-cc is and how to set up include/framework paths etc?

Install process works great but c'mon help a newb out here (and who isn't a newb iPhone developer)?

Comment by michael.mccaskill, Sep 12, 2007

Agreed. I finally successfully completed this process, but arm-apple-darwin-cc is not in /usr/local/bin.

Comment by pendorbound, Sep 12, 2007

arm-apple-darwin-cc is actually arm-apple-darwin-gcc in this version. There's a note to that effect on the iphone dev wiki. Either symlink arm-apple-darwin-cc to arm-apple-darwin-gcc, or modify your Makefile, and it should compile.

Comment by michael.mccaskill, Sep 12, 2007

Thank you very much. Is there any reason why we're using llvm-gcc-4.0 instead of llvm-gcc-4.2?

Comment by nightwatch41, Sep 12, 2007

LLVM-GCC 4.2 is very unstable at the moment. It should only be used if you're a GCC hacking wizard.

Comment by michael.mccaskill, Sep 12, 2007

I see. You sir, are cleary more a GCC hacking wizard that most of us. :)

Comment by brookstalley, Sep 12, 2007

This almost works on FreeBSD. odcctools doesn't compile, though, and that's a problem. All sorts of errors in the form:

In file included from /usr/include/stdlib.h:42,
                 from allocate.c:23:
/usr/include/sys/_types.h:99: error: conflicting types for '__mbstate_t'
..//include/i386/_types.h:74: error: previous declaration of '__mbstate_t' was here
In file included from allocate.c:23:
/usr/include/stdlib.h:52: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'size_t'
/usr/include/stdlib.h:89: error: expected declaration specifiers or '...' before 'size_t'

Any ideas? FreeBSD 7.0-current, amd64.

Comment by tee.el.gee, Sep 13, 2007

I have successfully installed the toolchain, but am not sure how to get started. I have downloaded the helloworld source and have tried compliling it, but I run into problems. I have changed the arm-apple-darwin-cc to arm-apple-darwin-gcc in the Makefile, but still no luck. Please help a newbie get started. Thanks for all of you hard work!

Comment by korobeynikov.anton, Sep 13, 2007
cc1: internal error: #pragma pack is already registered
make[4]: *** [crt3.o] Error 1
make[3]: *** [extra] Error 2
make[2]: *** [stmp-multilib] Error 2
make[1]: *** [all-gcc] Error 2
make: *** [all] Error 2

Is this with llvm-gcc 4.2 running on darwin? If yes - please file bug into LLVM bugzilla. It seems, something is wrong with my "pragma pack" patch.

Comment by rmspamfilter, Sep 13, 2007

In ubuntu when running ../llvm-gcc-4.0-iphone/configure --enable-llvm=$LLVMOBJDIR --enable-languages=c,c++,objc,obj-c++ \ --target=arm-apple-darwin --enable-sjlj-exceptions --with-heavenly=$HEAVENLY \ --with-as=/usr/local/bin/arm-apple-darwin-as --with-ld=/usr/local/bin/arm-apple-darwin-ld i get the following error

../libiberty/libiberty.a -L/iphone/llvm-svn/Release/lib -lpthread -ldl -lm \

cp/except.o: In function `nothrow_libfn_p': /iphone-dev/llvm-gcc-4.0-iphone-build/gcc/../../llvm-gcc-4.0-iphone/gcc/cp/except.c:918: undefined reference to `libc_name_p' collect2: ld returned 1 exit status make1?: [cc1plus-dummy] Error 1 make1?: Leaving directory `/iphone-dev/llvm-gcc-4.0-iphone-build/gcc' make: [all-gcc] Error

Comment by rmspamfilter, Sep 13, 2007

In ubuntu when running ../llvm-gcc-4.0-iphone/configure --enable-llvm=$LLVMOBJDIR --enable-languages=c,c++,objc,obj-c++ \ --target=arm-apple-darwin --enable-sjlj-exceptions --with-heavenly=$HEAVENLY \ --with-as=/usr/local/bin/arm-apple-darwin-as --with-ld=/usr/local/bin/arm-apple-darwin-ld i get the following error

../libiberty/libiberty.a -L/iphone/llvm-svn/Release/lib -lpthread -ldl -lm \

cp/except.o: In function `nothrow_libfn_p': /iphone-dev/llvm-gcc-4.0-iphone-build/gcc/../../llvm-gcc-4.0-iphone/gcc/cp/except.c:918: undefined reference to `libc_name_p' collect2: ld returned 1 exit status make1?: [cc1plus-dummy] Error 1 make1?: Leaving directory `/iphone-dev/llvm-gcc-4.0-iphone-build/gcc' make: [all-gcc] Error

Comment by m...@planet-rosen.com, Sep 13, 2007

The "can't locate file: -lc" is because HEAVENLY is either not defined correctly or because the DMG is not the right one - you need the full restore DMG , the .39 version, not the update DMG live and learn

Comment by gregory.dudek, Sep 13, 2007

It all works fine on Darwin/Intel, but on Darwin/PPC the C compiler (xgcc) hangs (!!) at one point (or at least I gave up after 900 CPU minutes) when compiling ../../llvm-gcc-4.0-iphone/gcc/libgcc2.c

Comment by pendorbound, Sep 13, 2007

Just wanted to drop a quick success report. Using an SVN pull from this afternoon, I'm up and compiling on my MacBookPro?.

Before this build, I manually obliterated anything in /usr/local that had 'arm' or 'llvm' in the name (careful with 'arm' as it's not a completely unique string -- there's stuff with arm in it that's important!). Then I rm -rf'd the llvm-svn and iphone-dev directories and checked them out. I built a fresh copy of GPM using Darwin Ports then built and installed LibStreams?. Finally I ran my shellscript that has all the instructions above in it.

For reference, the SVN revisions I've got: llvm: 41932 iphone-dev: 155 llvm-gcc-4.0: 41909 (Using this one) llvm-gcc-4.2: 41910 (NOT using this one)

So far both Hello and Books.app compile and work without issue.

Thanks for all the hard work in this!

Comment by avadh4all, Sep 14, 2007

Hi , I finally have successfully compiled and installed the toolchain on my 32 bit machine. I was trying it on 64 bit machine, even with chroot to 32 bit environment, it didnt work for me ..... :(

Now I m all set in SuSE 10.2 Intel Centrino Duo 32 bit.

Thanks for all the hard work you people has done.

Comment by samthedrummer, Sep 15, 2007

I keep getting this error when trying to compile the last time

make1?: No rule to make target /Users/samsoffes/iphone/_toolchain/iphone-dev/llvm-gcc-4.0-iphone-build/gcc/include/llvm/Intrinsics.gen', needed by llvm-convert.o'. Stop. make: [all-gcc] Error 2

Any fixes?

Comment by bnenning, Sep 15, 2007

I've tried to install the toolchain on OS X and Ubuntu Feisty. On both boxes everything appears to build and install, but when I try to compile the uikithelloworld app I get this output (after changing arm-apple-darwin-cc to arm-apple-darwin-gcc in the Makefile):

~/iphone/uikithelloworld$ make
arm-apple-darwin-gcc -c   hello.m -o hello.o
arm-apple-darwin-gcc -c   HelloApplication.m -o HelloApplication.o
arm-apple-darwin-gcc -ObjC -framework CoreFoundation -framework Foundation -framework UIKit -framework LayerKit -o Hello hello.o HelloApplication.o
/usr/local/bin/arm-apple-darwin-ld: Undefined symbols:
_objc_msgSend
_objc_msgSend_stret
collect2: ld returned 1 exit status
make: *** [Hello] Error 1
Comment by bnenning, Sep 15, 2007

Figured it out...I had to add "-lobjc" to the end of LDFLAGS in the Makefile. Now I can build iPhone binaries on both machines. Thanks very much for this guide and all your hard work.

Comment by gaxzerow, Sep 15, 2007

Confirmation (roxfan) that HFSExplorer (.dmg extractor) works on Linux (Fedora 7) with Sun's JVM (gij does not) http://hem.bredband.net/catacombae/hfsx.html

Comment by pmiller8, Sep 16, 2007

/usr/local/bin/arm-apple-darwin-ld: can't locate file for: -lc collect2: ld returned 1 exit status make2?: [libgcc_s.dylib] Error 1 make1?: [stmp-multilib] Error 2 make: [all-gcc] Error 2

anyone know what this is about? Thanks.

Comment by laughy, Sep 16, 2007

Note that copying the iphone files straight from my iphone -did not- seem to work ("cant locate file for: -lc" error). I had to extract the full restore DMG .39 into a folder and use that.

Comment by laughy, Sep 16, 2007

Note that copying the iphone files straight from my iphone -did not- seem to work ("cant locate file for: -lc" error). I had to extract the full restore DMG .39 into a folder and use that.

Comment by devcore, Sep 16, 2007

odcctools fails to compile in cygwin with these errors http://pastebin.com/m20f7aeef looks like it's all about conflicting headers, but i don't know how to fix it:( please help!

Comment by devcore, Sep 16, 2007

odcctools fails to compile in cygwin with these errors http://pastebin.com/m20f7aeef looks like it's all about conflicting headers, but i don't know how to fix it:( please help!

Comment by devcore, Sep 16, 2007

errors.c is in libstuff dir btw

Comment by tokenbaldguy, Sep 17, 2007

@samthedrummer: I had the same issue...I had moved the location of llvm-svn after compiling, and it didn't like that. I recompiled it in the new location and everything worked fine.

At least that fixed it for me...

Comment by sebastien.barre, Sep 17, 2007

I couldn't build the HelloWorld? example with the current toolchain (http://iphone.fiveforty.net/wiki/index.php/UIKit_Hello_World). I was able to build the same example with the 0.2 toolchain (http://iphone.fiveforty.net/wiki/index.php/Toolchain_Project).

My Makefile starts like this:

CC=arm-apple-darwin-gcc
CXX=arm-apple-darwin-g++
LD=$(CC)
LDFLAGS=-lobjc -framework CoreFoundation -framework Foundation -framework UIKit -framework LayerKit -Wl,-syslibroot,$(HEAVENLY)

And I'm getting this error:

arm-apple-darwin-gcc -c   hello.m -o hello.o
In file included from /usr/local/lib/gcc/arm-apple-darwin/4.0.1/../../../../arm-apple-darwin/include/CarbonCore/ConditionalMacros.h:42,
                 from /usr/local/lib/gcc/arm-apple-darwin/4.0.1/../../../../arm-apple-darwin/include/CarbonCore/MacTypes.h:20,
                 from /usr/local/lib/gcc/arm-apple-darwin/4.0.1/../../../../arm-apple-darwin/include/CoreFoundation/CFBase.h:38,
                 from /usr/local/lib/gcc/arm-apple-darwin/4.0.1/../../../../arm-apple-darwin/include/CoreFoundation/CFByteOrder.h:16,
                 from /usr/local/lib/gcc/arm-apple-darwin/4.0.1/../../../../arm-apple-darwin/include/CoreGraphics/CGGeometry.h:10,
                 from /usr/local/lib/gcc/arm-apple-darwin/4.0.1/../../../../arm-apple-darwin/include/CoreGraphics/CGAffineTransform.h:12,
                 from /usr/local/lib/gcc/arm-apple-darwin/4.0.1/../../../../arm-apple-darwin/include/CoreGraphics/CoreGraphics.h:12,
                 from /usr/local/lib/gcc/arm-apple-darwin/4.0.1/../../../../arm-apple-darwin/include/UIKit/UIKit.h:3,
                 from hello.m:1:
/usr/local/lib/gcc/arm-apple-darwin/4.0.1/../../../../arm-apple-darwin/include/TargetConditionals.h:110:10: error: #error unrecognized GNU C compiler

Now the current toolchain is much clean than the 0.2 (great job), so either the 0.3 has an issue here, or my Makefile, or maybe remnants of the 0.2 install are in the way (it looks like it was installing stuff all over the place, patching headers, etc.).

Any hint? Thanks

Comment by xyanthilous, Sep 18, 2007

On Ubuntu, I'm getting the same error as others above at the final make step:

cp/except.o: In function `nothrow_libfn_p': /home/dent/iphone/iphone-dev/llvm-gcc-4.0-iphone-build/gcc/../../llvm-gcc-4.0-iphone/gcc/cp/except.c:918: undefined reference to `libc_name_p' collect2: ld returned 1 exit status

Is this considered a -lc error? I copied the filesystem for HEAVENLY off my device directly and I do have a libc.dylib in $HEAVENLY/usr/lib. However its a symlink chain leading to $HEAVENLY/usr/lib/libSystem.B.dylib. Is this correct, or even related to my build problem?

Has anyone solved this problem?

Thanks.

Comment by xyanthilous, Sep 18, 2007

Regarding undefined reference to 'libc_name_p' on ubuntu:

libc_name_p is supposed to be defined in gcc/cp/cfns.h which is generated by gperf, so be sure to apt-get install gperf. But the cfns.h in llvm-gcc-4.0-iphone-build ends up blank anyway, so just copy it from llvm-gcc-4.0/gcc/cp.

cp llvm-gcc-4.0/gcc/cp/cfns.h llvm-gcc-4.0-iphone-build/gcc/cp

and that will get you past the error.

Cheers.

Comment by john.meacham, Sep 18, 2007

In order to compile odcctools on a x86-64 fedora linux machine, I did the following:

before the configure step do

; setarch i386 
; export CFLAGS="-m32" 
; export LDFLAGS="-m32"

then go ahead and follow the steps as normal. this was tested on a x86-64 install of fedora.

this fixes the issue of 'incompatable typedef' errors.

Comment by john.meacham, Sep 18, 2007

How much of the iPhone filesystem is needed for the build to work? can I just get by copying /System and /Library from my phone?

Comment by isidoror, Sep 19, 2007

Hi there, Yesterday after installing the toolchain I was able to compile. Now, same makefile and same app I get this error: /usr/local/bin/arm-apple-darwin-ld: -syslibroot: multiply specified Any ideas?

Comment by michael.mccaskill, Sep 19, 2007

I don't know the mechanics but I know that this toolchain doesn't require -syslibroot. Here is my Makefile for the HelloWorld?! app. Now I called the app MobileTest?:

CC=/usr/local/bin/arm-apple-darwin-gcc CXX=/usr/local/bin/arm-apple-darwin-g++ CFLAGS=-fsigned-char LDFLAGS=-Wl \

-framework Message \ -framework CoreFoundation? \ -framework Foundation \ -framework UIKit \ -framework LayerKit? \ -lobjc
LD=$(CC)

all: MobileTest? package

MobileTest?: main.o MobileTest?.o

$(LD) $(LDFLAGS) -o $@ $^

%.o: %.m %.c

$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@
package:
rm -f -r ./MobileTest?.app mkdir ./MobileTest?.app mv MobileTest? ./MobileTest?.app/ cp -r ./Resources/ ./MobileTest?.app/ chmod 644 ./MobileTest?.app/ chmod 755 ./MobileTest?.app/MobileTest?
clean:
rm -f .o MobileTest?

Comment by onitake, Sep 21, 2007

isidoror: As I pointed out earlier, forget about -syslibroot. If you need to specify a different SDK directory, use -isysroot /Your/SDK/Path (even for the linker). It will override the preset -syslibroot.

Comment by insanita...@yahoo.com, Sep 21, 2007

The fill-llvm-gcc script no longer has -c option as default... so if anyone follows the build instructions exactly, there is no step for svn co llvm-gcc-4.0... so the fill script will fail unless you have -c

Comment by freewa...@naver.com, Sep 22, 2007

Under Ubuntu 7.04, I couldn't extract 694-5262-39.dmg file correctly. The 694-5262-39.dmg file was successfully decrypted with vfdecrypt. The decrypted.dmg file could be explored with Transmac under Win-XP. File-system of decrypted.dmg seems to be HFSX. Is it true?

When I extracted it with Transmac, the file type is broken due to symbolic links. So, I couldn't use it.

I also tried "roxfan" mentions HFSExplorer under Ubuntu. But, when I opened the decrypted.dmg, it shows an error message as below. "Invalid HFS type. Program supports (HFS_PLUS, HFS_WRAPPED_HFS_PLUS). Detected type is (HFSX)."

According to "gaxzerow"'s comment, it should work.

Do you have any hint to resolve this problem?

Comment by idilberkan, Sep 22, 2007

badmanchild, I personallly think it was a ffolder name issue so I renamed llvm-gcc-4.0-iphone folder to llvm-gcc-4.0 and it worked fine. Was that a bad step?

Comment by william.s.yu, Sep 23, 2007

Oh it works now. I cleaned out my entire installation tree. Did the ./fill-llvm-gcc.sh -c one more time and it finally pulled through. I suspect there were some files lying around from my previous build.

Comment by kylegl54, Sep 25, 2007

Success on a PowerBook? G4.

  • Have a compilation problem with llvm-convert.cpp, that can be simply resolved by modifying llvm-internal.h, line 562, by removing the third argument (const char *LongDoubleName) (known  issue #59 )
  • To build the examples of Lucas Newman, you need to update your includes with the one of iphone-binutils

Thanks to all for this wonderfull tools :)

Comment by jasonjunkmail.Developer, Sep 25, 2007

Any confirmation on building the latest toolkit on Windows?

Comment by gaoxiaojun, Sep 26, 2007

Success on CentOS 4

Comment by f...@swarc.de, Sep 26, 2007

what about this error sebastien.barre reported on 17th of september.

#error unrecognized GNU C compiler

I do have the same.

Can someone explain the details behind it and how to fix it

Thx

Florian

Comment by niwaniwaniw, Sep 27, 2007

I got follow error when compoling the llvm-gcc-4.0-iphone on IntelMac?? with OSX10.4.10:

#error architecture not supported

Does anyone know how to avoid this error??

Comment by melcher.matthias, Sep 29, 2007

The -lc issue is easy to avoid by copying the /usr directory from the iPhone to the heavenly directory. It is looking for the file /usr/lib/libc.dylib . The copy command is "sudo scp -C -r root@192.168.1.105:/usr/ ." from the heavenly directory on the developer machine (assuming you have the scp deamon installed - see iNdependence, etc.).

Comment by melcher.matthias, Sep 29, 2007

I would like to shout a huge "thank you" to the developers and maintainers of this SVN and site. Everything worked pretty much "out of the box" on my 10.4.10 Intel OS X. Great work! Thank you!

Comment by unidevel, Sep 30, 2007

I successfully build the toolchain under Linux. tested with UIKit hello program and simple C hello world. but when I compile gnugo 3.6, it report

  Undefined symbols: ___eprintf
Any ideas with this error? I think it maybe the ncurses library's problem. I never build them, I wonder where they come from, maybe from MacOSX SDK.
Making all in patterns
make[2]: Entering directory `/mnt/rootfs/opt/iphone/apps/build/gnugo-3.6/pattern
s'
arm-apple-darwin-gcc  -g -O2 -Wall -W -Wpointer-arith -Wbad-function-cast -Wcast
-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmi
ssing-declarations -Wundef   -o mkpat  mkpat.o transform.o dfa.o ../utils/libuti
ls.a -lncurses
/opt/iphone/bin/arm-apple-darwin-ld: Undefined symbols:
___eprintf
collect2: ld returned 1 exit status
make[2]: *** [mkpat] Error 1
Comment by djMaxM, Sep 30, 2007

anybody gotten standard C++ libraries to compile on this darn thing? The instructions on the old Wiki don't work.

Comment by unidevel, Sep 30, 2007
/opt/iphone/bin/arm-apple-darwin-ld: Undefined symbols:
___eprintf

assert.h referenced eprintf, I just replace assert.h with

#define assert

compile ok now.

Comment by fayoeu, Oct 01, 2007

While compiling llvm, on mac osx, i get the following:

/usr/bin/ld: can't locate file for: -lgcc_s.10.4 collect2: ld returned 1 exit status make2?: [/Users/fayoeu/Desktop/llvm-svn/Release/bin/tblgen] Error 1 make1?: [TableGen/.makeall] Error 2 make: all? Error 1

Any suggestions?

Comment by madfxgao, Oct 01, 2007

when i step to make LLVM_VERSION_INFO=2.0-svn-iphone-dev-0.3-svn, i meet the following error: ../../../llvm-gcc-4.0-iphone/gcc/llvm-backend.cpp: In function 'void llvm_initialize_backend()': ../../../llvm-gcc-4.0-iphone/gcc/llvm-backend.cpp:191: error: 'createBFS_DAGScheduler' was not declared in this scope make1?: [llvm-backend.o] Error 1 make: [all-gcc] Error 2

Comment by jamesfmilne, Oct 02, 2007

fayoeu & madfxgao:

I get the same error. The code has evidently gone out of sync with the LLVM source code.

Nightwatch: Can you specify which SVN revision of LLVM you used to build the toolchain?

Comment by fayoeu, Oct 02, 2007

Hi all, i fixed my issue by upgrade to the latest Xcode, follow the link in the wiki. However, now I am running into the issue reported by madfxgao.

Comment by NRCoelho, Oct 03, 2007

Hi guys...

i'm trying to download the iphone file system since this morning without success completing the process; maybe i'm doing something wrong, like copying all the "/" directory.

heres my command line: scp -r [root@iphoneIP]:/ .

any thoughts? ideas?

Many thanks in advance

Nuno

Comment by huber...@gmx.de, Oct 03, 2007

The problem from madfxgao got a bugtracker number: issue#70. It is also my problem now...

Comment by leyland, Oct 03, 2007

I have the same issue as freewa...@naver.com on Ubuntu

The 38 file mounts fine, but when I try to do the vfdecrypt to the other file, the resulting file can not be mounted, calling 'file' on it returns that it is a "VAX COFF executable", which can't be right since the 38 file says it is a "Macintosh HFS Extended version 4". I don't know if vfdecrypt is working :P.

I want to try this by transferring the files from my iphone. Does any one know if this will work with files from an iphone with firmware 1.02? Is there a list of files/directories that are needed? I have a lot of music/video/apps on it and don't want to copy everything over.

Comment by voberle, Oct 04, 2007

Thanks for these great instructions. They have one problem tough: Two SVN repositories are needed, and trunk is taken from both. So it's sure that sometimes things will be broken.

Could you indicate in the guide some working revision numbers for the 2 repo? Most people building this toolchain would not need to use the lastest trunk code. Thanks.

Comment by meth...@yahoo.com, Oct 04, 2007

On Ubuntu 7.0.4, I can get all the way to the command: make LLVM_VERSION_INFO=2.0-svn-iphone-dev-0.3-svn but it errors with the configure bombing out when configuring the libstdc++-v3 with the following error:

checking for g++ that supports -ffunction-sections -fdata-sections... yes checking for sin in -lm... configure: error: Link tests are not allowed after GCC_NO_EXECUTABLES. make: [configure-target-libstdc++-v3] Error 1

Anybody seen this before?

Comment by gowangcheng, Oct 05, 2007

I build it on Ubuntu and got an error when making LLVM-GCC.

arm-apple-darwin-lipo -output libgcc_s.10.4.dylib -create libgcc_s.10.4.dylib_T arm-apple-darwin-lipo: can't figure out the architecture type of: libgcc_s.10.4.dylib_T make1?: [libgcc_s.10.4.dylib] Error 1

In order to avoid the bug reported by madfxgao, I sync the llvm to a early version (Oct.1). Is it caused by version mismatch?

Comment by meth...@yahoo.com, Oct 05, 2007

I figured out my problem (symlinks for /usr/lib dylibs not maintained after extracting from Windows XP and scp'ing files to Ubuntu 7.0.4.

However, I can now compile the HelloApplication?, but when I try to run it on my iPhone, all it shows is a big picture of "two papers, pencil, ruler and paintbrush", looks like a big "Write" icon.

I didn't get any errors when compiling though.

Comment by meth...@yahoo.com, Oct 05, 2007

nvm, Hello makefile doesn't chmod the combiled binaries, works now.

Comment by bmills, Oct 09, 2007

Couple tips from a successful build on Fedora Core 3... The following command will unpack the xcode DMG file under linux:

dd if=xcode_2.4.1_8m1910_6936315.dmg skip=323904 | gunzip | pax -r
The instructions talk about top-of-trunk for both repositories, which is a moving target. I had to downgrade my llvm to rev 42286 to get it to compile cleanly using the above instructions. This was with top-of-trunk iphone-dev, which at the time was revision 198 I had to downgrade llvm after getting errors about createBFS_DAGScheduler similar to the ones mentioned in http://code.google.com/p/iphone-dev/issues/detail?id=70

Comment by spkane00, Oct 11, 2007

to solve madfxgao's problem try this:

svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm-svn -r {2007-09-25}

to pull down a slightly older version of llvm.

Comment by vapuleixi, Oct 13, 2007

I have compiled everything well, but on the last step, making "make install" on llvm-gcc, i get this error:

/usr/bin/install -c -m 644 ./libgcc.a /usr/local/lib/gcc/arm-apple-darwin/4.0.1/ arm-apple-darwin-ranlib -c /usr/local/lib/gcc/arm-apple-darwin/4.0.1/libgcc.a make2?: arm-apple-darwin-ranlib: Command not found make2?: install? Error 127 make2?: Leaving directory `/home/isma/development/iphone/iphone-dev/build/llvm-gcc-4.0-iphone/gcc' make1?: [install-multilib] Error 2 make1?: Leaving directory `/home/isma/development/iphone/iphone-dev/build/llvm-gcc-4.0-iphone/gcc' make: [install-gcc] Error 2

do you know if the problem is on the Makefile? am i making something wrong? please help me, i haven't the arm-apple-darwin-gcc

Thanks to spkane00.

Comment by jasa...@gmx.net, Oct 15, 2007

I am stuck with the same Problem as meth...@yahoo.com: checking for sin in -lm... configure: error: Link tests are not allowed after GCC_NO_EXECUTABLES. make: [configure-target-libstdc++-v3] Error 1

Could it be a problem that my dylib-files are from the iPod touch and not from an iPhone (I tried before with an iPhone filesystem but I stuck with a different error, wich disapeared after I replaced the dylib-file (which wich was connected with the error) with a new copy from my iPod)?

Comment by jasa...@gmx.net, Oct 17, 2007

There's a torrent with the root filesystem on thepiratebay.org - simply search for iPhone.

Comment by paulspiteri, Oct 19, 2007

Is this supposed to work with the 1.1.1 filesystem?

I get this error after about 15 mins of make LLVM_VERSION_INFO=......

/usr/local/bin/arm-apple-darwin-ld: /home/paul/iphone-filesystem/usr/lib/libc.dylib truncated or malformed object (mach header extends past the end of the file) collect2: ld returned 1 exit status make2?: [libgcc_s.dylib] Error 1 make2?: Leaving directory `/home/paul/iphone-dev/build/llvm-gcc-4.0-iphone/gcc' make1?: [stmp-multilib] Error 2 make1?: Leaving directory `/home/paul/iphone-dev/build/llvm-gcc-4.0-iphone/gcc' make: [all-gcc] Error 2

So close...I'm running on Ubuntu 7.10. Thanks

Comment by damien.stolarz, Oct 20, 2007

Could someone make a VMWare image of a ubuntu toolchain OS config? That way, everyone trying to write apps could spend more time coding and less time chasing down header files.

Comment by XanthosX, Oct 21, 2007

Some of the headers appear to be missing, (eg. ABAddressBookUI) - was this an intentional omission?

Comment by terry.simons, Oct 23, 2007

put Hello in /Applications or /bin or /sbin or the like.

Comment by benzou, Oct 23, 2007

Can someone post a version of this compiled for OS X 10.4?

It would help a bunch. Thanks.

Comment by filberuk, Oct 23, 2007

Hello,

I'm getting the following error at the step: make LLVM_VERSION_INFO=2.0-svn-iphone-dev-0.3-svn

`arm-apple-darwin-lipo -output libgcc_s.10.4.dylib -create libgcc_s.10.4.dylib_T arm-apple-darwin-lipo: can't figure out the architecture type of: libgcc_s.10.4 .dylib_T make1?: [libgcc_s.10.4.dylib] Error 1 make1?: Leaving directory `/home/oem/iphone-dev/build/llvm-gcc-4.0-iphone/gcc' make: [all-gcc] Error 2 ` Same as gowangcheng...

Copied filesystem from iTouch, checked and libc.dylib is present and HEAVENLY path set correctly...

Comment by arheops, Oct 24, 2007

can anyone provide iphone ROOT archived?

Comment by pumpkingod, Oct 24, 2007

apple can. just grab it from their site and decrypt it

Comment by arheops, Oct 24, 2007

senks. already have one

Comment by arheops, Oct 25, 2007

but i still can't decrypt it... seems vfdecrypt not work. does it need to be compiled on 64 bit system or on 32 bit?

Comment by naughty.nin, Oct 26, 2007

paulspiteri: you retrieved the phone-fs using a win box. this faulty file in fact should be a symlink which win cannot handle. grab yourself a linux box! hope that helps

Comment by mewzca, Oct 28, 2007

On the last build phase, I am having problems!!! Can someone help?

it fails on:

/Users/mewse/toolchain/iphone-dev/build/llvm-gcc-4.0-iphone/gcc/xgcc -B/Users/mewse/toolchain/iphone-dev/build/llvm-gcc-4.0-iphone/gcc/ -B/usr/local/arm-apple-darwin/bin/ -B/usr/local/arm-apple-darwin/lib/ -isystem /usr/local/arm-apple-darwin/include -isystem /usr/local/arm-apple-darwin/sys-include -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -I. -I. -I../../../llvm-gcc-4.0-iphone/gcc -I../../../llvm-gcc-4.0-iphone/gcc/. -I../../../llvm-gcc-4.0-iphone/gcc/../include -I../../../llvm-gcc-4.0-iphone/gcc/../libcpp/include -I/Users/mewse/toolchain/llvm-svn/include -I/Users/mewse/toolchain/llvm-svn/include \

\
-c ../../../llvm-gcc-4.0-iphone/gcc/config/darwin-crt3.c -o crt3.o
xgcc: installation problem, cannot exec '-arch': No such file or directory make3?: [crt3.o] Error 1 make2?: extra? Error 2 make1?: [stmp-multilib] Error 2 make: [all-gcc] Error 2

I manually executed the last make command and this is what it spewed out:

sh-2.05b# /Users/mewse/toolchain/iphone-dev/build/llvm-gcc-4.0-iphone/gcc/xgcc -B/Users/mewse/toolchain/iphone-dev/build/llvm-gcc -4.0-iphone/gcc/ -B/usr/local/arm-apple-darwin/bin/ -B/usr/local/arm-apple-darwin/lib/ -isystem /usr/local/arm-apple-darwin/inclu de -isystem /usr/local/arm-apple-darwin/sys-include -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes

-Wold-style-definition -isystem ./include -I. -I. -I../../../llvm-gcc-4.0-iphone/gcc -I../../../llvm-gcc-4.0-iphone/gcc/. -I..
/../../llvm-gcc-4.0-iphone/gcc/../include -I../../../llvm-gcc-4.0-iphone/gcc/../libcpp/include -I/Users/mewse/toolchain/llvm-svn /include -I/Users/mewse/toolchain/llvm-svn/include -c ../../../llvm-gcc-4.0-iphone/gcc/config/darwin-crt3.c -o crt3.o -v Reading specs from /Users/mewse/toolchain/iphone-dev/build/llvm-gcc-4.0-iphone/gcc/specs Target: arm-apple-darwin Configured with: ../../llvm-gcc-4.0-iphone/configure --enable-llvm=/Users/mewse/toolchain/llvm-svn --enable-languages=c,c++,objc,obj-c++ --target=arm-apple-darwin --enable-sjlj-exceptions --with-heavenly=/usr/local/share/iphone-filesystem --with-as=/usr/local/bin/arm-apple-darwin-as --with-ld=/usr/local/bin/arm-apple-darwin-ld : (reconfigured) ../../llvm-gcc-4.0-iphone/configure --enable-llvm=/Users/mewse/toolchain/llvm-svn --enable-languages=c,c++,objc,obj-c++ --target=arm-apple-darwin --enable-sjlj-exceptions --with-heavenly=/usr/local/share/iphone-filesystem --with-as=/usr/local/bin/arm-apple-darwin-as --with-ld=/usr/local/bin/arm-apple-darwin-ld Thread model: posix gcc version 4.0.1 (Apple Computer, Inc. build 5449)(LLVM build 2.0-svn-iphone-dev-0.3-svn)
/Users/mewse/toolchain/iphone-dev/build/llvm-gcc-4.0-iphone/gcc/cc1 -quiet -v -I. -I. -I../../../llvm-gcc-4.0-iphone/gcc -I../../../llvm-gcc-4.0-iphone/gcc/. -I../../../llvm-gcc-4.0-iphone/gcc/../include -I../../../llvm-gcc-4.0-iphone/gcc/../libcpp/include -I/Users/mewse/toolchain/llvm-svn/include -I/Users/mewse/toolchain/llvm-svn/include -iprefix /Users/mewse/toolchain/iphone-dev/build/llvm-gcc-4.0-iphone/gcc/../lib/gcc/arm-apple-darwin/4.0.1/ -isystem /Users/mewse/toolchain/iphone-dev/build/llvm-gcc-4.0-iphone/gcc/include -DDYNAMIC -DIN_GCC -isystem /usr/local/arm-apple-darwin/include -isystem /usr/local/arm-apple-darwin/sys-include -isystem ./include ../../../llvm-gcc-4.0-iphone/gcc/config/darwin-crt3.c -fPIC -mfpu=vfp -mcpu=arm1176jzf-s -quiet -dumpbase darwin-crt3.c -mmacosx-version-min=10.4 -auxbase-strip crt3.o -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -version -o /var/tmp//ccqi6trh.s
ignoring nonexistent directory "/usr/local/arm-apple-darwin/sys-include" ignoring duplicate directory "./include" ignoring nonexistent directory "/Users/mewse/toolchain/iphone-dev/build/llvm-gcc-4.0-iphone/gcc/../lib/gcc/arm-apple-darwin/4.0.1/include" ignoring nonexistent directory "/Users/mewse/toolchain/iphone-dev/build/llvm-gcc-4.0-iphone/gcc/../lib/gcc/arm-apple-darwin/4.0.1/../../../../arm-apple-darwin/include" ignoring duplicate directory "/usr/local/lib/gcc/arm-apple-darwin/4.0.1/../../../../arm-apple-darwin/include" ignoring duplicate directory "." ignoring duplicate directory "../../../llvm-gcc-4.0-iphone/gcc/." ignoring duplicate directory "/Users/mewse/toolchain/llvm-svn/include" #include "..." search starts here: #include <...> search starts here:
. ../../../llvm-gcc-4.0-iphone/gcc ../../../llvm-gcc-4.0-iphone/gcc/../include ../../../llvm-gcc-4.0-iphone/gcc/../libcpp/include /Users/mewse/toolchain/llvm-svn/include /Users/mewse/toolchain/iphone-dev/build/llvm-gcc-4.0-iphone/gcc/include /usr/local/arm-apple-darwin/include /usr/local/include /usr/local/lib/gcc/arm-apple-darwin/4.0.1/include /usr/include /System/Library/Frameworks (framework directory) /Library/Frameworks (framework directory)
End of search list. GNU C version 4.0.1 (Apple Computer, Inc. build 5449)(LLVM build 2.0-svn-iphone-dev-0.3-svn) (arm-apple-darwin)
compiled by GNU C version 4.0.1 (Apple Computer, Inc. build 5370).
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 Compiler executable checksum: 93bfe937d44ac72df24c566a9adf5651
-arch arm -force_cpusubtype_ALL -o crt3.o /var/tmp//ccqi6trh.s
xgcc: installation problem, cannot exec '-arch': No such file or directory sh-2.05b#

Thanks!!

Comment by paulspiteri, Oct 28, 2007

naughty.nin, thanks. I downloaded the filesystem from my iphone (i didnt have one when i made that post) onto my ubuntu pc, now that error is gone :)

Comment by nasko...@hotmail.com, Oct 28, 2007

"/usr/local/bin/arm-apple-darwin-ld: /home/paul/iphone-filesystem/usr/lib/libc.dylib truncated or malformed object (mach header extends past the end of the file) collect2: ld returned 1 exit status make2?: [libgcc_s.dylib] Error 1 make2?: Leaving directory /home/paul/iphone-dev/build/llvm-gcc-4.0-iphone/gcc' make1?: [stmp-multilib] Error 2 make1?: Leaving directory /home/paul/iphone-dev/build/llvm-gcc-4.0-iphone/gcc' make: [all-gcc] Error 2"

open usr/lib directory (694-5262-39.dmg). Open all .dylib -1k. All of that files contain paths. Replace that small files with files that is described in. libc.dylib -> libSystem.dylib -> libSystem.B.dylib. By this way you have to copy libSystem.B.dylib two times and to rename that files to libc.dylib and libSystem.dylib. I've been successfully built toolchain on cygwin by this way.

Comment by insanita...@yahoo.com, Oct 28, 2007

Because the make step of LLVM-GCC seems to be reliant on running bash, perhaps include this in the instructions.

Comment by aakash.bapna, Oct 28, 2007

when i do "make LLVM_VERSION_INFO=2.0-svn-iphone-dev-0.3-svn " its runs for a long time and then results in this error -- /usr/local/bin/arm-apple-darwin-ld: /home/Aakash/iphone/iphone-image/usr/lib/libc.dylib truncated or malformed object (mach header extends past the end of the file) collect2: ld returned 1 exit status make2?: [libgcc_s.dylib] Error 1 make2?: Leaving directory `/root/iphone-dev/build/llvm-gcc-4.0-iphone/gcc' make1?: [stmp-multilib] Error 2 make1?: Leaving directory `/root/iphone-dev/build/llvm-gcc-4.0-iphone/gcc' make: [all-gcc] Error 2 -- i am sure my heavenly variable set right and libc.dylib is there, i think many others are having this problem. I am using fedora 7.04..

Comment by nasko...@hotmail.com, Oct 28, 2007

aakash: see my description above. Just open .dylib files (<=1 k), rename it - and for example libc.dylib shows path to libSystem and libSystem - path to libSystem.B.dylib. Just copy libSystem.B.dylib twice and rename 2 new files to libc.dylib and libSystem.dylib. You will have 2 equal files with different names. That will avoid you and from error GCC_NO_EXECUTABLES -ISSUE 73.

Comment by aakash.bapna, Oct 29, 2007

i made 2 copies of libSystem.B.dylib, renamed them to libc.dylib and libSystem.dylib. do i have to it for all .dylib files for just libc.dylib? after doing this (only libc.dylib file duplicates,renames) i got no errors , setup the tool chain successfully i think. when i compile a hello world source from dev team wiki. it gives me following error "[root@localhost test]# make /usr/local/arm-apple-darwin/bin/gcc -c -fsigned-char mainapp.m -o mainapp.o make: /usr/local/arm-apple-darwin/bin/gcc: Command not found make: [mainapp.o] Error 127 [root@localhost test]# " i don't have a /usr/local/arm-apple-darwin/bin/gcc folder!! only lib, include folders are there in /arm-apple-darwin/ what could have gone wrong?

Comment by nasko...@hotmail.com, Oct 29, 2007

yes. you have to do this for all .dylib files that include paths.

Comment by rhyscox, Oct 31, 2007

I get the "can't figure out the architecture type of: libgcc_s.10.4.dylib_T" error too, I copied from my touch over the original iphone files I had to solve a previous error. Is there any solution to this problem?

Comment by ViaJava, Oct 31, 2007

I had the libgcc_s.10.4.dylib_T error as well, and before that, I lacked a lot of folders in the arm-apple-darwin dir, so I went and fixed a lot of symlinks (not just the dylib ones) that didn't make the transfer, and went back to step 1, and successfully built it. You can check out the symlink section at the bottom of http://iphone.fiveforty.net/wiki/index.php/Toolchain_installation_-_Windows.

Comment by simerjots, Nov 01, 2007

I build the odcctools successfully!

But when I go to compile the Hello Word I get the following error make: /usr/local/bin/arm-apple-darwin-gcc: Command not found

I checked the /usr/local/bin/ directory and I shaw non 'arm-apple-darwin-gcc'

I am running this on cygwin on XP

Comment by aakash.bapna, Nov 01, 2007

Finally got it working... simerjots, please edit the makefile and try changing arm-apple-darwin-gcc to arm-apple-darwin or the toolchain directory in /usr/local/bin/ if you need the fixed symlinks i have uploaded it -- http://rapidshare.com/files/66800884/lib.rar password - aksblog.co.nr ,there are other usefull files too at http://rapidshare.com/users/JCFG2J including the macosx10.4u.sdk folder from xcode tools..

http://iphone.fiveforty.net/wiki/index.php/UIKit_Based_Applications http://www.cocoadev.com/index.pl?UIKit http://phonedev.tumblr.com/ http://www.lucasnewman.com/iphone/
can i have some more links on class libraries of UIKit, usefull good source codes? made a post at my blog http://aakash-bapna.blogspot.com about my experiences..

Comment by simerjots, Nov 01, 2007

still getting the same error

Comment by aakash.bapna, Nov 02, 2007

try this test app- http://absolutech.org/files/testApp.rar it worked for me ...

Comment by simerjots, Nov 02, 2007

I am trying to redo the tool kit from the begining

Everything goes smoothly, but at the final prompt running the following command "make LLVM_VERSION_INFO=2.0-svn-iphone-dev-0.3-svn" I get

configure: error: You must specify absolute path to your LLVM tree with --enable-llvm=DIR make: [configure-gcc] Error 1

Comment by cbrookes, Nov 02, 2007

Tested working on Ubuntu 7.10. You MUST have "patch" installed otherwise the header installation section of the guide fails to fix 3 files resulting in compile errors for helloworld.

Comment by speedbump0619, Nov 02, 2007

apparently newer versions of the standard headers files are different from the ones that some devs are using. The patch command indicated by cbrookes above is failing on my system leaving /usr/local/arm-apple-darwin/TargetConditionals?.h in a partially merged state. You need to verify that there are no patch .rej files there, and if there are manually merge them. This allowed me to build HelloWorld?.

Comment by dkgamez, Nov 02, 2007

I am seeing the same error as simerjots:

Everything goes smoothly, but at the final prompt running the following command "make LLVM_VERSION_INFO=2.0-svn-iphone-dev-0.3-svn" I get

configure: error: You must specify absolute path to your LLVM tree with --enable-llvm=DIR make: [configure-gcc] Error 1

Comment by Nabeel.Allana, Nov 03, 2007

# gcc -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -Wno-variadic-macros -Wold-style-definition -DHAVE_CONFIG_H -DENABLE_LLVM -I/home/maniacx/Desktop/temp/llvm-svn/include -D_DEBUG -D_GNU_SOURCE -DSTDC_LIMIT_MACROS -DLLVM_VERSION_INFO='"2.0-svn-iphone-dev-0.3-svn"' -I. -I. -I../../../../llvm-gcc-4.0-iphone/gcc -I../../../../llvm-gcc-4.0-iphone/gcc/. -I../../../../llvm-gcc-4.0-iphone/gcc/../include -I../../../../llvm-gcc-4.0-iphone/gcc/../libcpp/include -I/home/maniacx/Desktop/temp/llvm-svn/include -I/home/maniacx/Desktop/temp/llvm-svn/include ../../../../llvm-gcc-4.0-iphone/gcc/lambda-code.c -o lambda-code.o # gcc -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -Wno-variadic-macros -Wold-style-definition -DHAVE_CONFIG_H -DENABLE_LLVM -I/home/maniacx/Desktop/temp/llvm-svn/include -D_DEBUG -D_GNU_SOURCE -DSTDC_LIMIT_MACROS -DLLVM_VERSION_INFO='"2.0-svn-iphone-dev-0.3-svn"' -I. -I. -I../../../../llvm-gcc-4.0-iphone/gcc -I../../../../llvm-gcc-4.0-iphone/gcc/. -I../../../../llvm-gcc-4.0-iphone/gcc/../include -I../../../../llvm-gcc-4.0-iphone/gcc/../libcpp/include -I/home/maniacx/Desktop/temp/llvm-svn/include -I/home/maniacx/Desktop/temp/llvm-svn/include ../../../../llvm-gcc-4.0-iphone/gcc/tree-loop-linear.c -o tree-loop-linear.o # gcc -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -Wno-variadic-macros -Wold-style-definition -DHAVE_CONFIG_H -DENABLE_LLVM -I/home/maniacx/Desktop/temp/llvm-svn/include -D_DEBUG -D_GNU_SOURCE -DSTDC_LIMIT_MACROS -DLLVM_VERSION_INFO='"2.0-svn-iphone-dev-0.3-svn"' -I. -I. -I../../../../llvm-gcc-4.0-iphone/gcc -I../../../../llvm-gcc-4.0-iphone/gcc/. -I../../../../llvm-gcc-4.0-iphone/gcc/../include -I../../../../llvm-gcc-4.0-iphone/gcc/../libcpp/include -I/home/maniacx/Desktop/temp/llvm-svn/include -I/home/maniacx/Desktop/temp/llvm-svn/include ../../../../llvm-gcc-4.0-iphone/gcc/tree-object-size.c -o tree-object-size.o # c++ -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -W -Wall -Wwrite-strings -pedantic -Wno-long-long -Wno-variadic-macros -DHAVE_CONFIG_H -Wno-unused -DTARGET_NAME=\"arm-apple-darwin\" -DNDEBUG -DENABLE_LLVM -I/home/maniacx/Desktop/temp/llvm-svn/include -D_DEBUG -D_GNU_SOURCE -DSTDC_LIMIT_MACROS -DLLVM_VERSION_INFO='"2.0-svn-iphone-dev-0.3-svn"' -I. -I. -I../../../../llvm-gcc-4.0-iphone/gcc -I../../../../llvm-gcc-4.0-iphone/gcc/. -I../../../../llvm-gcc-4.0-iphone/gcc/../include -I../../../../llvm-gcc-4.0-iphone/gcc/../libcpp/include -I/home/maniacx/Desktop/temp/llvm-svn/include -I/home/maniacx/Desktop/temp/llvm-svn/include ../../../../llvm-gcc-4.0-iphone/gcc/llvm-backend.cpp -o llvm-backend.o # ../../../../llvm-gcc-4.0-iphone/gcc/llvm-backend.cpp: In function ‘void llvm_initialize_backend()’: # ../../../../llvm-gcc-4.0-iphone/gcc/llvm-backend.cpp:191: error: ‘createBFS_DAGScheduler’ was not declared in this scope # make1?: [llvm-backend.o] Error 1 # make1?: Leaving directory `/home/maniacx/Desktop/temp/iphone-dev/include/build/llvm-gcc-4.0-iphone/gcc' # make: [all-gcc] Error 2 # root@maniacx-desktop:~/Desktop/temp/iphone-dev/include/build/llvm-gcc-4.0-iphone#

http://pastebin.com/m4607f722

Anyone know what is wrong? I think it may be my firmware dump. Will try with a fresh one. Do you think its anything else?

Thanks.

Comment by compukid, Nov 04, 2007

When I try to do these steps: $ ../../llvm-gcc-4.0-iphone/configure --enable-llvm=llvm-config --obj-root \ --enable-languages=c,c++,objc,obj-c++ --target=arm-apple-darwin --enable-sjlj-exceptions \ --with-heavenly=$HEAVENLY --with-as=/usr/local/bin/arm-apple-darwin-as \ --with-ld=/usr/local/bin/arm-apple-darwin-ld

this is what I get. Permission Denied. Any suggestions...Thanks in advance

Macintosh:llvm-gcc-4.0-iphone xxx$ ../../llvm-gcc-4.0-iphone/configure --enable-llvm=llvm-config --obj-root \ > --enable-languages=c,c++,objc,obj-c++ --target=arm-apple-darwin --enable-sjlj-exceptions \ > --with-heavenly=$HEAVENLY --with-as=/usr/local/bin/arm-apple-darwin-as \ > --with-ld=/usr/local/bin/arm-apple-darwin-ld -bash: ../../llvm-gcc-4.0-iphone/configure: Permission denied

Comment by compukid, Nov 04, 2007

Just noticed I do not have a 'configure' file in ../../llvm-gcc-4.0-iphone/ location

Comment by Nabeel.Allana, Nov 04, 2007

>>compukid If that doesn't work, do this:

pushd ../../llvm-gcc-4.0-iphone/ chmod 777 ./ popd

then try it again

Comment by compukid, Nov 04, 2007

Thanks Nabeel. So that worked. I guess it didnt have the right permissions. The I did the remainin commands and got this: Macintosh:llvm-gcc-4.0-iphone xxx$ make LLVM_VERSION_INFO=2.0-svn-iphone-dev-0.3-svn make: No targets specified and no makefile found. Stop. Macintosh:llvm-gcc-4.0-iphone xxx$ sudo make install make: No rule to make target `install'. Stop. Macintosh:llvm-gcc-4.0-iphone xxx$ echo $HEAVENLY /usr/local/share/iphone-filesystem Macintosh:llvm-gcc-4.0-iphone xxx$ echo $LLVMOBJDIR /workarea/ipod/llvm-svn

Somethin tells me...thats not right, is it ?

Comment by compukid, Nov 04, 2007

And I keep getting this when I try runnin Hello World: /usr/include/sys/fcntl.h:418: error: parse error before ‘DARWIN_ALIAS_C’ /usr/include/sys/fcntl.h:419: error: parse error before ‘DARWIN_ALIAS_C’ /usr/include/sys/fcntl.h:420: error: parse error before ‘DARWIN_ALIAS_C’

Comment by aakash.bapna, Nov 05, 2007

compukid, do a cleanup and then a fresh install of toolchain, i too got same errors like No targets specified and no makefile found and no rule to make target "install"

Comment by oi...@spambog.com, Nov 05, 2007

successfully compiled the whole toolchain and UIKit_Hello_World? on debian etch! but there is no libc++

#include <string>
int main() { std::string foo = "bar"; }

$ arm-apple-darwin-g++ -o string string.c /usr/local/bin/arm-apple-darwin-ld: can't locate file for: -lstdc++ collect2: ld returned 1 exit status

any suggestions?

Comment by edpark, Nov 05, 2007

Using Leopard on an Intel I keep getting this error when trying to compile a hello world type example:

/usr/local/bin/arm-apple-darwin-ld: -syslibroot: multiply specified collect2: ld returned 1 exit status make: Hello? Error 1

This is the Makefile:

CC=arm-apple-darwin-gcc-4.0.1 -v CXX=/usr/local/arm-apple-darwin/bin/g++

LD=$(CC) LDFLAGS = -Wl,-syslibroot,$(HEAVENLY) \

-framework CoreFoundation? \ -framework Foundation \ -framework UIKit \ -framework LayerKit? \ -framework CoreGraphics? \ -framework GraphicsServices? \ -framework CoreSurface? \ -lobjc -larmfp

all: Hello

Hello: hello.o HelloApplication?.o

$(LD) $(LDFLAGS) -o $@ $^

%.o: %.m

$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@

clean:

rm -f .o Hello

Anyone come up with a fix for this?

Comment by edpark, Nov 05, 2007

With respect to my previous post of getting the "-syslibroot: multiply specified" error I just realized that I'm now getting the same error on my PPC Leopard install. The weird thing is that I was able to compile the example successfully only yesterday and since I rebooted my machine I can't compile any more. Did I lose some crucial environment setting?

Comment by yehezkiyahu, Nov 06, 2007

I've built the entire toolchain twice now. Both times on a Mac Book Pro running OS X 10.4.10, using the root filesystem from my iPod Touch, not an iPhone. The build process always seems to finish smoothly and according to this page I should be fine, yet I can't compile either the iphoneebooks app or the hello world app. I see the following error message (along with a mess of others, but I think this one's the first):

/usr/local/lib/gcc/arm-apple-darwin/4.0.1/../../../../arm-apple-darwin/include/TargetConditionals?.h:110:10: error: #error unrecognized GNU C compiler

I see this error message mentioned above by two other people. Has anyone figured out what it causing this problem? Is there a solution?

Thanks for any help or information.

Comment by musesum, Nov 07, 2007

compukid, I have the same problem. Did you solve yours? Does anyone know which makefile is expected in "make LLVM_VERSION_INFO=2.0-svn-iphone-dev-0.3-svn" ??

Comment by macosxman, Nov 08, 2007

dkgamez and simerjots:

instead of:

../../llvm-gcc-4.0-iphone/configure --enable-llvm=`llvm-config --obj-root` \
--enable-languages=c,c++,objc,obj-c++ --target=arm-apple-darwin --enable-sjlj-exceptions \
--with-heavenly=$HEAVENLY --with-as=/usr/local/bin/arm-apple-darwin-as \
--with-ld=/usr/local/bin/arm-apple-darwin-ld

try:

../../llvm-gcc-4.0-iphone/configure --enable-llvm=$LLVMOBJDIR \
--enable-languages=c,c++,objc,obj-c++ --target=arm-apple-darwin --enable-sjlj-exceptions \
--with-heavenly=$HEAVENLY --with-as=/usr/local/bin/arm-apple-darwin-as \
--with-ld=/usr/local/bin/arm-apple-darwin-ld

That seemed to fix that problem for me.

Comment by mrichards, Nov 08, 2007

Has anybody tried to obtain the headers from the xcode 3 dmg on Linux? Been trying several things, seems something has changed..

Comment by bricollins, Nov 11, 2007

Compiling odcctools fails on freebsd, same problem as brookstalley using freebsd 6.2 http://pastebin.com/f162e6e32

Comment by musesum, Nov 11, 2007

macosxman, you are the man. Your Nov8 post solved the libgcc_s.dylib probem that I in Leopard and Tiger (in that order, as I reverted back to solve this!) - as well as, I surmise, the problems reported by pmiller, paulspiteri, aakash.bapna, et al.

unless this breaks other environments, would seriously suggest that your change replace what is at the top of this page.

Many thanks!

Comment by oldnemesis, Nov 11, 2007

Worth mengioning that the offset for xcode25_8m2558_developerdvd.dmg is 1381744

Comment by willdtz, Nov 12, 2007

mrichards: fwiw, I couldn't get things to work with xcode 3 on linux--there's a readily available torrent for 2.4.1, and that did the trick just fine.

Comment by uitdesloot, Nov 15, 2007

When I try to build the toolchain (on MacOSX 10.4.11) everything goes fine until I get to darwin-crt3.c. Here the assembler starts failing with all sorts of strange error messages ("Unknown pseudo-op: .word" is the most decent one, later on it seems to be trying to compile comments after # signs, etc).

If I force the build onwards (by touching darwin-crt3.o) things go equally bad later when trying to build parts of libgcc.

I assume that I've somehow mixed my arm toolchain with the native toolchain or something (I didn't install into /usr/local but into a private dir), do these symptoms ring a bell for anyone?

Comment by da...@nycjava.net, Nov 16, 2007

Could someone please update the instructions to specify which build to use (I always have problems when using trunk) If you're going to specify a version for llvm, then we should do so for iphone-dev as well.

Anyway I have this issue with cross-compiling that points to the toolchain not using the correct lib, e.g. when specifying -liconv it uses /usr/lib/libiconv.dylib thus giving warnings and errors such as:

/usr/local/bin/arm-apple-darwin-ld: warning /usr/lib/libiconv.dylib cputype (18, architecture ppc) does not match cputype (12) for specified -arch flag: arm (file not loaded) /usr/local/bin/arm-apple-darwin-ld: Undefined symbols: libiconv

This isn't a bug with building the toolchain but with using it (on 10.4.10 PPC) should I file submit it as an issue or could it be somethign else? -thanks

Comment by neilpep, Nov 18, 2007

Have built the toolchain on a OS X 10.4.10 successfully.

Am trying to build helloworld app and getting the same problem that 3 other people are reporting

/usr/local/lib/gcc/arm-apple-darwin/4.0.1/../../../../arm-apple-darwin/include/TargetConditionals??.h:110:10: error: #error unrecognized GNU C compiler

Has anyone a solution to this yet ?

So close and yet so far!

Comment by alex.fishman, Nov 19, 2007

For those who get #error unrecognized GNU C compiler

This is because header files are installed incorrectly without pre-patching for arm architecture. Could happen because 'patch' utility is missing, install it first.

Comment by neilpep, Nov 21, 2007

Looks like its installed as standard (or installed as part of something else)

$ patch --version patch 2.5.8 Copyright (C) 1988 Larry Wall Copyright (C) 2002 Free Software Foundation, Inc.

This program comes with NO WARRANTY, to the extent permitted by law. You may redistribute copies of this program under the terms of the GNU General Public License. For more information about these matters, see the file named COPYING.

written by Larry Wall and Paul Eggert

Any other ideas ?

Comment by stubma, Nov 23, 2007

For those who get #error unrecognized GNU C compiler

I found that patch failed to patch TargetConditions?.h. You can fix it manually, just open /path-to-your-iphone-dev/include/include/TargetConditions?.h.diff, and apply it manually.

For the lazy buddies, here is the correct TargetConditions?.h, replace usr/local/arm-apple-drawin/include/TargetConditions?.h with it

/*
     File:       TargetConditionals.h
 
     Contains:   Autoconfiguration of TARGET_ conditionals for Mac OS X
	 
                 Note:  TargetConditionals.h in 3.4 Universal Interfaces works
						with all compilers.  This header only recognizes compilers
						known to run on Mac OS X.
 
     Copyright:  (c) 2000-2004 by Apple Computer, Inc., all rights reserved.
 
*/

#ifndef __TARGETCONDITIONALS__
#define __TARGETCONDITIONALS__
/****************************************************************************************************

    TARGET_CPU_*    
    These conditionals specify which microprocessor instruction set is being
    generated.  At most one of these is true, the rest are false.

        TARGET_CPU_PPC          - Compiler is generating PowerPC instructions for 32-bit mode
        TARGET_CPU_PPC64		- Compiler is generating PowerPC instructions for 64-bit mode
        TARGET_CPU_68K          - Compiler is generating 680x0 instructions
        TARGET_CPU_X86          - Compiler is generating x86 instructions
        TARGET_CPU_MIPS         - Compiler is generating MIPS instructions
        TARGET_CPU_SPARC        - Compiler is generating Sparc instructions
        TARGET_CPU_ALPHA        - Compiler is generating Dec Alpha instructions
        TARGET_CPU_ARM          - Compiler is generating ARM instructions


    TARGET_OS_* 
    These conditionals specify in which Operating System the generated code will
    run. At most one of the these is true, the rest are false.

        TARGET_OS_MAC           - Generate code will run under Mac OS
        TARGET_OS_WIN32         - Generate code will run under 32-bit Windows
        TARGET_OS_UNIX          - Generate code will run under some non Mac OS X unix 


    TARGET_RT_* 
    These conditionals specify in which runtime the generated code will
    run. This is needed when the OS and CPU support more than one runtime
    (e.g. Mac OS X supports CFM and mach-o).

        TARGET_RT_LITTLE_ENDIAN - Generated code uses little endian format for integers
        TARGET_RT_BIG_ENDIAN    - Generated code uses big endian format for integers    
        TARGET_RT_64_BIT        - Generated code uses 64-bit pointers    
        TARGET_RT_MAC_CFM       - TARGET_OS_MAC is true and CFM68K or PowerPC CFM (TVectors) are used
        TARGET_RT_MAC_MACHO     - TARGET_OS_MAC is true and Mach-O/dlyd runtime is used

****************************************************************************************************/


/*
 *	gcc based compiler used on Mac OS X
 */
#if defined(__GNUC__) && ( defined(__APPLE_CPP__) || defined(__APPLE_CC__) || defined(__MACOS_CLASSIC__) )
    #define TARGET_OS_MAC               1
    #define TARGET_OS_WIN32             0
    #define TARGET_OS_UNIX              0
    #if defined(__ppc__) 
        #define TARGET_CPU_PPC          1
        #define TARGET_CPU_PPC64        0
        #define TARGET_CPU_68K          0
        #define TARGET_CPU_X86          0
        #define TARGET_CPU_MIPS         0
        #define TARGET_CPU_SPARC        0   
        #define TARGET_CPU_ALPHA        0
        #define TARGET_CPU_ARM          0 
        #define TARGET_RT_LITTLE_ENDIAN 0
        #define TARGET_RT_BIG_ENDIAN    1
        #define TARGET_RT_64_BIT        0
        #ifdef __MACOS_CLASSIC__
           #define TARGET_RT_MAC_CFM    1
           #define TARGET_RT_MAC_MACHO  0
        #else
           #define TARGET_RT_MAC_CFM    0
           #define TARGET_RT_MAC_MACHO  1
       #endif
    #elif defined(__ppc64__) 
        #define TARGET_CPU_PPC          0
        #define TARGET_CPU_PPC64        1
        #define TARGET_CPU_68K          0
        #define TARGET_CPU_X86          0
        #define TARGET_CPU_MIPS         0
        #define TARGET_CPU_SPARC        0   
        #define TARGET_CPU_ALPHA        0
        #define TARGET_CPU_ARM          0 
        #define TARGET_RT_LITTLE_ENDIAN 0
        #define TARGET_RT_BIG_ENDIAN    1
        #define TARGET_RT_64_BIT        1
        #define TARGET_RT_MAC_CFM       0
        #define TARGET_RT_MAC_MACHO     1
     #elif defined(__i386__) 
        #define TARGET_CPU_PPC          0
        #define TARGET_CPU_PPC64        0
        #define TARGET_CPU_68K          0
        #define TARGET_CPU_X86          1
        #define TARGET_CPU_MIPS         0
        #define TARGET_CPU_SPARC        0
        #define TARGET_CPU_ALPHA        0
        #define TARGET_CPU_ARM          0 
        #define TARGET_RT_MAC_CFM       0
        #define TARGET_RT_MAC_MACHO     1
        #define TARGET_RT_LITTLE_ENDIAN 1
        #define TARGET_RT_BIG_ENDIAN    0
        #define TARGET_RT_64_BIT        0
     #elif defined(__arm__)
         #define TARGET_CPU_PPC          0
         #define TARGET_CPU_PPC64        0
         #define TARGET_CPU_68K          0
         #define TARGET_CPU_X86          0
         #define TARGET_CPU_X86_64       0
         #define TARGET_CPU_MIPS         0
         #define TARGET_CPU_SPARC        0
         #define TARGET_CPU_ALPHA        0
         #define TARGET_CPU_ARM          1 
         #define TARGET_RT_MAC_CFM       0
         #define TARGET_RT_MAC_MACHO     1
         #define TARGET_RT_LITTLE_ENDIAN 1
         #define TARGET_RT_BIG_ENDIAN    0
         #define TARGET_RT_64_BIT        0 
    #else
        #error unrecognized GNU C compiler
    #endif


/*
 *   CodeWarrior compiler from Metrowerks/Motorola
 */
#elif defined(__MWERKS__)
    #define TARGET_OS_MAC               1
    #define TARGET_OS_WIN32             0
    #define TARGET_OS_UNIX              0
    #if defined(__POWERPC__)
        #define TARGET_CPU_PPC          1
        #define TARGET_CPU_PPC64        0
        #define TARGET_CPU_68K          0
        #define TARGET_CPU_X86          0
        #define TARGET_CPU_MIPS         0
        #define TARGET_CPU_SPARC        0
        #define TARGET_CPU_ALPHA        0
        #define TARGET_RT_LITTLE_ENDIAN 0
        #define TARGET_RT_BIG_ENDIAN    1
    #elif defined(__INTEL__)
        #define TARGET_CPU_PPC          0
        #define TARGET_CPU_PPC64        0
        #define TARGET_CPU_68K          0
        #define TARGET_CPU_X86          1
        #define TARGET_CPU_MIPS         0
        #define TARGET_CPU_SPARC        0
        #define TARGET_CPU_ALPHA        0
        #define TARGET_RT_LITTLE_ENDIAN 1
        #define TARGET_RT_BIG_ENDIAN    0
    #else
        #error unknown Metrowerks CPU type
    #endif
    #define TARGET_RT_64_BIT            0
    #ifdef __MACH__
        #define TARGET_RT_MAC_CFM       0
        #define TARGET_RT_MAC_MACHO     1
    #else
        #define TARGET_RT_MAC_CFM       1
        #define TARGET_RT_MAC_MACHO     0
    #endif

/*
 *   unknown compiler
 */
#else
    #if defined(TARGET_CPU_PPC) && TARGET_CPU_PPC
        #define TARGET_CPU_PPC64 0
        #define TARGET_CPU_68K   0
        #define TARGET_CPU_X86   0
        #define TARGET_CPU_MIPS  0
        #define TARGET_CPU_SPARC 0
        #define TARGET_CPU_ALPHA 0
    #elif defined(TARGET_CPU_PPC64) && TARGET_CPU_PPC64
        #define TARGET_CPU_PPC   0
        #define TARGET_CPU_68K   0
        #define TARGET_CPU_X86   0
        #define TARGET_CPU_MIPS  0
        #define TARGET_CPU_SPARC 0
        #define TARGET_CPU_ALPHA 0
    #elif defined(TARGET_CPU_X86) && TARGET_CPU_X86
        #define TARGET_CPU_PPC   0
        #define TARGET_CPU_PPC64 0
        #define TARGET_CPU_68K   0
        #define TARGET_CPU_MIPS  0
        #define TARGET_CPU_SPARC 0
        #define TARGET_CPU_ALPHA 0
    #else
        /*
            NOTE:   If your compiler errors out here then support for your compiler 
            has not yet been added to TargetConditionals.h.  
            
            TargetConditionals.h is designed to be plug-and-play.  It auto detects
            which compiler is being run and configures the TARGET_ conditionals
            appropriately.  
            
            The short term work around is to set the TARGET_CPU_ and TARGET_OS_
            on the command line to the compiler (e.g. -DTARGET_CPU_MIPS=1 -DTARGET_OS_UNIX=1)
            
            The long term solution is to add a new case to this file which
            auto detects your compiler and sets up the TARGET_ conditionals.
            Then submit the changes to Apple Computer.
        */
        #error TargetConditionals.h: unknown compiler (see comment above)
        #define TARGET_CPU_PPC    0
        #define TARGET_CPU_68K    0
        #define TARGET_CPU_X86    0
        #define TARGET_CPU_MIPS   0
        #define TARGET_CPU_SPARC  0
        #define TARGET_CPU_ALPHA  0
    #endif
    #define TARGET_OS_MAC                1
    #define TARGET_OS_WIN32              0
    #define TARGET_OS_UNIX               0
    #if TARGET_CPU_PPC || TARGET_CPU_PPC64
        #define TARGET_RT_BIG_ENDIAN     1
        #define TARGET_RT_LITTLE_ENDIAN  0
    #else
        #define TARGET_RT_BIG_ENDIAN     0
        #define TARGET_RT_LITTLE_ENDIAN  1
    #endif
    #if TARGET_CPU_PPC64
        #define TARGET_RT_64_BIT         1
    #else
        #define TARGET_RT_64_BIT         0
    #endif
    #ifdef __MACH__
        #define TARGET_RT_MAC_MACHO      1
        #define TARGET_RT_MAC_CFM        0
    #else
        #define TARGET_RT_MAC_MACHO      0
        #define TARGET_RT_MAC_CFM        1
    #endif
	
#endif

#endif  /* __TARGETCONDITIONALS__ */
Comment by neilpep, Nov 24, 2007

That did the trick thanks very much.

Manny

Comment by emanuele.cipolloni, Nov 24, 2007

I installed and compiled the toolchain ok, I've been able to compile several project successfully, now I have started to build a C++ based project, I changed compiler from gcc to g++, compiles ok, but it complains at link stage with:

/usr/local/bin/arm-apple-darwin-ld: can't locate file for: -lstdc++

In fact I have searched for this file in all "usr" but it doesn't seems to exist, has any body been able to build a C++ project using current toolchain?

Many thanks.

Comment by dbsausag...@dsl.pipex.com, Nov 25, 2007

Built toolchain last night 100% ok - followed directions to the letter, no warnings, errors or the like. This is on G4 iBook on 10.4.10. Have now built MobileTerminal??.app with no problems.

WRT getting the iPod/iPhone root FS - there is now an 'afp' port. So you can set HEAVENLY to /Volumes/iPhone Root FileSystem?? - as long as you remember to connect before doing builds ? In the end I copied from my iPod touch to the local FS via afp but could do either way.

'afp' Info. here: Use the latest version.

http://www.tuaw.com/2007/11/11/afp-for-iphone-and-ipod-touch/ http://wickedpsyched.net/iphone/afp/

Comment by neilpep, Nov 28, 2007

Hi There emanuele.cipolloni

Yes that was my main aim to build a iPhone app with ObjC & C++ cross compliled and have successfully built apps with both, had to fiddle with the mak file of the test app quite a bit, but never got that link error.

I used the HelloWorld? test app as the base, I then renamed the .m files .mm, added a very simple c++ class in a .h and .cpp file, then newed and deleted it an instance of the test class in the applicationDidFinishLaunching so the constructor/destructors would get invoked.

This is the makefile I ended up with :-

CC=arm-apple-darwin-g++ LD=$(CC) LDFLAGS=-lobjc -framework CoreFoundation? -framework Foundation -framework UIKit -framework LayerKit?

all: Hello

Hello: hello.o HelloApplication?.o HelloTest?.o

$(LD) $(LDFLAGS) -o $@ $^

%.o: %.mm

$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@

%.o: %.cpp

$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@

clean:

rm -f .o Hello

Comment by jlongman, Nov 30, 2007

if you're on Leopard and having a hard time compiling odcctools, [here|http://conceitedsoftware.com/iphone/Toolchain%20on%20Leopard.txt]

Comment by jlongman, Dec 01, 2007

which is similar to many comments in issues here ;-)

Comment by avocade, Dec 01, 2007

A missing file ("UIKeyboardInputProtocol.h") in UIKit (which is #imported in another UIKit file) makes it unable to compile for example mobile-colloquy.

Comment by jlongman, Dec 04, 2007

Solved this by re-installing xcode-3.0.

Gah, now I can't even run ./configure when compiling llvm, in the first step.

configure:2773: gcc    conftest.c  >&5
/usr/libexec/gcc/i686-apple-darwin9/4.0.1/ld: warning unknown -macosx_version_min parameter value: 10.5.1 ignored (using 10.4)
/usr/libexec/gcc/i686-apple-darwin9/4.0.1/ld: /usr/lib/gcc/i686-apple-darwin9/4.0.1/../../../libgcc_s.10.5.dylib load command 8 unknown cmd field
/usr/libexec/gcc/i686-apple-darwin9/4.0.1/ld: /usr/lib/gcc/i686-apple-darwin9/4.0.1/../../../libSystem.dylib unknown flags (type) of section 6 (__TEXT,__dof_plockstat) in load command 0
collect2: ld returned 1 exit status
configure:2776: $? = 1
Comment by gargoylle.ltk, Dec 04, 2007

Successfully build on Gentoo x86_64. The only problem I ran into was that

$ ../../llvm-gcc-4.0-iphone/configure --enable-llvm=`llvm-config --obj-root` \
--enable-languages=c,c++,objc,obj-c++ --target=arm-apple-darwin --enable-sjlj-exceptions \
--with-heavenly=$HEAVENLY --with-as=/usr/local/bin/arm-apple-darwin-as \
--with-ld=/usr/local/bin/arm-apple-darwin-ld
$ make LLVM_VERSION_INFO=2.0-svn-iphone-dev-0.3-svn

failed - I don't remember the exact error message but it was clear that configure did not properly set LD. To recover from the error I ran the following commands:

$ make distclean
$ find . -type f -name config.cache -exec rm {} ";"
$ export LD=/usr/local/bin/arm-apple-darwin-ld
$ export AS=/usr/local/bin/arm-apple-darwin-as
$ ../../llvm-gcc-4.0-iphone/configure --enable-llvm=`llvm-config --obj-root` \
--enable-languages=c,c++,objc,obj-c++ --target=arm-apple-darwin --enable-sjlj-exceptions \
--with-heavenly=$HEAVENLY --with-as=/usr/local/bin/arm-apple-darwin-as \
--with-ld=/usr/local/bin/arm-apple-darwin-ld
$ make LLVM_VERSION_INFO=2.0-svn-iphone-dev-0.3-svn

After that everything went smooth (no compilation errors) and I was able to successfully build and run the UIKit Hello World application.

PS: to build odcctools I had to

export CFLAGS="-m32"
export LDFLAGS="-m32"

build and install them and then

unset CFLAGS LDFLAGS

Hope this helps someone.

Comment by neilpep, Dec 05, 2007

Hi

Anyone know of any good online guides on UIKit?

Thanks

Comment by ma...@freaks-brigade.com, Dec 10, 2007

Hi ! I ran into the following problem:

[root@91 odcctools]# setarch i386 -sh-3.1# bash [root@91 odcctools]# pwd /data/src/iphone-dev/build/odcctools [root@91 odcctools]# export CFLAGS="-m32" [root@91 odcctools]# export LDFLAGS="-m32" [root@91 odcctools]# ../../odcctools/configure --target=arm-apple-darwin --disable-ld64 checking build system type... i686-pc-linux-gnu checking host system type... i686-pc-linux-gnu checking target system type... arm-apple-darwin checking for gcc... gcc checking for C compiler default output file name... configure: error: C compiler cannot create executables See `config.log' for more details. [root@91 odcctools]# pwd /data/src/iphone-dev/build/odcctools [root@91 odcctools]# uname -a Linux 91.126.25.179 2.6.18-8.1.15.el5 #1 SMP Mon Oct 22 08:32:28 EDT 2007 i686 athlon i386 GNU/Linux [root@91 odcctools]#

Would be great if someone could help. Thankx !

Marty

Comment by micha.knaus, Dec 11, 2007

Hi

Comment by micha.knaus, Dec 11, 2007

Hi

On Ubuntu 7.04 i ran into the same problem already reported:

arm-apple-darwin-lipo: can't figure out the architecture type of: libgcc_s.10.4.dylib_T

Anyone have an idea ? Thanks in advance ! Micha

Comment by a...@db.org, Dec 13, 2007

many thanks for the detailed instructions. I finally managed to install the toolchain on my Debian Etch/AMD64 (with some hacks). When building some code with the toolchain I get this error:

$ make CC=arm-apple-darwin-gcc /usr/local/bin/arm-apple-darwin-ld: /usr/local/lib/gcc/arm-apple-darwin/4.0.1/libgcc.a(udivsi3.o) has external relocation entries in non-writable section (TEXT,text) for symbols: div0 collect2: ld returned 1 exit status