error: instruction requires: thumb2

Hi Everybody,

  I recently did a cross-compiling using clang (built with host=x86, target=arm) with the following command:

  > clang -march=armv7-a -mfloat-abi=soft -ccc-host-triple arm-none-linux-gnueabi -integrated-as main.c -o main.o -c

and get error message:

Try "-mthumb".

-Eli

It works. Thanks.

- Lei

It works. But a follow-up question: why do I have to compile it to thumb mode in order to pass the compilation? Is there a way to make it compile to regular arm mode? Thanks.

- Lei

Sure. Use legal ARM mode syntax for the instruction.

Specifically, there is no offset immediate for the ARM mode LDREX instruction. It's illegal syntax to supply one, even if it's zero.

-Jim

Aha, thanks.

- Lei