<html lang="en">
<head>
<title>Darwin Options - Using the GNU Compiler Collection (GCC)</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Using the GNU Compiler Collection (GCC)">
<meta name="generator" content="makeinfo 4.8">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Submodel-Options.html#Submodel-Options" title="Submodel Options">
<link rel="prev" href="CRX-Options.html#CRX-Options" title="CRX Options">
<link rel="next" href="DEC-Alpha-Options.html#DEC-Alpha-Options" title="DEC Alpha Options">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<!--
Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2 or
any later version published by the Free Software Foundation; with the
Invariant Sections being ``GNU General Public License'' and ``Funding
Free Software'', the Front-Cover texts being (a) (see below), and with
the Back-Cover Texts being (b) (see below).  A copy of the license is
included in the section entitled ``GNU Free Documentation License''.

(a) The FSF's Front-Cover Text is:

     A GNU Manual

(b) The FSF's Back-Cover Text is:

     You have freedom to copy and modify this GNU Manual, like GNU
     software.  Copies published by the Free Software Foundation raise
     funds for GNU development.-->
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
@import url("../raisonance.css");
  pre.display { font-family:inherit }
  pre.format  { font-family:inherit }
  pre.smalldisplay { font-family:inherit; font-size:smaller }
  pre.smallformat  { font-family:inherit; font-size:smaller }
  pre.smallexample { font-size:smaller }
  pre.smalllisp    { font-size:smaller }
  span.sc    { font-variant:small-caps }
  span.roman { font-family:serif; font-weight:normal; } 
  span.sansserif { font-family:sans-serif; font-weight:normal; } 
--></style>
</head>
<body>
<div class="node">
<p>
<a name="Darwin-Options"></a>
Next:&nbsp;<a rel="next" accesskey="n" href="DEC-Alpha-Options.html#DEC-Alpha-Options">DEC Alpha Options</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="CRX-Options.html#CRX-Options">CRX Options</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="Submodel-Options.html#Submodel-Options">Submodel Options</a>
<hr>
</div>

<h4 class="subsection">3.17.7 Darwin Options</h4>

<p><a name="index-Darwin-options-833"></a>
These options are defined for all architectures running the Darwin operating
system.

 <p>FSF GCC on Darwin does not create &ldquo;fat&rdquo; object files; it will create
