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?

Nandeep Mali
  • 4,456
  • 1
  • 25
  • 34
Liyan Chang
  • 7,721
  • 3
  • 39
  • 59
  • 2
    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? – tc. Sep 23 '12 at 03:34

3 Answers3

62

Use XCode's lipo:

xcrun -sdk iphoneos lipo
Cfr
  • 5,092
  • 1
  • 33
  • 50
  • 1
    Looks like it should be: xcrun -sdk iphoneos lipo -info myLibrary.a – Paul Solt Sep 17 '13 at 15:09
  • 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. – runamok Oct 10 '13 at 20:34
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.

Nandeep Mali
  • 4,456
  • 1
  • 25
  • 34
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).

Anton Banchev
  • 541
  • 8
  • 28