You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
183 lines
16 KiB
HTML
183 lines
16 KiB
HTML
4 years ago
|
<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.13">
|
||
|
<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="CR16-Options.html#CR16-Options" title="CR16 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-2015 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.3 or
|
||
|
any later version published by the Free Software Foundation; with the
|
||
|
Invariant Sections being ``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"><!--
|
||
|
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">
|
||
|
<a name="Darwin-Options"></a>
|
||
|
<p>
|
||
|
Next: <a rel="next" accesskey="n" href="DEC-Alpha-Options.html#DEC-Alpha-Options">DEC Alpha Options</a>,
|
||
|
Previous: <a rel="previous" accesskey="p" href="CR16-Options.html#CR16-Options">CR16 Options</a>,
|
||
|
Up: <a rel="up" accesskey="u" href="Submodel-Options.html#Submodel-Options">Submodel Options</a>
|
||
|
<hr>
|
||
|
</div>
|
||
|
|
||
|
<h4 class="subsection">3.17.10 Darwin Options</h4>
|
||
|
|
||
|
<p><a name="index-Darwin-options-1528"></a>
|
||
|
These options are defined for all architectures running the Darwin operating
|
||
|
system.
|
||
|
|
||
|
<p>FSF GCC on Darwin does not create “fat” object files; it creates
|
||
|
an object file for the single architecture that GCC was built to
|
||
|
target. Apple's GCC on Darwin does create “fat” 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 targeting, 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>, only permits instructions to
|
||
|
be used that are valid for the subtype of the file it is generating,
|
||
|
so you cannot put 64-bit instructions in a ‘<samp><span class="samp">ppc750</span></samp>’ object file.
|
||
|
The linker for shared libraries, <samp><span class="file">/usr/bin/libtool</span></samp>, fails
|
||
|
and prints 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="command">ld</span></samp>, quietly gives 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-1529"></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="file">Headers</span></samp> and/or
|
||
|
<samp><span class="file">PrivateHeaders</span></samp> directory contained directly in it that ends
|
||
|
in <samp><span class="file">.framework</span></samp>. The name of a framework is the name of this
|
||
|
directory excluding the <samp><span class="file">.framework</span></samp>. Headers associated with
|
||
|
the framework are found in one of those two directories, with
|
||
|
<samp><span class="file">Headers</span></samp> being searched first. A subframework is a framework
|
||
|
directory that is in a framework's <samp><span class="file">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 is 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="file">/System/Library/Frameworks</span></samp> and
|
||
|
<samp><span class="file">/Library/Frameworks</span></samp>. An example include looks like
|
||
|
<code>#include <Framework/header.h></code>, where <samp><span class="file">Framework</span></samp> denotes
|
||
|
the name of the framework and <samp><span class="file">header.h</span></samp> is found in the
|
||
|
<samp><span class="file">PrivateHeaders</span></samp> or <samp><span class="file">Headers</span></samp> directory.
|
||
|
|
||
|
<br><dt><code>-iframework</code><var>dir</var><dd><a name="index-iframework-1530"></a>Like <samp><span class="option">-F</span></samp> except the directory is a treated as a system
|
||
|
directory. The main difference between this <samp><span class="option">-iframework</span></samp> and
|
||
|
<samp><span class="option">-F</span></samp> is that with <samp><span class="option">-iframework</span></samp> the compiler does not
|
||
|
warn about constructs contained within header files found via
|
||
|
<var>dir</var>. This option is valid only for the C family of languages.
|
||
|
|
||
|
<br><dt><code>-gused</code><dd><a name="index-gused-1531"></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-gfull-1532"></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>If the compiler was built to use the system's headers by default,
|
||
|
then the default for this option is the system version on which the
|
||
|
compiler is running, otherwise the default is to make choices that
|
||
|
are compatible with as many systems and code bases as possible.
|
||
|
|
||
|
<br><dt><code>-mkernel</code><dd><a name="index-mkernel-1533"></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-use-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-mone_002dbyte_002dbool-1534"></a>Override the defaults for <code>bool</code> so that <code>sizeof(bool)==1</code>.
|
||
|
By default <code>sizeof(bool)</code> is <code>4</code> when compiling for
|
||
|
Darwin/PowerPC and <code>1</code> 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-1535"></a><a name="index-ffix_002dand_002dcontinue-1536"></a><a name="index-findirect_002ddata-1537"></a>Generate code suitable for fast turnaround development, such as to
|
||
|
allow GDB to dynamically load <samp><span class="file">.o</span></samp> 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-1538"></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-1539"></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-1540"></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-1541"></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-1542"></a>This option specifies the <var>executable</var> that will load the build
|
||
|
output file being linked. See man ld(1) for more information.
|
||
|
|
||
|
<br><dt><code>-dynamiclib</code><dd><a name="index-dynamiclib-1543"></a>When passed this option, GCC produces 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-force_005fcpusubtype_005fALL-1544"></a>This causes GCC's output file to have the ‘<samp><span class="samp">ALL</span></samp>’ 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-1545"></a><a name="index-client_005fname-1546"></a><a name="index-compatibility_005fversion-1547"></a><a name="index-current_005fversion-1548"></a><a name="index-dead_005fstrip-1549"></a><a name="index-dependency_002dfile-1550"></a><a name="index-dylib_005ffile-1551"></a><a name="index-dylinker_005finstall_005fname-1552"></a><a name="index-dynamic-1553"></a><a name="index-exported_005fsymbols_005flist-1554"></a><a name="index-filelist-1555"></a><a name="index-flat_005fnamespace-1556"></a><a name="index-force_005fflat_005fnamespace-1557"></a><a name="index-headerpad_005fmax_005finstall_005fnames-1558"></a><a name="index-image_005fbase-1559"></a><a name="index-init-1560"></a><a name="index-install_005fname-1561"></a><a name="index-keep_005fprivate_005fexterns-1562"></a><a name="index-multi_005fmodule-1563"></a><a name="index-multiply_005fdefined-1564"></a><a name="index-multiply_005fdefined_005funused-1565"></a><a name="index-noall_005fload-1566"></a><a name="index-no_005fdead_005fstrip_005finits_005fand_005fterms-1567"></a><a name="index-nofixprebinding-1568"></a><a name="index-nomultidefs-1569"></a><a name="index-noprebind-1570"></a><a name="index-noseglinkedit-1571"></a><a name="index-pagezero_005fsize-1572"></a><a name="index-prebind-1573"></a><a name="index-prebind_005fall_005ftwolevel_005fmodules-1574"></a><a name="index-private_005fbundle-1575"></a><a name="index-read_005fonly_005frelocs-1576"></a><a name="index-sectalign-1577"></a><a name="index-sectobjectsymbols-1578"></a><a name="index-whyload-1579"></a><a name="index-seg1addr-1580"></a><a name="index-sectcreate-1581"></a><a name="index-sectobjectsymbols-1582"></a><a name="index-sectorder-1583"></a><a name="index-segaddr-1584"></a><a name="index-segs_005fread_005fonly_005faddr-1585"></a><a name="index-segs_005fread_005fwrite_005faddr-1586"></a><a name="index-seg_005faddr_005ftable-1587"></a><a name="index-seg_005faddr_005ftable_005ffilename-1588"></a><a name="index-seglinkedit-1589"></a><a name="index-segprot-1590"></a><a name="index-segs_005fread_005fonly_005faddr-1591"></a><a name="index-segs_005fread_005fwrite_005faddr-1592"></a><a name="index-singl
|
||
|
describes them in detail.
|
||
|
</dl>
|
||
|
|
||
|
</body></html>
|
||
|
|