Search code examples
iosxcodelipo

Understanding architecture results from lipo tool


I built an Xcode project for armv7, armv7s arm64. I ran lipo -info on the resulting .a file:

Architectures in the fat file: Release-iphoneos/libhlsl2glsl.a are: armv7 (cputype (12) cpusubtype (11)) (cputype (16777228) cpusubtype (0))

What is this telling me?


Solution

  • It's display cputype and cpusubtype that you gets by using the functions sysctlor syctlbyname. See mach/machine.h for defined values :

    for cputype, 12 is for ARM CPU

    #define CPU_TYPE_ARM ((cpu_type_t) 12)
    

    16777228 (aka 0x100000C) is for ARM64 CPU : CPU_TYPE_ARM | CPU_ARCH_ABI64

    #define CPU_ARCH_ABI64  0x01000000 /* 64 bit ABI */
    

    for cpusubtype :

    #define CPU_SUBTYPE_ARM_V7S ((cpu_subtype_t) 11) /* Swift */
    
    #define CPU_SUBTYPE_ARM_ALL ((cpu_subtype_t) 0)