Darwin-Options.html 16 KB

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