Compile Library for armv7s - cputype (12) and cpusubtype (11)
Asked Answered
D

3

32

I'm a developer of a third party library and I'd like to recompile my library for armv7s, but I seem to have issues.

I updated xcode to 4.5. I updated the project and the related targets to have valid architectures of armv7 armv7s.

However, when I run file or lipo -info, it lists

  • i386
  • armv7
  • (cputype (12) cpusubtype (11))

No armv7s. Am I missing something?

Doreathadoreen answered 23/9, 2012 at 3:26 Comment(1)
My best guess is that lipo doesn't know about armv7s. Perhaps path/to/xcode/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/lipo will work better?Grassplot
T
62

Use XCode's lipo:

xcrun -sdk iphoneos lipo
Templeton answered 25/9, 2012 at 12:59 Comment(2)
Looks like it should be: xcrun -sdk iphoneos lipo -info myLibrary.aMoccasin
Thanks! This did the trick for me. The "normal" lipo identifies armv7s as (cputype (12) cpusubtype (11)). So if you try to run that lipo with the "-thin armv7s" an error will be thrown.Diablerie
A
17

Apparently, (cputype (12) cpusubtype (11)) is another nomenclature for armv7s.

You can refer more here: http://www.galloway.me.uk/2012/09/hacking-up-an-armv7s-library/

The above blog also describes a method for making some libraries armv7s build compatible. The description of above is near the end of the article where he explains about the output from file command.

To quote a part of it:

Inside this header (called a Mach-O header) is a field for the CPU type and the CPU subtype. ARM is CPU type 12, armv7 is CPU subtype 9 and armv7s is CPU subtype 11.

Angola answered 25/9, 2012 at 10:6 Comment(0)
T
1

lipo does not have a definition for armv7s and that is why you cannot see the name but only the cpu type and subtype. So this fat binary is ok, just we may have to wait until apple updates its tools if we want to mess with the new architecture manually (for example right now there is no way to merge manually armv7s slim binary into a fat binary).

Tiffanytiffi answered 24/9, 2012 at 10:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.