Android NDK - 它支持直接 ARM 代码还是只支持 Thumb [英] Android NDK - does it support straight ARM code or just Thumb
问题描述
我被要求评估我们产品的 Android 平台,我正在寻找各种选择,我只是刚刚触及表面,而困扰我的一件事是我看不到如何编译代码直接 ARM 代码(没有 Thumb),我知道 Thumb 运行速度较慢,我们需要代码的关键部分的性能.
I have been asked to evaluate the Android platform for our product and I am looking at various options, I am only just scratching the surface just now and the one thing that is bothering me is that I cannot see how to compile code as straight ARM code (no Thumb), I know that Thumb runs slower and we will need the performance in key sections of our code.
我认为它应该只是在 Android.mk
的 LOCAL_CFLAGS
中设置 -march
标志文件,但我无法让它工作......
I think it should just be setting the -march
flag in the LOCAL_CFLAGS
of the Android.mk
file, but I cannot get that to work...
谁能帮忙?
推荐答案
为 Android.mk
中的模块指定以下标志将直接编译 ARM 代码.
Specifying the following flag for a module in Android.mk
will compile straight ARM code.
LOCAL_ARM_MODE := arm
启用优化也可能有所帮助:
Enabling optimization may also help:
LOCAL_CFLAGS := -O3
这篇关于Android NDK - 它支持直接 ARM 代码还是只支持 Thumb的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!