aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/darwin.opt
blob: cc7d14c2e4d4a8529a1297d798f9b1b14bb67018 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
; Processor-independent options for Darwin.

; Copyright (C) 2005-2022 Free Software Foundation, Inc.
;
; This file is part of GCC.
;
; GCC is free software; you can redistribute it and/or modify it under
; the terms of the GNU General Public License as published by the Free
; Software Foundation; either version 3, or (at your option) any later
; version.
;
; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
; WARRANTY; without even the implied warranty of MERCHANTABILITY or
; FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
; for more details.
;
; You should have received a copy of the GNU General Public License
; along with GCC; see the file COPYING3.  If not see
; <http://www.gnu.org/licenses/>.

; We have a lot of Driver options, many of which are obsolete or very very
; rarely used so, to keep this file easier to manage:

; Please place all Non-driver options first (in alphabetical order), followed
; by Driver-only options.

; Non-driver options.

dependency-file
C ObjC C++ ObjC++ Separate Alias(MF) MissingArgError(missing filename after %qs)

fapple-kext
Target C++ Var(flag_apple_kext)
Generate code for darwin loadable kernel extensions.

iframework
Target RejectNegative C ObjC C++ ObjC++ Joined Separate
-iframework <dir>	Add <dir> to the end of the system framework include path.

mconstant-cfstrings
Target Var(darwin_constant_cfstrings) Init(1)
Generate compile-time CFString objects.

Wnonportable-cfstrings
Target Var(darwin_warn_nonportable_cfstrings) Init(1) Warning
Warn if constant CFString objects contain non-portable characters.

; Use new-style pic stubs if this is true, x86 only so far.
matt-stubs
Target Var(darwin_macho_att_stub) Init(1)
Generate AT&T-style stubs for Mach-O.

mdynamic-no-pic
Target Common Mask(MACHO_DYNAMIC_NO_PIC)
Generate code suitable for executables (NOT shared libs).

mfix-and-continue
Target Var(darwin_fix_and_continue)
Generate code suitable for fast turn around debugging.

mkernel
Target Var(flag_mkernel)
Generate code for the kernel or loadable kernel extensions.

; The Init here is for the convenience of GCC developers, so that cc1
; and cc1plus don't crash if no -mmacosx-version-min is passed.  The
; driver will always pass a -mmacosx-version-min, so in normal use the
; Init is never used.
mmacosx-version-min=
Target RejectNegative Joined Var(darwin_macosx_version_min) Init(DEF_MIN_OSX_VERSION)
The earliest macOS version on which this program will run.

; Really, only relevant to PowerPC which has a 4 byte bool by default.
mone-byte-bool
Target RejectNegative Var(darwin_one_byte_bool)
Set sizeof(bool) to 1.

msymbol-stubs
Target Var(darwin_symbol_stubs) Init(0)
Force generation of external symbol indirection stubs.

; Some code-gen may be improved / adjusted if the linker is sufficiently modern.
mtarget-linker=
Target RejectNegative Joined Alias(mtarget-linker)

mtarget-linker
Target RejectNegative Joined Separate Var(darwin_target_linker) Init(LD64_VERSION)
-mtarget-linker <version>	Specify that ld64 <version> is the toolchain linker for the current invocation.

; Driver options.

all_load
Driver RejectNegative
Load all members of archive libraries, rather than only those that satisfy undefined symbols.

allowable_client
Driver RejectNegative Separate
-allowable_client <name>	The output dylib is private to the client <name>.

arch
Driver RejectNegative Separate
-arch <name>	Generate output for architecture <name>.

arch_errors_fatal
Driver RejectNegative
Mismatches between file architecture and one specified by \"-arch\" are errors instead of warnings.

asm_macosx_version_min=
Driver RejectNegative Joined
The earliest macOS version on which this program will run (formatted for the assembler).

bind_at_load
Driver RejectNegative
Generate an output executable that binds symbols on load, rather than lazily.

bundle
Driver RejectNegative
Generate a Mach-O bundle (file type MH_BUNDLE).

bundle_loader
Driver RejectNegative Separate
-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.

