Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the benefits/consequences of compiling an armv7 only architecture?

In compiling iPhone apps, there is a setting for "Optimized" architecture (armv7 only) vs a standard armv6/armv7 architecture.

What are the benefits/consequences of compiling an armv7 only architecture?

like image 467
coneybeare Avatar asked May 30 '10 19:05

coneybeare


People also ask

What is ARMv7 architecture?

The architecture has evolved over time, and version seven of the architecture, ARMv7, defines three architecture "profiles": A-profile, the "Application" profile, implemented by 32-bit cores in the Cortex-A series and by some non-ARM cores. R-profile, the "Real-time" profile, implemented by cores in the Cortex-R series.

How many instructions does ARMv7 have?

ARMv7 contains two main instruction sets, the ARM and Thumb instruction sets. Much of the functionality available is identical in the two instruction sets.

What is ARMv7?

ARMv7 is a RISC(reduced instruction set computer) processor, with a Load/Store memory model. A Load/Store memory mode means memory access is restricted to specific instructions. An ARMV7 processor is a family of CPUs based on the RISC architecture developed by Advanced RISC Machines (ARM).


2 Answers

Unless your program requires OpenGLES 2.0 (which is only supported on armv7-supporting devices), you should compile the standard fat (armv6/armv7) binary. A fat binary is basically two (or more) Mach-O binaries glued together, with a single header page at the beginning. The performance cost is negligible: the dynamic loader must take an extra page fault for the header page to determine which architecture to load.

Building for armv7 only will essentially halve the size of your executable, although it's unlikely that your executable is all that large to begin with. You can use the "size" and "otool" commands on the host to get more information about the various sections in your app's binary, e.g. "size -arch armv6 build/Release/MyApp.app/MyApp" will get the size of various sections in the armv6 version of a binary, "size -arch armv7 build/Release/MyApp.app/MyApp" will get the size of various sections in the armv7 version of a binary, and obviously "ls -l build/Release/MyApp.app/MyApp" will get the actual file size of the binary.

like image 194
orange Avatar answered Sep 28 '22 06:09

orange


A smaller executable is a faster download from the app store. However, you do cut out non-armv7 devices.

like image 35
Alex Reynolds Avatar answered Sep 28 '22 06:09

Alex Reynolds