[LLVMdev] Is cross-compiling for ARM on x86 with llvm/Clang possible?

Joerg Sonnenberger joerg at britannica.bec.de
Mon Jun 18 05:59:45 PDT 2012


On Sat, Jun 16, 2012 at 08:20:23PM +0900, Journeyer J. Joh wrote:
> If the cross compiling is supported, is there any documentation on how to
> do it?

The short version is: assuming you have a cross-binutils installation
using e.g. x86_64--netbsd-as and x86_64--netbsd-ld, you add a symlink
called x86_64--netbsd-clang to clang and just call that with an
appropiate --sysroot to make it find your target include headers and
libraries. Substitute x86_64--netbsd with the triple of your choice.
Alternative, call clang -target x86_64--netbsd ...

Joerg



More information about the llvm-dev mailing list