[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#862514: Gcc creates illegal instructions when combining C + ASM on arm on sid



Package: gcc
Version: 6.3.0-4

Gcc creates binaries that fail with "invalid instruction". To
reproduce create the following main.c:

 int get_retval(void);

int main(int argc, char **argv) {
  return get_retval();
}

and the following retval-arm.S

.text
.globl get_retval

get_retval:
        mov     r0, #0
        bx      lr

Compile like this:

gcc -o prog main.c retval-arm.S

The result crashes. However if you add -march=armv7 the executable
works (-march=native crashes also).

This only happens on GCC using the version in Sid. It works when using
any version of Clang and also when using GCC in Jessie.

Originally reported here: https://github.com/mesonbuild/meson/issues/1776


Reply to: