You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

378 line
16KB

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- Copyright (C) 1988-2020 Free Software Foundation, Inc.
  4. Permission is granted to copy, distribute and/or modify this document
  5. under the terms of the GNU Free Documentation License, Version 1.3 or
  6. any later version published by the Free Software Foundation; with the
  7. Invariant Sections being "Funding Free Software", the Front-Cover
  8. Texts being (a) (see below), and with the Back-Cover Texts being (b)
  9. (see below). A copy of the license is included in the section entitled
  10. "GNU Free Documentation License".
  11. (a) The FSF's Front-Cover Text is:
  12. A GNU Manual
  13. (b) The FSF's Back-Cover Text is:
  14. You have freedom to copy and modify this GNU Manual, like GNU
  15. software. Copies published by the Free Software Foundation raise
  16. funds for GNU development. -->
  17. <!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
  18. <head>
  19. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  20. <title>Darwin Options (Using the GNU Compiler Collection (GCC))</title>
  21. <meta name="description" content="Darwin Options (Using the GNU Compiler Collection (GCC))">
  22. <meta name="keywords" content="Darwin Options (Using the GNU Compiler Collection (GCC))">
  23. <meta name="resource-type" content="document">
  24. <meta name="distribution" content="global">
  25. <meta name="Generator" content="makeinfo">
  26. <link href="index.html#Top" rel="start" title="Top">
  27. <link href="Option-Index.html#Option-Index" rel="index" title="Option Index">
  28. <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
  29. <link href="Submodel-Options.html#Submodel-Options" rel="up" title="Submodel Options">
  30. <link href="DEC-Alpha-Options.html#DEC-Alpha-Options" rel="next" title="DEC Alpha Options">
  31. <link href="C_002dSKY-Options.html#C_002dSKY-Options" rel="prev" title="C-SKY Options">
  32. <style type="text/css">
  33. <!--
  34. a.summary-letter {text-decoration: none}
  35. blockquote.indentedblock {margin-right: 0em}
  36. blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
  37. blockquote.smallquotation {font-size: smaller}
  38. div.display {margin-left: 3.2em}
  39. div.example {margin-left: 3.2em}
  40. div.lisp {margin-left: 3.2em}
  41. div.smalldisplay {margin-left: 3.2em}
  42. div.smallexample {margin-left: 3.2em}
  43. div.smalllisp {margin-left: 3.2em}
  44. kbd {font-style: oblique}
  45. pre.display {font-family: inherit}
  46. pre.format {font-family: inherit}
  47. pre.menu-comment {font-family: serif}
  48. pre.menu-preformatted {font-family: serif}
  49. pre.smalldisplay {font-family: inherit; font-size: smaller}
  50. pre.smallexample {font-size: smaller}
  51. pre.smallformat {font-family: inherit; font-size: smaller}
  52. pre.smalllisp {font-size: smaller}
  53. span.nolinebreak {white-space: nowrap}
  54. span.roman {font-family: initial; font-weight: normal}
  55. span.sansserif {font-family: sans-serif; font-weight: normal}
  56. ul.no-bullet {list-style: none}
  57. -->
  58. </style>
  59. </head>
  60. <body lang="en">
  61. <a name="Darwin-Options"></a>
  62. <div class="header">
  63. <p>
  64. Next: <a href="DEC-Alpha-Options.html#DEC-Alpha-Options" accesskey="n" rel="next">DEC Alpha Options</a>, Previous: <a href="C_002dSKY-Options.html#C_002dSKY-Options" accesskey="p" rel="prev">C-SKY Options</a>, Up: <a href="Submodel-Options.html#Submodel-Options" accesskey="u" rel="up">Submodel Options</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html#Option-Index" title="Index" rel="index">Index</a>]</p>
  65. </div>
  66. <hr>
  67. <a name="Darwin-Options-1"></a>
  68. <h4 class="subsection">3.19.12 Darwin Options</h4>
  69. <a name="index-Darwin-options"></a>
  70. <p>These options are defined for all architectures running the Darwin operating
  71. system.
  72. </p>
  73. <p>FSF GCC on Darwin does not create &ldquo;fat&rdquo; object files; it creates
  74. an object file for the single architecture that GCC was built to
  75. target. Apple&rsquo;s GCC on Darwin does create &ldquo;fat&rdquo; files if multiple
  76. <samp>-arch</samp> options are used; it does so by running the compiler or
  77. linker multiple times and joining the results together with
  78. <samp>lipo</samp>.
  79. </p>
  80. <p>The subtype of the file created (like &lsquo;<samp>ppc7400</samp>&rsquo; or &lsquo;<samp>ppc970</samp>&rsquo; or
  81. &lsquo;<samp>i686</samp>&rsquo;) is determined by the flags that specify the ISA
  82. that GCC is targeting, like <samp>-mcpu</samp> or <samp>-march</samp>. The
  83. <samp>-force_cpusubtype_ALL</samp> option can be used to override this.
  84. </p>
  85. <p>The Darwin tools vary in their behavior when presented with an ISA
  86. mismatch. The assembler, <samp>as</samp>, only permits instructions to
  87. be used that are valid for the subtype of the file it is generating,
  88. so you cannot put 64-bit instructions in a &lsquo;<samp>ppc750</samp>&rsquo; object file.
  89. The linker for shared libraries, <samp>/usr/bin/libtool</samp>, fails
  90. and prints an error if asked to create a shared library with a less
  91. restrictive subtype than its input files (for instance, trying to put
  92. a &lsquo;<samp>ppc970</samp>&rsquo; object file in a &lsquo;<samp>ppc7400</samp>&rsquo; library). The linker
  93. for executables, <code>ld</code>, quietly gives the executable the most
  94. restrictive subtype of any of its input files.
  95. </p>
  96. <dl compact="compact">
  97. <dt><code>-F<var>dir</var></code></dt>
  98. <dd><a name="index-F"></a>
  99. <p>Add the framework directory <var>dir</var> to the head of the list of
  100. directories to be searched for header files. These directories are
  101. interleaved with those specified by <samp>-I</samp> options and are
  102. scanned in a left-to-right order.
  103. </p>
  104. <p>A framework directory is a directory with frameworks in it. A
  105. framework is a directory with a <samp>Headers</samp> and/or
  106. <samp>PrivateHeaders</samp> directory contained directly in it that ends
  107. in <samp>.framework</samp>. The name of a framework is the name of this
  108. directory excluding the <samp>.framework</samp>. Headers associated with
  109. the framework are found in one of those two directories, with
  110. <samp>Headers</samp> being searched first. A subframework is a framework
  111. directory that is in a framework&rsquo;s <samp>Frameworks</samp> directory.
  112. Includes of subframework headers can only appear in a header of a
  113. framework that contains the subframework, or in a sibling subframework
  114. header. Two subframeworks are siblings if they occur in the same
  115. framework. A subframework should not have the same name as a
  116. framework; a warning is issued if this is violated. Currently a
  117. subframework cannot have subframeworks; in the future, the mechanism
  118. may be extended to support this. The standard frameworks can be found
  119. in <samp>/System/Library/Frameworks</samp> and
  120. <samp>/Library/Frameworks</samp>. An example include looks like
  121. <code>#include &lt;Framework/header.h&gt;</code>, where <samp>Framework</samp> denotes
  122. the name of the framework and <samp>header.h</samp> is found in the
  123. <samp>PrivateHeaders</samp> or <samp>Headers</samp> directory.
  124. </p>
  125. </dd>
  126. <dt><code>-iframework<var>dir</var></code></dt>
  127. <dd><a name="index-iframework"></a>
  128. <p>Like <samp>-F</samp> except the directory is a treated as a system
  129. directory. The main difference between this <samp>-iframework</samp> and
  130. <samp>-F</samp> is that with <samp>-iframework</samp> the compiler does not
  131. warn about constructs contained within header files found via
  132. <var>dir</var>. This option is valid only for the C family of languages.
  133. </p>
  134. </dd>
  135. <dt><code>-gused</code></dt>
  136. <dd><a name="index-gused"></a>
  137. <p>Emit debugging information for symbols that are used. For stabs
  138. debugging format, this enables <samp>-feliminate-unused-debug-symbols</samp>.
  139. This is by default ON.
  140. </p>
  141. </dd>
  142. <dt><code>-gfull</code></dt>
  143. <dd><a name="index-gfull"></a>
  144. <p>Emit debugging information for all symbols and types.
  145. </p>
  146. </dd>
  147. <dt><code>-mmacosx-version-min=<var>version</var></code></dt>
  148. <dd><p>The earliest version of MacOS X that this executable will run on
  149. is <var>version</var>. Typical values of <var>version</var> include <code>10.1</code>,
  150. <code>10.2</code>, and <code>10.3.9</code>.
  151. </p>
  152. <p>If the compiler was built to use the system&rsquo;s headers by default,
  153. then the default for this option is the system version on which the
  154. compiler is running, otherwise the default is to make choices that
  155. are compatible with as many systems and code bases as possible.
  156. </p>
  157. </dd>
  158. <dt><code>-mkernel</code></dt>
  159. <dd><a name="index-mkernel"></a>
  160. <p>Enable kernel development mode. The <samp>-mkernel</samp> option sets
  161. <samp>-static</samp>, <samp>-fno-common</samp>, <samp>-fno-use-cxa-atexit</samp>,
  162. <samp>-fno-exceptions</samp>, <samp>-fno-non-call-exceptions</samp>,
  163. <samp>-fapple-kext</samp>, <samp>-fno-weak</samp> and <samp>-fno-rtti</samp> where
  164. applicable. This mode also sets <samp>-mno-altivec</samp>,
  165. <samp>-msoft-float</samp>, <samp>-fno-builtin</samp> and
  166. <samp>-mlong-branch</samp> for PowerPC targets.
  167. </p>
  168. </dd>
  169. <dt><code>-mone-byte-bool</code></dt>
  170. <dd><a name="index-mone_002dbyte_002dbool"></a>
  171. <p>Override the defaults for <code>bool</code> so that <code>sizeof(bool)==1</code>.
  172. By default <code>sizeof(bool)</code> is <code>4</code> when compiling for
  173. Darwin/PowerPC and <code>1</code> when compiling for Darwin/x86, so this
  174. option has no effect on x86.
  175. </p>
  176. <p><strong>Warning:</strong> The <samp>-mone-byte-bool</samp> switch causes GCC
  177. to generate code that is not binary compatible with code generated
  178. without that switch. Using this switch may require recompiling all
  179. other modules in a program, including system libraries. Use this
  180. switch to conform to a non-default data model.
  181. </p>
  182. </dd>
  183. <dt><code>-mfix-and-continue</code></dt>
  184. <dt><code>-ffix-and-continue</code></dt>
  185. <dt><code>-findirect-data</code></dt>
  186. <dd><a name="index-mfix_002dand_002dcontinue"></a>
  187. <a name="index-ffix_002dand_002dcontinue"></a>
  188. <a name="index-findirect_002ddata"></a>
  189. <p>Generate code suitable for fast turnaround development, such as to
  190. allow GDB to dynamically load <samp>.o</samp> files into already-running
  191. programs. <samp>-findirect-data</samp> and <samp>-ffix-and-continue</samp>
  192. are provided for backwards compatibility.
  193. </p>
  194. </dd>
  195. <dt><code>-all_load</code></dt>
  196. <dd><a name="index-all_005fload"></a>
  197. <p>Loads all members of static archive libraries.
  198. See man ld(1) for more information.
  199. </p>
  200. </dd>
  201. <dt><code>-arch_errors_fatal</code></dt>
  202. <dd><a name="index-arch_005ferrors_005ffatal"></a>
  203. <p>Cause the errors having to do with files that have the wrong architecture
  204. to be fatal.
  205. </p>
  206. </dd>
  207. <dt><code>-bind_at_load</code></dt>
  208. <dd><a name="index-bind_005fat_005fload"></a>
  209. <p>Causes the output file to be marked such that the dynamic linker will
  210. bind all undefined references when the file is loaded or launched.
  211. </p>
  212. </dd>
  213. <dt><code>-bundle</code></dt>
  214. <dd><a name="index-bundle"></a>
  215. <p>Produce a Mach-o bundle format file.
  216. See man ld(1) for more information.
  217. </p>
  218. </dd>
  219. <dt><code>-bundle_loader <var>executable</var></code></dt>
  220. <dd><a name="index-bundle_005floader"></a>
  221. <p>This option specifies the <var>executable</var> that will load the build
  222. output file being linked. See man ld(1) for more information.
  223. </p>
  224. </dd>
  225. <dt><code>-dynamiclib</code></dt>
  226. <dd><a name="index-dynamiclib"></a>
  227. <p>When passed this option, GCC produces a dynamic library instead of
  228. an executable when linking, using the Darwin <samp>libtool</samp> command.
  229. </p>
  230. </dd>
  231. <dt><code>-force_cpusubtype_ALL</code></dt>
  232. <dd><a name="index-force_005fcpusubtype_005fALL"></a>
  233. <p>This causes GCC&rsquo;s output file to have the &lsquo;<samp>ALL</samp>&rsquo; subtype, instead of
  234. one controlled by the <samp>-mcpu</samp> or <samp>-march</samp> option.
  235. </p>
  236. </dd>
  237. <dt><code>-allowable_client <var>client_name</var></code></dt>
  238. <dt><code>-client_name</code></dt>
  239. <dt><code>-compatibility_version</code></dt>
  240. <dt><code>-current_version</code></dt>
  241. <dt><code>-dead_strip</code></dt>
  242. <dt><code>-dependency-file</code></dt>
  243. <dt><code>-dylib_file</code></dt>
  244. <dt><code>-dylinker_install_name</code></dt>
  245. <dt><code>-dynamic</code></dt>
  246. <dt><code>-exported_symbols_list</code></dt>
  247. <dt><code>-filelist</code></dt>
  248. <dt><code>-flat_namespace</code></dt>
  249. <dt><code>-force_flat_namespace</code></dt>
  250. <dt><code>-headerpad_max_install_names</code></dt>
  251. <dt><code>-image_base</code></dt>
  252. <dt><code>-init</code></dt>
  253. <dt><code>-install_name</code></dt>
  254. <dt><code>-keep_private_externs</code></dt>
  255. <dt><code>-multi_module</code></dt>
  256. <dt><code>-multiply_defined</code></dt>
  257. <dt><code>-multiply_defined_unused</code></dt>
  258. <dt><code>-noall_load</code></dt>
  259. <dt><code>-no_dead_strip_inits_and_terms</code></dt>
  260. <dt><code>-nofixprebinding</code></dt>
  261. <dt><code>-nomultidefs</code></dt>
  262. <dt><code>-noprebind</code></dt>
  263. <dt><code>-noseglinkedit</code></dt>
  264. <dt><code>-pagezero_size</code></dt>
  265. <dt><code>-prebind</code></dt>
  266. <dt><code>-prebind_all_twolevel_modules</code></dt>
  267. <dt><code>-private_bundle</code></dt>
  268. <dt><code>-read_only_relocs</code></dt>
  269. <dt><code>-sectalign</code></dt>
  270. <dt><code>-sectobjectsymbols</code></dt>
  271. <dt><code>-whyload</code></dt>
  272. <dt><code>-seg1addr</code></dt>
  273. <dt><code>-sectcreate</code></dt>
  274. <dt><code>-sectobjectsymbols</code></dt>
  275. <dt><code>-sectorder</code></dt>
  276. <dt><code>-segaddr</code></dt>
  277. <dt><code>-segs_read_only_addr</code></dt>
  278. <dt><code>-segs_read_write_addr</code></dt>
  279. <dt><code>-seg_addr_table</code></dt>
  280. <dt><code>-seg_addr_table_filename</code></dt>
  281. <dt><code>-seglinkedit</code></dt>
  282. <dt><code>-segprot</code></dt>
  283. <dt><code>-segs_read_only_addr</code></dt>
  284. <dt><code>-segs_read_write_addr</code></dt>
  285. <dt><code>-single_module</code></dt>
  286. <dt><code>-static</code></dt>
  287. <dt><code>-sub_library</code></dt>
  288. <dt><code>-sub_umbrella</code></dt>
  289. <dt><code>-twolevel_namespace</code></dt>
  290. <dt><code>-umbrella</code></dt>
  291. <dt><code>-undefined</code></dt>
  292. <dt><code>-unexported_symbols_list</code></dt>
  293. <dt><code>-weak_reference_mismatches</code></dt>
  294. <dt><code>-whatsloaded</code></dt>
  295. <dd><a name="index-allowable_005fclient"></a>
  296. <a name="index-client_005fname"></a>
  297. <a name="index-compatibility_005fversion"></a>
  298. <a name="index-current_005fversion"></a>
  299. <a name="index-dead_005fstrip"></a>
  300. <a name="index-dependency_002dfile"></a>
  301. <a name="index-dylib_005ffile"></a>
  302. <a name="index-dylinker_005finstall_005fname"></a>
  303. <a name="index-dynamic"></a>
  304. <a name="index-exported_005fsymbols_005flist"></a>
  305. <a name="index-filelist"></a>
  306. <a name="index-flat_005fnamespace"></a>
  307. <a name="index-force_005fflat_005fnamespace"></a>
  308. <a name="index-headerpad_005fmax_005finstall_005fnames"></a>
  309. <a name="index-image_005fbase"></a>
  310. <a name="index-init"></a>
  311. <a name="index-install_005fname"></a>
  312. <a name="index-keep_005fprivate_005fexterns"></a>
  313. <a name="index-multi_005fmodule"></a>
  314. <a name="index-multiply_005fdefined"></a>
  315. <a name="index-multiply_005fdefined_005funused"></a>
  316. <a name="index-noall_005fload"></a>
  317. <a name="index-no_005fdead_005fstrip_005finits_005fand_005fterms"></a>
  318. <a name="index-nofixprebinding"></a>
  319. <a name="index-nomultidefs"></a>
  320. <a name="index-noprebind"></a>
  321. <a name="index-noseglinkedit"></a>
  322. <a name="index-pagezero_005fsize"></a>
  323. <a name="index-prebind"></a>
  324. <a name="index-prebind_005fall_005ftwolevel_005fmodules"></a>
  325. <a name="index-private_005fbundle"></a>
  326. <a name="index-read_005fonly_005frelocs"></a>
  327. <a name="index-sectalign"></a>
  328. <a name="index-sectobjectsymbols"></a>
  329. <a name="index-whyload"></a>
  330. <a name="index-seg1addr"></a>
  331. <a name="index-sectcreate"></a>
  332. <a name="index-sectobjectsymbols-1"></a>
  333. <a name="index-sectorder"></a>
  334. <a name="index-segaddr"></a>
  335. <a name="index-segs_005fread_005fonly_005faddr"></a>
  336. <a name="index-segs_005fread_005fwrite_005faddr"></a>
  337. <a name="index-seg_005faddr_005ftable"></a>
  338. <a name="index-seg_005faddr_005ftable_005ffilename"></a>
  339. <a name="index-seglinkedit"></a>
  340. <a name="index-segprot"></a>
  341. <a name="index-segs_005fread_005fonly_005faddr-1"></a>
  342. <a name="index-segs_005fread_005fwrite_005faddr-1"></a>
  343. <a name="index-single_005fmodule"></a>
  344. <a name="index-static-1"></a>
  345. <a name="index-sub_005flibrary"></a>
  346. <a name="index-sub_005fumbrella"></a>
  347. <a name="index-twolevel_005fnamespace"></a>
  348. <a name="index-umbrella"></a>
  349. <a name="index-undefined"></a>
  350. <a name="index-unexported_005fsymbols_005flist"></a>
  351. <a name="index-weak_005freference_005fmismatches"></a>
  352. <a name="index-whatsloaded"></a>
  353. <p>These options are passed to the Darwin linker. The Darwin linker man page
  354. describes them in detail.
  355. </p></dd>
  356. </dl>
  357. <hr>
  358. <div class="header">
  359. <p>
  360. Next: <a href="DEC-Alpha-Options.html#DEC-Alpha-Options" accesskey="n" rel="next">DEC Alpha Options</a>, Previous: <a href="C_002dSKY-Options.html#C_002dSKY-Options" accesskey="p" rel="prev">C-SKY Options</a>, Up: <a href="Submodel-Options.html#Submodel-Options" accesskey="u" rel="up">Submodel Options</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html#Option-Index" title="Index" rel="index">Index</a>]</p>
  361. </div>
  362. </body>
  363. </html>