client_name
Driver RejectNegative Separate
-client_name <name>	Enable the executable being built to link against a private dylib (using allowable_client).

compatibility_version
Driver RejectNegative Separate
-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.

current_version
Driver RejectNegative Separate
-current_version <number>	Set the current version for the library to <number>.

dead_strip
Driver RejectNegative
Remove code and data that is unreachable from any exported symbol (including the entry point).

dylib_file
Driver RejectNegative Separate
-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\"

dylinker
Driver RejectNegative
Produce a Mach-O dylinker (file type MH_DYLINKER), only used for building dyld.

dylinker_install_name
Driver RejectNegative Separate
-dylinker_install_name <path>	Only used for building dyld.

dynamic
Driver RejectNegative
The default (and opposite of -static), implied by user mode executables, shared libraries and bundles.

dynamiclib
Driver RejectNegative
Produce a Mach-O shared library (file type MH_DYLIB), synonym for \"-shared\".

exported_symbols_list
Driver RejectNegative Separate
-exported_symbols_list <filename>	Export global symbols in <filename> in linked output file; any symbols not mentioned will be treated as \"hidden\".

filelist
Driver RejectNegative Separate
Supply a list of objects to be linked from a file, rather than the command line.

findirect-virtual-calls
Driver RejectNegative
Used for generating code for some older kernel revisions.

flat_namespace
Driver RejectNegative
Ignore the normal two-level namespace; resolve symbols in command line order and do not record which library provided the resolved symbol.

force_cpusubtype_ALL
Driver RejectNegative
For the assembler (and linker) permit any architecture sub-variant to be used without error.

force_flat_namespace
Driver RejectNegative
Set 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.

framework
Driver RejectNegative Separate
-framework <name>	The linker should search for the framework <name> in the framework search path.

fterminated-vtables
Driver RejectNegative
Used for generating code for some older kernel revisions.

gfull
Driver RejectNegative
Abbreviation for \"-g -fno-eliminate-unused-debug-symbols\".

gused
Driver RejectNegative
Abbreviation for \"-g -feliminate-unused-debug-symbols\".

headerpad_max_install_names
Driver RejectNegative
Automatically adds space for longer path names in load commands (up to MAXPATHLEN).

image_base
Driver RejectNegative Separate
-image_base <address>	Specify <address> as the base address for a dylib or bundle.

init
Driver RejectNegative Separate
-init <symbol_name>	The symbol <symbol_name> will be used as the first initialiser for a dylib.

install_name
Driver RejectNegative Separate
-install_name <name>	Set the install name for a dylib.

keep_private_externs
Driver RejectNegative
Usually \"private extern\" (hidden) symbols are made local when linking, this command suppresses that such that they remain exported.

multi_module
Driver RejectNegative
(Obsolete after 10.4) Multi modules are ignored at runtime since macOS 10.4.

multiply_defined
Driver RejectNegative Separate
(Obsolete after 10.4) -multiply_defined <treatment>	Provided a mechanism for warning about symbols defined in multiple dylibs.

