LLVM-gcc for ARM



Hello,

At this moment I have built from scratch a gcc compiler for ARM and I have in the classpath the binaries.

arm-elf-gcc -v
Using built-in specs.
Target: arm-elf
Configured with: …/gcc-4.3.3/configure --target=arm-elf --prefix=/tmp/arm-cortex-toolchain --enable-interwork --enable-multilib --enable-languages=c,c++ --with-newlib --disable-shared --with-gnu-as --with-gnu-ld
Thread model: single
gcc version 4.3.3 (GCC)


arm-elf-as -version
GNU assembler (GNU Binutils) 2.19.1
Copyright 2007 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or later.
This program has absolutely no warranty.
This assembler was configured for a target of arm-elf'.<br><br>Then<br>../llvm-gcc4.2-2.6.source/configure --prefix=pwd/../install --program-prefix=llvm- --enable-llvm=/home/LLVM/llvm-2.6/ --enable-languages=c,c++ --with-gnu-ld=/home/arm/bin/arm-elf-ld<br>--with-gnu-as=/home/arm/bin/arm-elf-as<br>--target=arm-elf<br><br><br>Then the following errors appeared:<br>/tmp/ccm99Neh.s: Assembler messages:<br>/tmp/ccm99Neh.s:96: Error: selected processor does not support sxtb r5,r5’
/tmp/ccm99Neh.s:537: Error: selected processor does not support sxtb r6,r6'<br>/tmp/ccm99Neh.s:705: Error: selected processor does not support sxtb r1,r1’
/tmp/ccm99Neh.s:711: Error: selected processor does not support `sxtb r1,r1’
make[3]: *** [libgcc/thumb/unwind-dw2-fde.o] Error 1


Any ideas?


Thank you,
Corina


|

Hello

/tmp/ccm99Neh.s:711: Error: selected processor does not support `sxtb r1,r1'
make[3]: *** [libgcc/thumb/unwind-dw2-fde.o] Error 1

Any ideas?

Yes. LLVM defaults to ARMv5 in codegeneration and does not support
ARMv4. Without any extra option arm-elf-as assumes ARMv4 and thus
gives you these errors. So:

1. If your desired target platform is ARMv4 and not newer - then
you're out of luck
2. Otherwise - add --with-cpu or --with-arch to llvm-gcc configure to
select the processor / arch desired.

It seems that you're interested in Cortex CPUs
("/tmp/arm-cortex-toolchain"), then your desired arch is armv7,
configure with --with-arch=armv7 or e.g. --with-cpu=cortex-a8