Question

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.

Était-ce utile?

La solution

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.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top