【mac/ios】 Darwin System and related flags( -arch -march )

Date: 2018.9.29


1、参考

https://developer.apple.com/library/archive/documentation/Darwin/Conceptual/64bitPorting/building/building.html
https://baike.baidu.com/item/达尔文操作系统/22029670?fr=aladdin
https://blog.csdn.net/hintcnuie/article/details/38468093

2、Mac OS X系统与Darwin系统

    达尔文操作系统是由苹果公司于2000年所释出的一个开放原始码操作系统。达尔文操作系统 是Macosx 操作环境的操作系统。苹果于2000年把达尔文操作系统释出给开放原始码社群。现在的达尔文操作系统皆可以在苹果电脑的PowerPC 架构和X86 架构下执行。
    达尔文操作系统是一种Unix-like操作系统,整合数种的技术,包含开放原始码的XNU核心,以微核心为基础的核心架构来实作Machkernel。操作系统的服务和userland 工具是以4.4BSD(柏克莱软件套件的UNIX),特别是FreeBSD和NetBSD) 为基础类似其他Unix-like, 达尔文操作系统也有对称多处理器的优点,高效能的网络设施和支援多种整合的档案系统。
    通常来说,大多数的计算机制造商都把自己的操作系统(以及大多数的应用程序)看作是私人拥有不会公开的。将源代码想外界开发人员免费提供是为了鼓励所有的开发人员都来修正其中的问题,对其进行改善。在Darwin之外,OS X还包括了自己的用户接口所有权,以及其他一些没有提供开源的特性。
    关于Mac OS X的介绍:
https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/OSX_Technology_Overview/About/About.html
    总而言之,Mac OS X系统的内核采用的是Darwin系统,属于Unix-like系统。
参考自:
https://baike.baidu.com/item/达尔文操作系统/22029670?fr=aladdin
https://blog.csdn.net/hintcnuie/article/details/38468093

3、mac和ios相关编译参数
-arch: Darwin options, eg, i386,x86_64, armv7, arm64,powerPC
-march: ARM options , eg, armv7, armv8

因此在配置ios平台编译选项时,这两个选项都需要指定;而配置mac平台编译时,只需要指定-arch选项。
The build setting VALID_ARCHS defines the architectures for which a given target can be built. This setting should contain a list of architectures separated by spaces. For example, to specify that your target can be built for i386, and x86_64, set VALID_ARCHS to “i386 x86_64” (without the quotes) in the Xcode inspector for your target.

The build setting ARCHS defines the architectures for which the entire project should be built. This setting should also contain a space-delimited list of architectures. This build setting can be defined either on the command-line to xcodebuild, or in a build style in Xcode.
参考自:
https://developer.apple.com/library/archive/documentation/Darwin/Conceptual/64bitPorting/building/building.html#//apple_ref/doc/uid/TP40001064-CH208-BCGECFEJ


THE END!

posted @ 2018-09-29 20:05  SoaringLee_fighting  阅读(175)  评论(0编辑  收藏  举报