I know ARMv7 compatible CPU can execute ARMv6 code.

But can I statically link ARMv6 code with ARMv7 code in single binary?

I am interested in both iOS 6 and Android platforms.

有帮助吗?

解决方案

Android supports building fat binary with both ARMv6 and ARMv7.

But Android 4.0 on ARMv7 devices has bug and it loads ARMv6 lib even when ARMv7 is available. You have to name libs differently. Parse /proc/cpu file and get information about cpu and load proper lib by name.

Android NDK have sample code to detect CPU.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top