]> gcc.gnu.org Git - gcc.git/blame - gcc/config/darwin.opt
Config,Darwin: Allow for configuring Darwin to use embedded runpath.
[gcc.git] / gcc / config / darwin.opt
CommitLineData
6ac49599
RS
1; Processor-independent options for Darwin.
2
aeee4812 3; Copyright (C) 2005-2023 Free Software Foundation, Inc.
6ac49599
RS
4;
5; This file is part of GCC.
6;
7; GCC is free software; you can redistribute it and/or modify it under
8; the terms of the GNU General Public License as published by the Free
2f83c7d6 9; Software Foundation; either version 3, or (at your option) any later
6ac49599
RS
10; version.
11;
12; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13; WARRANTY; without even the implied warranty of MERCHANTABILITY or
14; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15; for more details.
16;
17; You should have received a copy of the GNU General Public License
2f83c7d6
NC
18; along with GCC; see the file COPYING3. If not see
19; <http://www.gnu.org/licenses/>.
6ac49599 20
a8566e93
IS
21; We have a lot of Driver options, many of which are obsolete or very very
22; rarely used so, to keep this file easier to manage:
23
24; Please place all Non-driver options first (in alphabetical order), followed
25; by Driver-only options.
26
27; Non-driver options.
28
29dependency-file
30C ObjC C++ ObjC++ Separate Alias(MF) MissingArgError(missing filename after %qs)
31
32fapple-kext
eece52b5 33Target C++ Var(flag_apple_kext)
a8566e93
IS
34Generate code for darwin loadable kernel extensions.
35
cdd4b3c0
IS
36fconstant-cfstrings
37ObjC ObjC++ Alias(mconstant-cfstrings)
38Generate compile-time CFString objects.
39
a8566e93
IS
40iframework
41Target RejectNegative C ObjC C++ ObjC++ Joined Separate
42-iframework <dir> Add <dir> to the end of the system framework include path.
43
44mconstant-cfstrings
eece52b5 45Target Var(darwin_constant_cfstrings) Init(1)
a8566e93
IS
46Generate compile-time CFString objects.
47
48Wnonportable-cfstrings
eece52b5 49Target Var(darwin_warn_nonportable_cfstrings) Init(1) Warning
a8566e93
IS
50Warn if constant CFString objects contain non-portable characters.
51
52; Use new-style pic stubs if this is true, x86 only so far.
53matt-stubs
eece52b5 54Target Var(darwin_macho_att_stub) Init(1)
a8566e93
IS
55Generate AT&T-style stubs for Mach-O.
56
57mdynamic-no-pic
eece52b5 58Target Common Mask(MACHO_DYNAMIC_NO_PIC)
a8566e93
IS
59Generate code suitable for executables (NOT shared libs).
60
61mfix-and-continue
eece52b5 62Target Var(darwin_fix_and_continue)
a8566e93
IS
63Generate code suitable for fast turn around debugging.
64
65mkernel
eece52b5 66Target Var(flag_mkernel)
a8566e93
IS
67Generate code for the kernel or loadable kernel extensions.
68
69; The Init here is for the convenience of GCC developers, so that cc1
70; and cc1plus don't crash if no -mmacosx-version-min is passed. The
71; driver will always pass a -mmacosx-version-min, so in normal use the
72; Init is never used.
73mmacosx-version-min=
eece52b5 74Target RejectNegative Joined Var(darwin_macosx_version_min) Init(DEF_MIN_OSX_VERSION)
837cece8 75The earliest macOS version on which this program will run.
a8566e93
IS
76
77; Really, only relevant to PowerPC which has a 4 byte bool by default.
78mone-byte-bool
eece52b5 79Target RejectNegative Var(darwin_one_byte_bool)
a8566e93
IS
80Set sizeof(bool) to 1.
81
d308419c 82msymbol-stubs
eece52b5 83Target Var(darwin_symbol_stubs) Init(0)
d308419c 84Force generation of external symbol indirection stubs.
ce3a2015 85
a8566e93
IS
86; Some code-gen may be improved / adjusted if the linker is sufficiently modern.
87mtarget-linker=
eece52b5 88Target RejectNegative Joined Alias(mtarget-linker)
a8566e93
IS
89
90mtarget-linker
eece52b5 91Target RejectNegative Joined Separate Var(darwin_target_linker) Init(LD64_VERSION)
837cece8 92-mtarget-linker <version> Specify that ld64 <version> is the toolchain linker for the current invocation.
a8566e93
IS
93
94; Driver options.
2be55a25
JM
95
96all_load
353cb291 97Driver RejectNegative
837cece8 98Load all members of archive libraries, rather than only those that satisfy undefined symbols.
2be55a25
JM
99
100allowable_client
353cb291 101Driver RejectNegative Separate
837cece8 102-allowable_client <name> The output dylib is private to the client <name>.
2be55a25 103
bd837408
CS
104arch
105Driver RejectNegative Separate
837cece8 106-arch <name> Generate output for architecture <name>.
bd837408 107
2be55a25 108arch_errors_fatal
353cb291 109Driver RejectNegative
837cece8 110Mismatches between file architecture and one specified by \"-arch\" are errors instead of warnings.
2be55a25 111
b410cf1d
IS
112asm_macosx_version_min=
113Driver RejectNegative Joined
837cece8 114The earliest macOS version on which this program will run (formatted for the assembler).
b410cf1d 115
2be55a25 116bind_at_load
353cb291 117Driver RejectNegative
837cece8 118Generate an output executable that binds symbols on load, rather than lazily.
2be55a25
JM
119
120bundle
353cb291 121Driver RejectNegative
837cece8 122Generate a Mach-O bundle (file type MH_BUNDLE).
2be55a25
JM
123
124bundle_loader
353cb291 125Driver RejectNegative Separate
837cece8 126-bundle_loader <executable> Treat <executable> (that will be loading this bundle) as if it was one of the dynamic libraries the bundle is linked against for symbol resolution.
2be55a25 127
a8566e93
IS
128client_name
129Driver RejectNegative Separate
837cece8 130-client_name <name> Enable the executable being built to link against a private dylib (using allowable_client).
2be55a25 131
a8566e93
IS
132compatibility_version
133Driver RejectNegative Separate
837cece8 134-compatibility_version <number> Set the version for the client interface. Client programs must record a value less than or equal to <number>, or the binding will fail at runtime.
a8566e93
IS
135
136current_version
137Driver RejectNegative Separate
837cece8 138-current_version <number> Set the current version for the library to <number>.
a8566e93
IS
139
140dead_strip
353cb291 141Driver RejectNegative
837cece8 142Remove code and data that is unreachable from any exported symbol (including the entry point).
2be55a25
JM
143
144dylib_file
353cb291
IS
145Driver RejectNegative Separate
146-dylib_file install_name:file_name This allows linking of a dylib with \"install_name\" but to be found in a different install position \"file_name\"
2be55a25 147
391fbfb8 148dylinker
a8566e93
IS
149Driver RejectNegative
150Produce a Mach-O dylinker (file type MH_DYLINKER), only used for building dyld.
151
152dylinker_install_name
153Driver RejectNegative Separate
154-dylinker_install_name <path> Only used for building dyld.
391fbfb8 155
2be55a25 156dynamic
353cb291 157Driver RejectNegative
a8566e93 158The default (and opposite of -static), implied by user mode executables, shared libraries and bundles.
2be55a25
JM
159
160dynamiclib
353cb291 161Driver RejectNegative
837cece8 162Produce a Mach-O shared library (file type MH_DYLIB), synonym for \"-shared\".
2be55a25
JM
163
164exported_symbols_list
353cb291 165Driver RejectNegative Separate
837cece8 166-exported_symbols_list <filename> Export global symbols in <filename> in linked output file; any symbols not mentioned will be treated as \"hidden\".
2be55a25
JM
167
168filelist
169Driver RejectNegative Separate
837cece8 170Supply a list of objects to be linked from a file, rather than the command line.
2be55a25
JM
171
172findirect-virtual-calls
173Driver RejectNegative
a8566e93 174Used for generating code for some older kernel revisions.
2be55a25
JM
175
176flat_namespace
353cb291 177Driver RejectNegative
a8566e93 178Ignore the normal two-level namespace; resolve symbols in command line order and do not record which library provided the resolved symbol.
2be55a25
JM
179
180force_cpusubtype_ALL
353cb291 181Driver RejectNegative
a8566e93 182For the assembler (and linker) permit any architecture sub-variant to be used without error.
2be55a25
JM
183
184force_flat_namespace
353cb291 185Driver RejectNegative
837cece8 186Set the output object such that, on loading, dyld will ignore any two-level namespace information and resolve symbols in the discovery order for loaded libs.
2be55a25
JM
187
188framework
189Driver RejectNegative Separate
837cece8 190-framework <name> The linker should search for the framework <name> in the framework search path.
2be55a25
JM
191
192fterminated-vtables
193Driver RejectNegative
a8566e93 194Used for generating code for some older kernel revisions.
2be55a25
JM
195
196gfull
9ed32e27 197Driver RejectNegative
837cece8 198Abbreviation for \"-g -fno-eliminate-unused-debug-symbols\".
2be55a25
JM
199
200gused
9ed32e27 201Driver RejectNegative
837cece8 202Abbreviation for \"-g -feliminate-unused-debug-symbols\".
2be55a25 203
391fbfb8 204headerpad_max_install_names
a8566e93 205Driver RejectNegative
837cece8 206Automatically adds space for longer path names in load commands (up to MAXPATHLEN).
391fbfb8 207
2be55a25 208image_base
353cb291 209Driver RejectNegative Separate
837cece8 210-image_base <address> Specify <address> as the base address for a dylib or bundle.
2be55a25
JM
211
212init
353cb291 213Driver RejectNegative Separate
837cece8 214-init <symbol_name> The symbol <symbol_name> will be used as the first initialiser for a dylib.
2be55a25
JM
215
216install_name
353cb291 217Driver RejectNegative Separate
a8566e93 218-install_name <name> Set the install name for a dylib.
2be55a25 219
391fbfb8 220keep_private_externs
a8566e93
IS
221Driver RejectNegative
222Usually \"private extern\" (hidden) symbols are made local when linking, this command suppresses that such that they remain exported.
26705988 223
2be55a25 224multi_module
353cb291 225Driver RejectNegative
837cece8 226(Obsolete after 10.4) Multi modules are ignored at runtime since macOS 10.4.
2be55a25
JM
227
228multiply_defined
353cb291 229Driver RejectNegative Separate
837cece8 230(Obsolete after 10.4) -multiply_defined <treatment> Provided a mechanism for warning about symbols defined in multiple dylibs.
2be55a25
JM
231
232multiply_defined_unused
353cb291 233Driver RejectNegative Separate
a8566e93 234(Obsolete after 10.4) -multiply_defined_unused <treatment> Provided a mechanism for warning about symbols defined in the current executable also being defined in linked dylibs.
2be55a25
JM
235
236no_dead_strip_inits_and_terms
353cb291 237Driver RejectNegative
837cece8 238(Obsolete) Current linkers never dead-strip these items, so the option is not needed.
2be55a25 239
d4943ce9
IS
240nodefaultexport
241Driver RejectNegative
242Do not add a default symbol exports to modules or dynamic libraries.
243
6a6d3817
IS
244nodefaultrpaths
245Driver RejectNegative
246Do not add default run paths (for the compiler library directories) to executables, modules or dynamic libraries.
247
391fbfb8 248nofixprebinding
a8566e93 249Driver RejectNegative
837cece8 250(Obsolete after 10.3.9) Set MH_NOPREFIXBINDING, in an executable.
391fbfb8
JM
251
252nomultidefs
a8566e93
IS
253Driver RejectNegative
254(Obsolete after 10.4) Set MH_NOMULTIDEFS in an umbrella framework.
391fbfb8
JM
255
256noprebind
4827824f 257Driver RejectNegative Negative(prebind)
a8566e93 258(Obsolete) LD_PREBIND is no longer supported.
391fbfb8
JM
259
260noseglinkedit
4827824f 261Driver RejectNegative Negative(seglinkedit)
a8566e93 262(Obsolete) This is the default.
391fbfb8
JM
263
264object
a8566e93
IS
265Driver RejectNegative
266
267pagezero_size
268Driver RejectNegative Separate
837cece8 269-pagezero_size <size> Allows setting the page 0 size to 4kb when required.
391fbfb8
JM
270
271prebind
4827824f 272Driver RejectNegative Negative(noprebind)
a8566e93 273(Obsolete) LD_PREBIND is no longer supported.
391fbfb8
JM
274
275prebind_all_twolevel_modules
a8566e93
IS
276Driver RejectNegative
277(Obsolete) LD_PREBIND is no longer supported.
391fbfb8
JM
278
279preload
a8566e93
IS
280Driver RejectNegative
281Produces a Mach-O file suitable for embedded/ROM use.
391fbfb8
JM
282
283private_bundle
a8566e93
IS
284Driver RejectNegative
285(Obsolete) Allowed linking to proceed with \"-flat_namespace\" when a linked bundle contained a symbol also exported from the main executable.
391fbfb8
JM
286
287pthread
a8566e93 288Driver RejectNegative
391fbfb8 289
0674c9de 290rdynamic
a8566e93
IS
291Driver RejectNegative
292Synonym for \"-export-dynamic\" for linker versions that support it.
293
294read_only_relocs
295Driver RejectNegative Separate
837cece8 296-read_only_relocs <treatment> Allow relocations in read-only pages (not recommended).
a8566e93
IS
297
298sectalign
299Driver RejectNegative Separate Args(3)
837cece8 300-sectalign <segname> <sectname> <value> Set section <sectname> in segment <segname> to have alignment <value> which must be an integral power of two expressed in hexadecimal form.
a8566e93
IS
301
302sectcreate
303Driver RejectNegative Separate Args(3)
837cece8 304-sectcreate <segname> <sectname> <file> Create section <sectname> in segment <segname> from the contents of <file>.
a8566e93
IS
305
306sectobjectsymbols
307Driver RejectNegative Separate Args(2)
308(Obsolete) -sectobjectsymbols <segname> <sectname> Setting a local symbol at the start of a section is no longer supported.
309
310sectorder
311Driver RejectNegative Separate Args(3)
837cece8 312(Obsolete) -sectorder <segname> <sectname> <orderfile> Replaced by a more general option \"-order_file\".
0674c9de 313
2be55a25 314seg_addr_table
353cb291 315Driver RejectNegative Separate
837cece8 316-seg_addr_table <file> Specify the base addresses for dynamic libraries; <file> contains a line for each library.
2be55a25 317
a8566e93 318; This is only usable by the ld_classic linker.
2be55a25 319seg_addr_table_filename
353cb291 320Driver RejectNegative Separate
837cece8 321(Obsolete, ld_classic only) -seg_addr_table_filename <path>.
a8566e93
IS
322
323seg1addr
324Driver RejectNegative Separate
837cece8 325Synonym for \"image_base\".
2be55a25
JM
326
327segaddr
353cb291 328Driver RejectNegative Separate Args(2)
837cece8 329-segaddr <name> <address> Set the base address of segment <name> to <address> which must be aligned to a page boundary (currently 4kb).
a8566e93
IS
330
331; This is only usable by the ld_classic linker.
332segcreate
333Driver RejectNegative Separate Args(3)
837cece8 334(Obsolete, ld_classic only) -sectcreate <segname> <sectname> <file> Allowed creation of a section from a file.
2be55a25 335
391fbfb8 336seglinkedit
4827824f 337Driver RejectNegative Negative(noseglinkedit)
a8566e93
IS
338(Obsolete) Object files with LINKEDIT sections are no longer supported.
339
340segprot
341Driver RejectNegative Separate Args(3)
837cece8 342-segprot <segname> <max_prot> <init_prot> The virtual memory protections for segment <segname> have maximum and initial values <max_prot> and <init_prot> respectively. The specified values may contain \"r\", \"w\", \"x\" or \"-\" the latter meaning \"no access\".
391fbfb8 343
2be55a25 344segs_read_only_addr
353cb291 345Driver RejectNegative Separate
837cece8 346-segs_read_only_addr <address> Specify that <address> is the base address of the read-only segments of a dylib.
2be55a25
JM
347
348segs_read_write_addr
353cb291 349Driver RejectNegative Separate
837cece8 350-segs_read_write_addr <address> Specify that <address> is the base address address of the read-write segments of a dylib.
2be55a25
JM
351
352single_module
353cb291 353Driver RejectNegative
a8566e93
IS
354(Obsolete) This is the default.
355
356sub_library
357Driver RejectNegative Separate
837cece8 358-sub_library <name> Library named <name> will be re-exported (only useful for dylibs).
a8566e93
IS
359
360sub_umbrella
361Driver RejectNegative Separate
837cece8 362-sub_umbrella <name> Framework named <name> will be re-exported (only useful for dylibs).
2be55a25 363
391fbfb8 364twolevel_namespace
a8566e93 365Driver RejectNegative
837cece8 366This is the default.
391fbfb8
JM
367
368twolevel_namespace_hints
a8566e93 369Driver RejectNegative
837cece8 370Add extra information to the executable that can speed up dynamic loading (provided that dependent libraries are unchanged).
391fbfb8 371
2be55a25 372umbrella
353cb291 373Driver RejectNegative
a8566e93
IS
374-umbrella <framework> The specified framework will be re-exported.
375
376undefined
377Driver RejectNegative Separate
378-undefined <treatment> Specify the handling for undefined symbols (default is error).
2be55a25
JM
379
380unexported_symbols_list
353cb291 381Driver RejectNegative Separate
837cece8 382-unexported_symbols_list <filename> Do not export the global symbols listed in <filename>.
2be55a25
JM
383
384weak_reference_mismatches
353cb291 385Driver RejectNegative Separate
a8566e93 386-weak_reference_mismatches <treatment> Specifies what to do if a symbol import conflicts between file (weak in one and not in another) the default is to treat the symbol as non-weak.
2be55a25 387
391fbfb8 388whatsloaded
a8566e93 389Driver RejectNegative
837cece8 390Logs which object files the linker loads.
391fbfb8
JM
391
392whyload
a8566e93
IS
393Driver RejectNegative
394Logs which symbol(s) caused an object to be loaded.
395
396;(Obsolete, ignored) Strip symbols starting with "L", this is the default.
397X
398Driver RejectNegative
391fbfb8
JM
399
400y
a8566e93 401Driver RejectNegative Joined
837cece8 402(Obsolete, ignored) Old support similar to \"-whyload\".
391fbfb8
JM
403
404Mach
a8566e93
IS
405Driver RejectNegative
406(Obsolete and unhandled by ld64, ignored) ld should produce an executable (only handled by ld_classic).
This page took 5.423347 seconds and 5 git commands to generate.