multiply_defined_unused
Driver RejectNegative Separate
(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.

no_dead_strip_inits_and_terms
Driver RejectNegative
(Obsolete) Current linkers never dead-strip these items, so the option is not needed.

nodefaultexport
Driver RejectNegative
Do not add a default symbol exports to modules or dynamic libraries.

nofixprebinding
Driver RejectNegative
(Obsolete after 10.3.9) Set MH_NOPREFIXBINDING, in an executable.

nomultidefs
Driver RejectNegative
(Obsolete after 10.4)	Set MH_NOMULTIDEFS in an umbrella framework.

noprebind
Driver RejectNegative Negative(prebind)
(Obsolete) LD_PREBIND is no longer supported.

noseglinkedit
Driver RejectNegative Negative(seglinkedit)
(Obsolete) This is the default.

object
Driver RejectNegative

pagezero_size
Driver RejectNegative Separate
-pagezero_size <size>	Allows setting the page 0 size to 4kb when required.

prebind
Driver RejectNegative Negative(noprebind)
(Obsolete) LD_PREBIND is no longer supported.

prebind_all_twolevel_modules
Driver RejectNegative
(Obsolete) LD_PREBIND is no longer supported.

preload
Driver RejectNegative
Produces a Mach-O file suitable for embedded/ROM use.

private_bundle
Driver RejectNegative
(Obsolete) Allowed linking to proceed with \"-flat_namespace\" when a linked bundle contained a symbol also exported from the main executable.

pthread
Driver RejectNegative

rdynamic
Driver RejectNegative
Synonym for \"-export-dynamic\" for linker versions that support it.

read_only_relocs
Driver RejectNegative Separate
-read_only_relocs <treatment>	Allow relocations in read-only pages (not recommended).

sectalign
Driver RejectNegative Separate Args(3)
-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.

sectcreate
Driver RejectNegative Separate Args(3)
-sectcreate <segname> <sectname> <file>	Create section <sectname> in segment <segname> from the contents of <file>.

sectobjectsymbols
Driver RejectNegative Separate Args(2)
(Obsolete) -sectobjectsymbols <segname> <sectname>	Setting a local symbol at the start of a section is no longer supported.

sectorder
Driver RejectNegative Separate Args(3)
(Obsolete) -sectorder <segname> <sectname> <orderfile>	Replaced by a more general option \"-order_file\".

seg_addr_table
Driver RejectNegative Separate
-seg_addr_table <file>	Specify the base addresses for dynamic libraries; <file> contains a line for each library.

; This is only usable by the ld_classic linker.
seg_addr_table_filename
Driver RejectNegative Separate
(Obsolete, ld_classic only) -seg_addr_table_filename <path>.

seg1addr
Driver RejectNegative Separate
Synonym for \"image_base\".

segaddr
Driver RejectNegative Separate Args(2)
-segaddr <name> <address>	Set the base address of segment <name> to <address> which must be aligned to a page boundary (currently 4kb).

; This is only usable by the ld_classic linker.
segcreate
Driver RejectNegative Separate Args(3)
(Obsolete, ld_classic only) -sectcreate <segname> <sectname> <file>	Allowed creation of a section from a file.

seglinkedit
Driver RejectNegative Negative(noseglinkedit)
(Obsolete) Object files with LINKEDIT sections are no longer supported.

segprot
Driver RejectNegative Separate Args(3)
-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\".

segs_read_only_addr
Driver RejectNegative Separate
-segs_read_only_addr <address>	Specify that <address> is the base address of the read-only segments of a dylib.

segs_read_write_addr
Driver RejectNegative Separate
-segs_read_write_addr <address>	Specify that <address> is the base address address of the read-write segments of a dylib.

single_module
Driver RejectNegative
(Obsolete)	This is the default.

sub_library
Driver RejectNegative Separate
-sub_library <name>	Library named <name> will be re-exported (only useful for dylibs).

sub_umbrella
Driver RejectNegative Separate
-sub_umbrella <name>	Framework named <name> will be re-exported (only useful for dylibs).

twolevel_namespace
Driver RejectNegative
This is the default.

twolevel_namespace_hints
Driver RejectNegative
Add extra information to the executable that can speed up dynamic loading (provided that dependent libraries are unchanged).

umbrella
Driver RejectNegative
-umbrella <framework>	The specified framework will be re-exported.

undefined
Driver RejectNegative Separate
-undefined <treatment>	Specify the handling for undefined symbols (default is error).

unexported_symbols_list
Driver RejectNegative Separate
-unexported_symbols_list <filename>	Do not export the global symbols listed in <filename>.

weak_reference_mismatches
Driver RejectNegative Separate
-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.

whatsloaded
Driver RejectNegative
Logs which object files the linker loads.

whyload
Driver RejectNegative
Logs which symbol(s) caused an object to be loaded.

;(Obsolete, ignored)	Strip symbols starting with "L", this is the default.
X
Driver RejectNegative

y
Driver RejectNegative Joined
(Obsolete, ignored)	Old support similar to \"-whyload\".

Mach
Driver RejectNegative
(Obsolete and unhandled by ld64, ignored)	ld should produce an executable (only handled by ld_classic).