NDK r8支持编译MIPS平台的native so库编译方法介绍

本文介绍了如何使用Android NDK r8版本支持MIPS架构,包括添加支持的特性、配置步骤以及如何为MIPS设备编译so库。通过设置APP_ABI,可以在Android.mk文件中指定构建不同ABI的目标,如armeabi、armeabi-v7a和mips。此外,NDK还修复了一些问题,确保应用程序仅在兼容设备上可用。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Android NDK, Revision 8 (May 2012)

This release of the NDK includes support for MIPS ABI and a few additional fixes.

New features:
  • Added support for the MIPS ABI, which allows you to generate machine code that runs on compatible MIPS-based Android devices. Major features for MIPS include MIPS-specific toolchains, system headers, libraries and debugging support. For more details regarding MIPS support, see docs/CPU-MIPS.html in the NDK package.

    By default, code is generated for ARM-based devices. You can add mips to your APP_ABI definition in your Application.mk file to build for MIPS platforms. For example, the following line instructs ndk-build to build your code for three distinct ABIs:

    APP_ABI := armeabi armeabi-v7a mips

    Unless you rely on architecture-specific assembly sources, such as ARM assembly code, you should not need to touch your Android.mk files to build MIPS machine code.

  • You can build a standalone MIPS toolchain using the --arch=mips option when calling make-standalone-toolchain.sh. See docs/STANDALONE-TOOLCHAIN.html for more details.

Note: To ensure that your applications are available to users only if their devices are capable of running them, Google Play filters applications based on the instruction set information included in your application — no action is needed on your part to enable the filtering. Additionally, the Android system itself also checks your application at install time and allows the installation to continue only if the application provides a library that is compiled for the device's CPU architecture.

Important bug fixes:
  • Fixed a typo in GAbi++ implementation where the result of dynamic_cast<D>(b) of base class object b to derived class D is incorrectly adjusted in the opposite direction from the base class. (Issue 28721)
  • Fixed an issue in which make-standalone-toolchain.sh fails to copy libsupc++.*.
Other bug fixes:
  • Fixed ndk-build.cmd to ensure that ndk-build.cmd works correctly even if the user has redefined the SHELL environment variable, which may be changed when installing a variety of development tools in Windows environments

以上为Android NDK r8官方的release info.

这样,现在为止,NDK可以支持的CPU 指令集及架构平台有ARM, x86, MIPS。

编译方法:

在jni目录下的Applicaton.mk(如没有,需新建),增加一行如下指令:

APP_ABI := armeabi armeabi-v7a mips


其它不用改变。如要编译x86平台的库,可增加一个参数“x86"。

APP_ABI := armeabi armeabi-v7a mips x86

如在windows平台上开发,可以配置好eclipse+cygwin环境,方法见之前的博客文章

http://ericbaner.iteye.com/blog/1511832



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值