0

I'm trying to launch a native Android app on Intel Atom Z2560, but it always crashes in the same place with SIGILL ILL_ILLOPN (illegal operand) signal.

The crash doesn't happen with -O0.

The compiler I'm using is GCC 4.8 from NDK r10. I tried to set -march to atom, but that doesn't change anything.

Anybody knows how can I configure my build scripts so there is no incompatible code generated?

Triang3l
  • 1,230
  • 9
  • 29

1 Answers1

2

This is a known bug in NDK r10, see http://b.android.com/73843 for details on it. To avoid the issue, either use an older NDK version, or add (something like) this to your Android.mk:

ifeq ($(TARGET_ARCH_ABI), x86)
LOCAL_CFLAGS += -m32 # NDK r10 x86 bug workaround - http://b.android.com/73843
endif
mstorsjo
  • 12,983
  • 2
  • 39
  • 62
  • Thank you so much, it worked! Quite weird that they made -m64 the default. – Triang3l Sep 08 '14 at 17:29
  • 1
    Actually, `-m64` wasn't set by default, but if neither `-m32` nor `-m64` were specified, it behaved as if `-msse4.2 -mpopcnt` had been specified. – mstorsjo Sep 08 '14 at 18:13
  • this workaround isn't needed anymore with the latest NDK r10b release. – ph0b Sep 17 '14 at 11:20