如何对现有的ARMv7静态库iPad的AIR应用程序(arm64)联系起来? [英] How to link iPad Air app (arm64) against existing armv7 static libraries?
问题描述
我编的ARMv7静态库(LIB * .a)中,我要编译iPad的AIR应用程序(arm64)。
我得到了链接警告,然后链接错误:
I have compiled armv7 static libraries (lib*.a) and i'm going to compile iPad Air app (arm64). I'm getting linker warning and then linker error:
$ lipo -info /Users/user/Documents/dev/src/iOS_Projects/iProject/libMyLib.a
input file /Users/user/Documents/dev/src/iOS_Projects/iProject/libMyLib.a is not a fat file
Non-fat file: /Users/user/Documents/dev/src/iOS_Projects/iProject/libMyLib.a is architecture: armv7
Ld: warning: ignoring file /Users/user/Documents/dev/src/iOS_Projects/iProject/libMyLib.a, file was built for archive which is not the architecture being linked (arm64): /Users/user/Documents/dev/src/iOS_Projects/iProject/libMyLib.a ignoring file
这是不可取的(也不可能)重新编译静态库的arm64。我该如何使用他们?
It's undesirable (and can be impossible) to recompile static libs for arm64. How can i use them?
推荐答案
使用难度。
您只能AArch32状态,AArch64状态之间的异常边界切换,因此,虽然如64位内核/ 32位用户空间是可能的,这是不可能在一个单一的过程中同时使用。因为它是一个完全不同的指令集/注册布局/异常模型/等。有一个在的ARM / Thumb的风格没有32- / 64位互通(这是本质上的相同的指令只是不同的编码)。
You can only switch between AArch32 state and AArch64 state at an exception boundary, so whilst e.g. 64-bit kernel/32-bit userspace is possible, it's impossible to use both in a single process. Since it's an entirely different instruction set/register layout/exception model/etc. there's no 32/64-bit interworking in the style of ARM/Thumb (which are essentially just different encodings of the same instructions).
在一般(我不熟悉与iOS细节,但我认为它支持遗产AArch32流程作为Linux确实):
In general (I'm not familiar with iOS specifics, but I assume it supports "legacy" AArch32 processes as Linux does):
- 如果库完全集成到您的code,你最好的办法是简单地给在编译您的应用程序为32位。
- 如果您有超至关重要的 - 绝对,必须待64位code,但库调用没有在快速路径,你可以编译它们到您产卵为32位辅助程序额外的过程,并通过某种形式的IPC调用。
- 否则,您正在寻找某种形式的二进制翻译。
- If the libraries are completely integral to your code, your best bet is to simply give in and compile your app as 32-bit.
- If you have super-crucial-absolutely-must-be-64-bit code but the library calls are not in the fast path, you could compile them into a 32-bit helper program that you spawn as an additional process and call via some form of IPC.
- Otherwise you're looking at the ridiculously impractical prospect of some form of binary translation.
我推测,iOS版提供了IPC,它宁可在这种特殊情况下排除了第二个选项。
I gather that iOS offers no support for IPC, which rather rules out the second option in this particular case.
这篇关于如何对现有的ARMv7静态库iPad的AIR应用程序(arm64)联系起来?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!