[LLVMdev] ARM assembler bug on LLVM 3.5

Renato Golin renato.golin at linaro.org
Sun Sep 21 00:30:20 PDT 2014


On 20 September 2014 15:19, Mikulas Patocka
<mikulas at artax.karlin.mff.cuni.cz> wrote:
> The problem is this - you either compile this program with
> -mcpu=cortex-a9, then clang reports error on the sdiv instruction because
> cortex a9 doesn't have sdiv. Or - you compile the program with
> -mcpu=cortex-a15, then clang compiles it, but it uses full cortex-a15
> instruction set and the program crashes on cortex a9 and earlier cores.

LLVM always validates inline assembly. This may be too restrictive but
it has been for a while and there isn't yet a good incentive to turn
that off, even with a flag. This may change in the future for some
cases, but your case is not one of them.

The problem is that there isn't currently a way to pass flags to the
integrated assembler as of now (I'm working on it). When that starts
to work, you will be able to just pass "-mcpu=cortex-a9
-Wa,-mcpu=cortex-a15" and it'll do what you want. That should work on
GCC, too.

Right now, -Wa only works with an external assembler.


> Even if I use -no-integrated-as (as suggested in bug 18864), clang still
> examines the string in "asm" statement and reports an error. GCC doesn't
> examine the string in "asm" and works.

Have you tried passing -Wa,-mcpu=cortex-a15 together with -no-integrated-as?

cheers,
--renato



More information about the llvm-dev mailing list