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

霸气de小男生 提交于 2019-12-18 14:48:31

问题


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?


回答1:


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




回答2:


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.



来源:https://stackoverflow.com/questions/2940023/what-are-the-benefits-consequences-of-compiling-an-armv7-only-architecture

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!