an object file for the single architecture that it was built to
target.  Apple's GCC on Darwin does create &ldquo;fat&rdquo; files if multiple
<samp><span class="option">-arch</span></samp> options are used; it does so by running the compiler or
linker multiple times and joining the results together with
<samp><span class="file">lipo</span></samp>.

 <p>The subtype of the file created (like `<samp><span class="samp">ppc7400</span></samp>' or `<samp><span class="samp">ppc970</span></samp>' or
`<samp><span class="samp">i686</span></samp>') is determined by the flags that specify the ISA
that GCC is targetting, like <samp><span class="option">-mcpu</span></samp> or <samp><span class="option">-march</span></samp>.  The
<samp><span class="option">-force_cpusubtype_ALL</span></samp> option can be used to override this.

 <p>The Darwin tools vary in their behavior when presented with an ISA
mismatch.  The assembler, <samp><span class="file">as</span></samp>, will only permit instructions to
be used that are valid for the subtype of the file it is generating,
so you cannot put 64-bit instructions in an `<samp><span class="samp">ppc750</span></samp>' object file. 
The linker for shared libraries, <samp><span class="file">/usr/bin/libtool</span></samp>, will fail
and print an error if asked to create a shared library with a less
restrictive subtype than its input files (for instance, trying to put
a `<samp><span class="samp">ppc970</span></samp>' object file in a `<samp><span class="samp">ppc7400</span></samp>' library).  The linker
for executables, <samp><span class="file">ld</span></samp>, will quietly give the executable the most
restrictive subtype of any of its input files.

     <dl>
<dt><code>-F</code><var>dir</var><dd><a name="index-F-834"></a>Add the framework directory <var>dir</var> to the head of the list of
directories to be searched for header files.  These directories are
interleaved with those specified by <samp><span class="option">-I</span></samp> options and are
scanned in a left-to-right order.

     <p>A framework directory is a directory with frameworks in it.  A
framework is a directory with a `<samp><span class="samp">"Headers"</span></samp>' and/or
`<samp><span class="samp">"PrivateHeaders"</span></samp>' directory contained directly in it that ends
in `<samp><span class="samp">".framework"</span></samp>'.  The name of a framework is the name of this
directory excluding the `<samp><span class="samp">".framework"</span></samp>'.  Headers associated with
the framework are found in one of those two directories, with
`<samp><span class="samp">"Headers"</span></samp>' being searched first.  A subframework is a framework
directory that is in a framework's `<samp><span class="samp">"Frameworks"</span></samp>' directory. 
Includes of subframework headers can only appear in a header of a
framework that contains the subframework, or in a sibling subframework
header.  Two subframeworks are siblings if they occur in the same
framework.  A subframework should not have the same name as a
framework, a warning will be issued if this is violated.  Currently a
subframework cannot have subframeworks, in the future, the mechanism
may be extended to support this.  The standard frameworks can be found
in `<samp><span class="samp">"/System/Library/Frameworks"</span></samp>' and
`<samp><span class="samp">"/Library/Frameworks"</span></samp>'.  An example include looks like
<code>#include &lt;Framework/header.h&gt;</code>, where `<samp><span class="samp">Framework</span></samp>' denotes
the name of the framework and header.h is found in the
`<samp><span class="samp">"PrivateHeaders"</span></samp>' or `<samp><span class="samp">"Headers"</span></samp>' directory.

     <br><dt><code>-gused</code><dd><a name="index-g_t_002dgused-835"></a>Emit debugging information for symbols that are used.  For STABS
debugging format, this enables <samp><span class="option">-feliminate-unused-debug-symbols</span></samp>. 
This is by default ON.

     <br><dt><code>-gfull</code><dd><a name="index-g_t_002dgfull-836"></a>Emit debugging information for all symbols and types.

     <br><dt><code>-mmacosx-version-min=</code><var>version</var><dd>The earliest version of MacOS X that this executable will run on
is <var>version</var>.  Typical values of <var>version</var> include <code>10.1</code>,
<code>10.2</code>, and <code>10.3.9</code>.

     <p>The default for this option is to make choices that seem to be most
useful.

     <br><dt><code>-mkernel</code><dd><a name="index-mkernel-837"></a>Enable kernel development mode.  The <samp><span class="option">-mkernel</span></samp> option sets
<samp><span class="option">-static</span></samp>, <samp><span class="option">-fno-common</span></samp>, <samp><span class="option">-fno-cxa-atexit</span></samp>,
<samp><span class="option">-fno-exceptions</span></samp>, <samp><span class="option">-fno-non-call-exceptions</span></samp>,
<samp><span class="option">-fapple-kext</span></samp>, <samp><span class="option">-fno-weak</span></samp> and <samp><span class="option">-fno-rtti</span></samp> where
applicable.  This mode also sets <samp><span class="option">-mno-altivec</span></samp>,
<samp><span class="option">-msoft-float</span></samp>, <samp><span class="option">-fno-builtin</span></samp> and
<samp><span class="option">-mlong-branch</span></samp> for PowerPC targets.

     <br><dt><code>-mone-byte-bool</code><dd><a name="index-g_t_002dmone_002dbyte_002dbool-838"></a>Override the defaults for `<samp><span class="samp">bool</span></samp>' so that `<samp><span class="samp">sizeof(bool)==1</span></samp>'. 
By default `<samp><span class="samp">sizeof(bool)</span></samp>' is `<samp><span class="samp">4</span></samp>' when compiling for
Darwin/PowerPC and `<samp><span class="samp">1</span></samp>' when compiling for Darwin/x86, so this
option has no effect on x86.

     <p><strong>Warning:</strong> The <samp><span class="option">-mone-byte-bool</span></samp> switch causes GCC
to generate code that is not binary compatible with code generated
without that switch.  Using this switch may require recompiling all
other modules in a program, including system libraries.  Use this
switch to conform to a non-default data model.

     <br><dt><code>-mfix-and-continue</code><dt><code>-ffix-and-continue</code><dt><code>-findirect-data</code><dd><a name="index-mfix_002dand_002dcontinue-839"></a><a name="index-ffix_002dand_002dcontinue-840"></a><a name="index-findirect_002ddata-841"></a>Generate code suitable for fast turn around development.  Needed to
enable gdb to dynamically load <code>.o</code> files into already running
programs.  <samp><span class="option">-findirect-data</span></samp> and <samp><span class="option">-ffix-and-continue</span></samp>
are provided for backwards compatibility.

     <br><dt><code>-all_load</code><dd><a name="index-all_005fload-842"></a>Loads all members of static archive libraries. 
See man ld(1) for more information.

     <br><dt><code>-arch_errors_fatal</code><dd><a name="index-arch_005ferrors_005ffatal-843"></a>Cause the errors having to do with files that have the wrong architecture
to be fatal.

     <br><dt><code>-bind_at_load</code><dd><a name="index-bind_005fat_005fload-844"></a>Causes the output file to be marked such that the dynamic linker will
bind all undefined references when the file is loaded or launched.

     <br><dt><code>-bundle</code><dd><a name="index-bundle-845"></a>Produce a Mach-o bundle format file. 
See man ld(1) for more information.

     <br><dt><code>-bundle_loader </code><var>executable</var><dd><a name="index-bundle_005floader-846"></a>This option specifies the <var>executable</var> that will be loading the build
output file being linked.  See man ld(1) for more information.

     <br><dt><code>-dynamiclib</code><dd><a name="index-g_t_002ddynamiclib-847"></a>When passed this option, GCC will produce a dynamic library instead of
an executable when linking, using the Darwin <samp><span class="file">libtool</span></samp> command.

     <br><dt><code>-force_cpusubtype_ALL</code><dd><a name="index-g_t_002dforce_005fcpusubtype_005fALL-848"></a>This causes GCC's output file to have the <var>ALL</var> subtype, instead of
one controlled by the <samp><span class="option">-mcpu</span></samp> or <samp><span class="option">-march</span></samp> option.

     <br><dt><code>-allowable_client  </code><var>client_name</var><dt><code>-client_name</code><dt><code>-compatibility_version</code><dt><code>-current_version</code><dt><code>-dead_strip</code><dt><code>-dependency-file</code><dt><code>-dylib_file</code><dt><code>-dylinker_install_name</code><dt><code>-dynamic</code><dt><code>-exported_symbols_list</code><dt><code>-filelist</code><dt><code>-flat_namespace</code><dt><code>-force_flat_namespace</code><dt><code>-headerpad_max_install_names</code><dt><code>-image_base</code><dt><code>-init</code><dt><code>-install_name</code><dt><code>-keep_private_externs</code><dt><code>-multi_module</code><dt><code>-multiply_defined</code><dt><code>-multiply_defined_unused</code><dt><code>-noall_load</code><dt><code>-no_dead_strip_inits_and_terms</code><dt><code>-nofixprebinding</code><dt><code>-nomultidefs</code><dt><code>-noprebind</code><dt><code>-noseglinkedit</code><dt><code>-pagezero_size</code><dt><code>-prebind</code><dt><code>-prebind_all_twolevel_modules</code><dt><code>-private_bundle</code><dt><code>-read_only_relocs</code><dt><code>-sectalign</code><dt><code>-sectobjectsymbols</code><dt><code>-whyload</code><dt><code>-seg1addr</code><dt><code>-sectcreate</code><dt><code>-sectobjectsymbols</code><dt><code>-sectorder</code><dt><code>-segaddr</code><dt><code>-segs_read_only_addr</code><dt><code>-segs_read_write_addr</code><dt><code>-seg_addr_table</code><dt><code>-seg_addr_table_filename</code><dt><code>-seglinkedit</code><dt><code>-segprot</code><dt><code>-segs_read_only_addr</code><dt><code>-segs_read_write_addr</code><dt><code>-single_module</code><dt><code>-static</code><dt><code>-sub_library</code><dt><code>-sub_umbrella</code><dt><code>-twolevel_namespace</code><dt><code>-umbrella</code><dt><code>-undefined</code><dt><code>-unexported_symbols_list</code><dt><code>-weak_reference_mismatches</code><dt><code>-whatsloaded</code><dd>
<a name="index-allowable_005fclient-849"></a><a name="index-client_005fname-850"></a><a name="index-compatibility_005fversion-851"></a><a name="index-current_005fversion-852"></a><a name="index-dead_005fstrip-853"></a><a name="index-dependency_002dfile-854"></a><a name="index-dylib_005ffile-855"></a><a name="index-dylinker_005finstall_005fname-856"></a><a name="index-dynamic-857"></a><a name="index-exported_005fsymbols_005flist-858"></a><a name="index-filelist-859"></a><a name="index-flat_005fnamespace-860"></a><a name="index-force_005fflat_005fnamespace-861"></a><a name="index-headerpad_005fmax_005finstall_005fnames-862"></a><a name="index-image_005fbase-863"></a><a name="index-init-864"></a><a name="index-install_005fname-865"></a><a name="index-keep_005fprivate_005fexterns-866"></a><a name="index-multi_005fmodule-867"></a><a name="index-multiply_005fdefined-868"></a><a name="index-multiply_005fdefined_005funused-869"></a><a name="index-noall_005fload-870"></a><a name="index-no_005fdead_005fstrip_005finits_005fand_005fterms-871"></a><a name="index-nofixprebinding-872"></a><a name="index-nomultidefs-873"></a><a name="index-noprebind-874"></a><a name="index-noseglinkedit-875"></a><a name="index-pagezero_005fsize-876"></a><a name="index-prebind-877"></a><a name="index-prebind_005fall_005ftwolevel_005fmodules-878"></a><a name="index-private_005fbundle-879"></a><a name="index-read_005fonly_005frelocs-880"></a><a name="index-sectalign-881"></a><a name="index-sectobjectsymbols-882"></a><a name="index-whyload-883"></a><a name="index-seg1addr-884"></a><a name="index-sectcreate-885"></a><a name="index-sectobjectsymbols-886"></a><a name="index-sectorder-887"></a><a name="index-segaddr-888"></a><a name="index-segs_005fread_005fonly_005faddr-889"></a><a name="index-segs_005fread_005fwrite_005faddr-890"></a><a name="index-seg_005faddr_005ftable-891"></a><a name="index-seg_005faddr_005ftable_005ffilename-892"></a><a name="index-seglinkedit-893"></a><a name="index-segprot-894"></a><a name="index-segs_005fread_005fonly_005faddr-895"></a><a name="index-segs_005fread_005fwrite_005faddr-896"></a><a name="index-single_005fmodule-897"></a><a name="index-static-898"></a><a name="index-sub_005flibrary-899"></a><a name="index-sub_005fumbrella-900"></a><a name="index-twolevel_005fnamespace-901"></a><a name="index-umbrella-902"></a><a name="index-undefined-903"></a><a name="index-unexported_005fsymbols_005flist-904"></a><a name="index-weak_005freference_005fmismatches-905"></a><a name="index-whatsloaded-906"></a>
These options are passed to the Darwin linker.  The Darwin linker man page
describes them in detail. 
</dl>

 </body></html>

