1<html lang="en"> 2<head> 3<title>Darwin Options - Using the GNU Compiler Collection (GCC)</title> 4<meta http-equiv="Content-Type" content="text/html"> 5<meta name="description" content="Using the GNU Compiler Collection (GCC)"> 6<meta name="generator" content="makeinfo 4.13"> 7<link title="Top" rel="start" href="index.html#Top"> 8<link rel="up" href="Submodel-Options.html#Submodel-Options" title="Submodel Options"> 9<link rel="prev" href="CRX-Options.html#CRX-Options" title="CRX Options"> 10<link rel="next" href="DEC-Alpha-Options.html#DEC-Alpha-Options" title="DEC Alpha Options"> 11<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> 12<!-- 13Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 141998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 152010 Free Software Foundation, Inc. 16 17Permission is granted to copy, distribute and/or modify this document 18under the terms of the GNU Free Documentation License, Version 1.3 or 19any later version published by the Free Software Foundation; with the 20Invariant Sections being ``Funding Free Software'', the Front-Cover 21Texts being (a) (see below), and with the Back-Cover Texts being (b) 22(see below). A copy of the license is included in the section entitled 23``GNU Free Documentation License''. 24 25(a) The FSF's Front-Cover Text is: 26 27 A GNU Manual 28 29(b) The FSF's Back-Cover Text is: 30 31 You have freedom to copy and modify this GNU Manual, like GNU 32 software. Copies published by the Free Software Foundation raise 33 funds for GNU development.--> 34<meta http-equiv="Content-Style-Type" content="text/css"> 35<style type="text/css"><!-- 36 pre.display { font-family:inherit } 37 pre.format { font-family:inherit } 38 pre.smalldisplay { font-family:inherit; font-size:smaller } 39 pre.smallformat { font-family:inherit; font-size:smaller } 40 pre.smallexample { font-size:smaller } 41 pre.smalllisp { font-size:smaller } 42 span.sc { font-variant:small-caps } 43 span.roman { font-family:serif; font-weight:normal; } 44 span.sansserif { font-family:sans-serif; font-weight:normal; } 45--></style> 46<link rel="stylesheet" type="text/css" href="../cs.css"> 47</head> 48<body> 49<div class="node"> 50<a name="Darwin-Options"></a> 51<p> 52Next: <a rel="next" accesskey="n" href="DEC-Alpha-Options.html#DEC-Alpha-Options">DEC Alpha Options</a>, 53Previous: <a rel="previous" accesskey="p" href="CRX-Options.html#CRX-Options">CRX Options</a>, 54Up: <a rel="up" accesskey="u" href="Submodel-Options.html#Submodel-Options">Submodel Options</a> 55<hr> 56</div> 57 58<h4 class="subsection">3.17.7 Darwin Options</h4> 59 60<p><a name="index-Darwin-options-1132"></a> 61These options are defined for all architectures running the Darwin operating 62system. 63 64 <p>FSF GCC on Darwin does not create “fat” object files; it will create 65an object file for the single architecture that it was built to 66target. Apple's GCC on Darwin does create “fat” files if multiple 67<samp><span class="option">-arch</span></samp> options are used; it does so by running the compiler or 68linker multiple times and joining the results together with 69<samp><span class="file">lipo</span></samp>. 70 71 <p>The subtype of the file created (like ‘<samp><span class="samp">ppc7400</span></samp>’ or ‘<samp><span class="samp">ppc970</span></samp>’ or 72‘<samp><span class="samp">i686</span></samp>’) is determined by the flags that specify the ISA 73that GCC is targetting, like <samp><span class="option">-mcpu</span></samp> or <samp><span class="option">-march</span></samp>. The 74<samp><span class="option">-force_cpusubtype_ALL</span></samp> option can be used to override this. 75 76 <p>The Darwin tools vary in their behavior when presented with an ISA 77mismatch. The assembler, <samp><span class="file">as</span></samp>, will only permit instructions to 78be used that are valid for the subtype of the file it is generating, 79so you cannot put 64-bit instructions in a ‘<samp><span class="samp">ppc750</span></samp>’ object file. 80The linker for shared libraries, <samp><span class="file">/usr/bin/libtool</span></samp>, will fail 81and print an error if asked to create a shared library with a less 82restrictive subtype than its input files (for instance, trying to put 83a ‘<samp><span class="samp">ppc970</span></samp>’ object file in a ‘<samp><span class="samp">ppc7400</span></samp>’ library). The linker 84for executables, <samp><span class="file">ld</span></samp>, will quietly give the executable the most 85restrictive subtype of any of its input files. 86 87 <dl> 88<dt><code>-F</code><var>dir</var><dd><a name="index-F-1133"></a>Add the framework directory <var>dir</var> to the head of the list of 89directories to be searched for header files. These directories are 90interleaved with those specified by <samp><span class="option">-I</span></samp> options and are 91scanned in a left-to-right order. 92 93 <p>A framework directory is a directory with frameworks in it. A 94framework is a directory with a ‘<samp><span class="samp">"Headers"</span></samp>’ and/or 95‘<samp><span class="samp">"PrivateHeaders"</span></samp>’ directory contained directly in it that ends 96in ‘<samp><span class="samp">".framework"</span></samp>’. The name of a framework is the name of this 97directory excluding the ‘<samp><span class="samp">".framework"</span></samp>’. Headers associated with 98the framework are found in one of those two directories, with 99‘<samp><span class="samp">"Headers"</span></samp>’ being searched first. A subframework is a framework 100directory that is in a framework's ‘<samp><span class="samp">"Frameworks"</span></samp>’ directory. 101Includes of subframework headers can only appear in a header of a 102framework that contains the subframework, or in a sibling subframework 103header. Two subframeworks are siblings if they occur in the same 104framework. A subframework should not have the same name as a 105framework, a warning will be issued if this is violated. Currently a 106subframework cannot have subframeworks, in the future, the mechanism 107may be extended to support this. The standard frameworks can be found 108in ‘<samp><span class="samp">"/System/Library/Frameworks"</span></samp>’ and 109‘<samp><span class="samp">"/Library/Frameworks"</span></samp>’. An example include looks like 110<code>#include <Framework/header.h></code>, where ‘<samp><span class="samp">Framework</span></samp>’ denotes 111the name of the framework and header.h is found in the 112‘<samp><span class="samp">"PrivateHeaders"</span></samp>’ or ‘<samp><span class="samp">"Headers"</span></samp>’ directory. 113 114 <br><dt><code>-iframework</code><var>dir</var><dd><a name="index-iframework-1134"></a>Like <samp><span class="option">-F</span></samp> except the directory is a treated as a system 115directory. The main difference between this <samp><span class="option">-iframework</span></samp> and 116<samp><span class="option">-F</span></samp> is that with <samp><span class="option">-iframework</span></samp> the compiler does not 117warn about constructs contained within header files found via 118<var>dir</var>. This option is valid only for the C family of languages. 119 120 <br><dt><code>-gused</code><dd><a name="index-gused-1135"></a>Emit debugging information for symbols that are used. For STABS 121debugging format, this enables <samp><span class="option">-feliminate-unused-debug-symbols</span></samp>. 122This is by default ON. 123 124 <br><dt><code>-gfull</code><dd><a name="index-gfull-1136"></a>Emit debugging information for all symbols and types. 125 126 <br><dt><code>-mmacosx-version-min=</code><var>version</var><dd>The earliest version of MacOS X that this executable will run on 127is <var>version</var>. Typical values of <var>version</var> include <code>10.1</code>, 128<code>10.2</code>, and <code>10.3.9</code>. 129 130 <p>If the compiler was built to use the system's headers by default, 131then the default for this option is the system version on which the 132compiler is running, otherwise the default is to make choices which 133are compatible with as many systems and code bases as possible. 134 135 <br><dt><code>-mkernel</code><dd><a name="index-mkernel-1137"></a>Enable kernel development mode. The <samp><span class="option">-mkernel</span></samp> option sets 136<samp><span class="option">-static</span></samp>, <samp><span class="option">-fno-common</span></samp>, <samp><span class="option">-fno-cxa-atexit</span></samp>, 137<samp><span class="option">-fno-exceptions</span></samp>, <samp><span class="option">-fno-non-call-exceptions</span></samp>, 138<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 139applicable. This mode also sets <samp><span class="option">-mno-altivec</span></samp>, 140<samp><span class="option">-msoft-float</span></samp>, <samp><span class="option">-fno-builtin</span></samp> and 141<samp><span class="option">-mlong-branch</span></samp> for PowerPC targets. 142 143 <br><dt><code>-mone-byte-bool</code><dd><a name="index-mone_002dbyte_002dbool-1138"></a>Override the defaults for ‘<samp><span class="samp">bool</span></samp>’ so that ‘<samp><span class="samp">sizeof(bool)==1</span></samp>’. 144By default ‘<samp><span class="samp">sizeof(bool)</span></samp>’ is ‘<samp><span class="samp">4</span></samp>’ when compiling for 145Darwin/PowerPC and ‘<samp><span class="samp">1</span></samp>’ when compiling for Darwin/x86, so this 146option has no effect on x86. 147 148 <p><strong>Warning:</strong> The <samp><span class="option">-mone-byte-bool</span></samp> switch causes GCC 149to generate code that is not binary compatible with code generated 150without that switch. Using this switch may require recompiling all 151other modules in a program, including system libraries. Use this 152switch to conform to a non-default data model. 153 154 <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-1139"></a><a name="index-ffix_002dand_002dcontinue-1140"></a><a name="index-findirect_002ddata-1141"></a>Generate code suitable for fast turn around development. Needed to 155enable gdb to dynamically load <code>.o</code> files into already running 156programs. <samp><span class="option">-findirect-data</span></samp> and <samp><span class="option">-ffix-and-continue</span></samp> 157are provided for backwards compatibility. 158 159 <br><dt><code>-all_load</code><dd><a name="index-all_005fload-1142"></a>Loads all members of static archive libraries. 160See man ld(1) for more information. 161 162 <br><dt><code>-arch_errors_fatal</code><dd><a name="index-arch_005ferrors_005ffatal-1143"></a>Cause the errors having to do with files that have the wrong architecture 163to be fatal. 164 165 <br><dt><code>-bind_at_load</code><dd><a name="index-bind_005fat_005fload-1144"></a>Causes the output file to be marked such that the dynamic linker will 166bind all undefined references when the file is loaded or launched. 167 168 <br><dt><code>-bundle</code><dd><a name="index-bundle-1145"></a>Produce a Mach-o bundle format file. 169See man ld(1) for more information. 170 171 <br><dt><code>-bundle_loader </code><var>executable</var><dd><a name="index-bundle_005floader-1146"></a>This option specifies the <var>executable</var> that will be loading the build 172output file being linked. See man ld(1) for more information. 173 174 <br><dt><code>-dynamiclib</code><dd><a name="index-dynamiclib-1147"></a>When passed this option, GCC will produce a dynamic library instead of 175an executable when linking, using the Darwin <samp><span class="file">libtool</span></samp> command. 176 177 <br><dt><code>-force_cpusubtype_ALL</code><dd><a name="index-force_005fcpusubtype_005fALL-1148"></a>This causes GCC's output file to have the <var>ALL</var> subtype, instead of 178one controlled by the <samp><span class="option">-mcpu</span></samp> or <samp><span class="option">-march</span></samp> option. 179 180 <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-1149"></a><a name="index-client_005fname-1150"></a><a name="index-compatibility_005fversion-1151"></a><a name="index-current_005fversion-1152"></a><a name="index-dead_005fstrip-1153"></a><a name="index-dependency_002dfile-1154"></a><a name="index-dylib_005ffile-1155"></a><a name="index-dylinker_005finstall_005fname-1156"></a><a name="index-dynamic-1157"></a><a name="index-exported_005fsymbols_005flist-1158"></a><a name="index-filelist-1159"></a><a name="index-flat_005fnamespace-1160"></a><a name="index-force_005fflat_005fnamespace-1161"></a><a name="index-headerpad_005fmax_005finstall_005fnames-1162"></a><a name="index-image_005fbase-1163"></a><a name="index-init-1164"></a><a name="index-install_005fname-1165"></a><a name="index-keep_005fprivate_005fexterns-1166"></a><a name="index-multi_005fmodule-1167"></a><a name="index-multiply_005fdefined-1168"></a><a name="index-multiply_005fdefined_005funused-1169"></a><a name="index-noall_005fload-1170"></a><a name="index-no_005fdead_005fstrip_005finits_005fand_005fterms-1171"></a><a name="index-nofixprebinding-1172"></a><a name="index-nomultidefs-1173"></a><a name="index-noprebind-1174"></a><a name="index-noseglinkedit-1175"></a><a name="index-pagezero_005fsize-1176"></a><a name="index-prebind-1177"></a><a name="index-prebind_005fall_005ftwolevel_005fmodules-1178"></a><a name="index-private_005fbundle-1179"></a><a name="index-read_005fonly_005frelocs-1180"></a><a name="index-sectalign-1181"></a><a name="index-sectobjectsymbols-1182"></a><a name="index-whyload-1183"></a><a name="index-seg1addr-1184"></a><a name="index-sectcreate-1185"></a><a name="index-sectobjectsymbols-1186"></a><a name="index-sectorder-1187"></a><a name="index-segaddr-1188"></a><a name="index-segs_005fread_005fonly_005faddr-1189"></a><a name="index-segs_005fread_005fwrite_005faddr-1190"></a><a name="index-seg_005faddr_005ftable-1191"></a><a name="index-seg_005faddr_005ftable_005ffilename-1192"></a><a name="index-seglinkedit-1193"></a><a name="index-segprot-1194"></a><a name="index-segs_005fread_005fonly_005faddr-1195"></a><a name="index-segs_005fread_005fwrite_005faddr-1196"></a><a name="index-single_005fmodule-1197"></a><a name="index-static-1198"></a><a name="index-sub_005flibrary-1199"></a><a name="index-sub_005fumbrella-1200"></a><a name="index-twolevel_005fnamespace-1201"></a><a name="index-umbrella-1202"></a><a name="index-undefined-1203"></a><a name="index-unexported_005fsymbols_005flist-1204"></a><a name="index-weak_005freference_005fmismatches-1205"></a><a name="index-whatsloaded-1206"></a>These options are passed to the Darwin linker. The Darwin linker man page 181describes them in detail. 182</dl> 183 184 </body></html> 185 186