[LLVMdev] Cross-compiling the ARM toolchain

Renato Golin renato.golin at arm.com
Mon Sep 13 00:12:02 PDT 2010


>> I should say that I'm still a bit confused: Is it possible to build
>> for ARM CPUs now?

Yes!

>>  1/ from which hosts (x86-*-* ?)

AFAIK, all all supported platforms (x86, x86_64, etc)


>>  2/ for which targets (arm-*-* ?)

Virtually all. As far as I could test, all major architectures
(v4/v5/v6 + v7-A-R-M), although I'm still fighting with some Thumb
code generation. Could be my old gcc/binutils version (that still
doesn't even recognizes cortex-R4). You should check that yours is
really new (at least 2010) if you want v7R support.

>>  3/ what are the supported tools for ARM targets:
>>      a/ llvm-gcc (gcc 4.2)?
>>      b/ dragonegg (gcc 4.5)?
>>      c/ clang?

I haven't tested dragonegg, but clang and llvm-gcc do the job.
llvm-gcc seems to be more in sync with the ARM backend (for obvious
reasons), but it's a nightmare to compile it to the ARM backend. Clang
supports it out of the box.

Please, do have in mind that the code generated is by no means
super-optimized for each specific platform. There are some selected
features (mostly cortex-A*), but most of the code is generic to the
architecture or falls back to v4. So, if you're looking for great
optimizations GCC does for your specific SoC, you might not find it in
LLVM yet.

-- 
cheers,
--renato




More information about the llvm-dev mailing list