2

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.

Max
  • 6,286
  • 5
  • 44
  • 86
  • 1
    are you talking about NDK? If you want to generate both armeabi and armeabi-v7a binaries , then you can do something like this "APP_ABI := armeabi armeabi-v7a" in your Android.mk – Durairaj Packirisamy Nov 30 '12 at 16:07
  • Actually I develop with Marmalade SDK and my single binary would be used on both iOS and Android. I have subprojects that are compiled as static libs. For Android I select ARMv6 and for iOS 6 I select ARMv7. But I am not sure if I have to rebuild subprojects compiled in ARMv6 for android to link with ARMv7 code for iOS. – Max Nov 30 '12 at 16:52

1 Answers1

0

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.

Max
  • 6,286
  • 5
  • 44
  • 86