|
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- Ensure that you have a copy of bison and flex installed on your system. All major systems should have these tools installed or available in package management systems.
$ bison --version
GNU Bison version 1.28
$ flex --version
flex version 2.5.4 - Check out a copy of LLVM SVN, and build a release build (as opposed to a debug one). Currently, due to Issue 70, we are limited to revision 42498.
$ svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm-svn -r 42498
$ pushd llvm-svn
$ ./configure --enable-optimized
$ make ENABLE_OPTIMIZED=1
$ sudo make install
$ LLVMOBJDIR=`pwd`
$ popd - Check out a copy of the iphone-dev SVN repository.
$ svn checkout http://iphone-dev.googlecode.com/svn/trunk/ iphone-dev
$ pushd iphone-dev - Make a directory to hold the toolchain.
$ sudo mkdir /usr/local/arm-apple-darwin $ mkdir -p build/odcctools
$ pushd build/odcctools
$ ../../odcctools/configure --target=arm-apple-darwin --disable-ld64
$ make
$ sudo make install
$ popd - Get a copy of the iPhone root filesystem. This is usually obtained by decrypting and extracting the iPhone restore software using these tools, but there are many other methods to obtain this, including simply using scp to download all the files from the iPhone over Wi-Fi. Unpack the root filesystem somewhere, and set the environment variable $HEAVENLY to its path.
$ HEAVENLY=/usr/local/share/iphone-filesystem - Install the iPhone headers to the appropriate place. If you aren't on Mac OS X, replace the /Developer/SDKs/MacOSX10.4u.sdk path with the full path to the unpacked Mac OS X 10.4 Universal SDK. If you don't have a copy of this, see below.
$ pushd include
$ ./configure --with-macosx-sdk=/Developer/SDKs/MacOSX10.4u.sdk
$ sudo bash install-headers.sh
$ popd - Install csu, which includes crt1.o, dylib1.o, and bundle1.o. Don't rebuild them from source, as this requires a working cross-GCC, which you don't have yet (and the build-from-source process for csu is broken right now anyway). Binaries are provided for this reason.
$ mkdir -p build/csu
$ pushd build/csu
$ ../../csu/configure --host=arm-apple-darwin
$ sudo make install
$ popd - Only if you are compiling on leopard 10.5. This is an ugly workaround and compiling with the resulting toolchain will give you a warning.
$ mv llvm-gcc-4.0-iphone/configure llvm-gcc-4.0-iphone/configure.old
$ sed 's/^FLAGS_FOR_TARGET=$/FLAGS_FOR_TARGET=${FLAGS_FOR_TARGET-}/g' \
llvm-gcc-4.0-iphone/configure.old > llvm-gcc-4.0-iphone/configure
$ export FLAGS_FOR_TARGET="-mmacosx-version-min=10.1"
$ sudo ln -s /usr/local/arm-apple-darwin/lib/crt1.o \
/usr/local/arm-apple-darwin/lib/crt1.10.5.o- Configure and make LLVM-GCC. Make sure that $LLVMOBJDIR and $HEAVENLY are set per the instructions above.
$ mkdir -p build/llvm-gcc-4.0-iphone
$ pushd build/llvm-gcc-4.0-iphone
$ ../../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 --enable-wchar_t=no
$ make LLVM_VERSION_INFO=2.0-svn-iphone-dev-0.3-svn
$ sudo make install
$ popd
$ popd HOWTO obtain the Mac OS X headers on Linux or Windows- Install the cpio utility using your distribution's standard package management system. All the major Linux distributions, as well as Cygwin, should have this utility.
- Download the Xcode DMG from Apple's Developer Tools download page. It is free, but you will need to register with them. It is also huge (~924 MB).
- Extract the Packages/MacOSX10.4.Universal.pkg directory from the Xcode DMG. Do not use the Linux kernel's HFS+ loopback mount: it does not support the format used by this DMG, and your files will be corrupted. One program that is known to work is PowerISO, although it isn't free.
- Extract the pax archive inside the Mac OS X 10.4 SDK package.
mkdir MacOSX10.4-Universal-SDK
pushd MacOSX10.4-Universal-SDK
gunzip -c ../MacOSX10.4.Universal.pkg/Contents/Archive.pax.gz | cpio -i
popd The SDK files should now live in MacOSX10.4-Universal-SDK/Developer/SDKs/MacOSX10.4u.sdk in the current directory. You'll pass the path to this directory to the configure script in the include directory. Feel free to get rid of the Xcode DMG and the package directory now. Gotchas- Make sure that there are no spaces in any of the directory names that you use. GCC does not build if there are spaces in the directory names, and the shell scripts will not work. This is most often a problem on Windows.
- Make sure that /usr/local/bin is in your PATH. This is not the case out of the box on Mac OS X, although chances are if you've installed things from source before you've added it already.
- If LLVM failed to compile because of missing bison and/or flex (evidence that this was the case is a failed compile on utils/TableGen/FileLexer.l), you must make clean and delete utils/TableGen/FileParser.h before trying again with bison and flex installed. LLVM's make clean script does not always properly clean up after a failed build.
- Make sure that $HEAVENLY points to a copy of the full iPhone root filesystem, not just the unpacked update DMG. If you get errors about being unable to find -lc, then your $HEAVENLY is set incorrectly, you mistyped the --with-heavenly option to configure, or your copy of the root partition is incomplete. Your copy of the iPhone root filesystem must include a usr/lib/libc.dylib file.
|
An easy way to to extract the archive from the current dmg in linux is this:
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/nullNote: 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
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
While doing the following sequence:
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:
-r2
HFSExplorer can be used to extract .dmg files. Works on Windows, no idea about Linux. http://hem.bredband.net/catacombae/hfsx.html
File bug reports, please. I can much better respond to them when they're bug reports and not comments here. Thanks!
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.
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
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)?
Agreed. I finally successfully completed this process, but arm-apple-darwin-cc is not in /usr/local/bin.
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.
Thank you very much. Is there any reason why we're using llvm-gcc-4.0 instead of llvm-gcc-4.2?
LLVM-GCC 4.2 is very unstable at the moment. It should only be used if you're a GCC hacking wizard.
I see. You sir, are cleary more a GCC hacking wizard that most of us. :)
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.
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!
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.
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
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
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
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
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
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
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!
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.
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?
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):
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.
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
/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.
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.
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.
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!
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!
errors.c is in libstuff dir btw
@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...
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:
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 compilerNow 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
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.
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.
In order to compile odcctools on a x86-64 fedora linux machine, I did the following:
before the configure step do
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.
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?
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?
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 \
LD=$(CC)all: MobileTest? package
MobileTest?: main.o MobileTest?.o
%.o: %.m %.c
package: clean: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.
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
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?
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?
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.
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 :)
Any confirmation on building the latest toolkit on Windows?
Success on CentOS 4
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
I got follow error when compoling the llvm-gcc-4.0-iphone on IntelMac?? with OSX10.4.10:
Does anyone know how to avoid this error??
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.).
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!
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
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.
anybody gotten standard C++ libraries to compile on this darn thing? The instructions on the old Wiki don't work.
assert.h referenced eprintf, I just replace assert.h with
compile ok now.
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?
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
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?
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.
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
The problem from madfxgao got a bugtracker number: issue#70. It is also my problem now...
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.
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.
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?
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?
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.
nvm, Hello makefile doesn't chmod the combiled binaries, works now.
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
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.
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.
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)?
There's a torrent with the root filesystem on thepiratebay.org - simply search for iPhone.
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
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.
Some of the headers appear to be missing, (eg. ABAddressBookUI) - was this an intentional omission?
put Hello in /Applications or /bin or /sbin or the like.
Can someone post a version of this compiled for OS X 10.4?
It would help a bunch. Thanks.
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...
can anyone provide iphone ROOT archived?
apple can. just grab it from their site and decrypt it
senks. already have one
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?
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
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!!
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 :)
"/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.
Because the make step of LLVM-GCC seems to be reliant on running bash, perhaps include this in the instructions.
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..
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.
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 "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 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?
yes. you have to do this for all .dylib files that include paths.
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?
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.
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
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..
still getting the same error
try this test app- http://absolutech.org/files/testApp.rar it worked for me ...
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
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.
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?.
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
# 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.
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
Just noticed I do not have a 'configure' file in ../../llvm-gcc-4.0-iphone/ location
>>compukid If that doesn't work, do this:
pushd ../../llvm-gcc-4.0-iphone/ chmod 777 ./ popd
then try it again
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 ?
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’
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"
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?
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?
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?
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.
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" ??
dkgamez and simerjots:
instead of:
try:
That seemed to fix that problem for me.
Has anybody tried to obtain the headers from the xcode 3 dmg on Linux? Been trying several things, seems something has changed..
Compiling odcctools fails on freebsd, same problem as brookstalley using freebsd 6.2 http://pastebin.com/f162e6e32
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!
Worth mengioning that the offset for xcode25_8m2558_developerdvd.dmg is 1381744
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.
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?
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
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!
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.
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 ?
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__ */That did the trick thanks very much.
Manny
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.
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/
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
if you're on Leopard and having a hard time compiling odcctools, [here|http://conceitedsoftware.com/iphone/Toolchain%20on%20Leopard.txt]
which is similar to many comments in issues here ;-)
A missing file ("UIKeyboardInputProtocol.h") in UIKit (which is #imported in another UIKit file) makes it unable to compile for example mobile-colloquy.
Solved this by re-installing xcode-3.0.
Gah, now I can't even run ./configure when compiling llvm, in the first step.
Successfully build on Gentoo x86_64. The only problem I ran into was that
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-svnAfter 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
build and install them and then
Hope this helps someone.
Hi
Anyone know of any good online guides on UIKit?
Thanks
Hi ! I ran into the following problem:
odcctools?# setarch i386 -sh-3.1# bash odcctools?# pwd /data/src/iphone-dev/build/odcctools odcctools?# export CFLAGS="-m32" odcctools?# export LDFLAGS="-m32" 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. odcctools?# pwd /data/src/iphone-dev/build/odcctools 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 odcctools?#
Would be great if someone could help. Thankx !
Marty
Hi
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
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
any idea? the same error happens with several programs..
Succeed on Cygwin under Windows XP.
Note: please DO NOT "make clean" after "make install".
It could be useful to know that the offset on the current xcode image (xcode25_8m2558_developerdvd.dmg) is 1381744. I also didn't have the pax utility so my command line looked like this:
dd if=xcode25_8m2558_developerdvd.img skip=1381744 | gunzip | cpio -i
On Leopard, I somehow managed to not have llvm-config. I get the following error:
MacBook?:iphone-dev user$ ../../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-config: command not found -bash: ../../llvm-gcc-4.0-iphone/configure: No such file or directory Anyone know what I'm doing wrong?
for one that want to compile a objc, c++ mixed project, remember to add the following options in the LDFLAGS:
LDFLAGS=-L/usr/local/lib ....
because those cpp library is compiled to /usr/local/lib rather than /user/local/arm-apple-darwin/lib and you will get cannot find stdc++ library error.
When I try to compile anything, even code i've checked out from working iPhone app repositories, I get a bunch of errors where header files are missing. They are always the same and are included into foundation.h: NSCodingProtocol.h NSCopyingProtocol.h
Google doesn't return anything useful, I don't think i've missed a step out in the installation..
This is on OS X Leopard.
The actual errors in the XCode build results are from NSAffineTransform.h.
Can anyone help with this error on leopard?
cd libstuff && make gcc -Wall -Wno-long-double -Wno-import -DHAVE_CONFIG_H -I..//include -I../../../odcctools/include -g -O2 -fno-builtin-round -fno-builtin-trunc -no-cpp-precomp -mdynamic-no-pic -c -o execute.o ../../../odcctools/libstuff/execute.c In file included from ../../../odcctools/include/libkern/OSByteOrder.h:70, from ../../../odcctools/include/mach/ndr.h:94, from ../../../odcctools/include/mach/clock_priv.h:7, from ../../../odcctools/include/mach/mach_interface.h:37, from ../../../odcctools/include/mach/mach.h:62, from ../../../odcctools/libstuff/execute.c:25: ../../../odcctools/include/libkern/machine/OSByteOrder.h:45: error: redefinition of ‘OSSwapInt16’ /usr/include/libkern/i386/OSByteOrder.h:49: error: previous definition of ‘OSSwapInt16’ was here ../../../odcctools/include/libkern/machine/OSByteOrder.h:54: error: redefinition of ‘OSSwapInt32’ /usr/include/libkern/i386/OSByteOrder.h:58: error: previous definition of ‘OSSwapInt32’ was here ../../../odcctools/include/libkern/machine/OSByteOrder.h:63: error: redefinition of ‘OSSwapInt64’ /usr/include/libkern/i386/OSByteOrder.h:69: error: previous definition of ‘OSSwapInt64’ was here make1?: execute.o? Error 1 make: libstuff? Error 2
Hi,
I try to compile the toolchain on an Intel Leopard Machine, and it fails in the last but one step: make LLVM_VERSION_INFO=2.0-svn-iphone-dev-0.3-svn It fails when it checks for arm-apple-darwin-gcc . It executes gcc -isystem /usr/local/arm-apple-darwin/sys-include but I have not this sys-include directory anywhere. The make result is: checking for suffix of object files... configure: error: cannot compute suffix of object files: cannot compile See `config.log' for more details. make: configure-target-libstdc++-v3? Error 1
Can some help me fix this issue please?
@westbaer: I had the same problem. Do this: ../../odcctools/configure --target=arm-apple-darwin --disable-ld64 export INCPRIVEXT="-isysroot /Developer/SDKs/MacOSX10.4u.sdk" make
Another successful build on Ubuntu Fawn (Intel). I first used gamesover Cygwin install... but I rather work from a terminal in Linux any day.
:-)
Thanks, but I have an another problem.
/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
Sucessful build on Fedora 8 with gcc 4.1.2 20070925 and all patches up to date applied. The system is a VMWare 6.02 partition runing on XP on a HP nx9420 with Intel Centrino Duo.
Now time for HelloWorld? :)
Here is a pdf giving some simpler steps to install the toolchain : http://lucasnewman.com/phonedev.pdf
You'll have troubles compiling vfdecrypt under a core2duo leopard machine, as i did. Thus, google for a vfdecrypt binary, and you should be done.
Hi,
I have written a HOWTO for building a working 1.1.2 toolchain (or previous versions) under Leopard - get it at:
http://groups.google.com/group/jiggyapp-devel/web/iphone_leopard_toolchain_howto.rtf
It is a full step-by-step guide that includes downloading all the tools, firmware files, decryption utils, plus all the workarounds that fix the build process and the extra commands necessary to fix the holes in the current documentation on this site and others.
Hope it helps.
Cheers,
DamHack?
@DamHack? - damianlewis
Thanks for the HOWETO for Leopard. Do you know if this works with a PPC?
Works fine on my PPC G4 Leopard!
Ok. I've compiled 1.1.2 toolchain using cygwin on WinXP (before i've realized there is a special package) nvmnd
Question about compiling (optimize) what is the smallest filesize of the output executable? After standard -O3 & strip it's always 12956 for simple int main(int argc,char**argv){} Comparing to NerveGas?' BSD/alias 8864 is far too much (: is there some kind of asm here?
For those of you still getting that Error 2 message, here's what I did. I was getting some message about it not finding arm-apple-darwin-ranlib, so I checked to see if it was in /usr/local/bin, and it was, so I checked to see if /usr/local/bin was in my PATH, and it was, and I could run arm-apple-darwin-ranlib just fine from a terminal, so instead of sudo make install, I just did a su, and then make install, and it worked fine.
openSuSE 10.3.
or you used sudo to copy iphone-filesystem to /usr/local/share, but you don't have permissions to that folder. TRY:
Hiya ppl if Useing Windows Use VMWare it works and to mout to DMG download it in windows and mount it as CD Drive in linux works a treat
1.1.3 Help?
VMWare Image of them based on Debian 4R1: http://www.iphonefix.de/filebase/index.php?dir=iPhoneToolchain%20VMWare%20Image/
Hey neilpep, emanuele.cipolloni,
Are either of you still monitoring this thread? Was wondering if either of you made much progress in mixing C++ with ObjC in the same project?
As some other people here, I was also getting the following problem:
I got arm-apple-darwin-lipo to not complain by adding "-arch i386" between "-create" and libgcc_s.10.4.dylib_T
I went into ./gcc and entered the command manually. I needed to do the same for the binary for 10.5 that is build subsequently.
After that I got the whole toolchain compiled and managed to compile iPhone apps!
(I'm building on a Debian VM on Parallels... couldn't get it to build easily on Leopard)
ero.carrera: I have discovered similar problem today. The solution I found that worked for me is this one:
http://code.google.com/p/iphone-dev/issues/detail?id=86#c4
Add Source installer : http://iphonebaidu.com/app/ Test iPhone - iPhone Simulator : http://iphonebaidu.com/test/ All Software for Apple MAC : http://iphonebaidu.com/mac-iphone/ All Software for Apple iPhone : http://iphonebaidu.com/mac-iphone/iphone.html
Install iTransformy (.swf) view for iPhone : http://iphonebaidu.com/beta/ Forum iPhone : http://iphonebaidu.com/forum/
Copyright © 2008 iPhone Baidu! Inc. All rights reserved
does anyone want to work on porting GCC to the iphone itself...?
try copying libstdc++.dylib from /usr/local/lib to /usr/local/arm-apple-darwin/lib
to compile cpp programs
@ david.m.thornton Yes, I did it. It was a PITA to bootstrap it. It is fun, but I don't think it's very useful.
gcc on the iPhone almost compiles itself. Almost, because very big c++ sources fail to compile (preprocessed sources > 1.2M) because the whole Term is jettisoned when cc1plus eats up > 64MB of memory. I also had one c source that didn't compile but didn't crash either, perhaps gcc/llvm entered infinite loop. I had to manually compile those files off the iPhone.
woa woa woa - ok - woa
PITA ??? what
now go to iphone-gcc.googlecode.com... he
how did you do it .... also why did you use llvm... oh my god ive got so many questions to ask - ok do you want to be added to the iphone-gcc project...?
it would be sooooooo useful I will make a GUI IDE and it will be so sweet, seriously email me
Hi,
On Cygwin on Windows Vista, i obtain an error : could not locate -lcrt1.o
How to do ? Thanks
For libc.dylib complaining while building under Windows, iPhone firmware 1.1.2
I got the iphone filesystem by decrypting the .dmg then extracting using PowerISO and encountred the following problem while trying to compile helloWorld: /usr/local/bin/arm-apple-darwin-ld: /usr/local/arm-apple-darwin/filesystem/usr/lib/libc.dylib truncated or malformed object (mach header extends past the end of the file),
and after the reading of the posts here, i concluded that it is the symlink problem (the symlinks lost while extracting from the .dmg). And I've come up a script solving this:
Save the above as fixlink.sh, then copy to your cygwin /usr/local/arm-apple-darwin/filesystem folder. Open cygwin shell and type the following:
After it is done, the linking problem should no longer persist.
I get a compile error when running make for the odcctools (see below). Any ideas on how to correct this error? has anyone else run into this?
cd misc && make make1?: Nothing to be done for `default'. cd otool && make gcc -o otool main.o ofile_print.o m68k_disasm.o i860_disasm.o m88k_disasm.o i386_disasm.o ppc_disasm.o hppa_disasm.o sparc_disasm.o arm_disasm.o print_objc.o ofile.o -multiply_defined suppress -L..//libstuff -lstuff Undefined symbols: "print_objc_string_object_section_64", referenced from: processor in main.o "print_objc2", referenced from: processor in main.o ld: symbol(s) not found collect2: ld returned 1 exit status make1?: otool? Error 1 make: otool? Error 2
Does anyone have created an uninstall script ? Needed to switch to arm-apple-darwin-runtime port from DarwinPorts?. Not all packages have an "uninstall" rule..
does anyone here have a decrypted firmware for 1.1.4?
I was able to build toolchain on slax 5.8.8 with bison (GNU Bison) 2.1 flex version 2.5.4 gcc version 3.4.6
No special changes required.
Successfully build on Fedora core 8. hello world got compiled too. :)
I ran into this error doing make:
cd libstuff && make make1?: Entering directory `/home/skizzo/iphone-dev/build/odcctools/libstuff' gcc -Wall -Wno-long-double -Wno-import -DHAVE_CONFIG_H -DLITTLE_ENDIAN=1 -I..//include -I../../../odcctools/include -include ../../../odcctools/include/extern.h -I../../../odcctools/include/foreign -g -O2 -fno-builtin-round -fno-builtin-trunc -c -o ofile.o ../../../odcctools/libstuff/ofile.c In file included from ../../../odcctools/libstuff/ofile.c:44: ../../../odcctools/include/mach/ppc/thread_status.h:44:1: warning: "THREAD_STATE_NONE" redefined In file included from ../../../odcctools/include/mach/machine/thread_status.h:29, from ../../../odcctools/include/mach/thread_status.h:70, from ../../../odcctools/include/mach/exception_types.h:147, from ../../../odcctools/include/mach/mach_types.h:75, from ../../../odcctools/include/mach/mach.h:61, from ../../../odcctools/libstuff/ofile.c:32: ../../../odcctools/include/mach/i386/thread_status.h:110:1: warning: this is the location of the previous definition In file included from ../../../odcctools/libstuff/ofile.c:44: ../../../odcctools/include/mach/ppc/thread_status.h:53:1: warning: "VALID_THREAD_STATE_FLAVOR" redefined In file included from ../../../odcctools/include/mach/machine/thread_status.h:29, from ../../../odcctools/include/mach/thread_status.h:70, from ../../../odcctools/include/mach/exception_types.h:147, from ../../../odcctools/include/mach/mach_types.h:75, from ../../../odcctools/include/mach/mach.h:61, from ../../../odcctools/libstuff/ofile.c:32: ../../../odcctools/include/mach/i386/thread_status.h:127:1: warning: this is the location of the previous definition In file included from ../../../odcctools/libstuff/ofile.c:44: ../../../odcctools/include/mach/ppc/thread_status.h:155:1: warning: "MACHINE_THREAD_STATE" redefined In file included from ../../../odcctools/include/mach/machine/thread_status.h:29, from ../../../odcctools/include/mach/thread_status.h:70, from ../../../odcctools/include/mach/exception_types.h:147, from ../../../odcctools/include/mach/mach_types.h:75, from ../../../odcctools/include/mach/mach.h:61, from ../../../odcctools/libstuff/ofile.c:32: ../../../odcctools/include/mach/i386/thread_status.h:523:1: warning: this is the location of the previous definition In file included from ../../../odcctools/libstuff/ofile.c:44: ../../../odcctools/include/mach/ppc/thread_status.h:156:1: warning: "MACHINE_THREAD_STATE_COUNT" redefined In file included from ../../../odcctools/include/mach/machine/thread_status.h:29, from ../../../odcctools/include/mach/thread_status.h:70, from ../../../odcctools/include/mach/exception_types.h:147, from ../../../odcctools/include/mach/mach_types.h:75, from ../../../odcctools/include/mach/mach.h:61, from ../../../odcctools/libstuff/ofile.c:32: ../../../odcctools/include/mach/i386/thread_status.h:524:1: warning: this is the location of the previous definition ../../../odcctools/libstuff/ofile.c: In function ‘ofile_map’: ../../../odcctools/libstuff/ofile.c:747: warning: dereferencing type-punned pointer will break strict-aliasing rules ../../../odcctools/libstuff/ofile.c:3765:8: warning: extra tokens at end of #endif directive At top level: cc1: error: unrecognized command line option "-Wno-long-double" make1?: ofile.o? Error 1 make1?: Leaving directory `/home/skizzo/iphone-dev/build/odcctools/libstuff' make: libstuff? Error 2
Can you help me?
Succeed on Cygwin under Windows XP & Vista. (iPhone 1.1.4)
<<Windows Cygwin Binary Toolchain Installation>>
Solution for the problem: <<... /usr/local/bin/arm-apple-darwin-ld: can't locate file for: -lcrt1.o >>
..is... (step by step installation) 1)Do all the steps from the official page... (http://wiki.iphonegameover.com/Windows_Cygwin_Binary_Toolchain_Installation)
When asked 'Do you wish to connect to your device and download the required files?' Press n for No. <<<----
2) Decrypt a firmware ipsw manually and place the extracted filesystem in /usr/local/arm-apple-darwin/filesystem after Cygwin is installed.. (follow the next steps)
For Firmware 1.1.4 (i) get the vfdecrypt.exe from Rapid Share (http://rapidshare.com/files/112406081/vfdecrypt.rar.html) (ii) get the Apple's iPhone firmware 1.1.4 and rename it with extension .zip and unzip it (run) vfdecrypt -i 022-3894-4.dmg -o decrypted114.dmg -k d0a0c0977bd4b6350b256d6650ec9eca419b6f961f593e74b7e5b93e010b698ca6cca1fe
download 30 day eval of TransMac? (google and you will find)
Open decrypted114.dmg with TransMac?
Extract the applications you want and transfer the to /usr/local/arm-apple-darwin/filesystem
Start the installation ..
When you see the <<Your toolchain installation is now complete!>> message...
3) Copy/Replace the lib files of the following attachment to C:\cygwin\usr\local\arm-apple-darwin\filesystem\usr\lib http://rapidshare.com/files/66800884/lib.rar (14.2mb) Password for rar file is: aksblog.co.nr
4) Now you are ready to compile the first helloWorld app: http://rapidshare.com/files/112409124/helloWorld.rar.html. just decompress it in a folder e.g C:\cygwin\Developer\helloWorld and run <<make>> to do the job!
Enjoy ;)
Hi,
On redhat linux, at stage make LLVM_VERSION_INFO=2.0-svn-iphone-dev-0.3-svn, I get this error:
make2?: Entering directory `/root/naci/iphone/toolchain/iphone-dev/build/llvm-gcc-4.0-iphone/gcc' make GCC_FOR_TARGET="/root/naci/iphone/toolchain/iphone-dev/build/llvm-gcc-4.0-iphone/gcc/xgcc -B/root/naci/iphone/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" \ AR_FOR_TARGET="arm-apple-darwin-ar" \ AR_CREATE_FOR_TARGET="arm-apple-darwin-ar rc" \ AR_EXTRACT_FOR_TARGET="arm-apple-darwin-ar x" \ AR_FLAGS_FOR_TARGET="" \ CC="gcc" CFLAGS="-g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition " \ BUILD_PREFIX="" \ BUILD_PREFIX_1="loser-" \ LANGUAGES="" \ LIBGCC2_CFLAGS="-O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fPIC -pipe -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -DGCC_FLOAT_NOT_NEEDED -Dinhibit_libc " \ MULTILIB_CFLAGS="" T= crt3.o make3?: Entering directory `/root/naci/iphone/toolchain/iphone-dev/build/llvm-gcc-4.0-iphone/gcc' make3?: Leaving directory `/root/naci/iphone/toolchain/iphone-dev/build/llvm-gcc-4.0-iphone/gcc' /root/naci/iphone/toolchain/iphone-dev/build/llvm-gcc-4.0-iphone/gcc/xgcc -B/root/naci/iphone/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 -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fPIC -pipe -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -DGCC_FLOAT_NOT_NEEDED -Dinhibit_libc -dynamiclib -nodefaultlibs -install_name /usr/lib/libgcc_sif test . = ppc64 ; then echo _. ; fi.1.dylib -single_module -o ./libgcc_s.1.dylib.tmp -Wl,-exported_symbols_list,libgcc/./libgcc.map -compatibility_version 1 -current_version 1.0 libgcc/./udivsi3_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 libgcc/./ashldi3_s.o libgcc/./ashrdi3_s.o libgcc/./cmpdi2_s.o libgcc/./ucmpdi2_s.o libgcc/./floatdidf_s.o libgcc/./floatdisf_s.o libgcc/./fixunsdfsi_s.o libgcc/./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 libgcc/./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 libgcc/./subvsi3_s.o libgcc/./subvdi3_s.o libgcc/./mulvsi3_s.o libgcc/./mulvdi3_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 libgcc/./paritydi2_s.o libgcc/./powisf2_s.o libgcc/./powidf2_s.o libgcc/./powixf2_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 libgcc/./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: archive: /usr/lib/libc.a has no table of contents, add one with ranlib(1) (can't load from it) collect2: ld returned 1 exit status make2?: libgcc_s.dylib? Error 1 make2?: Leaving directory `/root/naci/iphone/toolchain/iphone-dev/build/llvm-gcc-4.0-iphone/gcc' make1?: stmp-multilib? Error 2 make1?: Leaving directory `/root/naci/iphone/toolchain/iphone-dev/build/llvm-gcc-4.0-iphone/gcc' make: all-gcc? Error 2
Any idea? Thanks,
nsical.
sorry for the above post, I hadn't set HEAVENLY correctly.
Folks, I am stuck at make LLVM_VERSION_INFO=2.0-svn-iphone-dev-0.3-svn:
checking for sin in -lm... configure: error: Link tests are not allowed after GCC_NO_EXECUTABLES. make: configure-target-libstdc++-v3? Error 1
Symlink in /usr/local/share/iphone-filesystem/usr/lib are ok as I got them from iphone with tar, scp, untar method.
This is on Red Hat 3.4.3-9.EL4. naciselim.
On my Ubuntu 8.04, LLVMOBJDIR=pwd should be changed to LLVMOBJDIR=$PWD And also I have to remove -Wno-long-double in odcctools makefiles during odcctools building process. After figuring out all of these, the tool chain can be build successfully!!!
I successfully installed everything on Sabayon (Gentoo based) wuth no errors, but when tring to build a simple Hello World example I get this:
/usr/local/libexec/gcc/arm-apple-darwin/4.0.1/collect2 -dynamic -arch arm -macosx_version_min 10.4 -syslibroot /usr/local/share/iphone-filesystem -weak_reference_mismatches non-weak -o SampleApp? -lcrt1.o -L/usr/local/lib/gcc/arm-apple-darwin/4.0.1 -L/usr/local/lib/gcc/arm-apple-darwin/4.0.1/../../../../arm-apple-darwin/lib -lobjc -framework CoreFoundation? -framework Foundation -framework UIKit -framework LayerKit? -framework CoreGraphics? mainapp.o SampleApp?.o -lgcc -lSystem /usr/local/bin/arm-apple-darwin-ld: can't locate framework for: -framework CoreFoundation? collect2: ld returned 1 exit status make: SampleApp? Error 1
I have extracted the SDKs from the XCode .dmg archive, they are installed with ./configure --with-macosx-sdk=/Developer/SDKs/MacOSX10.4u.sdk sudo bash install-headers.sh
I even reinstalled them, just in case, but still it does not compile.
When compiling LLVM-GCC, the toolchain does not successfully link against the libc.dylib from the leaked beta 5 (5a274d). This the error I receive:
On Ubuntu 8.04, I can make it all the way through the above steps (including doing the LLVMOBJDIR=$PWD and removing -Wno-long-double in the odcctools config file), but once I've apparently succeeded, I can't make any apps. Compilation fails when it tries to find files in /usr/local/arm-apple-darwin/include - the files that should have been copied there in the
$ ./configure --with-macosx-sdk=/Developer/SDKs/MacOSX10.4u.sdk $ sudo bash install-headers.sh
steps. Many files are copied there, but most of the .h files in the "capitalized" directories (CoreGraphics?, CoreServices?, IOKit, etc., etc.) are not copied over.
I finally caught the errors that fly by when running install-headers.sh and see that it's looking for
.../MacOSX10.4u.sdk//System/Library/Frameworks/CoreAudio?.framework/Headers .../MacOSX10.4u.sdk//System/Library/Frameworks/IOKit.framework/Headers etc. etc.
which in fact, do not exist in my xcode2.5 SDK. Instead, the .h files are mainly in subdirectories under those like .../Version/A/files.h
Anyone else have this problem? Does xcode3.0 work better? (I have a powerbook G4 running Tiger, so it doesn't want to touch xcode3.0 but was able to open 2.5)
Maybe tweaking install-headers.sh is the answer? What about the people who say they've got it all working on Ubuntu 8.04 - what xcode are you folks using?
Thanks.
To update my cry for help on Ubuntu 8.04 - I got it working by copying all the .h files that were missing from the framework so they are now in their correct places in /usr/local/arm-apple-darwin/include...
I can now compile programs and run them on my iPod Touch.
I have this same error building the llvm toolchain:
make1?: No rule to make target /Users/gdtv/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
I did not see an answer anywhere on the web. I was following a similiar Leopard Guide by NerveGas???.
This is probably the 3rd or 4th hurdle and the only one that I can't find an answer too but one or two other people ran into this in 2007.
Side note: any chance for an updated guide perhaps using Leopard 10.5.3 and any parts of Apple's SDK? Or simply a guide for 10.5.3 with all the patches and workarounds?
Back the LLVM error, any ideas?
Thank you!
Could it support fotran 77 language?
i'm gettin a bash error when doing the last step (setting up LLVM)...
bash: llvm-config: command not found
If you downloaded xcode_3.0.dmg (instead of 2.5), you'll find that it includes MacOSX10.4.Universal.pkg as a file and not a directory, so that the instructions above won't work.
To extract the contents of this file under Linux, I did the following:
The xar command comes standard on Ubuntu, I don't know about other distros.
Can I get some help with Leopard? The document linked above for Leopard users appears no longer to exist. I am on Leopard and have the 1.1.4 firmware. I get stuck here:
http://arslinux.pastebin.ca/1059719
Thanks.
hi,i try to follow this tutorial,but i can't get this:"Get a copy of the iPhone root filesystem. " i don't have Wi-Fi,but a cable.I don't known how to connect my iPhone to Fedora 8 and how to get the cope of my iPhone root filesystem. i'm a new comer,can anybody tell me how to do it, thanks a lot!
Hey,
Instead of trying to download the filesystem from your iPhone, you can try downloading one that has already been released. Try searching for "iphone firmware" on a torrent site and look at http://tungchingkai.blogspot.com/2008/01/decrypt-iphone-filesystem-firmware_28.html for tips on how to extract and decrypt it.
Hi,
I need some help here. I am trying to compile llvm-gcc on Debian but I get a compile error.
Please, someone help me. I have been trying for several weeks now to get an unofficial SDK running, and I always get caught at the last step.
now i already fix it ,thanks for ever...@mailinator.com,!
geeky geeks
I'm getting the same error as bankai at the link for libc:
while running OS X 10.4.11 with Xcode 2.4.1.
/usr/local/bin/arm-apple-darwin-ld: /Volumes/macos2/iphone-dev/iphone-filesystem/usr/lib/libc.dylib load command 7 unknown cmd field collect2: ld returned 1 exit status make2?: libgcc_s.dylib? Error 1 make1?: stmp-multilib? Error 2 make: all-gcc? Error 2
In several places, such as the apple xcode-users list (http://lists.apple.com/archives/xcode-users/2007/Dec/msg00440.html), the suggestion is to set MACOSX_DEPLOYMENT_TARGET=10.4 in the environment. I've tried that, but no dice thus far. It seems like it would run counter to the 'arm' target we're aiming for.
I should add that I'm using an iPod Touch fs after a 2.0 update.
Does this toolchain allow development of applications that run under 2.0 -- and has anyone actually successfully built applications that run under 2.0 (jailbroken)?
I realize this thread has been alive for nearly a year now. With respect, is it time for a cleaned up version of this wiki/HOWTO? A list of updated requirements for this would also be much appreciated. I remember reading from before on this thread that Tiger was required (not Leopard) to get this compile to work. Is that still the case?
I agree. I used the instructions in this thread successfully months ago to build 1.1.X applications, but don't know how to reconcile this thread with the need to use MacOS-X 10.5 headers/libraries and components and libraries from the 2.0 runtime. Saurik's instructions at http://www.saurik.com/id/4 are very confusing as well, and make references to 1.1.4, although their appear to be references to 2.0 in his writeup, as well. This thread here was excellent months ago, but needs to be updated to make it easy to build 2.0 applications with current components.
I'm very interested by script/tutorial to build toolchain for iphone 2.0 (and if possible for 1.X) with all detail for a "newbiz". All informations available are confused (Saurik, NerveGas?, flags in makefile ..).
Somebody have THE tutorial ?
Regards, Rikk
i just did a new install of Ubuntu Gutsy as it is on the works list. I installed bison and flex and svn. I then did the get on llvm.
When I follow the first instructions to build llvm I get the famous error:
configure: error: C compiler cannot create executables
What do I do? The gcc --version replies with 4.1.3. Do I need an older version?
With regards to my previous build error "/usr/local/bin/arm-apple-darwin-ld: /Volumes/macos2/iphone-dev/iphone-filesystem/usr/lib/libc.dylib load command 7 unknown cmd field", I tried rebuilding from scratch, with the same result.
I incorporated a couple of minor changes suggested by the comments into the process:
1) WAS: llvm-gcc-4.0-iphone/configure --enable-llvm=llvm-config --obj-root \ IS: llvm-gcc-4.0-iphone/configure --enable-llvm=$LLVMOBJDIR \
2) Tarring the entire ipod touch 2.0 file system on-board and scp'ing the archive to a Mac G4, avoiding the file-not-found errors I was getting when using CyberDuck? to scp it over piecemeal.
My environment: iPod Touch, update 2.0 Mac G4, OS 10.4.11 Xcode 2.4.1 (gcc 4.0.1) bison 1.28 flex 2.5.4
Everything sails through with only a few warnings, until the linker error at the last step. I suppose the published build process just isn't iphone/pod 2.0-compatible, but I lack enough information to decide where to go from here.
I've been overlooking the admonition at the top of this page: Don't Post Your Bugs Here! My problem is addressed in issue #141. There isn't a direct solution, but there is the suggestion to try the build under Leopard using the build instructions at http://wikee.iphwn.org/howto:toolchain_on_leopard_aspen
I'm trying to compile the toolchain using the official iPhone SDK: /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk but I get stuck at the last step when compiling the LLVM compiler:
/usr/local/bin/arm-apple-darwin-ld: /usr/local/share/iphone-filesystem/usr/lib/libc.dylib load command 7 unknown cmd field collect2: ld returned 1 exit status make2?: libgcc_s.dylib? Error 1 make1?: stmp-multilib? Error 2 make: all-gcc? Error 2
Any ideas?
Error during compilation of LLVM
make ENABLE_OPTIMIZED=1 make1?: Entering directory `/usr/local/coding/iphone/llvm-svn/lib/System' llvm1?: Compiling Alarm.cpp for Release build llvm1?: Compiling Disassembler.cpp for Release build llvm1?: Compiling DynamicLibrary?.cpp for Release build DynamicLibrary?.cpp: In static member function ‘static void llvm::sys::DynamicLibrary?::SearchForAddressOfSymbol?(const char)’: DynamicLibrary?.cpp:178: error: ‘strcmp’ was not declared in this scope DynamicLibrary?.cpp:179: error: ‘strcmp’ was not declared in this scope DynamicLibrary?.cpp:180: error: ‘strcmp’ was not declared in this scope make1?: /usr/local/coding/iphone/llvm-svn/lib/System/Release/DynamicLibrary.o? Error 1 make1?: Leaving directory `/usr/local/coding/iphone/llvm-svn/lib/System' make: all? Error 1
Any suggestions???
There is one problem occured while I checkout the code. the detail is as following. How can i do???? A iphone-dev/llvm-gcc-4.0-iphone/libstdc++-v3/testsuite/22_locale/collate/com pare/char/wrapped_env.cc svn: Can't move 'iphone-dev/llvm-gcc-4.0-iphone/libstdc++-v3/testsuite/22_locale /collate/compare/.svn/tmp/entries' to 'iphone-dev/llvm-gcc-4.0-iphone/libstdc++- v3/testsuite/22_locale/collate/compare/.svn/entries': Permission denied
Josen@dme-liuyuanjun /iphone/toolchain $ svn checkout http://iphone-dev.googlecode.com/svn/trunk/ iphone-dev
Fetching external item into 'iphone-dev/llvm-gcc-4.0-iphone/libstdc++-v3' svn: Working copy 'iphone-dev/llvm-gcc-4.0-iphone/libstdc++-v3/testsuite/22_loca le/collate/compare' locked svn: run 'svn cleanup' to remove locks (type 'svn help cleanup' for details)
My problems are in build odcctools. i'm on ubuntu 8.04 and the errors are :
/home/vanius/iphone/llvm-svn/iphone-dev/odcctools/include/mach/i386/thread_status.h:524:1: aviso: esta é a localização da definição prévia /home/vanius/iphone/llvm-svn/iphone-dev/odcctools/libstuff/ofile.c: Na função ‘ofile_map’: /home/vanius/iphone/llvm-svn/iphone-dev/odcctools/libstuff/ofile.c:747: aviso: dereferencing type-punned pointer will break strict-aliasing rules /home/vanius/iphone/llvm-svn/iphone-dev/odcctools/libstuff/ofile.c:3765:8: aviso: símbolo extra no fim da diretriz #endif No nivel superior: cc1: erro: unrecognized command line option "-Wno-long-double" make1?: ofile.o? Erro 1 make1?: Saindo do diretório `/home/vanius/iphone/llvm-svn/iphone-dev/build/odcctools/libstuff' make: libstuff? Erro 2
anyone can help me?
Are you all idiots or intentionally ignoring "IF THE TOOLCHAIN DOES NOT BUILD FOR YOU, DO NOT LEAVE A COMMENT HERE"?
This toolchain installation method appears to be obsolete, or less preferred.
Installing the toolchain on your iphone and using it to compile is dramatically easier to get up and running.
http://soi.kd6.us/2008/09/27/so-i-made-my-iphone-say-hello-world/
kb
Hi I am using Ubuntu Hardy, and I was able to successfully install the toolchain (with a little bit of tweaking). However, I couldn't locate a Hello World program from this site, so I downloaded one from http://www.oreillynet.com/mac/blog/2007/08/a_simpler_hello_world_for_the.html which compiles fine, and produces an executable.
Not having an in-real-life iPhone, I'm unable to run my HelloWorld? application produced by the toolchain. There is an emulator in the iPhone SDK, but I don't have a Mac (Intel or other kind) either. Is anyone aware of an iPhone emulator that works on Linux or Windows? Thanks and good luck.
Sierra Bravo
I have got to the step :
make LLVM_VERSION_INFO=2.0-svn-iphone-dev-0.3-svn
and this is my error:
configure: error: cannot execute: /usr/local/bin/arm-apple-darwin-ld: check --with-ld or env. var. DEFAULT_LINKER make: configure-gcc? Error 1
I Installed llvm through ubuntu - (eaerly in the tutorial guide above, i chose to)sudo apt-get install llvm because compiling it myself lead to horrific problems and apt is quicker!
Somebody please help!
Okay, I successfully compiled the toolchain. Unfortunately, I can't find any information on how to use it to compile stuff. How do I tell Ubuntu that configure and make ought to use the iphone tools instead of the i386 Ubuntu tools?
The link to the decrypter for the ipsw software is broken
Hey you guys, I just created a script that automates the toolchain build on a MAC OSX box. It also has a very small helloworld program and Makefile to show how it's done.
Get it here: http://code.google.com/p/iphone-toolchain-automated-build/
Everything is tested on MAC OSX 10.5.6
Enjoy!
iphone-dev/build/llvm-gcc-4.0-iphone$ sudo make install /bin/bash ../../llvm-gcc-4.0-iphone/mkinstalldirs /usr/local /usr/local /bin/bash: line 4: cd: fixincludes: No such file or directory make: install-fixincludes? Fehler 1
What is going wrong?
System: Ubuntu 8.10
Hi have this problem: when I run last make (in /built/llvm-gcc-4.0-iphone) it return me with this error:
checking for dsymutil... no dsymutil is not available configure: error: You must specify absolute path to your LLVM tree with --enable-llvm=DIR make: configure-gcc? Error 1
What it mean? What is dsymutil?
I was getting hell trying to extract the SDK files from the xcode dmg on Ubuntu 8.04, but I did some very precise googling and came up with some slightly related instructions on a Mac/Windows cross compiling site. "xar -xv -f MacOSX10.4.Universal.pkg" will extract the contents of the .pkg (might wanna do this into an empty folder as the files will be placed into the directory containing the xcode .dmg, then run "zcat Payload | cpio -id" in the directory containing the Payload file you just extracted. It got me moving, hope that helps someone.
I just solved another one of my problems by resetting my environment variables (apparently they aren't permanent, so if you've closed your terminal you might need to reset them, LLVMOBJDIR needs to be set to the directory containing llvm-svn and HEAVENLY needs to be set to the directory containing your iPhone filesystem).
Download the iphone-filesystem from
http://george.insideiphone.com/wp-content/uploads/2008/01/iphone-filesystem.tar.bz2
llvm-gcc-4.0-iphone/configure the iphone-filesystem scp from iphone 3g, then make, it thrown such issue:
libc.dylib load command 7 unknown cmd field
but redid with iphone-filesystem via http://george.insideiphone.com/wp-content/uploads/2008/01/iphone-filesystem.tar.bz2
it is ok except compile the UIKit or LayerKit? app.
so please play the helloworld console app via terminal _
Issue 141 Comment 16 fixed the libc.dylib load issue
easy way to build the toolchain for 3g directly:
apt-get install iphone-gcc apt-cache search toolchain
sirtoozee, against what version of the OS were those tools built, or what version of the OS is that bz2 file you linked? 2.0? 3.0 beta 2 or 3? Thanks!!
ted.vail, please have a look at http://www.saurik.com/id/4
saurik is the active one who playing the toolchain for 3g, but what NightWatch? did was only suitable for old iphone;
bz2 file I linked is the old iphone file-system, i diff it with my iphone 3g, for example there is no /System/Library/Frameworks/LayerKit? any more...
so I am too tired to build the toolchain on my MacBook? with Tiger, instead, I apt-get install iphone-gcc and toolchain on my iphone 3g with the help of apt and cydia (see the "What Next?" section in the http://www.saurik.com/id/4);
PS: the old toolchain could compiled the console app, but I wanna GUI helloworld _
I need to donwload llvn from http://llvm.org/releases/download.html. the link is not working. is there any alternate way to download llvm.
ForAddressOfSymbol?(const char)’: DynamicLibrary?.cpp:178: error: ‘strcmp’ was not declared in this scope DynamicLibrary?.cpp:179: error: ‘strcmp’ was not declared in this scope DynamicLibrary?.cpp:180: error: ‘strcmp’ was not declared in this scope make1?: /home/pitufo/dev/llvm-svn/lib/System/Release/DynamicLibrary.o? Erreur 1 make1?: quittant le répertoire « /home/pitufo/dev/llvm-svn/lib/System » make: all? Erreur 1
Emm, I wanna try PyObjC http://www.saurik.com/id/5 to do the GUI stuff
What is the difference between the instructions on this page and the ones over here: http://code.google.com/p/iphonedevonlinux/wiki/Installation
THIS IS NOT A BUG REPORT Hi there I am trying to follow this step-by-step well documented method, as I am still on Tiger and as the iPhone SDK is only available for Leopard. When coming to the point: iPhone root filesystem, I am not sure of what I am to do: I have the "iPhone1,2_2.0.2_5C1_Restore.ipsw" file, I unzip it and obtain "iPhone1,2_2.0.2_5C1_Restore.ipsw.app". Is it this that is called the iphone-filesystem in this step? Thanks in advance Achim
I'm getting this error:
checking for arm-apple-darwin-gcc... //iphone-dev/build/llvm-gcc-4.0-iphone/gcc/xgcc -B//iphone-dev/build/llvm-gcc-4.0-iphone/gcc/ -mmacosx-version-min=10.1 -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 checking for suffix of object files... configure: error: cannot compute suffix of object files: cannot compile
some ideas?
On the "sudo make install" step, I got a error: llvm1?: Installing Release Archive Library /usr/local/lib/libLLVMSupport.a make1?: No rule to make target /Developer/iPhoneToolchain/llvm-svn/Release/bin/tblgen', needed by /Developer/iPhoneToolchain/llvm-svn/lib/VMCore/Release/Intrinsics.gen.tmp'. Stop. make: install? Error 1 Any ideas?
I am trying to build the toolchain on windows. Anyone ever heard of the msgfmt command?
When I enter the command, it starts to compile. After about 30 minutes, I get to the error you see below. ./make-toolchain.sh /usr/bin/install -c mkheaders /usr/local/libexec/gcc/arm-apple-darwin9/4.2.1/install-tools/mkheaders make2?: Leaving directory `/cygdrive/c/projects/tools/home/iphone-2.0-toolchain/build/gcc-4.2-iphone/fixincludes' make2?: Entering directory `/cygdrive/c/projects/tools/home/iphone-2.0-toolchain/build/gcc-4.2-iphone/gcc' test -d po || mkdir po /cygdrive/c/downloads/mono/Mono-2.4/bin/msgfmt --statistics -o po/be.gmo /cygdrive/c/projects/tools/home/iphone-2.0-toolchain/src/gcc/gcc/po/be.po c:\downloads\mono\Mono-2.4\bin\msgfmt.exe: error while opening "/cygdrive/c/projects/tools/home/iphone-2.0-toolchain/src/gcc/gcc/po/be.po" for reading: No such file or directory make2?: po/be.gmo? Error 1 make2?: Leaving directory `/cygdrive/c/projects/tools/home/iphone-2.0-toolchain/build/gcc-4.2-iphone/gcc' make1?: install-gcc? Error 2 make1?: Leaving directory `/cygdrive/c/projects/tools/home/iphone-2.0-toolchain/build/gcc-4.2-iphone' make: install? Error 2
I also find it strange that msgfmt would be executed, from Mono?
test -d po || mkdir po checking whether getopt is declared... /cygdrive/c/downloads/mono/Mono-2.4/bin/msgfmt --statistics -o po/be.gmo /cygdrive/c/projects/tools/home/iphone-2.0-toolcshain/src/gcc/libcpp/po/be.po c:\downloads\mono\Mono-2.4\bin\msgfmt.exe: error while opening "/cygdrive/c/projects/tools/home/iphone-2.0-toolchain/src/gcc/libcpp/po/be.po" for reading: No such file or directory