[LLVMdev] How to Cross compile llvm to ARM ?

Renato Golin rengolin at systemcall.org
Fri Jun 10 01:04:42 PDT 2011


2011/5/11 Jason Kim <jasonwkim at google.com>:
> It is possible to do so (we do it here locally for PNaCl project, for
> example, going from X86 to ARM),
> but it requires setup for things like llvm-gcc, the target libc and
> other target libraries you are linking against...
> not to mention a cross compiling binutils, and its irritating to get "right"

Hi Jason,

I agree it's more difficult, what I don't agree is that it's ok to be
more difficult... ;)

James sent a patch to fix some issues on selecting the target
(march/mcpu/mos) that should get most of it done until link time
simply by running vanilla clang/LLVM (no need for the
soon-to-be-deprecated llvm-gcc).

Also, while the ELF writer is good enough for some basic code, it has
problems with more complex C++ code, so one might need GAS to get
there, but that's easy to fix (and you have been doing a good job at
it).

The main problem are the libraries and the linker, and that's an area
that has been barely touched so far... But for that, if you just
download CodeSourcery's pack, you should be fine. So, all in all, not
that hard. ;)

cheers,
--renato



More information about the llvm-dev mailing list