Compiling llvm libraries to run on iPhone

Hi,

I was wondering whether anyone has managed to compile the LLVM libraries to run on iPhone?

After compiling and installing the iPhone toolchain on MacBook running Leopard (10.5.2). I run configure

In the llvm2.3 directory:

./configure –host=arm-apple-darwin –target=arm-apple-darwin –enable-optimized –enable-targets=arm

I run make, including an override for TBLGEN (because I obviously can’t run the native ARM tblgen):

make ENABLE_OPTIMIZED=1 TBLGEN=/usr/local/bin/tblgen

All goes very well until I get the following error:

llvm[3]: Compiling ScheduleDAGList.cpp for Release build

llvm[3]: Compiling ScheduleDAGRRList.cpp for Release build

llvm[3]: Compiling SelectionDAG.cpp for Release build

llvm[3]: Compiling SelectionDAGISel.cpp for Release build

/var/folders/Xq/XqzGACxLHWq4Af0cQbEMdE+++TI/-Tmp-//cc6xGQcn.s:unknown:immediate value (-288) too large

make[3]: *** [/Users/ur/llvm-2.3/lib/CodeGen/SelectionDAG/Release/SelectionDAGISel.o] Error 1

make[2]: *** [SelectionDAG/.makeall] Error 2

make[1]: *** [CodeGen/.makeall] Error 2

make: *** [all] Error 1

I have also tried compiling v2.2 and get the same error.

Any help would be really appreciated,

Rob.

Hi,

I was wondering whether anyone has managed to compile the LLVM libraries to run on iPhone?

After compiling and installing the iPhone toolchain on MacBook running Leopard (10.5.2). I run configure
In the llvm2.3 directory:

./configure –host=arm-apple-darwin –target=arm-apple-darwin –enable-optimized –enable-targets=arm

I run make, including an override for TBLGEN (because I obviously can’t run the native ARM tblgen):

make ENABLE_OPTIMIZED=1 TBLGEN=/usr/local/bin/tblgen

All goes very well until I get the following error:

llvm[3]: Compiling ScheduleDAGList.cpp for Release build
llvm[3]: Compiling ScheduleDAGRRList.cpp for Release build
llvm[3]: Compiling SelectionDAG.cpp for Release build
llvm[3]: Compiling SelectionDAGISel.cpp for Release build
/var/folders/Xq/XqzGACxLHWq4Af0cQbEMdE+++TI/-Tmp-//cc6xGQcn.s:unknown:immed iate value (-288) too large
make[3]: *** [/Users/ur/llvm-2.3/lib/CodeGen/SelectionDAG/Release/SelectionDAGISel.o] Error 1
make[2]: *** [SelectionDAG/.makeall] Error 2
make[1]: *** [CodeGen/.makeall] Error 2
make: *** [all] Error 1

Hmmm, you are definitely a brave soul :slight_smile:

Try
make ENABLE_OPTIMIZED=1 TBLGEN=/usr/local/bin/tblgen VERBOSE=1

and look what the command for compiling SelectionDAGISel.o is.
Then execute it directly, adding -S --save-temps etc. to the soup.

My theory is that the assembler freaks out on illegal input.
Try to find the corresponding snippet (of the .cpp file)
and reduce it to a minimum.

File a bug report (http://llvm.org/bugs/). I am sure Evan or someone
else will love to fix it :slight_smile:

Cheers,

    Gabor

That looks like an internal compiler error. Use delta
(http://delta.tigris.org/) to reduce the issue if possible, then send
a bug-report to whoever distributes your ARM compiler. (For an iPhone,
I'm guessing that's Apple.)

-Eli

File a bug report (http://llvm.org/bugs/). I am sure Evan or someone
else will love to fix it :slight_smile:

Cheers,

Gabor

As Eli said, this address is only to be used if you use llvm-gcc
for compiling. But the best bet is probably to use Apple's
bugreporter.

    Gabor

This is being caused by the assembler you are using not being very good. You should switch to the odcctools-9.2-ld branch of the assembler (the one that I actively maintain). That one is like Apple’s SDK assembler (who’s source code is available on their website) with a bunch of custom hacks/additions. More information about how to get the newer versions of the open source iPhone toolchain are available on my website: http://www.saurik.com/id/4. You are going to have a hard time cross compiling anything complex with the one you have installed.

Sincerely,
Jay Freeman (saurik)
saurik@saurik.com
http://www.saurik.com/