[LLVMdev] Cross compiling question

Luke Dalessandro luked at cs.rochester.edu
Fri Jan 30 10:36:16 PST 2009


S. Bharadwaj Yadavalli wrote:
> 
> I am trying to build a x86_64 to ARM cross compiler.
> 
> I configured, built and installed LLVM as follows:
> 
> $ ../../../src/llvm/configure 
> --with-llvmgccdir=<llvm-root>/install/x86_64-arm/llvm-gcc-4.2 
> --enable-optimized --enable-jit 
> --prefix=<llvm-root>/install/x86_64-arm/llvm 
> --target=arm-unknown-linux-gnueabi
> 
> $ make
> $ make install
> 
> Then I configured gcc front end as follows:
> 
> $ ../../../src/llvm-gcc-4.2/configure 
> --prefix=<llvm-root>/install/x86_64-arm/llvm-gcc-4.2 
> --program-prefix=llvm-x86_64-arm 
> --enable-llvm=<llvm-root>/install/x86_64-arm/llvm 
> --enable-languages=c,c++ --disable-multilib 
> --target=arm-unknown-linux-gnueabi

I can't really comment on your specific problem, but you might try 
adding --with-build-sysroot to point to your arm headers. You also need 
to have binutils built for cross ARM as well. If cross binutils is in 
your path (bins will have arm prefix) you're fine, otherwise you need to 
specify them at configure too (--with-gnu-ld, --with-gnu-as). I don't 
know if you need cross gmp or mpfr too.

I may be way off-base, but this is part of how I got a cross for SPARC 
built.

Good luck,
Luke



> 
> I get the following error:
> 
> exec: 2: -meabi=4: not found
> 
> while assembling ../../../../src/llvm-gcc-4.2/gcc/crtstuff.c
> 
> I found that execution of the command
>  <llvm-root>/build/x86_64-arm/llvm-gcc-4.2/./gcc/as
> 
> which is part of execution of the command
> 
> <llvm-root>/build/x86_64-arm/llvm-gcc-4.2/./gcc/xgcc
> 
> is the resulting in this error. It turns out that this is a 2 line shell 
> script that exec's the arguments like thus:
> 
> #!/bin/sh
> exec  "$@"
> 
> Where is the assembler that needs to be invoked? What do I need to do to 
> get the configuration find it?
> 
> What am I doing wrong?
> 
> Thanks for any help!
> 
> Bharadwaj
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




More information about the llvm-dev mailing list