Pergunta

I am compiling an NDK project using APP_ABI=armeabi to target ARMv5 cpu. I have code that deals with floating points, and when running on a low-end HTC Wildfire ARMv6 device, I see that I get a crash with SIGILL.

Disassembling the binary shows that it crashes exactly here

4397a8:       ed9f7b18        vldr    d7, [pc, #96]

Why is the NDK generating fp instruction when I specified APP_ABI=armeabi, isn't is supposed to be eabi calls, not explicitly neon code? To troubleshoot I even added this to the mk file:

LOCAL_CFLAGS := -mfloat-abi=softfp -msoft-float -mfpu=vfp

Yet it still generates the binary code above. What parameter should I specify to make sure my float instructions actually generate soft code? Or, is this device just completely broken? Here's the CPU info:

>adb shell getprop | grep abi
[ro.product.cpu.abi]: [armeabi]

>adb shell cat /proc/cpuinfo
Processor       : ARMv6-compatible processor rev 2 (v6l)
BogoMIPS        : 244.94
Features        : swp half thumb fastmult edsp java
CPU implementer : 0x41
CPU architecture: 6TEJ
CPU variant     : 0x1
CPU part        : 0xb36
CPU revision    : 2

Hardware        : buzz
Revision        : 0081
Serial          : 0000000000000000
Foi útil?

Solução

Please run ndk-build -B V=1 command and post the output. Otherwise we can't see real compiler flags used during the compilation.

Any way, -mfloat-abi=softfp flag means hardware floating point. To force software emulation you should use -mfloat-abi=soft option.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top