toolchain/gcc-linaro-6.3.1-2017.02-x8.../share/doc/gcc/Darwin-Options.html

379 lines
16 KiB
HTML
Raw Normal View History

2024-03-22 05:10:17 +00:00
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Copyright (C) 1988-2016 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. -->
<!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ -->
<head>
<title>Using the GNU Compiler Collection (GCC): Darwin Options</title>
<meta name="description" content="Using the GNU Compiler Collection (GCC): Darwin Options">
<meta name="keywords" content="Using the GNU Compiler Collection (GCC): Darwin Options">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#Top" rel="start" title="Top">
<link href="Option-Index.html#Option-Index" rel="index" title="Option Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Submodel-Options.html#Submodel-Options" rel="up" title="Submodel Options">
<link href="DEC-Alpha-Options.html#DEC-Alpha-Options" rel="next" title="DEC Alpha Options">
<link href="CR16-Options.html#CR16-Options" rel="prev" title="CR16 Options">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.indentedblock {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
div.smalllisp {margin-left: 3.2em}
kbd {font-style:oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nocodebreak {white-space:nowrap}
span.nolinebreak {white-space:nowrap}
span.roman {font-family:serif; font-weight:normal}
span.sansserif {font-family:sans-serif; font-weight:normal}
ul.no-bullet {list-style: none}
-->
</style>
</head>
<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<a name="Darwin-Options"></a>
<div class="header">
<p>
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>
</div>
<hr>
<a name="Darwin-Options-1"></a>
<h4 class="subsection">3.18.10 Darwin Options</h4>
<a name="index-Darwin-options"></a>
<p>These options are defined for all architectures running the Darwin operating
system.
</p>
<p>FSF GCC on Darwin does not create &ldquo;fat&rdquo; object files; it creates
an object file for the single architecture that GCC was built to
target. Apple&rsquo;s GCC on Darwin does create &ldquo;fat&rdquo; files if multiple
<samp>-arch</samp> options are used; it does so by running the compiler or
linker multiple times and joining the results together with
<samp>lipo</samp>.
</p>
<p>The subtype of the file created (like &lsquo;<samp>ppc7400</samp>&rsquo; or &lsquo;<samp>ppc970</samp>&rsquo; or
&lsquo;<samp>i686</samp>&rsquo;) is determined by the flags that specify the ISA
that GCC is targeting, like <samp>-mcpu</samp> or <samp>-march</samp>. The
<samp>-force_cpusubtype_ALL</samp> option can be used to override this.
</p>
<p>The Darwin tools vary in their behavior when presented with an ISA
mismatch. The assembler, <samp>as</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 &lsquo;<samp>ppc750</samp>&rsquo; object file.
The linker for shared libraries, <samp>/usr/bin/libtool</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 &lsquo;<samp>ppc970</samp>&rsquo; object file in a &lsquo;<samp>ppc7400</samp>&rsquo; library). The linker
for executables, <code>ld</code>, quietly gives the executable the most
restrictive subtype of any of its input files.
</p>
<dl compact="compact">
<dt><code>-F<var>dir</var></code></dt>
<dd><a name="index-F"></a>
<p>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>-I</samp> options and are
scanned in a left-to-right order.
</p>
<p>A framework directory is a directory with frameworks in it. A
framework is a directory with a <samp>Headers</samp> and/or
<samp>PrivateHeaders</samp> directory contained directly in it that ends
in <samp>.framework</samp>. The name of a framework is the name of this
directory excluding the <samp>.framework</samp>. Headers associated with
the framework are found in one of those two directories, with
<samp>Headers</samp> being searched first. A subframework is a framework
directory that is in a framework&rsquo;s <samp>Frameworks</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>/System/Library/Frameworks</samp> and
<samp>/Library/Frameworks</samp>. An example include looks like
<code>#include &lt;Framework/header.h&gt;</code>, where <samp>Framework</samp> denotes
the name of the framework and <samp>header.h</samp> is found in the
<samp>PrivateHeaders</samp> or <samp>Headers</samp> directory.
</p>
</dd>
<dt><code>-iframework<var>dir</var></code></dt>
<dd><a name="index-iframework"></a>
<p>Like <samp>-F</samp> except the directory is a treated as a system
directory. The main difference between this <samp>-iframework</samp> and
<samp>-F</samp> is that with <samp>-iframework</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.
</p>
</dd>
<dt><code>-gused</code></dt>
<dd><a name="index-gused"></a>
<p>Emit debugging information for symbols that are used. For stabs
debugging format, this enables <samp>-feliminate-unused-debug-symbols</samp>.
This is by default ON.
</p>
</dd>
<dt><code>-gfull</code></dt>
<dd><a name="index-gfull"></a>
<p>Emit debugging information for all symbols and types.
</p>
</dd>
<dt><code>-mmacosx-version-min=<var>version</var></code></dt>
<dd><p>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>
<p>If the compiler was built to use the system&rsquo;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.
</p>
</dd>
<dt><code>-mkernel</code></dt>
<dd><a name="index-mkernel"></a>
<p>Enable kernel development mode. The <samp>-mkernel</samp> option sets
<samp>-static</samp>, <samp>-fno-common</samp>, <samp>-fno-use-cxa-atexit</samp>,
<samp>-fno-exceptions</samp>, <samp>-fno-non-call-exceptions</samp>,
<samp>-fapple-kext</samp>, <samp>-fno-weak</samp> and <samp>-fno-rtti</samp> where
applicable. This mode also sets <samp>-mno-altivec</samp>,
<samp>-msoft-float</samp>, <samp>-fno-builtin</samp> and
<samp>-mlong-branch</samp> for PowerPC targets.
</p>
</dd>
<dt><code>-mone-byte-bool</code></dt>
<dd><a name="index-mone_002dbyte_002dbool"></a>
<p>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>
<p><strong>Warning:</strong> The <samp>-mone-byte-bool</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.
</p>
</dd>
<dt><code>-mfix-and-continue</code></dt>
<dt><code>-ffix-and-continue</code></dt>
<dt><code>-findirect-data</code></dt>
<dd><a name="index-mfix_002dand_002dcontinue"></a>
<a name="index-ffix_002dand_002dcontinue"></a>
<a name="index-findirect_002ddata"></a>
<p>Generate code suitable for fast turnaround development, such as to
allow GDB to dynamically load <samp>.o</samp> files into already-running
programs. <samp>-findirect-data</samp> and <samp>-ffix-and-continue</samp>
are provided for backwards compatibility.
</p>
</dd>
<dt><code>-all_load</code></dt>
<dd><a name="index-all_005fload"></a>
<p>Loads all members of static archive libraries.
See man ld(1) for more information.
</p>
</dd>
<dt><code>-arch_errors_fatal</code></dt>
<dd><a name="index-arch_005ferrors_005ffatal"></a>
<p>Cause the errors having to do with files that have the wrong architecture
to be fatal.
</p>
</dd>
<dt><code>-bind_at_load</code></dt>
<dd><a name="index-bind_005fat_005fload"></a>
<p>Causes the output file to be marked such that the dynamic linker will
bind all undefined references when the file is loaded or launched.
</p>
</dd>
<dt><code>-bundle</code></dt>
<dd><a name="index-bundle"></a>
<p>Produce a Mach-o bundle format file.
See man ld(1) for more information.
</p>
</dd>
<dt><code>-bundle_loader <var>executable</var></code></dt>
<dd><a name="index-bundle_005floader"></a>
<p>This option specifies the <var>executable</var> that will load the build
output file being linked. See man ld(1) for more information.
</p>
</dd>
<dt><code>-dynamiclib</code></dt>
<dd><a name="index-dynamiclib"></a>
<p>When passed this option, GCC produces a dynamic library instead of
an executable when linking, using the Darwin <samp>libtool</samp> command.
</p>
</dd>
<dt><code>-force_cpusubtype_ALL</code></dt>
<dd><a name="index-force_005fcpusubtype_005fALL"></a>
<p>This causes GCC&rsquo;s output file to have the &lsquo;<samp>ALL</samp>&rsquo; subtype, instead of
one controlled by the <samp>-mcpu</samp> or <samp>-march</samp> option.
</p>
</dd>
<dt><code>-allowable_client <var>client_name</var></code></dt>
<dt><code>-client_name</code></dt>
<dt><code>-compatibility_version</code></dt>
<dt><code>-current_version</code></dt>
<dt><code>-dead_strip</code></dt>
<dt><code>-dependency-file</code></dt>
<dt><code>-dylib_file</code></dt>
<dt><code>-dylinker_install_name</code></dt>
<dt><code>-dynamic</code></dt>
<dt><code>-exported_symbols_list</code></dt>
<dt><code>-filelist</code></dt>
<dt><code>-flat_namespace</code></dt>
<dt><code>-force_flat_namespace</code></dt>
<dt><code>-headerpad_max_install_names</code></dt>
<dt><code>-image_base</code></dt>
<dt><code>-init</code></dt>
<dt><code>-install_name</code></dt>
<dt><code>-keep_private_externs</code></dt>
<dt><code>-multi_module</code></dt>
<dt><code>-multiply_defined</code></dt>
<dt><code>-multiply_defined_unused</code></dt>
<dt><code>-noall_load</code></dt>
<dt><code>-no_dead_strip_inits_and_terms</code></dt>
<dt><code>-nofixprebinding</code></dt>
<dt><code>-nomultidefs</code></dt>
<dt><code>-noprebind</code></dt>
<dt><code>-noseglinkedit</code></dt>
<dt><code>-pagezero_size</code></dt>
<dt><code>-prebind</code></dt>
<dt><code>-prebind_all_twolevel_modules</code></dt>
<dt><code>-private_bundle</code></dt>
<dt><code>-read_only_relocs</code></dt>
<dt><code>-sectalign</code></dt>
<dt><code>-sectobjectsymbols</code></dt>
<dt><code>-whyload</code></dt>
<dt><code>-seg1addr</code></dt>
<dt><code>-sectcreate</code></dt>
<dt><code>-sectobjectsymbols</code></dt>
<dt><code>-sectorder</code></dt>
<dt><code>-segaddr</code></dt>
<dt><code>-segs_read_only_addr</code></dt>
<dt><code>-segs_read_write_addr</code></dt>
<dt><code>-seg_addr_table</code></dt>
<dt><code>-seg_addr_table_filename</code></dt>
<dt><code>-seglinkedit</code></dt>
<dt><code>-segprot</code></dt>
<dt><code>-segs_read_only_addr</code></dt>
<dt><code>-segs_read_write_addr</code></dt>
<dt><code>-single_module</code></dt>
<dt><code>-static</code></dt>
<dt><code>-sub_library</code></dt>
<dt><code>-sub_umbrella</code></dt>
<dt><code>-twolevel_namespace</code></dt>
<dt><code>-umbrella</code></dt>
<dt><code>-undefined</code></dt>
<dt><code>-unexported_symbols_list</code></dt>
<dt><code>-weak_reference_mismatches</code></dt>
<dt><code>-whatsloaded</code></dt>
<dd><a name="index-allowable_005fclient"></a>
<a name="index-client_005fname"></a>
<a name="index-compatibility_005fversion"></a>
<a name="index-current_005fversion"></a>
<a name="index-dead_005fstrip"></a>
<a name="index-dependency_002dfile"></a>
<a name="index-dylib_005ffile"></a>
<a name="index-dylinker_005finstall_005fname"></a>
<a name="index-dynamic"></a>
<a name="index-exported_005fsymbols_005flist"></a>
<a name="index-filelist"></a>
<a name="index-flat_005fnamespace"></a>
<a name="index-force_005fflat_005fnamespace"></a>
<a name="index-headerpad_005fmax_005finstall_005fnames"></a>
<a name="index-image_005fbase"></a>
<a name="index-init"></a>
<a name="index-install_005fname"></a>
<a name="index-keep_005fprivate_005fexterns"></a>
<a name="index-multi_005fmodule"></a>
<a name="index-multiply_005fdefined"></a>
<a name="index-multiply_005fdefined_005funused"></a>
<a name="index-noall_005fload"></a>
<a name="index-no_005fdead_005fstrip_005finits_005fand_005fterms"></a>
<a name="index-nofixprebinding"></a>
<a name="index-nomultidefs"></a>
<a name="index-noprebind"></a>
<a name="index-noseglinkedit"></a>
<a name="index-pagezero_005fsize"></a>
<a name="index-prebind"></a>
<a name="index-prebind_005fall_005ftwolevel_005fmodules"></a>
<a name="index-private_005fbundle"></a>
<a name="index-read_005fonly_005frelocs"></a>
<a name="index-sectalign"></a>
<a name="index-sectobjectsymbols"></a>
<a name="index-whyload"></a>
<a name="index-seg1addr"></a>
<a name="index-sectcreate"></a>
<a name="index-sectobjectsymbols-1"></a>
<a name="index-sectorder"></a>
<a name="index-segaddr"></a>
<a name="index-segs_005fread_005fonly_005faddr"></a>
<a name="index-segs_005fread_005fwrite_005faddr"></a>
<a name="index-seg_005faddr_005ftable"></a>
<a name="index-seg_005faddr_005ftable_005ffilename"></a>
<a name="index-seglinkedit"></a>
<a name="index-segprot"></a>
<a name="index-segs_005fread_005fonly_005faddr-1"></a>
<a name="index-segs_005fread_005fwrite_005faddr-1"></a>
<a name="index-single_005fmodule"></a>
<a name="index-static-1"></a>
<a name="index-sub_005flibrary"></a>
<a name="index-sub_005fumbrella"></a>
<a name="index-twolevel_005fnamespace"></a>
<a name="index-umbrella"></a>
<a name="index-undefined"></a>
<a name="index-unexported_005fsymbols_005flist"></a>
<a name="index-weak_005freference_005fmismatches"></a>
<a name="index-whatsloaded"></a>
<p>These options are passed to the Darwin linker. The Darwin linker man page
describes them in detail.
</p></dd>
</dl>
<hr>
<div class="header">
<p>
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>
</div>
</body>
</html>