Android armeabi 和 armeabi-v7a 的区别
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12219202/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Difference between armeabi and armeabi-v7a
提问by Seva Alekseyev
As far as I can tell from the docs, the difference between the two supported flavors of ARM architecture in Android NDK is only in the set of supported CPU instructions. Is that really so? Is there no difference in calling conventions, or system call sequence, or something else?
据我从文档中可以看出,Android NDK 中支持的两种 ARM 架构风格之间的区别仅在于支持的 CPU 指令集。真的是这样吗?在调用约定、系统调用序列或其他方面没有区别吗?
I'm wondering what will happen if I compile a module to an ARM object file (with a compiler other than NDK - Free Pascal specifically), specifying ARMv6 as the architecture, and then link it to both armeabi and armeabi-v7a shared libraries. The FPC bits are not supposed to perform neither system calls nor Java calls, except via my own C-based interface.
我想知道如果我将模块编译为 ARM 对象文件(特别是使用 NDK - Free Pascal 以外的编译器),指定 ARMv6 作为架构,然后将其链接到 armeabi 和 armeabi-v7a 共享库会发生什么。FPC 位不应该执行系统调用和 Java 调用,除非通过我自己的基于 C 的接口。
EDIT: a hello world library, compiled with FPC for ARM, links and runs under ARMv7a emulator.
编辑:一个 hello world 库,使用 FPC for ARM 编译,链接并在 ARMv7a 模拟器下运行。
采纳答案by Alex Cohn
You definitely can run armeabi shared library on v7, and you can call its exported functions from another module. So, to be on the safe side, I would create a separate .so
file from you Pascal code, sticking to armeabi (maybe with some C/C++ wrappers), and use this shared library with both your armeabi and armeabi-v7a libraries. The easiest way to load everything in correct order is to use
你绝对可以在 v7 上运行 armeabi 共享库,你可以从另一个模块调用它的导出函数。所以,为了安全起见,我会.so
从你的 Pascal 代码中创建一个单独的文件,坚持使用 armeabi(可能使用一些 C/C++ 包装器),并将这个共享库与你的 armeabi 和 armeabi-v7a 库一起使用。以正确顺序加载所有内容的最简单方法是使用
System.loadLibrary("pascal"); // armeabi
System.loadLibrary("c++"); // the platform will choose armeabi or armeabi-v7a