现在的位置: 首页 > 综合 > 正文

NDK r6 新的特性

2013年02月01日 ⁄ 综合 ⁄ 共 2009字 ⁄ 字号 评论关闭

随着r5中对native activity的支持,对ndk的关注比较紧,多么希望对c和c++更多的支持啊。下面是翻译自ndk的CHANGES.html中对r6的描述。

android-ndk-r6

IMPORTANT CHANGES:
- Official support for the x86 ABI.
  This release of the Android NDK now provides support for the 'x86' ABI.
  This allows you to generate machine code that runs on future x86-based
  Android devices.

  Note that by default, code is still generated for ARM-based devices.
  You can however add 'x86' to your APP_PLATFORM definition in your
  Application.mk. For example, the following line instructs ndk-build
  to build your code for three distinct ABIs:

    APP_ABI := armeabi armeabi-v7a x86

  Unless you rely on ARM-based assembly sources, you shouldn't need to touch
  your Android.mk files to build x86 machine code.

  For all details regarding x86 support, please read the new documentation
  file named docs/CPU-X86.html.

  Don't hesitate to file NDK bugs related to x86 at http://b.android.com

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

- The new 'ndk-stack' tool can be used to translate stack traces
  (as reported by adb logcat in case of crash in native code) into
  something more readable, i.e. containing function / source file /
  line number information corresponding to each stack frame.

  For more information and usage example, see the new documentation
  file docs/NDK-STACK.html

OTHER FIXES & CHANGES:
- The arm-eabi-4.4.0, which had been deprecated since NDK r5, has been
  finally removed from the NDK distribution.

大意如下:

重要的变化:

-官方支持x86 ABI。

新发布的Android NDK 版本 现在提供了对x86 ABI的支持。
这允许你生成的机器码在未来的基于x86架构的Android设备上运行。

注意,代码仍然默认的生成基于ARM的设备。然而你可以在Application.mk中的APP_PLATFORM定义中添加‘x86’。
例如,下面一行指示ndk-build来构建你的代码向三种不同的ABI:
 APP_ABI := armeabi armeabi-v7a x86

除非你依赖基于ARM的汇编源,否则你不需要管Android.mk来构建x86机器码。

关于对x86支持的所有细节,请阅读新文档docs目录下面的CPU-X86.html。

有关x86的bugs,请不用迟疑的归档在http://b.android.com
- 你可以构建一个单独的x86工具链,当调用make-standalone-toolchain.sh时使用 --toolchain=x86-4.4.3选项。
  具体细节请看docs/STANDALONE-TOOLCHAIN.html。

- 新的“ndk栈”工具可以翻译栈的痕迹(在native代码crash时,adb logcat报告的)更多一些可读信息。
  即,包含函数/源文件/行数信息相应的每个栈的帧。

  更多信息和用法示例,请阅读新的文档docs/NDK-STACK.html。

其它 FIXES & CHANGES:
- arm-eabi-4.4.0, 从NDK r5 已经过时(deprecated),已经从NDK分布上永远的移除了。

       

抱歉!评论已关闭.