I'm having problem with generating ppc64-assembler code.
First I create ppc64-assembler with llc:
llc -march=ppc64 gzip.bc -f -o gzip.s
Then I try to compile this with a cross-compiler on x86_64-linux to ppc64-linux:
But the compiler gives me
gzip.4.s: Assembler messages:
gzip.4.s:2007: Error: value of 326712 too large for field of 2 bytes at 6994
The line 2007 looks like:
ld 6, block_start@l(6)
Where the symbol block_start is defined at the end of gzip.s as
.lcomm block_start,8 # 'block_start'
Is there something wrong with my cross-compiler or is the llc-generated code bad?
Most likely the latter, the powerpc64-unknown-linux-gnu target is not
officially supported by LLVM. In fact there is no support for the
64-bit PowerPC Linux ABI in the PPC backend at all. The generated
assembly is probably some Darwin-centric 64-bit code.
As part of Google Summer of Code 2009 I'm currently working on making
powerpc-unknown-linux-gnu an officially supported target, it is still
in early stages though.
Actually a lot of the 32-bit ABI is already implemented (thanks
Nicolas!) and if you're generating the LLVM IR yourself it should
already work reasonably well. I've heard from people successfully
using the JIT on PPC Linux. However, clang and llvm-gcc both lack
proper ABI support, it's also not possible to bootstrap llvm-gcc yet.
I'm currently implementing the missing ABI features in the PPC backend
and I expect to start working on llvm-gcc next week. So stay tuned