Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid NDK ARM build settings to run on most devices?
    primarykey
    data
    text
    <p>I've got a few Android NDK apps out and people complain my app doesn't work on their phones. What I'd like to know is what are the compilation settings that will support most if not all ARM devices on the market?</p> <p>My problem seems to be armeabi-v7a devices that have a varying amount of support for VFP, NEON, etc. I'm looking for a solution to build apps that run on the most platforms, even if that's at the cost of optimization.</p> <p>I was using the default NDK build scripts for armeabi and armeabi-v7a, that specified: <code>-march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3</code></p> <p>This does not work on some devices, for example on Acer A500 (CPU Nvidia Tegra2 (Dual Cortex A9)). This CPU does not implement NEON, from what I'm learning here <a href="http://wiki.debian.org/ArmHardFloatPort/VfpComparison" rel="nofollow">http://wiki.debian.org/ArmHardFloatPort/VfpComparison</a>.</p> <p>The crash, specifically, is this:</p> <pre><code>F/libc (15549): Fatal signal 4 (SIGILL) at 0x5bfd9260 (code=1) ...(snip)... I/DEBUG ( 81): #00 pc 0005b260 /data/data/com.burnsmod.oscpad/lib/libapplication.so (tanf) </code></pre> <p>Looking at libapplication.so, I see tanf is being generated as:</p> <pre><code>0005b25c &lt;tanf&gt;: 5b25c: ee070a90 fmsr s15, r0 5b260: eef70ae7 fcvtds d16, s15 5b264: e92d4010 push {r4, lr} 5b268: ec510b30 vmov r0, r1, d16 5b26c: ebff4b6c bl 2e024 &lt;_ZN15ButtonUIHandler10FreeImagesEv-0x6ac&gt; 5b270: ec410b30 vmov d16, r0, r1 5b274: eef77be0 fcvtsd s15, d16 5b278: ee170a90 fmrs r0, s15 5b27c: e8bd8010 pop {r4, pc} </code></pre> <p>So, what's the answer? vfpv2? vfp? vfpv3? vfpv3-d16?</p> <p>Right now if I use readelf I find my application library's dependencies are:</p> <pre><code>MacBook:armeabi-v7a tom$ arm-linux-androideabi-readelf -A libapplication.so Attribute Section: aeabi File Attributes Tag_CPU_name: "7-A" Tag_CPU_arch: v7 Tag_CPU_arch_profile: Application Tag_ARM_ISA_use: Yes Tag_THUMB_ISA_use: Thumb-2 Tag_VFP_arch: VFPv3 Tag_ABI_PCS_wchar_t: 4 Tag_ABI_FP_denormal: Needed Tag_ABI_FP_exceptions: Needed Tag_ABI_FP_number_model: IEEE 754 Tag_ABI_align8_needed: Yes Tag_ABI_align8_preserved: Yes, except leaf SP Tag_ABI_enum_size: int Tag_ABI_HardFP_use: SP and DP </code></pre> <p><strong>VFP2</strong>: Compiling with '-mfpu=vfpv2' or '-mfpu=vfp2' isn't supported in NDK 7, both return an error message.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload