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

本文深入探讨了MacOSX系统与Darwin操作系统的关系,揭示了Darwin作为MacOSX内核的角色,以及其作为Unix-like系统的特点。文章还详细介绍了Mac和iOS平台的编译参数,如-arch和-march选项,为开发者提供了实用的编译配置指导。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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.youkuaiyun.com/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.youkuaiyun.com/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!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

飞翔的鲲

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值