[LLVMdev] Setting up a cross-compiler for cortex-m3

salvatore benedetto salvatore.benedetto at gmail.com
Sun Jul 22 13:05:01 PDT 2012


On Sun, Jul 22, 2012 at 9:57 PM, Anton Korobeynikov
<anton at korobeynikov.info> wrote:
>> clang++ -ccc-gcc-name arm-none-linux-gnueabi-g++ -ccc-host-triple
>> thumbv7m-none-gnueabi testReference.cpp -c -mcpu=cortex-m3
>> fatal error: error in backend: CPU: 'cortex-m3' does not support ARM
>> mode execution!
> Ok, and what's about -mthumb then?

$ clang++ -ccc-gcc-name arm-none-linux-gnueabi-g++ -ccc-host-triple
thumbv7m-none-gnueabi testReference.cpp -c -mcpu=cortex-m3 -mthumb
$ arm-none-linux-gnueabi-readelf -A testReference.o
Attribute Section: aeabi
File Attributes
  Tag_CPU_name: "Cortex-M3"
  Tag_CPU_arch: v7
  Tag_CPU_arch_profile: Microcontroller
  Tag_THUMB_ISA_use: Thumb-2
  Tag_ABI_FP_denormal: Needed
  Tag_ABI_FP_exceptions: Needed
  Tag_ABI_FP_number_model: IEEE 754
  Tag_ABI_align_needed: 8-byte
  Tag_ABI_align_preserved: 8-byte, except leaf SP
  Tag_DIV_use: Not allowed

That did the trick. Although it's a lot of options.

Thanks a lot!

S.



More information about the llvm-dev mailing list