I know android provides support for ARMv5TE and ARMv7a CPU. (armeabi and areabi-v7a folders)
Most Android Phones’s CPUs now are ARMv6 without VFP, ARMv6 with VFP and ARMv7 with VFP.
My app has physics simulation and I wish to target devices with hardware float point only. (VFP). I do not wish to support devices without VFP.
How do I configure NDK project to compile ARMEABI code to be ARMv6 with VFP instead of ARVv5TE ?
I can block old ARMv6 without VFP and ARmv5 device via Google Play interface when APK is uploaded.
NDK does not really provides any convenient way to change default build options. You can only add additional flags but not override standard options.
Default
LOCAL_CFLAGSand most of other options will not work for you because NDK puts its options after yours and overrides your flags. The only solution I know is to define globalAPP_CFLAGSin theApplication.mk. So the following should result in binaries optimized for armv6 having VFPv2:Also if I remember correctly, vfp instructions on armv6 hardware require to compile your code in arm mode (not thumb). Specify
LOCAL_ARM_MODE := armfor every target inAndroid.mkto achieve this.By the way I think that you will not be satisfied by performance of armv6 device. Even newest hi-end armv7 processors are about 10 times slower than modern Intel Core CPUs.