Android NDK - 它支持直接 ARM 代码还是只支持 Thumb [英] Android NDK - does it support straight ARM code or just Thumb

查看:36
本文介绍了Android NDK - 它支持直接 ARM 代码还是只支持 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.mkLOCAL_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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