|
|
Building
How to build the toolchain.
Please note that these instructions are subject to change. Before updating your toolchain installation, you should always check the newest version of this page. You should also check Portability to see whether there are any special instructions for your particular platform.
FILE BUG REPORTS TO REPORT BUGS INSTEAD OF LEAVING BUGS AS COMMENTS ON THIS PAGE! THIS MEANS THAT IF THE TOOLCHAIN DOES NOT BUILD FOR YOU, DO NOT LEAVE A COMMENT HERE!
HOWTO build the toolchain
- 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
- Build odcctools.
$ 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
- You're done. Have fun!
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
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.
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
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:
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=70to 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 \
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 2I 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
/../../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) 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: 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) GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 Compiler executable checksum: 93bfe937d44ac72df24c566a9adf5651 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 "[root@localhost test]# make /usr/local/arm-apple-darwin/bin/gcc -c -fsigned-char mainapp.m -o mainapp.o make: /usr/local/arm-apple-darwin/bin/gcc: Command not found make: [mainapp.o] Error 127 [root@localhost test]# " i don't have a /usr/local/arm-apple-darwin/bin/gcc folder!! only lib, include folders are there in /arm-apple-darwin/ what could have gone wrong?
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..
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) \
all: Hello
Hello: hello.o HelloApplication?.o
%.o: %.m
clean:
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
%.o: %.mm
%.o: %.cpp
clean:
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:
[root@91 odcctools]# setarch i386 -sh-3.1# bash [root@91 odcctools]# pwd /data/src/iphone-dev/build/odcctools [root@91 odcctools]# export CFLAGS="-m32" [root@91 odcctools]# export LDFLAGS="-m32" [root@91 odcctools]# ../../odcctools/configure --target=arm-apple-darwin --disable-ld64 checking build system type... i686-pc-linux-gnu checking host system type... i686-pc-linux-gnu checking target system type... arm-apple-darwin checking for gcc... gcc checking for C compiler default output file name... configure: error: C compiler cannot create executables See `config.log' for more details. [root@91 odcctools]# pwd /data/src/iphone-dev/build/odcctools [root@91 odcctools]# uname -a Linux 91.126.25.179 2.6.18-8.1.15.el5 #1 SMP Mon Oct 22 08:32:28 EDT 2007 i686 athlon i386 GNU/Linux [root@91 odcctools]#
Would be great if someone could help. Thankx !
Marty
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