1; Processor-independent options for Darwin.
2
3; Copyright (C) 2005-2022 Free Software Foundation, Inc.
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
9; Software Foundation; either version 3, or (at your option) any later
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
18; along with GCC; see the file COPYING3.  If not see
19; <http://www.gnu.org/licenses/>.
20
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
33Target C++ Var(flag_apple_kext)
34Generate code for darwin loadable kernel extensions.
35
36fconstant-cfstrings
37ObjC ObjC++ Alias(mconstant-cfstrings)
38Generate compile-time CFString objects.
39
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
45Target Var(darwin_constant_cfstrings) Init(1)
46Generate compile-time CFString objects.
47
48Wnonportable-cfstrings
49Target Var(darwin_warn_nonportable_cfstrings) Init(1) Warning
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
54Target Var(darwin_macho_att_stub) Init(1)
55Generate AT&T-style stubs for Mach-O.
56
57mdynamic-no-pic
58Target Common Mask(MACHO_DYNAMIC_NO_PIC)
59Generate code suitable for executables (NOT shared libs).
60
61mfix-and-continue
62Target Var(darwin_fix_and_continue)
63Generate code suitable for fast turn around debugging.
64
65mkernel
66Target Var(flag_mkernel)
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=
74Target RejectNegative Joined Var(darwin_macosx_version_min) Init(DEF_MIN_OSX_VERSION)
75The earliest macOS version on which this program will run.
76
77; Really, only relevant to PowerPC which has a 4 byte bool by default.
78mone-byte-bool
79Target RejectNegative Var(darwin_one_byte_bool)
80Set sizeof(bool) to 1.
81
82msymbol-stubs
83Target Var(darwin_symbol_stubs) Init(0)
84Force generation of external symbol indirection stubs.
85
86; Some code-gen may be improved / adjusted if the linker is sufficiently modern.
87mtarget-linker=
88Target RejectNegative Joined Alias(mtarget-linker)
89
90mtarget-linker
91Target RejectNegative Joined Separate Var(darwin_target_linker) Init(LD64_VERSION)
92-mtarget-linker <version>     Specify that ld64 <version> is the toolchain linker for the current invocation.
93
94; Driver options.
95
96all_load
97Driver RejectNegative
98Load all members of archive libraries, rather than only those that satisfy undefined symbols.
99
100allowable_client
101Driver RejectNegative Separate
102-allowable_client <name>      The output dylib is private to the client <name>.
103
104arch
105Driver RejectNegative Separate
106-arch <name>        Generate output for architecture <name>.
107
108arch_errors_fatal
109Driver RejectNegative
110Mismatches between file architecture and one specified by \"-arch\" are errors instead of warnings.
111
112asm_macosx_version_min=
113Driver RejectNegative Joined
114The earliest macOS version on which this program will run (formatted for the assembler).
115
116bind_at_load
117Driver RejectNegative
118Generate an output executable that binds symbols on load, rather than lazily.
119
120bundle
121Driver RejectNegative
122Generate a Mach-O bundle (file type MH_BUNDLE).
123
124bundle_loader
125Driver RejectNegative Separate
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.
127
128client_name
129Driver RejectNegative Separate
130-client_name <name> Enable the executable being built to link against a private dylib (using allowable_client).
131
132compatibility_version
133Driver RejectNegative Separate
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.
135
136current_version
137Driver RejectNegative Separate
138-current_version <number>     Set the current version for the library to <number>.
139
140dead_strip
141Driver RejectNegative
142Remove code and data that is unreachable from any exported symbol (including the entry point).
143
144dylib_file
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\"
147
148dylinker
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.
155
156dynamic
157Driver RejectNegative
158The default (and opposite of -static), implied by user mode executables, shared libraries and bundles.
159
160dynamiclib
161Driver RejectNegative
162Produce a Mach-O shared library (file type MH_DYLIB), synonym for \"-shared\".
163
164exported_symbols_list
165Driver RejectNegative Separate
166-exported_symbols_list <filename>       Export global symbols in <filename> in linked output file; any symbols not mentioned will be treated as \"hidden\".
167
168filelist
169Driver RejectNegative Separate
170Supply a list of objects to be linked from a file, rather than the command line.
171
172findirect-virtual-calls
173Driver RejectNegative
174Used for generating code for some older kernel revisions.
175
176flat_namespace
177Driver RejectNegative
178Ignore the normal two-level namespace; resolve symbols in command line order and do not record which library provided the resolved symbol.
179
180force_cpusubtype_ALL
181Driver RejectNegative
182For the assembler (and linker) permit any architecture sub-variant to be used without error.
183
184force_flat_namespace
185Driver RejectNegative
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.
187
188framework
189Driver RejectNegative Separate
190-framework <name>   The linker should search for the framework <name> in the framework search path.
191
192fterminated-vtables
193Driver RejectNegative
194Used for generating code for some older kernel revisions.
195
196gfull
197Driver RejectNegative
198Abbreviation for \"-g -fno-eliminate-unused-debug-symbols\".
199
200gused
201Driver RejectNegative
202Abbreviation for \"-g -feliminate-unused-debug-symbols\".
203
204headerpad_max_install_names
205Driver RejectNegative
206Automatically adds space for longer path names in load commands (up to MAXPATHLEN).
207
208image_base
209Driver RejectNegative Separate
210-image_base <address>         Specify <address> as the base address for a dylib or bundle.
211
212init
213Driver RejectNegative Separate
214-init <symbol_name> The symbol <symbol_name> will be used as the first initialiser for a dylib.
215
216install_name
217Driver RejectNegative Separate
218-install_name <name>          Set the install name for a dylib.
219
220keep_private_externs
221Driver RejectNegative
222Usually \"private extern\" (hidden) symbols are made local when linking, this command suppresses that such that they remain exported.
223
224multi_module
225Driver RejectNegative
226(Obsolete after 10.4) Multi modules are ignored at runtime since macOS 10.4.
227
228multiply_defined
229Driver RejectNegative Separate
230(Obsolete after 10.4) -multiply_defined <treatment>         Provided a mechanism for warning about symbols defined in multiple dylibs.
231
232multiply_defined_unused
233Driver RejectNegative Separate
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.
235
236no_dead_strip_inits_and_terms
237Driver RejectNegative
238(Obsolete) Current linkers never dead-strip these items, so the option is not needed.
239
240nodefaultexport
241Driver RejectNegative
242Do not add a default symbol exports to modules or dynamic libraries.
243
244nofixprebinding
245Driver RejectNegative
246(Obsolete after 10.3.9) Set MH_NOPREFIXBINDING, in an executable.
247
248nomultidefs
249Driver RejectNegative
250(Obsolete after 10.4)         Set MH_NOMULTIDEFS in an umbrella framework.
251
252noprebind
253Driver RejectNegative Negative(prebind)
254(Obsolete) LD_PREBIND is no longer supported.
255
256noseglinkedit
257Driver RejectNegative Negative(seglinkedit)
258(Obsolete) This is the default.
259
260object
261Driver RejectNegative
262
263pagezero_size
264Driver RejectNegative Separate
265-pagezero_size <size>         Allows setting the page 0 size to 4kb when required.
266
267prebind
268Driver RejectNegative Negative(noprebind)
269(Obsolete) LD_PREBIND is no longer supported.
270
271prebind_all_twolevel_modules
272Driver RejectNegative
273(Obsolete) LD_PREBIND is no longer supported.
274
275preload
276Driver RejectNegative
277Produces a Mach-O file suitable for embedded/ROM use.
278
279private_bundle
280Driver RejectNegative
281(Obsolete) Allowed linking to proceed with \"-flat_namespace\" when a linked bundle contained a symbol also exported from the main executable.
282
283pthread
284Driver RejectNegative
285
286rdynamic
287Driver RejectNegative
288Synonym for \"-export-dynamic\" for linker versions that support it.
289
290read_only_relocs
291Driver RejectNegative Separate
292-read_only_relocs <treatment> Allow relocations in read-only pages (not recommended).
293
294sectalign
295Driver RejectNegative Separate Args(3)
296-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.
297
298sectcreate
299Driver RejectNegative Separate Args(3)
300-sectcreate <segname> <sectname> <file> Create section <sectname> in segment <segname> from the contents of <file>.
301
302sectobjectsymbols
303Driver RejectNegative Separate Args(2)
304(Obsolete) -sectobjectsymbols <segname> <sectname>          Setting a local symbol at the start of a section is no longer supported.
305
306sectorder
307Driver RejectNegative Separate Args(3)
308(Obsolete) -sectorder <segname> <sectname> <orderfile>      Replaced by a more general option \"-order_file\".
309
310seg_addr_table
311Driver RejectNegative Separate
312-seg_addr_table <file>        Specify the base addresses for dynamic libraries; <file> contains a line for each library.
313
314; This is only usable by the ld_classic linker.
315seg_addr_table_filename
316Driver RejectNegative Separate
317(Obsolete, ld_classic only) -seg_addr_table_filename <path>.
318
319seg1addr
320Driver RejectNegative Separate
321Synonym for \"image_base\".
322
323segaddr
324Driver RejectNegative Separate Args(2)
325-segaddr <name> <address>     Set the base address of segment <name> to <address> which must be aligned to a page boundary (currently 4kb).
326
327; This is only usable by the ld_classic linker.
328segcreate
329Driver RejectNegative Separate Args(3)
330(Obsolete, ld_classic only) -sectcreate <segname> <sectname> <file>   Allowed creation of a section from a file.
331
332seglinkedit
333Driver RejectNegative Negative(noseglinkedit)
334(Obsolete) Object files with LINKEDIT sections are no longer supported.
335
336segprot
337Driver RejectNegative Separate Args(3)
338-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\".
339
340segs_read_only_addr
341Driver RejectNegative Separate
342-segs_read_only_addr <address>          Specify that <address> is the base address of the read-only segments of a dylib.
343
344segs_read_write_addr
345Driver RejectNegative Separate
346-segs_read_write_addr <address>         Specify that <address> is the base address address of the read-write segments of a dylib.
347
348single_module
349Driver RejectNegative
350(Obsolete)          This is the default.
351
352sub_library
353Driver RejectNegative Separate
354-sub_library <name> Library named <name> will be re-exported (only useful for dylibs).
355
356sub_umbrella
357Driver RejectNegative Separate
358-sub_umbrella <name>          Framework named <name> will be re-exported (only useful for dylibs).
359
360twolevel_namespace
361Driver RejectNegative
362This is the default.
363
364twolevel_namespace_hints
365Driver RejectNegative
366Add extra information to the executable that can speed up dynamic loading (provided that dependent libraries are unchanged).
367
368umbrella
369Driver RejectNegative
370-umbrella <framework>         The specified framework will be re-exported.
371
372undefined
373Driver RejectNegative Separate
374-undefined <treatment>        Specify the handling for undefined symbols (default is error).
375
376unexported_symbols_list
377Driver RejectNegative Separate
378-unexported_symbols_list <filename>     Do not export the global symbols listed in <filename>.
379
380weak_reference_mismatches
381Driver RejectNegative Separate
382-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.
383
384whatsloaded
385Driver RejectNegative
386Logs which object files the linker loads.
387
388whyload
389Driver RejectNegative
390Logs which symbol(s) caused an object to be loaded.
391
392;(Obsolete, ignored)          Strip symbols starting with "L", this is the default.
393X
394Driver RejectNegative
395
396y
397Driver RejectNegative Joined
398(Obsolete, ignored) Old support similar to \"-whyload\".
399
400Mach
401Driver RejectNegative
402(Obsolete and unhandled by ld64, ignored)         ld should produce an executable (only handled by ld_classic).
403