如何强制 select 更新版本的 androideabi?

How to force select a newer version of androideabi?

当我构建代码时,我看到正在使用 $(NDK)\toolchains\arm-linux-androideabi-4.6,尽管我的机器上有 $(NDK)\toolchains\arm-linux-androideabi-4.8

我的理解是应该始终使用最新的 androideabi 以便可以使用最新的 gcc 编译器。我想知道为什么 ndk-build 选择旧版本。

这是我的 Application.mk 供您参考:

APP_ABI := armeabi-v7a 
APP_PLATFORM := android-16
APP_OPTIM := release
APP_STL := gnustl_static
APP_CPPFLAGS := -std=gnu++11

APP_PLATFORM 的值需要为 android-16 以便我们可以支持 Android OS 4.1 及更高版本。我想知道 androideabi 是否绑定到 APP_PLATFORMvalue.

问题不是 ABI,而是工具链版本。

您可以在 Android.mk

中控制它

来自其文档:

NDK_TOOLCHAIN_VERSION

Define this variable to either 4.6, 4.7 or 4.8 to select version of the GCC compiler. 4.6 is the default