blob: 0dca391cf0b5b1e56186aecd3c447b945fa2fa2a [file] [log] [blame]
Richard Smith081ad4d2017-01-24 19:39:46 +00001..
2 -------------------------------------------------------------------
3 NOTE: This file is automatically generated by running clang-tblgen
4 -gen-opt-docs. Do not edit this file by hand!!
5 -------------------------------------------------------------------
6
7=====================================
8Clang command line argument reference
9=====================================
10.. contents::
11 :local:
12
13Introduction
14============
15
16This page lists the command line arguments currently supported by the
17GCC-compatible ``clang`` and ``clang++`` drivers.
18
19
20.. program:: clang
Richard Smithc5b2e002017-01-27 02:08:37 +000021.. option:: -B<dir>, --prefix <arg>, --prefix=<arg>
Richard Smith081ad4d2017-01-24 19:39:46 +000022
Richard Smithc5b2e002017-01-27 02:08:37 +000023Add <dir> to search path for binaries and object files used implicitly
Richard Smith081ad4d2017-01-24 19:39:46 +000024
Richard Smith081ad4d2017-01-24 19:39:46 +000025.. option:: -F<arg>
26
27Add directory to framework include search path
28
Richard Smith081ad4d2017-01-24 19:39:46 +000029.. option:: -ObjC
30
31Treat source input files as Objective-C inputs
32
Richard Smithb2c82a62017-01-27 01:54:42 +000033.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +000034.. option:: -ObjC++
Richard Smithb2c82a62017-01-27 01:54:42 +000035.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +000036
37Treat source input files as Objective-C++ inputs
38
Vedant Kumar368540f2018-08-23 17:55:03 +000039.. option:: -Qn, -fno-ident
Craig Topper42da9cb2018-04-23 21:41:06 +000040
41Do not emit metadata containing compiler name and version
42
Richard Smith081ad4d2017-01-24 19:39:46 +000043.. option:: -Qunused-arguments
44
45Don't emit warning for unused driver arguments
46
Vedant Kumar368540f2018-08-23 17:55:03 +000047.. option:: -Qy, -fident
Craig Topper42da9cb2018-04-23 21:41:06 +000048
49Emit metadata containing compiler name and version
50
Richard Smith081ad4d2017-01-24 19:39:46 +000051.. option:: -Wa,<arg>,<arg2>...
52
53Pass the comma separated arguments in <arg> to the assembler
54
Richard Smith081ad4d2017-01-24 19:39:46 +000055.. option:: -Wlarge-by-value-copy=<arg>
56
Richard Smith081ad4d2017-01-24 19:39:46 +000057.. option:: -Xarch\_<arg1> <arg2>
58
Fangrui Songd8c97292020-06-18 14:52:39 -070059.. program:: clang1
60.. option:: -Xarch\_device <arg>
61.. program:: clang
62
63Pass <arg> to the CUDA/HIP device compilation
64
65.. program:: clang2
66.. option:: -Xarch\_host <arg>
67.. program:: clang
68
69Pass <arg> to the CUDA/HIP host compilation
70
Richard Smith081ad4d2017-01-24 19:39:46 +000071.. option:: -Xcuda-fatbinary <arg>
72
73Pass <arg> to fatbinary invocation
74
Richard Smith081ad4d2017-01-24 19:39:46 +000075.. option:: -Xcuda-ptxas <arg>
76
77Pass <arg> to the ptxas assembler
78
Boris Kolpackovb150d242017-08-30 09:15:53 +000079.. option:: -Xopenmp-target <arg>
80
81Pass <arg> to the target offloading toolchain.
82
83.. program:: clang1
Jonas Hahnfelda180fc42018-02-22 17:10:28 +000084.. option:: -Xopenmp-target=<triple> <arg>
Boris Kolpackovb150d242017-08-30 09:15:53 +000085.. program:: clang
86
Jonas Hahnfelda180fc42018-02-22 17:10:28 +000087Pass <arg> to the target offloading toolchain identified by <triple>.
Boris Kolpackovb150d242017-08-30 09:15:53 +000088
Richard Smith081ad4d2017-01-24 19:39:46 +000089.. option:: -Z<arg>
90
Richard Smith081ad4d2017-01-24 19:39:46 +000091.. option:: -a<arg>, --profile-blocks
92
Richard Smith081ad4d2017-01-24 19:39:46 +000093.. option:: -all\_load
94
Richard Smith081ad4d2017-01-24 19:39:46 +000095.. option:: -allowable\_client <arg>
96
Richard Smith081ad4d2017-01-24 19:39:46 +000097.. option:: --analyze
98
99Run the static analyzer
100
Richard Smith081ad4d2017-01-24 19:39:46 +0000101.. option:: --analyzer-no-default-checks
102
Richard Smith081ad4d2017-01-24 19:39:46 +0000103.. option:: --analyzer-output<arg>
104
Craig Topper9624beb2020-03-10 11:08:19 -0700105Static analyzer report output format (html\|plist\|plist-multi-file\|plist-html\|sarif\|text).
Richard Smith081ad4d2017-01-24 19:39:46 +0000106
Richard Smith081ad4d2017-01-24 19:39:46 +0000107.. option:: -ansi, --ansi
108
Richard Smith081ad4d2017-01-24 19:39:46 +0000109.. option:: -arch <arg>
110
Richard Smithb2c82a62017-01-27 01:54:42 +0000111.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000112.. option:: -arch\_errors\_fatal
Richard Smithb2c82a62017-01-27 01:54:42 +0000113.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000114
Richard Smithb2c82a62017-01-27 01:54:42 +0000115.. program:: clang2
Richard Smith081ad4d2017-01-24 19:39:46 +0000116.. option:: -arch\_only <arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000117.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000118
Richard Smith081ad4d2017-01-24 19:39:46 +0000119.. option:: -arcmt-migrate-emit-errors
120
121Emit ARC errors even if the migrator can fix them
122
Richard Smith081ad4d2017-01-24 19:39:46 +0000123.. option:: -arcmt-migrate-report-output <arg>
124
125Output path for the plist report
126
Craig Topperd23254a2017-07-20 17:52:48 +0000127.. option:: --autocomplete=<arg>
128
Richard Smith081ad4d2017-01-24 19:39:46 +0000129.. option:: -bind\_at\_load
130
Richard Smith081ad4d2017-01-24 19:39:46 +0000131.. option:: -bundle
132
Richard Smithb2c82a62017-01-27 01:54:42 +0000133.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000134.. option:: -bundle\_loader <arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000135.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000136
Richard Smith081ad4d2017-01-24 19:39:46 +0000137.. option:: -client\_name<arg>
138
Richard Smith081ad4d2017-01-24 19:39:46 +0000139.. option:: -compatibility\_version<arg>
140
Craig Topper287c8012018-01-03 18:29:12 +0000141.. option:: --config <arg>
142
143Specifies configuration file
144
Richard Smith081ad4d2017-01-24 19:39:46 +0000145.. option:: --constant-cfstrings
146
Richard Smith081ad4d2017-01-24 19:39:46 +0000147.. option:: --cuda-compile-host-device
148
149Compile CUDA code for both host and device (default). Has no effect on non-CUDA compilations.
150
Richard Smith081ad4d2017-01-24 19:39:46 +0000151.. option:: --cuda-device-only
152
153Compile CUDA code for device only
154
Richard Smith081ad4d2017-01-24 19:39:46 +0000155.. option:: --cuda-host-only
156
157Compile CUDA code for host only. Has no effect on non-CUDA compilations.
158
Jonas Hahnfeld06039e82018-04-20 13:26:03 +0000159.. option:: --cuda-include-ptx=<arg>, --no-cuda-include-ptx=<arg>
160
Sylvestre Ledru90f1dfb2019-01-01 12:51:14 +0000161Include PTX for the following GPU architecture (e.g. sm\_35) or 'all'. May be specified more than once.
Jonas Hahnfeld06039e82018-04-20 13:26:03 +0000162
Richard Smith081ad4d2017-01-24 19:39:46 +0000163.. option:: --cuda-noopt-device-debug, --no-cuda-noopt-device-debug
164
165Enable device-side debug info generation. Disables ptxas optimizations.
166
Richard Smith081ad4d2017-01-24 19:39:46 +0000167.. option:: -current\_version<arg>
168
Richard Smith081ad4d2017-01-24 19:39:46 +0000169.. option:: -dead\_strip
170
Richard Smith081ad4d2017-01-24 19:39:46 +0000171.. option:: -dependency-dot <arg>
172
173Filename to write DOT-formatted header dependencies to
174
Richard Smith081ad4d2017-01-24 19:39:46 +0000175.. option:: -dependency-file <arg>
176
177Filename (or -) to write dependency output to
178
Konstantin Zhuravlyovb581c5a2020-10-09 08:29:53 -0400179.. option:: -dsym-dir<dir>
180
181Directory to output dSYM's (if any) to
182
Richard Smith081ad4d2017-01-24 19:39:46 +0000183.. option:: -dumpmachine
184
Richard Smith081ad4d2017-01-24 19:39:46 +0000185.. option:: -dumpversion
186
Richard Smith081ad4d2017-01-24 19:39:46 +0000187.. option:: --dyld-prefix=<arg>, --dyld-prefix <arg>
188
Richard Smith081ad4d2017-01-24 19:39:46 +0000189.. option:: -dylib\_file <arg>
190
Richard Smith081ad4d2017-01-24 19:39:46 +0000191.. option:: -dylinker
192
Richard Smithb2c82a62017-01-27 01:54:42 +0000193.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000194.. option:: -dylinker\_install\_name<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000195.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000196
Richard Smith081ad4d2017-01-24 19:39:46 +0000197.. option:: -dynamic
198
Richard Smith081ad4d2017-01-24 19:39:46 +0000199.. option:: -dynamiclib
200
Richard Smith081ad4d2017-01-24 19:39:46 +0000201.. option:: -emit-ast
202
203Emit Clang AST files for source inputs
204
Konstantin Zhuravlyovb581c5a2020-10-09 08:29:53 -0400205.. option:: --emit-static-lib
206
207Enable linker job to emit a static library.
208
Craig Topper9624beb2020-03-10 11:08:19 -0700209.. option:: -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang
210
211Trivial automatic variable initialization to zero is only here for benchmarks, it'll eventually be removed, and I'm OK with that because I'm only using it to benchmark
212
Richard Smith081ad4d2017-01-24 19:39:46 +0000213.. option:: -exported\_symbols\_list <arg>
214
Richard Smith081ad4d2017-01-24 19:39:46 +0000215.. option:: -faligned-new=<arg>
216
Richard Smith081ad4d2017-01-24 19:39:46 +0000217.. option:: -fcuda-flush-denormals-to-zero, -fno-cuda-flush-denormals-to-zero
218
219Flush denormal floating point values to zero in CUDA device mode.
220
Jonas Hahnfeld06039e82018-04-20 13:26:03 +0000221.. option:: -ffixed-r19
222
Vedant Kumar368540f2018-08-23 17:55:03 +0000223Reserve register r19 (Hexagon only)
Jonas Hahnfeld06039e82018-04-20 13:26:03 +0000224
Richard Smith081ad4d2017-01-24 19:39:46 +0000225.. option:: -fheinous-gnu-extensions
226
Richard Smith081ad4d2017-01-24 19:39:46 +0000227.. option:: -flat\_namespace
228
Richard Smith081ad4d2017-01-24 19:39:46 +0000229.. option:: -fopenmp-targets=<arg1>,<arg2>...
230
231Specify comma-separated list of triples OpenMP offloading targets to be supported
232
Richard Smith081ad4d2017-01-24 19:39:46 +0000233.. option:: -force\_cpusubtype\_ALL
234
Richard Smithb2c82a62017-01-27 01:54:42 +0000235.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000236.. option:: -force\_flat\_namespace
Richard Smithb2c82a62017-01-27 01:54:42 +0000237.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000238
Richard Smithb2c82a62017-01-27 01:54:42 +0000239.. program:: clang2
Richard Smith081ad4d2017-01-24 19:39:46 +0000240.. option:: -force\_load <arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000241.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000242
Richard Smith081ad4d2017-01-24 19:39:46 +0000243.. option:: -framework <arg>
244
Richard Smith78e23fd2017-04-13 22:39:49 +0000245.. option:: -frtlib-add-rpath, -fno-rtlib-add-rpath
246
247Add -rpath with architecture-specific resource directory to the linker flags
248
Craig Topper9624beb2020-03-10 11:08:19 -0700249.. option:: -fsanitize-system-blacklist=<arg>
250
251Path to system blacklist file for sanitizers
252
253.. option:: -fsystem-module
254
255Build this module as a system module. Only used with -emit-module
256
Richard Smith081ad4d2017-01-24 19:39:46 +0000257.. option:: --gcc-toolchain=<arg>, -gcc-toolchain <arg>
258
259Use the gcc toolchain at the given directory
260
Richard Smith081ad4d2017-01-24 19:39:46 +0000261.. option:: -gcodeview
262
263Generate CodeView debug information
264
Craig Topper9624beb2020-03-10 11:08:19 -0700265.. option:: -gcodeview-ghash, -gno-codeview-ghash
266
267Emit type record hashes in a .debug$H section
268
269.. option:: -ginline-line-tables, -gno-inline-line-tables
270
Konstantin Zhuravlyovb581c5a2020-10-09 08:29:53 -0400271.. option:: --gpu-instrument-lib=<arg>
272
273Instrument device library for HIP, which is a LLVM bitcode containing \_\_cyg\_profile\_func\_enter and \_\_cyg\_profile\_func\_exit
274
Craig Topper9624beb2020-03-10 11:08:19 -0700275.. option:: --gpu-max-threads-per-block=<arg>
276
277Default max threads per block for kernel launch bounds for HIP
278
Richard Smith081ad4d2017-01-24 19:39:46 +0000279.. option:: -headerpad\_max\_install\_names<arg>
280
Richard Smith081ad4d2017-01-24 19:39:46 +0000281.. option:: -help, --help
282
283Display available options
284
Richard Smith081ad4d2017-01-24 19:39:46 +0000285.. option:: --help-hidden
286
Jonas Hahnfeld06039e82018-04-20 13:26:03 +0000287Display help for hidden options
288
Vedant Kumar368540f2018-08-23 17:55:03 +0000289.. option:: --hip-link
290
291Link clang-offload-bundler bundles for HIP
292
Konstantin Zhuravlyovb581c5a2020-10-09 08:29:53 -0400293.. option:: --hip-version=<arg>
294
295HIP version in the format of major.minor.patch
296
Craig Topper9624beb2020-03-10 11:08:19 -0700297.. option:: -ibuiltininc
298
299Enable builtin #include directories even when -nostdinc is used before or after -ibuiltininc. Using -nobuiltininc after the option disables it
300
Richard Smith081ad4d2017-01-24 19:39:46 +0000301.. option:: -image\_base <arg>
302
Richard Smith081ad4d2017-01-24 19:39:46 +0000303.. option:: -index-header-map
304
305Make the next included directory (-I or -F) an indexer header map
306
Richard Smith081ad4d2017-01-24 19:39:46 +0000307.. option:: -init <arg>
308
Richard Smith081ad4d2017-01-24 19:39:46 +0000309.. option:: -install\_name <arg>
310
Craig Topper9624beb2020-03-10 11:08:19 -0700311.. option:: -interface-stub-version=<arg>
312
Richard Smith081ad4d2017-01-24 19:39:46 +0000313.. option:: -keep\_private\_externs
314
Richard Smith081ad4d2017-01-24 19:39:46 +0000315.. option:: -lazy\_framework <arg>
316
Richard Smithb2c82a62017-01-27 01:54:42 +0000317.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000318.. option:: -lazy\_library <arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000319.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000320
Richard Smith081ad4d2017-01-24 19:39:46 +0000321.. option:: -mbig-endian, -EB
322
Craig Topper9624beb2020-03-10 11:08:19 -0700323.. option:: -mbranch-protection=<arg>
324
325Enforce targets of indirect branches and function returns
326
Konstantin Zhuravlyovb581c5a2020-10-09 08:29:53 -0400327.. option:: -mharden-sls=<arg>
328
329Select straight-line speculation hardening scope
330
Richard Smith081ad4d2017-01-24 19:39:46 +0000331.. option:: --migrate
332
333Run the migrator
334
Richard Smith78e23fd2017-04-13 22:39:49 +0000335.. option:: -mios-simulator-version-min=<arg>, -miphonesimulator-version-min=<arg>
336
Richard Smith081ad4d2017-01-24 19:39:46 +0000337.. option:: -mlinker-version=<arg>
338
Richard Smith081ad4d2017-01-24 19:39:46 +0000339.. option:: -mlittle-endian, -EL
340
Richard Smith081ad4d2017-01-24 19:39:46 +0000341.. option:: -mllvm <arg>
342
343Additional arguments to forward to LLVM's option processing
344
Richard Smith081ad4d2017-01-24 19:39:46 +0000345.. option:: -module-dependency-dir <arg>
346
347Directory to dump module dependencies to
348
Richard Smith78e23fd2017-04-13 22:39:49 +0000349.. option:: -mtvos-simulator-version-min=<arg>, -mappletvsimulator-version-min=<arg>
350
Richard Smith081ad4d2017-01-24 19:39:46 +0000351.. option:: -multi\_module
352
Richard Smith081ad4d2017-01-24 19:39:46 +0000353.. option:: -multiply\_defined <arg>
354
Richard Smithb2c82a62017-01-27 01:54:42 +0000355.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000356.. option:: -multiply\_defined\_unused <arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000357.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000358
Richard Smith78e23fd2017-04-13 22:39:49 +0000359.. option:: -mwatchos-simulator-version-min=<arg>, -mwatchsimulator-version-min=<arg>
360
Richard Smith081ad4d2017-01-24 19:39:46 +0000361.. option:: --no-cuda-version-check
362
363Don't error out if the detected version of the CUDA install is too low for the requested CUDA gpu architecture.
364
Richard Smith081ad4d2017-01-24 19:39:46 +0000365.. option:: -no-integrated-cpp, --no-integrated-cpp
366
Richard Smith081ad4d2017-01-24 19:39:46 +0000367.. option:: -no\_dead\_strip\_inits\_and\_terms
368
Richard Smith081ad4d2017-01-24 19:39:46 +0000369.. option:: -nobuiltininc
370
371Disable builtin #include directories
372
Richard Smith081ad4d2017-01-24 19:39:46 +0000373.. option:: -nodefaultlibs
374
Richard Smith081ad4d2017-01-24 19:39:46 +0000375.. option:: -nofixprebinding
376
Fangrui Songd8c97292020-06-18 14:52:39 -0700377.. option:: -nogpuinc, -nocudainc
378
Craig Topper9624beb2020-03-10 11:08:19 -0700379.. option:: -nogpulib, -nocudalib
380
381Do not link device library for CUDA/HIP device compilation
382
Richard Smith081ad4d2017-01-24 19:39:46 +0000383.. option:: -nolibc
384
Richard Smith081ad4d2017-01-24 19:39:46 +0000385.. option:: -nomultidefs
386
Craig Topperd23254a2017-07-20 17:52:48 +0000387.. option:: -nopie, -no-pie
Richard Smith081ad4d2017-01-24 19:39:46 +0000388
Richard Smith081ad4d2017-01-24 19:39:46 +0000389.. option:: -noprebind
390
Petr Hosek08cb3422019-07-11 19:06:38 +0000391.. option:: -noprofilelib
392
Richard Smith081ad4d2017-01-24 19:39:46 +0000393.. option:: -noseglinkedit
394
Richard Smith081ad4d2017-01-24 19:39:46 +0000395.. option:: -nostdinc, --no-standard-includes
396
Richard Smithb2c82a62017-01-27 01:54:42 +0000397.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000398.. option:: -nostdinc++
Richard Smithb2c82a62017-01-27 01:54:42 +0000399.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000400
401Disable standard #include directories for the C++ standard library
402
Boris Kolpackovb150d242017-08-30 09:15:53 +0000403.. option:: -nostdlib++
Boris Kolpackovb150d242017-08-30 09:15:53 +0000404
Richard Smith081ad4d2017-01-24 19:39:46 +0000405.. option:: -nostdlibinc
406
Richard Smith081ad4d2017-01-24 19:39:46 +0000407.. option:: -o<file>, --output <arg>, --output=<arg>
408
409Write output to <file>
410
Richard Smith081ad4d2017-01-24 19:39:46 +0000411.. option:: -objcmt-atomic-property
412
413Make migration to 'atomic' properties
414
Richard Smith081ad4d2017-01-24 19:39:46 +0000415.. option:: -objcmt-migrate-all
416
417Enable migration to modern ObjC
418
Richard Smith081ad4d2017-01-24 19:39:46 +0000419.. option:: -objcmt-migrate-annotation
420
421Enable migration to property and method annotations
422
Richard Smith081ad4d2017-01-24 19:39:46 +0000423.. option:: -objcmt-migrate-designated-init
424
425Enable migration to infer NS\_DESIGNATED\_INITIALIZER for initializer methods
426
Richard Smith081ad4d2017-01-24 19:39:46 +0000427.. option:: -objcmt-migrate-instancetype
428
429Enable migration to infer instancetype for method result type
430
Richard Smith081ad4d2017-01-24 19:39:46 +0000431.. option:: -objcmt-migrate-literals
432
433Enable migration to modern ObjC literals
434
Richard Smith081ad4d2017-01-24 19:39:46 +0000435.. option:: -objcmt-migrate-ns-macros
436
437Enable migration to NS\_ENUM/NS\_OPTIONS macros
438
Richard Smith081ad4d2017-01-24 19:39:46 +0000439.. option:: -objcmt-migrate-property
440
441Enable migration to modern ObjC property
442
Richard Smith081ad4d2017-01-24 19:39:46 +0000443.. option:: -objcmt-migrate-property-dot-syntax
444
445Enable migration of setter/getter messages to property-dot syntax
446
Richard Smith081ad4d2017-01-24 19:39:46 +0000447.. option:: -objcmt-migrate-protocol-conformance
448
449Enable migration to add protocol conformance on classes
450
Richard Smith081ad4d2017-01-24 19:39:46 +0000451.. option:: -objcmt-migrate-readonly-property
452
453Enable migration to modern ObjC readonly property
454
Richard Smith081ad4d2017-01-24 19:39:46 +0000455.. option:: -objcmt-migrate-readwrite-property
456
457Enable migration to modern ObjC readwrite property
458
Richard Smith081ad4d2017-01-24 19:39:46 +0000459.. option:: -objcmt-migrate-subscripting
460
461Enable migration to modern ObjC subscripting
462
Richard Smith081ad4d2017-01-24 19:39:46 +0000463.. option:: -objcmt-ns-nonatomic-iosonly
464
465Enable migration to use NS\_NONATOMIC\_IOSONLY macro for setting property's 'atomic' attribute
466
Richard Smith081ad4d2017-01-24 19:39:46 +0000467.. option:: -objcmt-returns-innerpointer-property
468
469Enable migration to annotate property with NS\_RETURNS\_INNER\_POINTER
470
Richard Smith081ad4d2017-01-24 19:39:46 +0000471.. option:: -objcmt-whitelist-dir-path=<arg>, -objcmt-white-list-dir-path=<arg>
472
473Only modify files with a filename contained in the provided directory path
474
Richard Smith081ad4d2017-01-24 19:39:46 +0000475.. option:: -object
476
Fangrui Songd8c97292020-06-18 14:52:39 -0700477.. option:: --offload-arch=<arg>, --cuda-gpu-arch=<arg>, --no-offload-arch=<arg>
478
Konstantin Zhuravlyovb581c5a2020-10-09 08:29:53 -0400479CUDA offloading device architecture (e.g. sm\_35), or HIP offloading target ID in the form of a device architecture followed by target ID features delimited by a colon. Each target ID feature is a pre-defined string followed by a plus or minus sign (e.g. gfx908:xnack+:sram-ecc-). May be specified more than once.
Fangrui Songd8c97292020-06-18 14:52:39 -0700480
Richard Smith081ad4d2017-01-24 19:39:46 +0000481.. option:: -p, --profile
482
Richard Smith081ad4d2017-01-24 19:39:46 +0000483.. option:: -pagezero\_size<arg>
484
Richard Smith081ad4d2017-01-24 19:39:46 +0000485.. option:: -pg
486
487Enable mcount instrumentation
488
Richard Smith081ad4d2017-01-24 19:39:46 +0000489.. option:: -pipe, --pipe
490
491Use pipes between commands, when possible
492
Richard Smith081ad4d2017-01-24 19:39:46 +0000493.. option:: -prebind
494
Richard Smithb2c82a62017-01-27 01:54:42 +0000495.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000496.. option:: -prebind\_all\_twolevel\_modules
Richard Smithb2c82a62017-01-27 01:54:42 +0000497.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000498
Richard Smith081ad4d2017-01-24 19:39:46 +0000499.. option:: -preload
500
Richard Smith081ad4d2017-01-24 19:39:46 +0000501.. option:: --print-diagnostic-categories
502
Vedant Kumar368540f2018-08-23 17:55:03 +0000503.. option:: -print-effective-triple, --print-effective-triple
504
505Print the effective target triple
506
Richard Smith081ad4d2017-01-24 19:39:46 +0000507.. option:: -print-file-name=<file>, --print-file-name=<file>, --print-file-name <arg>
508
509Print the full library path of <file>
510
Richard Smith081ad4d2017-01-24 19:39:46 +0000511.. option:: -print-ivar-layout
512
513Enable Objective-C Ivar layout bitmap print trace
514
Richard Smith081ad4d2017-01-24 19:39:46 +0000515.. option:: -print-libgcc-file-name, --print-libgcc-file-name
516
517Print the library path for the currently used compiler runtime library ("libgcc.a" or "libclang\_rt.builtins.\*.a")
518
Richard Smith081ad4d2017-01-24 19:39:46 +0000519.. option:: -print-multi-directory, --print-multi-directory
520
Richard Smith081ad4d2017-01-24 19:39:46 +0000521.. option:: -print-multi-lib, --print-multi-lib
522
Richard Smith081ad4d2017-01-24 19:39:46 +0000523.. option:: -print-prog-name=<name>, --print-prog-name=<name>, --print-prog-name <arg>
524
525Print the full program path of <name>
526
Richard Smith78e23fd2017-04-13 22:39:49 +0000527.. option:: -print-resource-dir, --print-resource-dir
528
529Print the resource directory pathname
530
Richard Smith081ad4d2017-01-24 19:39:46 +0000531.. option:: -print-search-dirs, --print-search-dirs
532
533Print the paths used for finding libraries and programs
534
Vedant Kumar368540f2018-08-23 17:55:03 +0000535.. option:: -print-target-triple, --print-target-triple
536
537Print the normalized target triple
538
Fangrui Songd8c97292020-06-18 14:52:39 -0700539.. option:: -print-targets, --print-targets
540
541Print the registered targets
542
Richard Smith081ad4d2017-01-24 19:39:46 +0000543.. option:: -private\_bundle
544
Richard Smith081ad4d2017-01-24 19:39:46 +0000545.. option:: -pthread, -no-pthread
546
547Support POSIX threads in generated code
548
Richard Smith081ad4d2017-01-24 19:39:46 +0000549.. option:: -pthreads
550
Richard Smith081ad4d2017-01-24 19:39:46 +0000551.. option:: -read\_only\_relocs <arg>
552
Richard Smith081ad4d2017-01-24 19:39:46 +0000553.. option:: -relocatable-pch, --relocatable-pch
554
555Whether to build a relocatable precompiled header
556
Richard Smith081ad4d2017-01-24 19:39:46 +0000557.. option:: -remap
558
Richard Smith081ad4d2017-01-24 19:39:46 +0000559.. option:: -rewrite-legacy-objc
560
561Rewrite Legacy Objective-C source to C++
562
Richard Smith081ad4d2017-01-24 19:39:46 +0000563.. option:: -rtlib=<arg>, --rtlib=<arg>, --rtlib <arg>
564
565Compiler runtime library to use
566
Richard Smith081ad4d2017-01-24 19:39:46 +0000567.. option:: -save-stats=<arg>, --save-stats=<arg>, -save-stats (equivalent to -save-stats=cwd), --save-stats (equivalent to -save-stats=cwd)
568
569Save llvm statistics.
570
Richard Smith081ad4d2017-01-24 19:39:46 +0000571.. option:: -save-temps=<arg>, --save-temps=<arg>, -save-temps (equivalent to -save-temps=cwd), --save-temps (equivalent to -save-temps=cwd)
572
573Save intermediate compilation results.
574
Richard Smith081ad4d2017-01-24 19:39:46 +0000575.. option:: -sectalign <arg1> <arg2> <arg3>
576
Richard Smith081ad4d2017-01-24 19:39:46 +0000577.. option:: -sectcreate <arg1> <arg2> <arg3>
578
Richard Smith081ad4d2017-01-24 19:39:46 +0000579.. option:: -sectobjectsymbols <arg1> <arg2>
580
Richard Smith081ad4d2017-01-24 19:39:46 +0000581.. option:: -sectorder <arg1> <arg2> <arg3>
582
Richard Smith081ad4d2017-01-24 19:39:46 +0000583.. option:: -seg1addr<arg>
584
Richard Smith081ad4d2017-01-24 19:39:46 +0000585.. option:: -seg\_addr\_table <arg>
586
Richard Smithb2c82a62017-01-27 01:54:42 +0000587.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000588.. option:: -seg\_addr\_table\_filename <arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000589.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000590
Richard Smith081ad4d2017-01-24 19:39:46 +0000591.. option:: -segaddr <arg1> <arg2>
592
Richard Smith081ad4d2017-01-24 19:39:46 +0000593.. option:: -segcreate <arg1> <arg2> <arg3>
594
Richard Smith081ad4d2017-01-24 19:39:46 +0000595.. option:: -seglinkedit
596
Richard Smith081ad4d2017-01-24 19:39:46 +0000597.. option:: -segprot <arg1> <arg2> <arg3>
598
Richard Smith081ad4d2017-01-24 19:39:46 +0000599.. option:: -segs\_read\_<arg>
600
Richard Smithb2c82a62017-01-27 01:54:42 +0000601.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000602.. option:: -segs\_read\_only\_addr <arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000603.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000604
Richard Smithb2c82a62017-01-27 01:54:42 +0000605.. program:: clang2
Richard Smith081ad4d2017-01-24 19:39:46 +0000606.. option:: -segs\_read\_write\_addr <arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000607.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000608
Richard Smith081ad4d2017-01-24 19:39:46 +0000609.. option:: -serialize-diagnostics <arg>, --serialize-diagnostics <arg>
610
611Serialize compiler diagnostics to a file
612
Richard Smith081ad4d2017-01-24 19:39:46 +0000613.. option:: -shared-libgcc
614
Craig Topper16418662017-11-20 18:07:43 +0000615.. option:: -shared-libsan, -shared-libasan
616
Vedant Kumar368540f2018-08-23 17:55:03 +0000617Dynamically link the sanitizer runtime
618
Richard Smith081ad4d2017-01-24 19:39:46 +0000619.. option:: -single\_module
620
Richard Smith081ad4d2017-01-24 19:39:46 +0000621.. option:: -static-libgcc
622
Craig Topper16418662017-11-20 18:07:43 +0000623.. option:: -static-libsan
624
Vedant Kumar368540f2018-08-23 17:55:03 +0000625Statically link the sanitizer runtime
626
Richard Smith081ad4d2017-01-24 19:39:46 +0000627.. option:: -static-libstdc++
628
Craig Topper9624beb2020-03-10 11:08:19 -0700629.. option:: -static-openmp
630
631Use the static host OpenMP runtime while linking.
632
Richard Smith081ad4d2017-01-24 19:39:46 +0000633.. option:: -std-default=<arg>
634
Richard Smith081ad4d2017-01-24 19:39:46 +0000635.. option:: -stdlib=<arg>, --stdlib=<arg>, --stdlib <arg>
636
637C++ standard library to use
638
Richard Smith081ad4d2017-01-24 19:39:46 +0000639.. option:: -sub\_library<arg>
640
Richard Smithb2c82a62017-01-27 01:54:42 +0000641.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000642.. option:: -sub\_umbrella<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000643.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000644
Richard Smith081ad4d2017-01-24 19:39:46 +0000645.. option:: --sysroot=<arg>, --sysroot <arg>
646
Richard Smith081ad4d2017-01-24 19:39:46 +0000647.. option:: --target-help
648
Richard Smith081ad4d2017-01-24 19:39:46 +0000649.. option:: --target=<arg>, -target <arg>
650
651Generate code for the given target
652
Richard Smith081ad4d2017-01-24 19:39:46 +0000653.. option:: -time
654
655Time individual commands
656
Richard Smith081ad4d2017-01-24 19:39:46 +0000657.. option:: -traditional, --traditional
658
Richard Smith081ad4d2017-01-24 19:39:46 +0000659.. option:: -traditional-cpp, --traditional-cpp
660
661Enable some traditional CPP emulation
662
Richard Smith081ad4d2017-01-24 19:39:46 +0000663.. option:: -twolevel\_namespace
664
Richard Smithb2c82a62017-01-27 01:54:42 +0000665.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000666.. option:: -twolevel\_namespace\_hints
Richard Smithb2c82a62017-01-27 01:54:42 +0000667.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000668
Richard Smith081ad4d2017-01-24 19:39:46 +0000669.. option:: -umbrella <arg>
670
Richard Smith081ad4d2017-01-24 19:39:46 +0000671.. option:: -unexported\_symbols\_list <arg>
672
Craig Topper9624beb2020-03-10 11:08:19 -0700673.. option:: -unwindlib=<arg>, --unwindlib=<arg>
674
675Unwind library to use
676
Richard Smith081ad4d2017-01-24 19:39:46 +0000677.. option:: -v, --verbose
678
679Show commands to run and use verbose output
680
Richard Smith081ad4d2017-01-24 19:39:46 +0000681.. option:: --verify-debug-info
682
683Verify the binary representation of debug output
684
Richard Smith081ad4d2017-01-24 19:39:46 +0000685.. option:: --version
686
Craig Topper16418662017-11-20 18:07:43 +0000687Print version information
688
Richard Smith081ad4d2017-01-24 19:39:46 +0000689.. option:: -w, --no-warnings
690
691Suppress all warnings
692
Richard Smith081ad4d2017-01-24 19:39:46 +0000693.. option:: -weak-l<arg>
694
Richard Smith081ad4d2017-01-24 19:39:46 +0000695.. option:: -weak\_framework <arg>
696
Richard Smithb2c82a62017-01-27 01:54:42 +0000697.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000698.. option:: -weak\_library <arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000699.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000700
Richard Smithb2c82a62017-01-27 01:54:42 +0000701.. program:: clang2
Richard Smith081ad4d2017-01-24 19:39:46 +0000702.. option:: -weak\_reference\_mismatches <arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000703.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000704
Richard Smith081ad4d2017-01-24 19:39:46 +0000705.. option:: -whatsloaded
706
Richard Smith081ad4d2017-01-24 19:39:46 +0000707.. option:: -whyload
708
Richard Smith081ad4d2017-01-24 19:39:46 +0000709.. option:: -working-directory<arg>, -working-directory=<arg>
710
711Resolve file paths relative to the specified directory
712
Richard Smith081ad4d2017-01-24 19:39:46 +0000713.. option:: -x<language>, --language <arg>, --language=<arg>
714
715Treat subsequent input files as having type <language>
716
Richard Smith081ad4d2017-01-24 19:39:46 +0000717.. option:: -y<arg>
718
719Actions
720=======
721The action to perform on the input.
722
Richard Smith081ad4d2017-01-24 19:39:46 +0000723.. option:: -E, --preprocess
724
725Only run the preprocessor
726
Richard Smith081ad4d2017-01-24 19:39:46 +0000727.. option:: -S, --assemble
728
729Only run preprocess and compilation steps
730
Richard Smithc5b2e002017-01-27 02:08:37 +0000731.. option:: -c, --compile
732
733Only run preprocess, compile, and assemble steps
734
Craig Topper9624beb2020-03-10 11:08:19 -0700735.. option:: -emit-interface-stubs
736
Konstantin Zhuravlyovb581c5a2020-10-09 08:29:53 -0400737Generate Interface Stub Files.
Craig Topper9624beb2020-03-10 11:08:19 -0700738
Richard Smith081ad4d2017-01-24 19:39:46 +0000739.. option:: -emit-llvm
740
741Use the LLVM representation for assembler and object files
742
Craig Topper9624beb2020-03-10 11:08:19 -0700743.. option:: -emit-merged-ifs
744
745Generate Interface Stub Files, emit merged text not binary.
746
Richard Smith081ad4d2017-01-24 19:39:46 +0000747.. option:: -fsyntax-only
748
Richard Smith081ad4d2017-01-24 19:39:46 +0000749.. option:: -module-file-info
750
751Provide information about a particular module file
752
Richard Smith081ad4d2017-01-24 19:39:46 +0000753.. option:: --precompile
754
755Only precompile the input
756
Richard Smith081ad4d2017-01-24 19:39:46 +0000757.. option:: -rewrite-objc
758
759Rewrite Objective-C source to C++
760
Richard Smith081ad4d2017-01-24 19:39:46 +0000761.. option:: -verify-pch
762
763Load and verify that a pre-compiled header file is not stale
764
765Compilation flags
766=================
767
768Flags controlling the behavior of Clang during compilation. These flags have
769no effect during actions that do not perform compilation.
770
Richard Smithc5b2e002017-01-27 02:08:37 +0000771.. option:: -Xassembler <arg>
Richard Smith081ad4d2017-01-24 19:39:46 +0000772
Richard Smithc5b2e002017-01-27 02:08:37 +0000773Pass <arg> to the assembler
Richard Smith081ad4d2017-01-24 19:39:46 +0000774
Richard Smith081ad4d2017-01-24 19:39:46 +0000775.. option:: -Xclang <arg>
776
777Pass <arg> to the clang compiler
778
Boris Kolpackovb150d242017-08-30 09:15:53 +0000779.. option:: -fclang-abi-compat=<version>
780
781Attempt to match the ABI of Clang <version>
782
Richard Smith081ad4d2017-01-24 19:39:46 +0000783.. option:: -fcomment-block-commands=<arg>,<arg2>...
784
785Treat each comma separated argument in <arg> as a documentation comment block command
786
Vedant Kumar368540f2018-08-23 17:55:03 +0000787.. option:: -fcomplete-member-pointers, -fno-complete-member-pointers
788
789Require member pointer base types to be complete if they would be significant under the Microsoft ABI
790
791.. option:: -fcrash-diagnostics-dir=<arg>
792
Richard Smith081ad4d2017-01-24 19:39:46 +0000793.. option:: -fdeclspec, -fno-declspec
794
795Allow \_\_declspec as a keyword
796
Richard Smith081ad4d2017-01-24 19:39:46 +0000797.. option:: -fdepfile-entry=<arg>
798
Richard Smith081ad4d2017-01-24 19:39:46 +0000799.. option:: -fdiagnostics-fixit-info, -fno-diagnostics-fixit-info
800
Richard Smith081ad4d2017-01-24 19:39:46 +0000801.. option:: -fdiagnostics-format=<arg>
802
Richard Smith081ad4d2017-01-24 19:39:46 +0000803.. option:: -fdiagnostics-parseable-fixits
804
805Print fix-its in machine parseable form
806
Richard Smith081ad4d2017-01-24 19:39:46 +0000807.. option:: -fdiagnostics-print-source-range-info
808
809Print source range spans in numeric form
810
Richard Smith081ad4d2017-01-24 19:39:46 +0000811.. option:: -fdiagnostics-show-category=<arg>
812
Jonas Hahnfelda180fc42018-02-22 17:10:28 +0000813.. option:: -fdiscard-value-names, -fno-discard-value-names
814
815Discard value names in LLVM IR
816
Richard Smith081ad4d2017-01-24 19:39:46 +0000817.. option:: -fexperimental-new-pass-manager, -fno-experimental-new-pass-manager
818
819Enables an experimental new pass manager in LLVM.
820
Kevin P. Neald4ce8622020-07-10 08:46:09 -0400821.. option:: -fexperimental-strict-floating-point
822
Konstantin Zhuravlyovb581c5a2020-10-09 08:29:53 -0400823Enables experimental strict floating point in LLVM.
Kevin P. Neald4ce8622020-07-10 08:46:09 -0400824
Craig Topper16418662017-11-20 18:07:43 +0000825.. option:: -ffine-grained-bitfield-accesses, -fno-fine-grained-bitfield-accesses
826
Vedant Kumar368540f2018-08-23 17:55:03 +0000827Use separate accesses for consecutive bitfield runs with legal widths and alignments.
Craig Topper16418662017-11-20 18:07:43 +0000828
Fangrui Songd8c97292020-06-18 14:52:39 -0700829.. option:: -fglobal-isel, -fexperimental-isel, -fno-global-isel
830
831Enables the global instruction selector
832
Richard Smith081ad4d2017-01-24 19:39:46 +0000833.. option:: -finline-functions, -fno-inline-functions
834
835Inline suitable functions
836
Richard Smith081ad4d2017-01-24 19:39:46 +0000837.. option:: -finline-hint-functions
838
839Inline functions which are (explicitly or implicitly) marked inline
840
Richard Smith081ad4d2017-01-24 19:39:46 +0000841.. option:: -fno-crash-diagnostics
842
Richard Smith78e23fd2017-04-13 22:39:49 +0000843Disable auto-generation of preprocessed source files and a script for reproduction during a clang crash
844
Richard Smith081ad4d2017-01-24 19:39:46 +0000845.. option:: -fno-sanitize-blacklist
846
847Don't use blacklist file for sanitizers
848
Richard Smith081ad4d2017-01-24 19:39:46 +0000849.. option:: -fparse-all-comments
850
Craig Topper9624beb2020-03-10 11:08:19 -0700851.. option:: -frecord-command-line, -fno-record-command-line, -frecord-gcc-switches
Scott Linderde6beb02018-12-14 15:38:15 +0000852
Richard Smith081ad4d2017-01-24 19:39:46 +0000853.. option:: -fsanitize-address-field-padding=<arg>
854
855Level of field padding for AddressSanitizer
856
Craig Topperd23254a2017-07-20 17:52:48 +0000857.. option:: -fsanitize-address-globals-dead-stripping
858
859Enable linker dead stripping of globals in AddressSanitizer
860
Filipe Cabecinhas0eb50082018-11-02 17:29:04 +0000861.. option:: -fsanitize-address-poison-custom-array-cookie, -fno-sanitize-address-poison-custom-array-cookie
Jonas Hahnfelda180fc42018-02-22 17:10:28 +0000862
Craig Topper9624beb2020-03-10 11:08:19 -0700863Enable poisoning array cookies when using custom operator new\[\] in AddressSanitizer
Jonas Hahnfelda180fc42018-02-22 17:10:28 +0000864
Richard Smith081ad4d2017-01-24 19:39:46 +0000865.. option:: -fsanitize-address-use-after-scope, -fno-sanitize-address-use-after-scope
866
867Enable use-after-scope detection in AddressSanitizer
868
Craig Topper9624beb2020-03-10 11:08:19 -0700869.. option:: -fsanitize-address-use-odr-indicator, -fno-sanitize-address-use-odr-indicator
870
871Enable ODR indicator globals to avoid false ODR violation reports in partially sanitized programs at the cost of an increase in binary size
872
Richard Smith081ad4d2017-01-24 19:39:46 +0000873.. option:: -fsanitize-blacklist=<arg>
874
875Path to blacklist file for sanitizers
876
Craig Topper9624beb2020-03-10 11:08:19 -0700877.. option:: -fsanitize-cfi-canonical-jump-tables, -fno-sanitize-cfi-canonical-jump-tables
878
879Make the jump table addresses canonical in the symbol table
880
Richard Smith081ad4d2017-01-24 19:39:46 +0000881.. option:: -fsanitize-cfi-cross-dso, -fno-sanitize-cfi-cross-dso
882
883Enable control flow integrity (CFI) checks for cross-DSO calls.
884
Vlad Tsyrklevich634c6012017-10-31 22:39:44 +0000885.. option:: -fsanitize-cfi-icall-generalize-pointers
886
Craig Topper16418662017-11-20 18:07:43 +0000887Generalize pointers in CFI indirect call type signature checks
Vlad Tsyrklevich634c6012017-10-31 22:39:44 +0000888
Konstantin Zhuravlyovb581c5a2020-10-09 08:29:53 -0400889.. option:: -fsanitize-coverage-allowlist=<arg>, -fsanitize-coverage-whitelist=<arg>
Fangrui Songd8c97292020-06-18 14:52:39 -0700890
Fangrui Song2a4317b2020-06-19 22:22:47 -0700891Restrict sanitizer coverage instrumentation exclusively to modules and functions that match the provided special case list, except the blocked ones
Fangrui Songd8c97292020-06-18 14:52:39 -0700892
Konstantin Zhuravlyovb581c5a2020-10-09 08:29:53 -0400893.. option:: -fsanitize-coverage-blocklist=<arg>, -fsanitize-coverage-blacklist=<arg>
Fangrui Songd8c97292020-06-18 14:52:39 -0700894
Fangrui Song2a4317b2020-06-19 22:22:47 -0700895Disable sanitizer coverage instrumentation for modules and functions that match the provided special case list, even the allowed ones
Fangrui Songd8c97292020-06-18 14:52:39 -0700896
Richard Smith081ad4d2017-01-24 19:39:46 +0000897.. option:: -fsanitize-coverage=<arg1>,<arg2>..., -fno-sanitize-coverage=<arg1>,<arg2>...
898
899Specify the type of coverage instrumentation for Sanitizers
900
Craig Topper9624beb2020-03-10 11:08:19 -0700901.. option:: -fsanitize-hwaddress-abi=<arg>
902
903Select the HWAddressSanitizer ABI to target (interceptor or platform, default interceptor). This option is currently unused.
904
905.. option:: -fsanitize-link-c++-runtime, -fno-sanitize-link-c++-runtime
906
907.. option:: -fsanitize-link-runtime, -fno-sanitize-link-runtime
Richard Smith081ad4d2017-01-24 19:39:46 +0000908
Richard Smith081ad4d2017-01-24 19:39:46 +0000909.. option:: -fsanitize-memory-track-origins, -fno-sanitize-memory-track-origins
910
911Enable origins tracking in MemorySanitizer
912
Richard Smithb2c82a62017-01-27 01:54:42 +0000913.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +0000914.. option:: -fsanitize-memory-track-origins=<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +0000915.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +0000916
917Enable origins tracking in MemorySanitizer
918
Craig Topper16418662017-11-20 18:07:43 +0000919.. option:: -fsanitize-memory-use-after-dtor, -fno-sanitize-memory-use-after-dtor
Richard Smith081ad4d2017-01-24 19:39:46 +0000920
921Enable use-after-destroy detection in MemorySanitizer
922
Boris Kolpackovb150d242017-08-30 09:15:53 +0000923.. option:: -fsanitize-minimal-runtime, -fno-sanitize-minimal-runtime
924
Fangrui Songd8c97292020-06-18 14:52:39 -0700925.. option:: -fsanitize-recover=<arg1>,<arg2>..., -fno-sanitize-recover=<arg1>,<arg2>..., -fsanitize-recover (equivalent to -fsanitize-recover=all)
Richard Smith081ad4d2017-01-24 19:39:46 +0000926
927Enable recovery for specified sanitizers
928
Richard Smith081ad4d2017-01-24 19:39:46 +0000929.. option:: -fsanitize-stats, -fno-sanitize-stats
930
931Enable sanitizer statistics gathering.
932
Richard Smith081ad4d2017-01-24 19:39:46 +0000933.. option:: -fsanitize-thread-atomics, -fno-sanitize-thread-atomics
934
935Enable atomic operations instrumentation in ThreadSanitizer (default)
936
Richard Smith081ad4d2017-01-24 19:39:46 +0000937.. option:: -fsanitize-thread-func-entry-exit, -fno-sanitize-thread-func-entry-exit
938
939Enable function entry/exit instrumentation in ThreadSanitizer (default)
940
Richard Smith081ad4d2017-01-24 19:39:46 +0000941.. option:: -fsanitize-thread-memory-access, -fno-sanitize-thread-memory-access
942
943Enable memory access instrumentation in ThreadSanitizer (default)
944
Fangrui Songd8c97292020-06-18 14:52:39 -0700945.. option:: -fsanitize-trap=<arg1>,<arg2>..., -fno-sanitize-trap=<arg1>,<arg2>..., -fsanitize-trap (equivalent to -fsanitize-trap=all), -fsanitize-undefined-trap-on-error (equivalent to -fsanitize-trap=undefined)
Richard Smith081ad4d2017-01-24 19:39:46 +0000946
947Enable trapping for specified sanitizers
948
Richard Smith081ad4d2017-01-24 19:39:46 +0000949.. option:: -fsanitize-undefined-strip-path-components=<number>
950
951Strip (or keep only, if negative) a given number of path components when emitting check metadata.
952
Richard Smith081ad4d2017-01-24 19:39:46 +0000953.. option:: -fsanitize=<check>,<arg2>..., -fno-sanitize=<arg1>,<arg2>...
954
955Turn on runtime checks for various forms of undefined or suspicious behavior. See user manual for available checks
956
Vedant Kumar368540f2018-08-23 17:55:03 +0000957.. option:: -moutline, -mno-outline
958
959Enable function outlining (AArch64 only)
960
Richard Smith081ad4d2017-01-24 19:39:46 +0000961.. option:: --param <arg>, --param=<arg>
962
Craig Topper9624beb2020-03-10 11:08:19 -0700963.. option:: -print-supported-cpus, --print-supported-cpus, -mcpu=?, -mtune=?
964
965Print supported cpu models for the given target (if target is not specified, it will print the supported cpus for the default target)
966
Richard Smith081ad4d2017-01-24 19:39:46 +0000967.. option:: -std=<arg>, --std=<arg>, --std <arg>
968
969Language standard to compile for
970
Richard Smithc5b2e002017-01-27 02:08:37 +0000971Preprocessor flags
972~~~~~~~~~~~~~~~~~~
973
974Flags controlling the behavior of the Clang preprocessor.
975
976.. option:: -C, --comments
977
978Include comments in preprocessed output
979
980.. option:: -CC, --comments-in-macros
981
982Include comments from within macros in preprocessed output
983
984.. option:: -D<macro>=<value>, --define-macro <arg>, --define-macro=<arg>
985
986Define <macro> to <value> (or 1 if <value> omitted)
987
988.. option:: -H, --trace-includes
989
990Show header includes and nesting depth
991
992.. option:: -P, --no-line-commands
993
994Disable linemarker output in -E mode
995
996.. option:: -U<macro>, --undefine-macro <arg>, --undefine-macro=<arg>
997
998Undefine macro <macro>
999
1000.. option:: -Wp,<arg>,<arg2>...
1001
1002Pass the comma separated arguments in <arg> to the preprocessor
1003
1004.. option:: -Xpreprocessor <arg>
1005
1006Pass <arg> to the preprocessor
1007
Craig Topper9624beb2020-03-10 11:08:19 -07001008.. option:: -fmacro-prefix-map=<arg>
1009
1010remap file source paths in predefined preprocessor macros
1011
Richard Smith081ad4d2017-01-24 19:39:46 +00001012Include path management
Richard Smithc5b2e002017-01-27 02:08:37 +00001013-----------------------
Richard Smith081ad4d2017-01-24 19:39:46 +00001014
1015Flags controlling how ``#include``\s are resolved to files.
1016
Andrei Lebedev8dd4e3c2020-08-01 15:54:11 -07001017.. option:: -I<dir>, --include-directory <arg>, --include-directory=<arg>
Richard Smith081ad4d2017-01-24 19:39:46 +00001018
Andrei Lebedev8dd4e3c2020-08-01 15:54:11 -07001019Add directory to include search path. If there are multiple -I options, these directories are searched in the order they are given before the standard system directories are searched. If the same directory is in the SYSTEM include search paths, for example if also specified with -isystem, the -I option will be ignored
Richard Smith081ad4d2017-01-24 19:39:46 +00001020
Richard Smith081ad4d2017-01-24 19:39:46 +00001021.. option:: -I-, --include-barrier
1022
Richard Smithc5b2e002017-01-27 02:08:37 +00001023Restrict all prior -I flags to double-quoted inclusion and remove current directory from include path
1024
Jonas Hahnfelda180fc42018-02-22 17:10:28 +00001025.. option:: --cuda-path-ignore-env
1026
1027Ignore environment variables to detect CUDA installation
1028
Richard Smith081ad4d2017-01-24 19:39:46 +00001029.. option:: --cuda-path=<arg>
1030
1031CUDA installation path
1032
Richard Smith081ad4d2017-01-24 19:39:46 +00001033.. option:: -cxx-isystem<directory>
1034
1035Add directory to the C++ SYSTEM include search path
1036
Richard Smith081ad4d2017-01-24 19:39:46 +00001037.. option:: -fbuild-session-file=<file>
1038
1039Use the last modification time of <file> as the build session timestamp
1040
Richard Smith081ad4d2017-01-24 19:39:46 +00001041.. option:: -fbuild-session-timestamp=<time since Epoch in seconds>
1042
1043Time when the current build session started
1044
Boris Kolpackovb150d242017-08-30 09:15:53 +00001045.. option:: -fmodule-file=\[<name>=\]<file>
1046
1047Specify the mapping of module name to precompiled module file, or load a module file if name is omitted.
1048
Richard Smith081ad4d2017-01-24 19:39:46 +00001049.. option:: -fmodules-cache-path=<directory>
1050
1051Specify the module cache path
1052
Richard Smith081ad4d2017-01-24 19:39:46 +00001053.. option:: -fmodules-disable-diagnostic-validation
1054
1055Disable validation of the diagnostic options when loading the module
1056
Richard Smith081ad4d2017-01-24 19:39:46 +00001057.. option:: -fmodules-prune-after=<seconds>
1058
1059Specify the interval (in seconds) after which a module file will be considered unused
1060
Richard Smith081ad4d2017-01-24 19:39:46 +00001061.. option:: -fmodules-prune-interval=<seconds>
1062
1063Specify the interval (in seconds) between attempts to prune the module cache
1064
Richard Smith081ad4d2017-01-24 19:39:46 +00001065.. option:: -fmodules-user-build-path <directory>
1066
1067Specify the module user build path
1068
Richard Smith081ad4d2017-01-24 19:39:46 +00001069.. option:: -fmodules-validate-once-per-build-session
1070
1071Don't verify input files for the modules if the module has been successfully validated or loaded during this build session
1072
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00001073.. option:: -fmodules-validate-system-headers, -fno-modules-validate-system-headers
Richard Smith081ad4d2017-01-24 19:39:46 +00001074
1075Validate the system headers that a module depends on when loading the module
1076
Richard Smith081ad4d2017-01-24 19:39:46 +00001077.. option:: -fprebuilt-module-path=<directory>
1078
1079Specify the prebuilt module path
1080
Richard Smith081ad4d2017-01-24 19:39:46 +00001081.. option:: -idirafter<arg>, --include-directory-after <arg>, --include-directory-after=<arg>
1082
1083Add directory to AFTER include search path
1084
Richard Smith081ad4d2017-01-24 19:39:46 +00001085.. option:: -iframework<arg>
1086
1087Add directory to SYSTEM framework search path
1088
Richard Smith78e23fd2017-04-13 22:39:49 +00001089.. option:: -iframeworkwithsysroot<directory>
1090
1091Add directory to SYSTEM framework search path, absolute paths are relative to -isysroot
1092
Richard Smith081ad4d2017-01-24 19:39:46 +00001093.. option:: -imacros<file>, --imacros<file>, --imacros=<arg>
1094
1095Include macros from file before parsing
1096
Richard Smith081ad4d2017-01-24 19:39:46 +00001097.. option:: -include<file>, --include<file>, --include=<arg>
1098
1099Include file before parsing
1100
Richard Smith081ad4d2017-01-24 19:39:46 +00001101.. option:: -include-pch <file>
1102
1103Include precompiled header file
1104
Richard Smith081ad4d2017-01-24 19:39:46 +00001105.. option:: -iprefix<dir>, --include-prefix <arg>, --include-prefix=<arg>
1106
1107Set the -iwithprefix/-iwithprefixbefore prefix
1108
Richard Smith081ad4d2017-01-24 19:39:46 +00001109.. option:: -iquote<directory>
1110
1111Add directory to QUOTE include search path
1112
Richard Smith081ad4d2017-01-24 19:39:46 +00001113.. option:: -isysroot<dir>
1114
1115Set the system root directory (usually /)
1116
Richard Smith081ad4d2017-01-24 19:39:46 +00001117.. option:: -isystem<directory>
1118
1119Add directory to SYSTEM include search path
1120
Richard Smith081ad4d2017-01-24 19:39:46 +00001121.. option:: -isystem-after<directory>
1122
1123Add directory to end of the SYSTEM include search path
1124
Richard Smith081ad4d2017-01-24 19:39:46 +00001125.. option:: -ivfsoverlay<arg>
1126
1127Overlay the virtual filesystem described by file over the real file system
1128
Richard Smith081ad4d2017-01-24 19:39:46 +00001129.. option:: -iwithprefix<dir>, --include-with-prefix <arg>, --include-with-prefix-after <arg>, --include-with-prefix-after=<arg>, --include-with-prefix=<arg>
1130
1131Set directory to SYSTEM include search path with prefix
1132
Richard Smith081ad4d2017-01-24 19:39:46 +00001133.. option:: -iwithprefixbefore<dir>, --include-with-prefix-before <arg>, --include-with-prefix-before=<arg>
1134
1135Set directory to include search path with prefix
1136
Richard Smith081ad4d2017-01-24 19:39:46 +00001137.. option:: -iwithsysroot<directory>
1138
1139Add directory to SYSTEM include search path, absolute paths are relative to -isysroot
1140
Craig Topper9624beb2020-03-10 11:08:19 -07001141.. option:: --libomptarget-nvptx-path=<arg>
1142
1143Path to libomptarget-nvptx libraries
1144
Richard Smith081ad4d2017-01-24 19:39:46 +00001145.. option:: --ptxas-path=<arg>
1146
1147Path to ptxas (used for compiling CUDA code)
1148
Fangrui Songd8c97292020-06-18 14:52:39 -07001149.. option:: --rocm-path=<arg>
1150
1151ROCm installation path, used for finding and automatically linking required bitcode libraries.
1152
Craig Topper9624beb2020-03-10 11:08:19 -07001153.. program:: clang1
1154.. option:: -stdlib++-isystem<directory>
1155.. program:: clang
1156
1157Use directory as the C++ standard library include path
1158
Richard Smith081ad4d2017-01-24 19:39:46 +00001159.. option:: --system-header-prefix=<prefix>, --no-system-header-prefix=<prefix>, --system-header-prefix <arg>
1160
1161Treat all #include paths starting with <prefix> as including a system header.
1162
1163Dependency file generation
Richard Smithc5b2e002017-01-27 02:08:37 +00001164--------------------------
Richard Smith081ad4d2017-01-24 19:39:46 +00001165
1166Flags controlling generation of a dependency file for ``make``-like build
1167systems.
1168
Richard Smith081ad4d2017-01-24 19:39:46 +00001169.. option:: -M, --dependencies
1170
1171Like -MD, but also implies -E and writes to stdout by default
1172
Richard Smith081ad4d2017-01-24 19:39:46 +00001173.. option:: -MD, --write-dependencies
1174
1175Write a depfile containing user and system headers
1176
Richard Smith081ad4d2017-01-24 19:39:46 +00001177.. option:: -MF<file>
1178
1179Write depfile output from -MMD, -MD, -MM, or -M to <file>
1180
Richard Smith081ad4d2017-01-24 19:39:46 +00001181.. option:: -MG, --print-missing-file-dependencies
1182
1183Add missing headers to depfile
1184
Richard Smith081ad4d2017-01-24 19:39:46 +00001185.. option:: -MJ<arg>
1186
1187Write a compilation database entry per input
1188
Richard Smith081ad4d2017-01-24 19:39:46 +00001189.. option:: -MM, --user-dependencies
1190
1191Like -MMD, but also implies -E and writes to stdout by default
1192
Richard Smith081ad4d2017-01-24 19:39:46 +00001193.. option:: -MMD, --write-user-dependencies
1194
1195Write a depfile containing user headers
1196
Richard Smith081ad4d2017-01-24 19:39:46 +00001197.. option:: -MP
1198
1199Create phony target for each dependency (other than main file)
1200
Richard Smith081ad4d2017-01-24 19:39:46 +00001201.. option:: -MQ<arg>
1202
1203Specify name of main file output to quote in depfile
1204
Richard Smith081ad4d2017-01-24 19:39:46 +00001205.. option:: -MT<arg>
1206
1207Specify name of main file output in depfile
1208
Richard Smith081ad4d2017-01-24 19:39:46 +00001209.. option:: -MV
1210
1211Use NMake/Jom format for the depfile
1212
1213Dumping preprocessor state
Richard Smithc5b2e002017-01-27 02:08:37 +00001214--------------------------
Richard Smith081ad4d2017-01-24 19:39:46 +00001215
1216Flags allowing the state of the preprocessor to be dumped in various ways.
1217
Richard Smith081ad4d2017-01-24 19:39:46 +00001218.. option:: -d
1219
Richard Smithb2c82a62017-01-27 01:54:42 +00001220.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001221.. option:: -d<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +00001222.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001223
Richard Smith081ad4d2017-01-24 19:39:46 +00001224.. option:: -dD
1225
1226Print macro definitions in -E mode in addition to normal output
1227
Richard Smith081ad4d2017-01-24 19:39:46 +00001228.. option:: -dI
1229
1230Print include directives in -E mode in addition to normal output
1231
Richard Smith081ad4d2017-01-24 19:39:46 +00001232.. option:: -dM
1233
1234Print macro definitions in -E mode instead of normal output
1235
1236Diagnostic flags
1237~~~~~~~~~~~~~~~~
1238
1239Flags controlling which warnings, errors, and remarks Clang will generate.
1240See the :doc:`full list of warning and remark flags <DiagnosticsReference>`.
1241
Richard Smith081ad4d2017-01-24 19:39:46 +00001242.. option:: -R<remark>
1243
1244Enable the specified remark
1245
Richard Smith081ad4d2017-01-24 19:39:46 +00001246.. option:: -Rpass-analysis=<arg>
1247
1248Report transformation analysis from optimization passes whose name matches the given POSIX regular expression
1249
Richard Smith081ad4d2017-01-24 19:39:46 +00001250.. option:: -Rpass-missed=<arg>
1251
1252Report missed transformations by optimization passes whose name matches the given POSIX regular expression
1253
Richard Smith081ad4d2017-01-24 19:39:46 +00001254.. option:: -Rpass=<arg>
1255
1256Report transformations performed by optimization passes whose name matches the given POSIX regular expression
1257
Richard Smith081ad4d2017-01-24 19:39:46 +00001258.. option:: -W<warning>, --extra-warnings, --warn-<arg>, --warn-=<arg>
1259
1260Enable the specified warning
1261
Richard Smith081ad4d2017-01-24 19:39:46 +00001262.. option:: -Wdeprecated, -Wno-deprecated
1263
Richard Smithc5b2e002017-01-27 02:08:37 +00001264Enable warnings for deprecated constructs and define \_\_DEPRECATED
Richard Smith081ad4d2017-01-24 19:39:46 +00001265
Richard Smith081ad4d2017-01-24 19:39:46 +00001266.. option:: -Wnonportable-cfstrings<arg>, -Wno-nonportable-cfstrings<arg>
1267
Richard Smith081ad4d2017-01-24 19:39:46 +00001268Target-independent compilation options
1269~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Richard Smith081ad4d2017-01-24 19:39:46 +00001270.. option:: -Wframe-larger-than=<arg>
1271
Richard Smith081ad4d2017-01-24 19:39:46 +00001272.. option:: -fPIC, -fno-PIC
1273
Richard Smith081ad4d2017-01-24 19:39:46 +00001274.. option:: -fPIE, -fno-PIE
1275
Vedant Kumar368540f2018-08-23 17:55:03 +00001276.. option:: -faddrsig, -fno-addrsig
1277
1278Emit an address-significance table
1279
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00001280.. option:: -falign-functions, -fno-align-functions
1281
1282.. program:: clang1
1283.. option:: -falign-functions=<arg>
1284.. program:: clang
1285
Richard Smithb2c82a62017-01-27 01:54:42 +00001286.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001287.. option:: -faligned-allocation, -faligned-new, -fno-aligned-allocation
Richard Smithb2c82a62017-01-27 01:54:42 +00001288.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001289
1290Enable C++17 aligned allocation functions
1291
Craig Topperd23254a2017-07-20 17:52:48 +00001292.. option:: -fallow-editor-placeholders, -fno-allow-editor-placeholders
1293
1294Treat editor placeholders as valid source code
1295
Richard Smith081ad4d2017-01-24 19:39:46 +00001296.. option:: -fallow-unsupported
1297
Richard Smith78e23fd2017-04-13 22:39:49 +00001298.. option:: -faltivec, -fno-altivec
Richard Smith081ad4d2017-01-24 19:39:46 +00001299
Richard Smith081ad4d2017-01-24 19:39:46 +00001300.. option:: -fansi-escape-codes
1301
1302Use ANSI escape codes for diagnostics
1303
Richard Smith081ad4d2017-01-24 19:39:46 +00001304.. option:: -fapple-kext, -findirect-virtual-calls, -fterminated-vtables
1305
1306Use Apple's kernel extensions ABI
1307
Craig Topper9624beb2020-03-10 11:08:19 -07001308.. option:: -fapple-link-rtlib
1309
1310Force linking the clang builtins runtime library
1311
Richard Smith081ad4d2017-01-24 19:39:46 +00001312.. option:: -fapple-pragma-pack, -fno-apple-pragma-pack
1313
1314Enable Apple gcc-compatible #pragma pack handling
1315
Richard Smith081ad4d2017-01-24 19:39:46 +00001316.. option:: -fapplication-extension, -fno-application-extension
1317
1318Restrict code to those available for App Extensions
1319
Richard Smith081ad4d2017-01-24 19:39:46 +00001320.. option:: -fasm, -fno-asm
1321
Richard Smith081ad4d2017-01-24 19:39:46 +00001322.. option:: -fasm-blocks, -fno-asm-blocks
1323
Richard Smith081ad4d2017-01-24 19:39:46 +00001324.. option:: -fassociative-math, -fno-associative-math
1325
Richard Smith081ad4d2017-01-24 19:39:46 +00001326.. option:: -fassume-sane-operator-new, -fno-assume-sane-operator-new
1327
Richard Smith081ad4d2017-01-24 19:39:46 +00001328.. option:: -fast
1329
Richard Smith081ad4d2017-01-24 19:39:46 +00001330.. option:: -fastcp
1331
Richard Smith081ad4d2017-01-24 19:39:46 +00001332.. option:: -fastf
1333
Richard Smith081ad4d2017-01-24 19:39:46 +00001334.. option:: -fasynchronous-unwind-tables, -fno-asynchronous-unwind-tables
1335
Richard Smith081ad4d2017-01-24 19:39:46 +00001336.. option:: -fautolink, -fno-autolink
1337
Fangrui Songd8c97292020-06-18 14:52:39 -07001338.. option:: -fbasic-block-sections=<arg>
Sriraman Tallame0bca462020-06-01 23:17:29 -07001339
1340Generate labels for each basic block or place each basic block or a subset of basic blocks in its own section.
1341
Richard Smith081ad4d2017-01-24 19:39:46 +00001342.. option:: -fblocks, -fno-blocks
1343
1344Enable the 'blocks' language feature
1345
Richard Smith081ad4d2017-01-24 19:39:46 +00001346.. option:: -fbootclasspath=<arg>, --bootclasspath <arg>, --bootclasspath=<arg>
1347
Richard Smith081ad4d2017-01-24 19:39:46 +00001348.. option:: -fborland-extensions, -fno-borland-extensions
1349
1350Accept non-standard constructs supported by the Borland compiler
1351
Richard Smith081ad4d2017-01-24 19:39:46 +00001352.. option:: -fbracket-depth=<arg>
1353
Richard Smith081ad4d2017-01-24 19:39:46 +00001354.. option:: -fbuiltin, -fno-builtin
1355
Richard Smith081ad4d2017-01-24 19:39:46 +00001356.. option:: -fbuiltin-module-map
1357
1358Load the clang builtins module map file.
1359
Vedant Kumar368540f2018-08-23 17:55:03 +00001360.. option:: -fc++-static-destructors, -fno-c++-static-destructors
1361
Richard Smith081ad4d2017-01-24 19:39:46 +00001362.. option:: -fcaret-diagnostics, -fno-caret-diagnostics
1363
Craig Topper596527b2018-01-23 18:40:15 +00001364.. option:: -fcf-protection=<arg>, -fcf-protection (equivalent to -fcf-protection=full)
1365
1366Instrument control-flow architecture protection. Options: return, branch, full, none.
1367
Craig Topper9624beb2020-03-10 11:08:19 -07001368.. option:: -fcf-runtime-abi=<arg>
1369
Vedant Kumar368540f2018-08-23 17:55:03 +00001370.. option:: -fchar8\_t, -fno-char8\_t
1371
1372Enable C++ builtin type char8\_t
1373
Richard Smith081ad4d2017-01-24 19:39:46 +00001374.. option:: -fclasspath=<arg>, --CLASSPATH <arg>, --CLASSPATH=<arg>, --classpath <arg>, --classpath=<arg>
1375
Richard Smith081ad4d2017-01-24 19:39:46 +00001376.. option:: -fcolor-diagnostics, -fno-color-diagnostics
1377
Fangrui Songd8c97292020-06-18 14:52:39 -07001378Enable colors in diagnostics
Richard Smith081ad4d2017-01-24 19:39:46 +00001379
Richard Smith081ad4d2017-01-24 19:39:46 +00001380.. option:: -fcommon, -fno-common
1381
Craig Topper9624beb2020-03-10 11:08:19 -07001382Place uninitialized global variables in a common block
Sjoerd Meijer3d9a0442020-03-09 19:25:24 +00001383
Richard Smith081ad4d2017-01-24 19:39:46 +00001384.. option:: -fcompile-resource=<arg>, --resource <arg>, --resource=<arg>
1385
Richard Smith081ad4d2017-01-24 19:39:46 +00001386.. option:: -fconstant-cfstrings, -fno-constant-cfstrings
1387
Richard Smith081ad4d2017-01-24 19:39:46 +00001388.. option:: -fconstant-string-class=<arg>
1389
Richard Smith081ad4d2017-01-24 19:39:46 +00001390.. option:: -fconstexpr-backtrace-limit=<arg>
1391
Richard Smith081ad4d2017-01-24 19:39:46 +00001392.. option:: -fconstexpr-depth=<arg>
1393
Richard Smith081ad4d2017-01-24 19:39:46 +00001394.. option:: -fconstexpr-steps=<arg>
1395
Craig Topper9624beb2020-03-10 11:08:19 -07001396.. option:: -fconvergent-functions
1397
1398Assume functions may be convergent
1399
Richard Smith081ad4d2017-01-24 19:39:46 +00001400.. option:: -fcoroutines-ts, -fno-coroutines-ts
1401
1402Enable support for the C++ Coroutines TS
1403
Richard Smith081ad4d2017-01-24 19:39:46 +00001404.. option:: -fcoverage-mapping, -fno-coverage-mapping
1405
1406Generate coverage mapping to enable code coverage analysis
1407
Richard Smith081ad4d2017-01-24 19:39:46 +00001408.. option:: -fcreate-profile
1409
Craig Topper9624beb2020-03-10 11:08:19 -07001410.. option:: -fcs-profile-generate
1411
1412Generate instrumented code to collect context sensitive execution counts into default.profraw (overridden by LLVM\_PROFILE\_FILE env var)
1413
1414.. program:: clang1
1415.. option:: -fcs-profile-generate=<directory>
1416.. program:: clang
1417
1418Generate instrumented code to collect context sensitive execution counts into <directory>/default.profraw (overridden by LLVM\_PROFILE\_FILE env var)
1419
Fangrui Songd8c97292020-06-18 14:52:39 -07001420.. option:: -fcuda-approx-transcendentals, -fno-cuda-approx-transcendentals
1421
1422Use approximate transcendental functions
1423
1424.. option:: -fcuda-short-ptr, -fno-cuda-short-ptr
1425
1426Use 32-bit pointers for accessing const/local/shared address spaces
1427
Richard Smith081ad4d2017-01-24 19:39:46 +00001428.. option:: -fcxx-exceptions, -fno-cxx-exceptions
1429
1430Enable C++ exceptions
1431
Richard Smith081ad4d2017-01-24 19:39:46 +00001432.. option:: -fcxx-modules, -fno-cxx-modules
1433
Richard Smith081ad4d2017-01-24 19:39:46 +00001434.. option:: -fdata-sections, -fno-data-sections
1435
Craig Topper9624beb2020-03-10 11:08:19 -07001436Place each data in its own section
1437
1438.. option:: -fdebug-compilation-dir <arg>, -fdebug-compilation-dir=<arg>
1439
1440The compilation directory to embed in the debug info.
1441
1442.. option:: -fdebug-default-version=<arg>
1443
1444Default DWARF version to use, if a -g option caused DWARF debug info to be produced
Richard Smith081ad4d2017-01-24 19:39:46 +00001445
Richard Smith081ad4d2017-01-24 19:39:46 +00001446.. option:: -fdebug-info-for-profiling, -fno-debug-info-for-profiling
1447
Fangrui Songd8c97292020-06-18 14:52:39 -07001448Emit extra debug info to make sample profile more accurate
Richard Smith081ad4d2017-01-24 19:39:46 +00001449
Richard Smith78e23fd2017-04-13 22:39:49 +00001450.. option:: -fdebug-macro, -fno-debug-macro
1451
1452Emit macro debug information
1453
Richard Smith081ad4d2017-01-24 19:39:46 +00001454.. option:: -fdebug-pass-arguments
1455
Richard Smith081ad4d2017-01-24 19:39:46 +00001456.. option:: -fdebug-pass-structure
1457
Richard Smith081ad4d2017-01-24 19:39:46 +00001458.. option:: -fdebug-prefix-map=<arg>
1459
1460remap file source paths in debug info
1461
Craig Topper9624beb2020-03-10 11:08:19 -07001462.. option:: -fdebug-ranges-base-address, -fno-debug-ranges-base-address
1463
Fangrui Songd8c97292020-06-18 14:52:39 -07001464Use DWARF base address selection entries in .debug\_ranges
Craig Topper9624beb2020-03-10 11:08:19 -07001465
Richard Smith081ad4d2017-01-24 19:39:46 +00001466.. option:: -fdebug-types-section, -fno-debug-types-section
1467
1468Place debug types in their own section (ELF Only)
1469
Richard Smith081ad4d2017-01-24 19:39:46 +00001470.. option:: -fdelayed-template-parsing, -fno-delayed-template-parsing
1471
1472Parse templated function definitions at the end of the translation unit
1473
Vedant Kumar368540f2018-08-23 17:55:03 +00001474.. option:: -fdelete-null-pointer-checks, -fno-delete-null-pointer-checks
1475
Fangrui Songd8c97292020-06-18 14:52:39 -07001476Treat usage of null pointers as undefined behavior (default)
Vedant Kumar368540f2018-08-23 17:55:03 +00001477
Richard Smith081ad4d2017-01-24 19:39:46 +00001478.. option:: -fdenormal-fp-math=<arg>
1479
Richard Smith081ad4d2017-01-24 19:39:46 +00001480.. option:: -fdiagnostics-absolute-paths
1481
1482Print absolute paths in diagnostics
1483
Richard Smith081ad4d2017-01-24 19:39:46 +00001484.. option:: -fdiagnostics-color, -fno-diagnostics-color
1485
Richard Smithb2c82a62017-01-27 01:54:42 +00001486.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001487.. option:: -fdiagnostics-color=<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +00001488.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001489
Craig Topperd23254a2017-07-20 17:52:48 +00001490.. option:: -fdiagnostics-hotness-threshold=<number>
1491
1492Prevent optimization remarks from being output if they do not have at least this profile count
1493
Richard Smith081ad4d2017-01-24 19:39:46 +00001494.. option:: -fdiagnostics-show-hotness, -fno-diagnostics-show-hotness
1495
1496Enable profile hotness information in diagnostic line
1497
Richard Smith081ad4d2017-01-24 19:39:46 +00001498.. option:: -fdiagnostics-show-note-include-stack, -fno-diagnostics-show-note-include-stack
1499
1500Display include stacks for diagnostic notes
1501
Richard Smith081ad4d2017-01-24 19:39:46 +00001502.. option:: -fdiagnostics-show-option, -fno-diagnostics-show-option
1503
1504Print option name with mappable diagnostics
1505
Richard Smith081ad4d2017-01-24 19:39:46 +00001506.. option:: -fdiagnostics-show-template-tree
1507
1508Print a template comparison tree for differing templates
1509
Vedant Kumar368540f2018-08-23 17:55:03 +00001510.. option:: -fdigraphs, -fno-digraphs
1511
1512Enable alternative token representations '<:', ':>', '<%', '%>', '%:', '%:%:' (default)
1513
Richard Smith081ad4d2017-01-24 19:39:46 +00001514.. option:: -fdollars-in-identifiers, -fno-dollars-in-identifiers
1515
1516Allow '$' in identifiers
1517
Craig Topper16418662017-11-20 18:07:43 +00001518.. option:: -fdouble-square-bracket-attributes, -fno-double-square-bracket-attributes
1519
1520Enable '\[\[\]\]' attributes in all C and C++ language modes
1521
Richard Smith081ad4d2017-01-24 19:39:46 +00001522.. option:: -fdwarf-directory-asm, -fno-dwarf-directory-asm
1523
Craig Topper188252d2017-12-11 21:09:16 +00001524.. option:: -fdwarf-exceptions
1525
1526Use DWARF style exceptions
1527
Richard Smith081ad4d2017-01-24 19:39:46 +00001528.. option:: -felide-constructors, -fno-elide-constructors
1529
Richard Smith081ad4d2017-01-24 19:39:46 +00001530.. option:: -feliminate-unused-debug-symbols, -fno-eliminate-unused-debug-symbols
1531
Konstantin Zhuravlyovb581c5a2020-10-09 08:29:53 -04001532.. option:: -feliminate-unused-debug-types, -fno-eliminate-unused-debug-types
1533
1534Do not emit debug info for defined but unused types
1535
Richard Smith081ad4d2017-01-24 19:39:46 +00001536.. option:: -fembed-bitcode=<option>, -fembed-bitcode (equivalent to -fembed-bitcode=all), -fembed-bitcode-marker (equivalent to -fembed-bitcode=marker)
1537
1538Embed LLVM bitcode (option: off, all, bitcode, marker)
1539
Richard Smith081ad4d2017-01-24 19:39:46 +00001540.. option:: -femit-all-decls
1541
1542Emit all declarations, even if unused
1543
Richard Smith081ad4d2017-01-24 19:39:46 +00001544.. option:: -femulated-tls, -fno-emulated-tls
1545
1546Use emutls functions to access thread\_local variables
1547
Fangrui Songd8c97292020-06-18 14:52:39 -07001548.. option:: -fenable-matrix
1549
1550Enable matrix data type and related builtin functions
1551
Richard Smith081ad4d2017-01-24 19:39:46 +00001552.. option:: -fencoding=<arg>, --encoding <arg>, --encoding=<arg>
1553
Richard Smith081ad4d2017-01-24 19:39:46 +00001554.. option:: -ferror-limit=<arg>
1555
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00001556.. option:: -fescaping-block-tail-calls, -fno-escaping-block-tail-calls
1557
Richard Smith081ad4d2017-01-24 19:39:46 +00001558.. option:: -fexceptions, -fno-exceptions
1559
1560Enable support for exception handling
1561
Richard Smith081ad4d2017-01-24 19:39:46 +00001562.. option:: -fexec-charset=<arg>
1563
Craig Topper9624beb2020-03-10 11:08:19 -07001564.. option:: -fexperimental-new-constant-interpreter
1565
1566Enable the experimental new constant interpreter
1567
Fangrui Songd8c97292020-06-18 14:52:39 -07001568.. option:: -fexperimental-relative-c++-abi-vtables, -fno-experimental-relative-c++-abi-vtables
1569
1570Use the experimental C++ class ABI for classes with virtual tables
1571
Richard Smith081ad4d2017-01-24 19:39:46 +00001572.. option:: -fextdirs=<arg>, --extdirs <arg>, --extdirs=<arg>
1573
Richard Smith081ad4d2017-01-24 19:39:46 +00001574.. option:: -ffast-math, -fno-fast-math
1575
1576Allow aggressive, lossy floating-point optimizations
1577
Craig Topper9624beb2020-03-10 11:08:19 -07001578.. option:: -ffile-prefix-map=<arg>
1579
1580remap file source paths in debug info and predefined preprocessor macros
1581
Richard Smith081ad4d2017-01-24 19:39:46 +00001582.. option:: -ffinite-math-only, -fno-finite-math-only
1583
Vedant Kumar368540f2018-08-23 17:55:03 +00001584.. option:: -ffixed-point, -fno-fixed-point
1585
1586Enable fixed point types
1587
Richard Smith081ad4d2017-01-24 19:39:46 +00001588.. option:: -ffor-scope, -fno-for-scope
1589
Craig Topper9624beb2020-03-10 11:08:19 -07001590.. option:: -fforce-dwarf-frame, -fno-force-dwarf-frame
1591
1592Always emit a debug frame section
1593
Vedant Kumar368540f2018-08-23 17:55:03 +00001594.. option:: -fforce-emit-vtables, -fno-force-emit-vtables
1595
1596Emits more virtual tables to improve devirtualization
1597
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00001598.. option:: -fforce-enable-int128, -fno-force-enable-int128
1599
1600Enable support for int128\_t type
1601
Richard Smith081ad4d2017-01-24 19:39:46 +00001602.. option:: -ffp-contract=<arg>
1603
Craig Topper9624beb2020-03-10 11:08:19 -07001604Form fused FP ops (e.g. FMAs): fast (everywhere) \| on (according to FP\_CONTRACT pragma) \| off (never fuse). Default is 'fast' for CUDA/HIP and 'on' otherwise.
1605
1606.. option:: -ffp-exception-behavior=<arg>
1607
1608Specifies the exception behavior of floating-point operations.
1609
1610.. option:: -ffp-model=<arg>
1611
1612Controls the semantics of floating-point calculations.
Richard Smith081ad4d2017-01-24 19:39:46 +00001613
Richard Smith081ad4d2017-01-24 19:39:46 +00001614.. option:: -ffreestanding
1615
1616Assert that the compilation takes place in a freestanding environment
1617
Richard Smith081ad4d2017-01-24 19:39:46 +00001618.. option:: -ffunction-sections, -fno-function-sections
1619
Craig Topper9624beb2020-03-10 11:08:19 -07001620Place each function in its own section
Richard Smith081ad4d2017-01-24 19:39:46 +00001621
Richard Smith081ad4d2017-01-24 19:39:46 +00001622.. option:: -fgnu-inline-asm, -fno-gnu-inline-asm
1623
Richard Smith081ad4d2017-01-24 19:39:46 +00001624.. option:: -fgnu-keywords, -fno-gnu-keywords
1625
1626Allow GNU-extension keywords regardless of language standard
1627
Richard Smith081ad4d2017-01-24 19:39:46 +00001628.. option:: -fgnu-runtime
1629
1630Generate output compatible with the standard GNU Objective-C runtime
1631
Richard Smith081ad4d2017-01-24 19:39:46 +00001632.. option:: -fgnu89-inline, -fno-gnu89-inline
1633
1634Use the gnu89 inline semantics
1635
Craig Topper9624beb2020-03-10 11:08:19 -07001636.. option:: -fgnuc-version=<arg>
1637
1638Sets various macros to claim compatibility with the given GCC version (default is 4.2.1)
1639
Fangrui Songd8c97292020-06-18 14:52:39 -07001640.. option:: -fgpu-allow-device-init, -fno-gpu-allow-device-init
1641
1642Allow device side init function in HIP
1643
Tony661797b2020-10-28 22:20:51 +00001644.. option:: -fgpu-defer-diag, -fno-gpu-defer-diag
1645
1646Defer host/device related diagnostic messages for CUDA/HIP
1647
Fangrui Songd8c97292020-06-18 14:52:39 -07001648.. option:: -fgpu-rdc, -fcuda-rdc, -fno-gpu-rdc
1649
1650Generate relocatable device code, also known as separate compilation mode
1651
1652.. option:: -fhip-new-launch-api, -fno-hip-new-launch-api
1653
1654Use new kernel launching API for HIP
1655
Richard Smith081ad4d2017-01-24 19:39:46 +00001656.. option:: -fhonor-infinities, -fhonor-infinites, -fno-honor-infinities
1657
Richard Smith081ad4d2017-01-24 19:39:46 +00001658.. option:: -fhonor-nans, -fno-honor-nans
1659
Richard Smith081ad4d2017-01-24 19:39:46 +00001660.. option:: -fhosted
1661
Craig Topper9624beb2020-03-10 11:08:19 -07001662.. option:: -fignore-exceptions
1663
1664Enable support for ignoring exception handling constructs
1665
Richard Smith081ad4d2017-01-24 19:39:46 +00001666.. option:: -fimplicit-module-maps, -fmodule-maps, -fno-implicit-module-maps
1667
1668Implicitly search the file system for module map files.
1669
Richard Smith081ad4d2017-01-24 19:39:46 +00001670.. option:: -fimplicit-modules, -fno-implicit-modules
1671
Richard Smith081ad4d2017-01-24 19:39:46 +00001672.. option:: -finput-charset=<arg>
1673
Craig Topper188252d2017-12-11 21:09:16 +00001674.. option:: -finstrument-function-entry-bare
1675
1676Instrument function entry only, after inlining, without arguments to the instrumentation call
1677
Richard Smith081ad4d2017-01-24 19:39:46 +00001678.. option:: -finstrument-functions
1679
1680Generate calls to instrument function entry and exit
1681
Craig Topper16418662017-11-20 18:07:43 +00001682.. option:: -finstrument-functions-after-inlining
1683
1684Like -finstrument-functions, but insert the calls after inlining
1685
Richard Smith081ad4d2017-01-24 19:39:46 +00001686.. option:: -fintegrated-as, -fno-integrated-as, -integrated-as
1687
1688Enable the integrated assembler
1689
Craig Topper9624beb2020-03-10 11:08:19 -07001690.. option:: -fintegrated-cc1, -fno-integrated-cc1
1691
1692Run cc1 in-process
1693
Richard Smith081ad4d2017-01-24 19:39:46 +00001694.. option:: -fjump-tables, -fno-jump-tables
1695
Fangrui Songd8c97292020-06-18 14:52:39 -07001696Use jump tables for lowering switches
Vedant Kumar368540f2018-08-23 17:55:03 +00001697
Fangrui Songd8c97292020-06-18 14:52:39 -07001698.. option:: -fkeep-static-consts, -fno-keep-static-consts
1699
1700Keep static const variables if unused
Vedant Kumar368540f2018-08-23 17:55:03 +00001701
Craig Topper9624beb2020-03-10 11:08:19 -07001702.. option:: -flax-vector-conversions=<arg>, -flax-vector-conversions (equivalent to -flax-vector-conversions=integer), -fno-lax-vector-conversions (equivalent to -flax-vector-conversions=none)
1703
1704Enable implicit vector bit-casts
Richard Smith081ad4d2017-01-24 19:39:46 +00001705
Richard Smith081ad4d2017-01-24 19:39:46 +00001706.. option:: -flimited-precision=<arg>
1707
Richard Smith081ad4d2017-01-24 19:39:46 +00001708.. option:: -flto, -fno-lto
1709
1710Enable LTO in 'full' mode
1711
Richard Smith081ad4d2017-01-24 19:39:46 +00001712.. option:: -flto-jobs=<arg>
1713
1714Controls the backend parallelism of -flto=thin (default of 0 means the number of threads will be derived from the number of CPUs detected)
1715
Richard Smithb2c82a62017-01-27 01:54:42 +00001716.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001717.. option:: -flto=<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +00001718.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001719
1720Set LTO mode to either 'full' or 'thin'
1721
Richard Smith081ad4d2017-01-24 19:39:46 +00001722.. option:: -fmacro-backtrace-limit=<arg>
1723
Richard Smith081ad4d2017-01-24 19:39:46 +00001724.. option:: -fmath-errno, -fno-math-errno
1725
1726Require math functions to indicate errors by setting errno
1727
Craig Topper9624beb2020-03-10 11:08:19 -07001728.. option:: -fmax-tokens=<arg>
1729
1730Max total number of preprocessed tokens for -Wmax-tokens.
1731
Richard Smith081ad4d2017-01-24 19:39:46 +00001732.. option:: -fmax-type-align=<arg>
1733
1734Specify the maximum alignment to enforce on pointers lacking an explicit alignment
1735
Konstantin Zhuravlyovb581c5a2020-10-09 08:29:53 -04001736.. option:: -fmemory-profile, -fno-memory-profile
1737
1738Enable heap memory profiling
1739
Richard Smith081ad4d2017-01-24 19:39:46 +00001740.. option:: -fmerge-all-constants, -fno-merge-all-constants
1741
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00001742Allow merging of constants
1743
Richard Smith081ad4d2017-01-24 19:39:46 +00001744.. option:: -fmessage-length=<arg>
1745
Fangrui Songd8c97292020-06-18 14:52:39 -07001746Format message diagnostics so that they fit within N columns
1747
Richard Smith081ad4d2017-01-24 19:39:46 +00001748.. option:: -fmodule-file-deps, -fno-module-file-deps
1749
Richard Smith081ad4d2017-01-24 19:39:46 +00001750.. option:: -fmodule-map-file=<file>
1751
1752Load this module map file
1753
Richard Smith081ad4d2017-01-24 19:39:46 +00001754.. option:: -fmodule-name=<name>, -fmodule-implementation-of <arg>, -fmodule-name <arg>
1755
1756Specify the name of the module to build
1757
Richard Smith081ad4d2017-01-24 19:39:46 +00001758.. option:: -fmodules, -fno-modules
1759
1760Enable the 'modules' language feature
1761
Richard Smith081ad4d2017-01-24 19:39:46 +00001762.. option:: -fmodules-decluse, -fno-modules-decluse
1763
1764Require declaration of modules used within a module
1765
Richard Smith081ad4d2017-01-24 19:39:46 +00001766.. option:: -fmodules-ignore-macro=<arg>
1767
1768Ignore the definition of the given macro when building and loading modules
1769
Richard Smith081ad4d2017-01-24 19:39:46 +00001770.. option:: -fmodules-search-all, -fno-modules-search-all
1771
1772Search even non-imported modules to resolve references
1773
Richard Smith081ad4d2017-01-24 19:39:46 +00001774.. option:: -fmodules-strict-decluse
1775
1776Like -fmodules-decluse but requires all headers to be in modules
1777
Richard Smith081ad4d2017-01-24 19:39:46 +00001778.. option:: -fmodules-ts
1779
1780Enable support for the C++ Modules TS
1781
Craig Topper9624beb2020-03-10 11:08:19 -07001782.. option:: -fmodules-validate-input-files-content
1783
1784Validate PCM input files based on content if mtime differs
1785
Richard Smith081ad4d2017-01-24 19:39:46 +00001786.. option:: -fms-compatibility, -fno-ms-compatibility
1787
1788Enable full Microsoft Visual C++ compatibility
1789
Richard Smith081ad4d2017-01-24 19:39:46 +00001790.. option:: -fms-compatibility-version=<arg>
1791
1792Dot-separated value representing the Microsoft compiler version number to report in \_MSC\_VER (0 = don't define it (default))
1793
Richard Smith081ad4d2017-01-24 19:39:46 +00001794.. option:: -fms-extensions, -fno-ms-extensions
1795
1796Accept some non-standard constructs supported by the Microsoft compiler
1797
Richard Smith081ad4d2017-01-24 19:39:46 +00001798.. option:: -fms-memptr-rep=<arg>
1799
Craig Topper9624beb2020-03-10 11:08:19 -07001800.. option:: -fms-volatile
Richard Smith081ad4d2017-01-24 19:39:46 +00001801
Richard Smith081ad4d2017-01-24 19:39:46 +00001802.. option:: -fmsc-version=<arg>
1803
1804Microsoft compiler version number to report in \_MSC\_VER (0 = don't define it (default))
1805
Richard Smith081ad4d2017-01-24 19:39:46 +00001806.. option:: -fmudflap
1807
Richard Smith081ad4d2017-01-24 19:39:46 +00001808.. option:: -fmudflapth
1809
Richard Smith081ad4d2017-01-24 19:39:46 +00001810.. option:: -fnested-functions
1811
Richard Smith081ad4d2017-01-24 19:39:46 +00001812.. option:: -fnew-alignment=<align>, -fnew-alignment <arg>
1813
1814Specifies the largest alignment guaranteed by '::operator new(size\_t)'
1815
Richard Smith081ad4d2017-01-24 19:39:46 +00001816.. option:: -fnext-runtime
1817
Fangrui Songd8c97292020-06-18 14:52:39 -07001818.. option:: -fno-access-control, -fno-no-access-control
1819
Richard Smith081ad4d2017-01-24 19:39:46 +00001820.. option:: -fno-builtin-<arg>
1821
1822Disable implicit builtin knowledge of a specific function
1823
Richard Smith081ad4d2017-01-24 19:39:46 +00001824.. option:: -fno-elide-type
1825
1826Do not elide types when printing diagnostics
1827
Richard Smith081ad4d2017-01-24 19:39:46 +00001828.. option:: -fno-max-type-align
1829
Richard Smith081ad4d2017-01-24 19:39:46 +00001830.. option:: -fno-operator-names
1831
1832Do not treat C++ operator name keywords as synonyms for operators
1833
Richard Smith081ad4d2017-01-24 19:39:46 +00001834.. option:: -fno-strict-modules-decluse
1835
Craig Topper9624beb2020-03-10 11:08:19 -07001836.. option:: -fno-temp-file
1837
1838Directly create compilation output files. This may lead to incorrect incremental builds if the compiler crashes
1839
Richard Smith081ad4d2017-01-24 19:39:46 +00001840.. option:: -fno-working-directory
1841
Craig Topper9624beb2020-03-10 11:08:19 -07001842.. option:: -fno\_modules-validate-input-files-content
1843
1844.. program:: clang1
1845.. option:: -fno\_pch-validate-input-files-content
1846.. program:: clang
1847
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00001848.. option:: -fnoxray-link-deps
1849
Richard Smith081ad4d2017-01-24 19:39:46 +00001850.. option:: -fobjc-abi-version=<arg>
1851
Richard Smith081ad4d2017-01-24 19:39:46 +00001852.. option:: -fobjc-arc, -fno-objc-arc
1853
1854Synthesize retain and release calls for Objective-C pointers
1855
Richard Smith081ad4d2017-01-24 19:39:46 +00001856.. option:: -fobjc-arc-exceptions, -fno-objc-arc-exceptions
1857
1858Use EH-safe code when synthesizing retains and releases in -fobjc-arc
1859
Craig Topper9624beb2020-03-10 11:08:19 -07001860.. option:: -fobjc-convert-messages-to-runtime-calls, -fno-objc-convert-messages-to-runtime-calls
1861
Richard Smith081ad4d2017-01-24 19:39:46 +00001862.. option:: -fobjc-exceptions, -fno-objc-exceptions
1863
1864Enable Objective-C exceptions
1865
Richard Smith081ad4d2017-01-24 19:39:46 +00001866.. option:: -fobjc-infer-related-result-type, -fno-objc-infer-related-result-type
1867
Richard Smith081ad4d2017-01-24 19:39:46 +00001868.. option:: -fobjc-legacy-dispatch, -fno-objc-legacy-dispatch
1869
Richard Smith081ad4d2017-01-24 19:39:46 +00001870.. option:: -fobjc-link-runtime
1871
Richard Smith081ad4d2017-01-24 19:39:46 +00001872.. option:: -fobjc-nonfragile-abi, -fno-objc-nonfragile-abi
1873
Richard Smith081ad4d2017-01-24 19:39:46 +00001874.. option:: -fobjc-nonfragile-abi-version=<arg>
1875
Richard Smith081ad4d2017-01-24 19:39:46 +00001876.. option:: -fobjc-runtime=<arg>
1877
1878Specify the target Objective-C runtime kind and version
1879
Richard Smith081ad4d2017-01-24 19:39:46 +00001880.. option:: -fobjc-sender-dependent-dispatch
1881
Richard Smith081ad4d2017-01-24 19:39:46 +00001882.. option:: -fobjc-weak, -fno-objc-weak
1883
1884Enable ARC-style weak references in Objective-C
1885
Richard Smith081ad4d2017-01-24 19:39:46 +00001886.. option:: -fomit-frame-pointer, -fno-omit-frame-pointer
1887
Richard Smith081ad4d2017-01-24 19:39:46 +00001888.. option:: -fopenmp, -fno-openmp
1889
Jonas Hahnfelda180fc42018-02-22 17:10:28 +00001890Parse OpenMP pragmas and generate parallel code.
Boris Kolpackovb150d242017-08-30 09:15:53 +00001891
Craig Topper287c8012018-01-03 18:29:12 +00001892.. option:: -fopenmp-simd, -fno-openmp-simd
1893
1894Emit OpenMP code only for SIMD-based constructs.
1895
Richard Smith081ad4d2017-01-24 19:39:46 +00001896.. option:: -fopenmp-version=<arg>
1897
Richard Smithb2c82a62017-01-27 01:54:42 +00001898.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001899.. option:: -fopenmp=<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +00001900.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001901
Richard Smith081ad4d2017-01-24 19:39:46 +00001902.. option:: -foperator-arrow-depth=<arg>
1903
Francis Visoiu Mistrih3bd7cbb2019-12-04 10:19:41 -08001904.. option:: -foptimization-record-file=<file>
Richard Smith081ad4d2017-01-24 19:39:46 +00001905
Craig Topper9624beb2020-03-10 11:08:19 -07001906Specify the output name of the file containing the optimization remarks. Implies -fsave-optimization-record. On Darwin platforms, this cannot be used with multiple -arch <arch> options.
Francis Visoiu Mistrih3bd7cbb2019-12-04 10:19:41 -08001907
1908.. option:: -foptimization-record-passes=<regex>
1909
1910Only include passes which match a specified regular expression in the generated optimization record (by default, include all passes)
Richard Smith081ad4d2017-01-24 19:39:46 +00001911
Richard Smith081ad4d2017-01-24 19:39:46 +00001912.. option:: -foptimize-sibling-calls, -fno-optimize-sibling-calls
1913
Craig Topper9624beb2020-03-10 11:08:19 -07001914.. option:: -forder-file-instrumentation
1915
1916Generate instrumented code to collect order file into default.profraw file (overridden by '=' form of option or LLVM\_PROFILE\_FILE env var)
1917
Richard Smith081ad4d2017-01-24 19:39:46 +00001918.. option:: -foutput-class-dir=<arg>, --output-class-directory <arg>, --output-class-directory=<arg>
1919
Richard Smith081ad4d2017-01-24 19:39:46 +00001920.. option:: -fpack-struct, -fno-pack-struct
1921
Richard Smithb2c82a62017-01-27 01:54:42 +00001922.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001923.. option:: -fpack-struct=<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +00001924.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001925
1926Specify the default maximum struct packing alignment
1927
Richard Smith081ad4d2017-01-24 19:39:46 +00001928.. option:: -fpascal-strings, -fno-pascal-strings, -mpascal-strings
1929
1930Recognize and construct Pascal-style string literals
1931
Craig Topper9624beb2020-03-10 11:08:19 -07001932.. option:: -fpass-plugin=<dsopath>
1933
1934Load pass plugin from a dynamic shared object file (only with new pass manager).
1935
1936.. option:: -fpatchable-function-entry=<N,M>
1937
1938Generate M NOPs before function entry and N-M NOPs after function entry
1939
Richard Smith081ad4d2017-01-24 19:39:46 +00001940.. option:: -fpcc-struct-return
1941
1942Override the default ABI to return all structs on the stack
1943
Konstantin Zhuravlyovb581c5a2020-10-09 08:29:53 -04001944.. option:: -fpch-codegen, -fno-pch-codegen
1945
1946Generate code for uses of this PCH that assumes an explicit object file will be built for the PCH
1947
1948.. option:: -fpch-debuginfo, -fno-pch-debuginfo
1949
1950Generate debug info for types in an object file built from this PCH and do not generate them elsewhere
1951
1952.. option:: -fpch-instantiate-templates, -fno-pch-instantiate-templates
1953
1954Instantiate templates already while building a PCH
1955
Richard Smith081ad4d2017-01-24 19:39:46 +00001956.. option:: -fpch-preprocess
1957
Craig Topper9624beb2020-03-10 11:08:19 -07001958.. option:: -fpch-validate-input-files-content
1959
1960Validate PCH input files based on content if mtime differs
1961
Richard Smith081ad4d2017-01-24 19:39:46 +00001962.. option:: -fpic, -fno-pic
1963
Richard Smith081ad4d2017-01-24 19:39:46 +00001964.. option:: -fpie, -fno-pie
1965
Craig Topper16418662017-11-20 18:07:43 +00001966.. option:: -fplt, -fno-plt
1967
Richard Smith081ad4d2017-01-24 19:39:46 +00001968.. option:: -fplugin=<dsopath>
1969
1970Load the named plugin (dynamic shared object)
1971
Richard Smith081ad4d2017-01-24 19:39:46 +00001972.. option:: -fpreserve-as-comments, -fno-preserve-as-comments
1973
Richard Smith081ad4d2017-01-24 19:39:46 +00001974.. option:: -fprofile-arcs, -fno-profile-arcs
1975
Richard Smith081ad4d2017-01-24 19:39:46 +00001976.. option:: -fprofile-dir=<arg>
1977
Craig Topper9624beb2020-03-10 11:08:19 -07001978.. option:: -fprofile-exclude-files=<arg>
1979
1980Instrument only functions from files where names don't match all the regexes separated by a semi-colon
1981
1982.. option:: -fprofile-filter-files=<arg>
1983
1984Instrument only functions from files where names match any regex separated by a semi-colon
1985
Richard Smith081ad4d2017-01-24 19:39:46 +00001986.. option:: -fprofile-generate, -fno-profile-generate
1987
1988Generate instrumented code to collect execution counts into default.profraw (overridden by LLVM\_PROFILE\_FILE env var)
1989
Richard Smithb2c82a62017-01-27 01:54:42 +00001990.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00001991.. option:: -fprofile-generate=<directory>
Richard Smithb2c82a62017-01-27 01:54:42 +00001992.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00001993
1994Generate instrumented code to collect execution counts into <directory>/default.profraw (overridden by LLVM\_PROFILE\_FILE env var)
1995
Richard Smith081ad4d2017-01-24 19:39:46 +00001996.. option:: -fprofile-instr-generate, -fno-profile-instr-generate
1997
1998Generate instrumented code to collect execution counts into default.profraw file (overridden by '=' form of option or LLVM\_PROFILE\_FILE env var)
1999
Richard Smithb2c82a62017-01-27 01:54:42 +00002000.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00002001.. option:: -fprofile-instr-generate=<file>
Richard Smithb2c82a62017-01-27 01:54:42 +00002002.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00002003
2004Generate instrumented code to collect execution counts into <file> (overridden by LLVM\_PROFILE\_FILE env var)
2005
Richard Smith081ad4d2017-01-24 19:39:46 +00002006.. option:: -fprofile-instr-use, -fno-profile-instr-use, -fprofile-use
2007
Richard Smithb2c82a62017-01-27 01:54:42 +00002008.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00002009.. option:: -fprofile-instr-use=<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +00002010.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00002011
2012Use instrumentation data for profile-guided optimization
2013
Craig Topper9624beb2020-03-10 11:08:19 -07002014.. option:: -fprofile-remapping-file=<file>, -fprofile-remapping-file <arg>
2015
2016Use the remappings described in <file> to match the profile data against names in the program
2017
Boris Kolpackovb150d242017-08-30 09:15:53 +00002018.. option:: -fprofile-sample-accurate, -fauto-profile-accurate, -fno-profile-sample-accurate
2019
2020Specifies that the sample profile is accurate. If the sample
2021 profile is accurate, callsites without profile samples are marked
2022 as cold. Otherwise, treat callsites without profile samples as if
2023 we have no profile
2024
Richard Smith78e23fd2017-04-13 22:39:49 +00002025.. option:: -fprofile-sample-use, -fauto-profile, -fno-profile-sample-use
2026
2027.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00002028.. option:: -fprofile-sample-use=<arg>, -fauto-profile=<arg>
Richard Smith78e23fd2017-04-13 22:39:49 +00002029.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00002030
2031Enable sample-based profile guided optimizations
2032
Konstantin Zhuravlyovb581c5a2020-10-09 08:29:53 -04002033.. option:: -fprofile-update=<method>
2034
2035Set update method of profile counters (atomic,prefer-atomic,single)
2036
Richard Smithb2c82a62017-01-27 01:54:42 +00002037.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00002038.. option:: -fprofile-use=<pathname>
Richard Smithb2c82a62017-01-27 01:54:42 +00002039.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00002040
2041Use instrumentation data for profile-guided optimization. If pathname is a directory, it reads from <pathname>/default.profdata. Otherwise, it reads from file <pathname>.
2042
Richard Smith081ad4d2017-01-24 19:39:46 +00002043.. option:: -freciprocal-math, -fno-reciprocal-math
2044
2045Allow division operations to be reassociated
2046
Richard Smith081ad4d2017-01-24 19:39:46 +00002047.. option:: -freg-struct-return
2048
2049Override the default ABI to return small structs in registers
2050
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00002051.. option:: -fregister-global-dtors-with-atexit, -fno-register-global-dtors-with-atexit
2052
2053Use atexit or \_\_cxa\_atexit to register global destructors
2054
Richard Smith081ad4d2017-01-24 19:39:46 +00002055.. option:: -frelaxed-template-template-args, -fno-relaxed-template-template-args
2056
2057Enable C++17 relaxed template template argument matching
2058
Richard Smith081ad4d2017-01-24 19:39:46 +00002059.. option:: -freroll-loops, -fno-reroll-loops
2060
2061Turn on loop reroller
2062
Richard Smith081ad4d2017-01-24 19:39:46 +00002063.. option:: -fretain-comments-from-system-headers
2064
Craig Topperd23254a2017-07-20 17:52:48 +00002065.. option:: -frewrite-imports, -fno-rewrite-imports
2066
Richard Smith081ad4d2017-01-24 19:39:46 +00002067.. option:: -frewrite-includes, -fno-rewrite-includes
2068
Richard Smith081ad4d2017-01-24 19:39:46 +00002069.. option:: -frewrite-map-file <arg>
2070
Richard Smithb2c82a62017-01-27 01:54:42 +00002071.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00002072.. option:: -frewrite-map-file=<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +00002073.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00002074
Richard Smith081ad4d2017-01-24 19:39:46 +00002075.. option:: -fropi, -fno-ropi
2076
Fangrui Songd8c97292020-06-18 14:52:39 -07002077Generate read-only position independent code (ARM only)
2078
Craig Topper9624beb2020-03-10 11:08:19 -07002079.. option:: -frounding-math, -fno-rounding-math
2080
Richard Smith081ad4d2017-01-24 19:39:46 +00002081.. option:: -frtti, -fno-rtti
2082
Fangrui Songd8c97292020-06-18 14:52:39 -07002083.. option:: -frtti-data, -fno-rtti-data
2084
Richard Smith081ad4d2017-01-24 19:39:46 +00002085.. option:: -frwpi, -fno-rwpi
2086
Fangrui Songd8c97292020-06-18 14:52:39 -07002087Generate read-write position independent code (ARM only)
2088
Richard Smith081ad4d2017-01-24 19:39:46 +00002089.. option:: -fsave-optimization-record, -fno-save-optimization-record
2090
2091Generate a YAML optimization record file
2092
Francis Visoiu Mistrih3bd7cbb2019-12-04 10:19:41 -08002093.. program:: clang1
2094.. option:: -fsave-optimization-record=<format>
2095.. program:: clang
2096
Craig Topper9624beb2020-03-10 11:08:19 -07002097Generate an optimization record file in a specific format
Francis Visoiu Mistrih3bd7cbb2019-12-04 10:19:41 -08002098
Craig Topper188252d2017-12-11 21:09:16 +00002099.. option:: -fseh-exceptions
2100
2101Use SEH style exceptions
2102
Craig Topper9624beb2020-03-10 11:08:19 -07002103.. option:: -fsemantic-interposition, -fno-semantic-interposition
2104
Richard Smith081ad4d2017-01-24 19:39:46 +00002105.. option:: -fshort-enums, -fno-short-enums
2106
2107Allocate to an enum type only as many bytes as it needs for the declared range of possible values
2108
Richard Smith081ad4d2017-01-24 19:39:46 +00002109.. option:: -fshort-wchar, -fno-short-wchar
2110
2111Force wchar\_t to be a short unsigned int
2112
Richard Smith081ad4d2017-01-24 19:39:46 +00002113.. option:: -fshow-column, -fno-show-column
2114
Richard Smith081ad4d2017-01-24 19:39:46 +00002115.. option:: -fshow-overloads=<arg>
2116
2117Which overload candidates to show when overload resolution fails: best\|all; defaults to all
2118
Richard Smith081ad4d2017-01-24 19:39:46 +00002119.. option:: -fshow-source-location, -fno-show-source-location
2120
Richard Smith081ad4d2017-01-24 19:39:46 +00002121.. option:: -fsignaling-math, -fno-signaling-math
2122
Richard Smith081ad4d2017-01-24 19:39:46 +00002123.. option:: -fsigned-bitfields
2124
Richard Smith081ad4d2017-01-24 19:39:46 +00002125.. option:: -fsigned-char, -fno-signed-char, --signed-char
2126
Fangrui Songd8c97292020-06-18 14:52:39 -07002127char is signed
2128
Richard Smith081ad4d2017-01-24 19:39:46 +00002129.. option:: -fsigned-zeros, -fno-signed-zeros
2130
Richard Smith081ad4d2017-01-24 19:39:46 +00002131.. option:: -fsized-deallocation, -fno-sized-deallocation
2132
2133Enable C++14 sized global deallocation functions
2134
Richard Smith081ad4d2017-01-24 19:39:46 +00002135.. option:: -fsjlj-exceptions
2136
2137Use SjLj style exceptions
2138
Richard Smith081ad4d2017-01-24 19:39:46 +00002139.. option:: -fslp-vectorize, -fno-slp-vectorize, -ftree-slp-vectorize
2140
2141Enable the superword-level parallelism vectorization passes
2142
Richard Smith081ad4d2017-01-24 19:39:46 +00002143.. option:: -fspell-checking, -fno-spell-checking
2144
Richard Smith081ad4d2017-01-24 19:39:46 +00002145.. option:: -fspell-checking-limit=<arg>
2146
Richard Smith081ad4d2017-01-24 19:39:46 +00002147.. option:: -fsplit-dwarf-inlining, -fno-split-dwarf-inlining
2148
Jonas Hahnfelda180fc42018-02-22 17:10:28 +00002149Provide minimal debug info in the object/executable to facilitate online symbolication/stack traces in the absence of .dwo/.dwp files when using Split DWARF
Richard Smith081ad4d2017-01-24 19:39:46 +00002150
Craig Topper9624beb2020-03-10 11:08:19 -07002151.. option:: -fsplit-lto-unit, -fno-split-lto-unit
2152
Fangrui Songd8c97292020-06-18 14:52:39 -07002153Enables splitting of the LTO unit
Craig Topper9624beb2020-03-10 11:08:19 -07002154
Konstantin Zhuravlyovb581c5a2020-10-09 08:29:53 -04002155.. option:: -fsplit-machine-functions, -fno-split-machine-functions
2156
2157Enable late function splitting using profile information (x86 ELF)
2158
Richard Smith081ad4d2017-01-24 19:39:46 +00002159.. option:: -fsplit-stack
2160
Konstantin Zhuravlyovb581c5a2020-10-09 08:29:53 -04002161.. option:: -fstack-clash-protection, -fno-stack-clash-protection
Craig Topper9624beb2020-03-10 11:08:19 -07002162
2163Enable stack clash protection
2164
Richard Smith081ad4d2017-01-24 19:39:46 +00002165.. option:: -fstack-protector, -fno-stack-protector
2166
Konstantin Zhuravlyovb581c5a2020-10-09 08:29:53 -04002167Enable stack protectors for some functions vulnerable to stack smashing. This uses a loose heuristic which considers functions vulnerable if they contain a char (or 8bit integer) array or constant sized calls to alloca , which are of greater size than ssp-buffer-size (default: 8 bytes). All variable sized calls to alloca are considered vulnerable. A function with a stack protector has a guard value added to the stack frame that is checked on function exit. The guard value must be positioned in the stack frame such that a buffer overflow from a vulnerable variable will overwrite the guard value before overwriting the function's return address. The reference stack guard value is stored in a global variable.
Richard Smith081ad4d2017-01-24 19:39:46 +00002168
Richard Smith081ad4d2017-01-24 19:39:46 +00002169.. option:: -fstack-protector-all
2170
Craig Topper9624beb2020-03-10 11:08:19 -07002171Enable stack protectors for all functions
Richard Smith081ad4d2017-01-24 19:39:46 +00002172
Richard Smith081ad4d2017-01-24 19:39:46 +00002173.. option:: -fstack-protector-strong
2174
Craig Topper9624beb2020-03-10 11:08:19 -07002175Enable stack protectors for some functions vulnerable to stack smashing. Compared to -fstack-protector, this uses a stronger heuristic that includes functions containing arrays of any size (and any type), as well as any calls to alloca or the taking of an address from a local variable
Richard Smith081ad4d2017-01-24 19:39:46 +00002176
Craig Topper596527b2018-01-23 18:40:15 +00002177.. option:: -fstack-size-section, -fno-stack-size-section
2178
2179Emit section containing metadata on function stack sizes
2180
Richard Smith081ad4d2017-01-24 19:39:46 +00002181.. option:: -fstandalone-debug, -fno-limit-debug-info, -fno-standalone-debug
2182
2183Emit full debug info for all types used by the program
2184
Richard Smith081ad4d2017-01-24 19:39:46 +00002185.. option:: -fstrict-aliasing, -fno-strict-aliasing
2186
Richard Smith081ad4d2017-01-24 19:39:46 +00002187.. option:: -fstrict-enums, -fno-strict-enums
2188
2189Enable optimizations based on the strict definition of an enum's value range
2190
Vedant Kumar368540f2018-08-23 17:55:03 +00002191.. option:: -fstrict-float-cast-overflow, -fno-strict-float-cast-overflow
2192
2193Assume that overflowing float-to-int casts are undefined (default)
2194
Richard Smith081ad4d2017-01-24 19:39:46 +00002195.. option:: -fstrict-overflow, -fno-strict-overflow
2196
Richard Smith081ad4d2017-01-24 19:39:46 +00002197.. option:: -fstrict-return, -fno-strict-return
2198
Richard Smith081ad4d2017-01-24 19:39:46 +00002199.. option:: -fstrict-vtable-pointers, -fno-strict-vtable-pointers
2200
2201Enable optimizations based on the strict rules for overwriting polymorphic C++ objects
2202
Richard Smith081ad4d2017-01-24 19:39:46 +00002203.. option:: -fstruct-path-tbaa, -fno-struct-path-tbaa
2204
Craig Topper9624beb2020-03-10 11:08:19 -07002205.. option:: -fsymbol-partition=<arg>
2206
Richard Smith081ad4d2017-01-24 19:39:46 +00002207.. option:: -ftabstop=<arg>
2208
Richard Smith081ad4d2017-01-24 19:39:46 +00002209.. option:: -ftemplate-backtrace-limit=<arg>
2210
Richard Smith081ad4d2017-01-24 19:39:46 +00002211.. option:: -ftemplate-depth-<arg>
2212
Richard Smith081ad4d2017-01-24 19:39:46 +00002213.. option:: -ftemplate-depth=<arg>
2214
Fangrui Songd8c97292020-06-18 14:52:39 -07002215.. option:: -ftest-coverage, -fno-test-coverage
Richard Smith081ad4d2017-01-24 19:39:46 +00002216
Craig Topper9624beb2020-03-10 11:08:19 -07002217.. option:: -fthin-link-bitcode=<arg>
2218
2219Write minimized bitcode to <file> for the ThinLTO thin link only
2220
Richard Smith081ad4d2017-01-24 19:39:46 +00002221.. option:: -fthinlto-index=<arg>
2222
2223Perform ThinLTO importing using provided function summary index
2224
Richard Smith081ad4d2017-01-24 19:39:46 +00002225.. option:: -fthreadsafe-statics, -fno-threadsafe-statics
2226
Richard Smith081ad4d2017-01-24 19:39:46 +00002227.. option:: -ftime-report
2228
Anton Afanasyev4fdcabf2019-07-24 14:55:40 +00002229.. option:: -ftime-trace
2230
Craig Topper9624beb2020-03-10 11:08:19 -07002231
2232Turn on time profiler. Generates JSON file based on output filename. Results
2233can be analyzed with chrome://tracing or `Speedscope App
2234<https://www.speedscope.app>`_ for flamegraph visualization.
Anton Afanasyev4fdcabf2019-07-24 14:55:40 +00002235
2236.. option:: -ftime-trace-granularity=<arg>
2237
2238Minimum time granularity (in microseconds) traced by time profiler
2239
Richard Smith081ad4d2017-01-24 19:39:46 +00002240.. option:: -ftls-model=<arg>
2241
Richard Smith081ad4d2017-01-24 19:39:46 +00002242.. option:: -ftrap-function=<arg>
2243
2244Issue call to specified function rather than a trap instruction
2245
Richard Smith081ad4d2017-01-24 19:39:46 +00002246.. option:: -ftrapping-math, -fno-trapping-math
2247
Richard Smith081ad4d2017-01-24 19:39:46 +00002248.. option:: -ftrapv
2249
2250Trap on integer overflow
2251
Richard Smith081ad4d2017-01-24 19:39:46 +00002252.. option:: -ftrapv-handler <arg>
2253
Richard Smithb2c82a62017-01-27 01:54:42 +00002254.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00002255.. option:: -ftrapv-handler=<function name>
Richard Smithb2c82a62017-01-27 01:54:42 +00002256.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00002257
2258Specify the function to be called on overflow
2259
Richard Smith081ad4d2017-01-24 19:39:46 +00002260.. option:: -ftrigraphs, -fno-trigraphs, -trigraphs, --trigraphs
2261
2262Process trigraph sequences
2263
Fangrui Songd8c97292020-06-18 14:52:39 -07002264.. option:: -ftrivial-auto-var-init-stop-after=<arg>
2265
2266Stop initializing trivial automatic stack variables after the specified number of instances
2267
Craig Topper9624beb2020-03-10 11:08:19 -07002268.. option:: -ftrivial-auto-var-init=<arg>
2269
2270Initialize trivial automatic stack variables: uninitialized (default) \| pattern
2271
Fangrui Songd8c97292020-06-18 14:52:39 -07002272.. option:: -funique-basic-block-section-names, -fno-unique-basic-block-section-names
Richard Smith081ad4d2017-01-24 19:39:46 +00002273
Fangrui Songd8c97292020-06-18 14:52:39 -07002274Use unique names for basic block sections (ELF Only)
2275
2276.. option:: -funique-internal-linkage-names, -fno-unique-internal-linkage-names
2277
2278Uniqueify Internal Linkage Symbol Names by appending the MD5 hash of the module path
2279
2280.. option:: -funique-section-names, -fno-unique-section-names
Richard Smith081ad4d2017-01-24 19:39:46 +00002281
Richard Smith081ad4d2017-01-24 19:39:46 +00002282.. option:: -funit-at-a-time, -fno-unit-at-a-time
2283
Richard Smith081ad4d2017-01-24 19:39:46 +00002284.. option:: -funroll-loops, -fno-unroll-loops
2285
2286Turn on loop unroller
2287
Richard Smith081ad4d2017-01-24 19:39:46 +00002288.. option:: -funsafe-math-optimizations, -fno-unsafe-math-optimizations
2289
Richard Smith081ad4d2017-01-24 19:39:46 +00002290.. option:: -funsigned-bitfields
2291
Richard Smith081ad4d2017-01-24 19:39:46 +00002292.. option:: -funsigned-char, -fno-unsigned-char, --unsigned-char
2293
Richard Smith081ad4d2017-01-24 19:39:46 +00002294.. option:: -funwind-tables, -fno-unwind-tables
2295
Richard Smith081ad4d2017-01-24 19:39:46 +00002296.. option:: -fuse-cxa-atexit, -fno-use-cxa-atexit
2297
Richard Smith081ad4d2017-01-24 19:39:46 +00002298.. option:: -fuse-init-array, -fno-use-init-array
2299
Richard Smith081ad4d2017-01-24 19:39:46 +00002300.. option:: -fuse-ld=<arg>
2301
Richard Smith081ad4d2017-01-24 19:39:46 +00002302.. option:: -fuse-line-directives, -fno-use-line-directives
2303
Fangrui Songd8c97292020-06-18 14:52:39 -07002304Use #line in preprocessed output
2305
Craig Topper9624beb2020-03-10 11:08:19 -07002306.. option:: -fvalidate-ast-input-files-content
2307
2308Compute and store the hash of input files used to build an AST. Files with mismatching mtime's are considered valid if both contents is identical
2309
Richard Smith081ad4d2017-01-24 19:39:46 +00002310.. option:: -fveclib=<arg>
2311
2312Use the given vector functions library
2313
Richard Smith081ad4d2017-01-24 19:39:46 +00002314.. option:: -fvectorize, -fno-vectorize, -ftree-vectorize
2315
2316Enable the loop vectorization passes
2317
Craig Topper9624beb2020-03-10 11:08:19 -07002318.. option:: -fverbose-asm, -dA, -fno-verbose-asm
2319
Fangrui Songd8c97292020-06-18 14:52:39 -07002320Generate verbose assembly output
2321
2322.. option:: -fvirtual-function-elimination, -fno-virtual-function-elimination
Craig Topper9624beb2020-03-10 11:08:19 -07002323
2324Enables dead virtual function elimination optimization. Requires -flto=full
2325
2326.. option:: -fvisibility-global-new-delete-hidden
2327
2328Give global C++ operator new and delete declarations hidden visibility
Richard Smith081ad4d2017-01-24 19:39:46 +00002329
Richard Smith081ad4d2017-01-24 19:39:46 +00002330.. option:: -fvisibility-inlines-hidden
2331
Fangrui Songdf81b972018-07-19 22:45:41 +00002332Give inline C++ member functions hidden visibility by default
Richard Smith081ad4d2017-01-24 19:39:46 +00002333
Konstantin Zhuravlyovb581c5a2020-10-09 08:29:53 -04002334.. option:: -fvisibility-inlines-hidden-static-local-var, -fno-visibility-inlines-hidden-static-local-var
2335
2336When -fvisibility-inlines-hidden is enabled, static variables in inline C++ member functions will also be given hidden visibility by default
2337
Richard Smith081ad4d2017-01-24 19:39:46 +00002338.. option:: -fvisibility-ms-compat
2339
2340Give global types 'default' visibility and global functions and variables 'hidden' visibility by default
2341
Richard Smith081ad4d2017-01-24 19:39:46 +00002342.. option:: -fvisibility=<arg>
2343
2344Set the default symbol visibility for all global declarations
2345
Craig Topper9624beb2020-03-10 11:08:19 -07002346.. option:: -fwasm-exceptions
2347
2348Use WebAssembly style exceptions
2349
Richard Smith081ad4d2017-01-24 19:39:46 +00002350.. option:: -fwhole-program-vtables, -fno-whole-program-vtables
2351
2352Enables whole-program vtable optimization. Requires -flto
2353
Richard Smith081ad4d2017-01-24 19:39:46 +00002354.. option:: -fwrapv, -fno-wrapv
2355
2356Treat signed integer overflow as two's complement
2357
Richard Smith081ad4d2017-01-24 19:39:46 +00002358.. option:: -fwritable-strings
2359
2360Store string literals as writable data
2361
Craig Topper188252d2017-12-11 21:09:16 +00002362.. option:: -fxray-always-emit-customevents, -fno-xray-always-emit-customevents
2363
Fangrui Songd8c97292020-06-18 14:52:39 -07002364Always emit \_\_xray\_customevent(...) calls even if the containing function is not always instrumented
Craig Topper188252d2017-12-11 21:09:16 +00002365
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00002366.. option:: -fxray-always-emit-typedevents, -fno-xray-always-emit-typedevents
2367
Fangrui Songd8c97292020-06-18 14:52:39 -07002368Always emit \_\_xray\_typedevent(...) calls even if the containing function is not always instrumented
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00002369
Richard Smith78e23fd2017-04-13 22:39:49 +00002370.. option:: -fxray-always-instrument=<arg>
2371
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00002372DEPRECATED: Filename defining the whitelist for imbuing the 'always instrument' XRay attribute.
2373
2374.. option:: -fxray-attr-list=<arg>
2375
2376Filename defining the list of functions/types for imbuing XRay attributes.
Richard Smith78e23fd2017-04-13 22:39:49 +00002377
Konstantin Zhuravlyovb581c5a2020-10-09 08:29:53 -04002378.. option:: -fxray-function-groups=<arg>
2379
2380Only instrument 1 of N groups
2381
Fangrui Songd8c97292020-06-18 14:52:39 -07002382.. option:: -fxray-function-index, -fno-xray-function-index
2383
Craig Topper9624beb2020-03-10 11:08:19 -07002384.. option:: -fxray-ignore-loops, -fno-xray-ignore-loops
2385
2386Don't instrument functions with loops unless they also meet the minimum function size
2387
Richard Smith081ad4d2017-01-24 19:39:46 +00002388.. option:: -fxray-instruction-threshold<arg>
2389
Richard Smithb2c82a62017-01-27 01:54:42 +00002390.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00002391.. option:: -fxray-instruction-threshold=<arg>
Richard Smithb2c82a62017-01-27 01:54:42 +00002392.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00002393
2394Sets the minimum function size to instrument with XRay
2395
Richard Smith081ad4d2017-01-24 19:39:46 +00002396.. option:: -fxray-instrument, -fno-xray-instrument
2397
2398Generate XRay instrumentation sleds on function entry and exit
2399
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00002400.. option:: -fxray-instrumentation-bundle=<arg>
2401
Craig Topper9624beb2020-03-10 11:08:19 -07002402Select which XRay instrumentation points to emit. Options: all, none, function-entry, function-exit, function, custom. Default is 'all'. 'function' includes both 'function-entry' and 'function-exit'.
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00002403
2404.. option:: -fxray-link-deps
2405
2406Tells clang to add the link dependencies for XRay.
2407
2408.. option:: -fxray-modes=<arg>
2409
2410List of modes to link in by default into XRay instrumented binaries.
2411
Richard Smith78e23fd2017-04-13 22:39:49 +00002412.. option:: -fxray-never-instrument=<arg>
2413
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00002414DEPRECATED: Filename defining the whitelist for imbuing the 'never instrument' XRay attribute.
Richard Smith78e23fd2017-04-13 22:39:49 +00002415
Konstantin Zhuravlyovb581c5a2020-10-09 08:29:53 -04002416.. option:: -fxray-selected-function-group=<arg>
2417
2418When using -fxray-function-groups, select which group of functions to instrument. Valid range is 0 to fxray-function-groups - 1
2419
Richard Smith081ad4d2017-01-24 19:39:46 +00002420.. option:: -fzero-initialized-in-bss, -fno-zero-initialized-in-bss
2421
Richard Smith081ad4d2017-01-24 19:39:46 +00002422.. option:: -fzvector, -fno-zvector, -mzvector
2423
2424Enable System z vector language extension
2425
Richard Smith081ad4d2017-01-24 19:39:46 +00002426.. option:: -pedantic, --pedantic, -no-pedantic, --no-pedantic
2427
Richard Smith081ad4d2017-01-24 19:39:46 +00002428.. option:: -pedantic-errors, --pedantic-errors
2429
2430OpenCL flags
2431------------
Richard Smith081ad4d2017-01-24 19:39:46 +00002432.. option:: -cl-denorms-are-zero
2433
2434OpenCL only. Allow denormals to be flushed to zero.
2435
Richard Smith081ad4d2017-01-24 19:39:46 +00002436.. option:: -cl-fast-relaxed-math
2437
2438OpenCL only. Sets -cl-finite-math-only and -cl-unsafe-math-optimizations, and defines \_\_FAST\_RELAXED\_MATH\_\_.
2439
Richard Smith081ad4d2017-01-24 19:39:46 +00002440.. option:: -cl-finite-math-only
2441
2442OpenCL only. Allow floating-point optimizations that assume arguments and results are not NaNs or +-Inf.
2443
Richard Smith081ad4d2017-01-24 19:39:46 +00002444.. option:: -cl-fp32-correctly-rounded-divide-sqrt
2445
2446OpenCL only. Specify that single precision floating-point divide and sqrt used in the program source are correctly rounded.
2447
Richard Smith081ad4d2017-01-24 19:39:46 +00002448.. option:: -cl-kernel-arg-info
2449
2450OpenCL only. Generate kernel argument metadata.
2451
Richard Smith081ad4d2017-01-24 19:39:46 +00002452.. option:: -cl-mad-enable
2453
2454OpenCL only. Allow use of less precise MAD computations in the generated binary.
2455
Richard Smith081ad4d2017-01-24 19:39:46 +00002456.. option:: -cl-no-signed-zeros
2457
2458OpenCL only. Allow use of less precise no signed zeros computations in the generated binary.
2459
Richard Smith081ad4d2017-01-24 19:39:46 +00002460.. option:: -cl-opt-disable
2461
2462OpenCL only. This option disables all optimizations. By default optimizations are enabled.
2463
Richard Smith081ad4d2017-01-24 19:39:46 +00002464.. option:: -cl-single-precision-constant
2465
2466OpenCL only. Treat double precision floating-point constant as single precision constant.
2467
Richard Smith081ad4d2017-01-24 19:39:46 +00002468.. option:: -cl-std=<arg>
2469
2470OpenCL language standard to compile for.
2471
Richard Smith081ad4d2017-01-24 19:39:46 +00002472.. option:: -cl-strict-aliasing
2473
2474OpenCL only. This option is added for compatibility with OpenCL 1.0.
2475
Jonas Hahnfelda180fc42018-02-22 17:10:28 +00002476.. option:: -cl-uniform-work-group-size
2477
2478OpenCL only. Defines that the global work-size be a multiple of the work-group size specified to clEnqueueNDRangeKernel
2479
Richard Smith081ad4d2017-01-24 19:39:46 +00002480.. option:: -cl-unsafe-math-optimizations
2481
2482OpenCL only. Allow unsafe floating-point optimizations. Also implies -cl-no-signed-zeros and -cl-mad-enable.
2483
Craig Topper9624beb2020-03-10 11:08:19 -07002484SYCL flags
2485----------
2486.. option:: -fsycl, -fno-sycl
2487
2488Enable SYCL kernels compilation for device
2489
2490.. option:: -sycl-std=<arg>
2491
2492SYCL language standard to compile for.
2493
Richard Smith081ad4d2017-01-24 19:39:46 +00002494Target-dependent compilation options
2495~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Fangrui Songd8c97292020-06-18 14:52:39 -07002496.. option:: -G<size>, -G=<arg>, -msmall-data-limit=<arg>, -msmall-data-threshold=<arg>
Richard Smithc5b2e002017-01-27 02:08:37 +00002497
Fangrui Songd8c97292020-06-18 14:52:39 -07002498Put objects of at most <size> bytes into small data section (MIPS / Hexagon)
Richard Smithc5b2e002017-01-27 02:08:37 +00002499
Craig Topper9624beb2020-03-10 11:08:19 -07002500.. option:: -ffixed-x1
2501
Fangrui Songd8c97292020-06-18 14:52:39 -07002502Reserve the x1 register (AArch64/RISC-V only)
Craig Topper9624beb2020-03-10 11:08:19 -07002503
2504.. option:: -ffixed-x10
2505
Fangrui Songd8c97292020-06-18 14:52:39 -07002506Reserve the x10 register (AArch64/RISC-V only)
Craig Topper9624beb2020-03-10 11:08:19 -07002507
2508.. option:: -ffixed-x11
2509
Fangrui Songd8c97292020-06-18 14:52:39 -07002510Reserve the x11 register (AArch64/RISC-V only)
Craig Topper9624beb2020-03-10 11:08:19 -07002511
2512.. option:: -ffixed-x12
2513
Fangrui Songd8c97292020-06-18 14:52:39 -07002514Reserve the x12 register (AArch64/RISC-V only)
Craig Topper9624beb2020-03-10 11:08:19 -07002515
2516.. option:: -ffixed-x13
2517
Fangrui Songd8c97292020-06-18 14:52:39 -07002518Reserve the x13 register (AArch64/RISC-V only)
Craig Topper9624beb2020-03-10 11:08:19 -07002519
2520.. option:: -ffixed-x14
2521
Fangrui Songd8c97292020-06-18 14:52:39 -07002522Reserve the x14 register (AArch64/RISC-V only)
Craig Topper9624beb2020-03-10 11:08:19 -07002523
2524.. option:: -ffixed-x15
2525
Fangrui Songd8c97292020-06-18 14:52:39 -07002526Reserve the x15 register (AArch64/RISC-V only)
Craig Topper9624beb2020-03-10 11:08:19 -07002527
2528.. option:: -ffixed-x16
2529
Fangrui Songd8c97292020-06-18 14:52:39 -07002530Reserve the x16 register (AArch64/RISC-V only)
Craig Topper9624beb2020-03-10 11:08:19 -07002531
2532.. option:: -ffixed-x17
2533
Fangrui Songd8c97292020-06-18 14:52:39 -07002534Reserve the x17 register (AArch64/RISC-V only)
Craig Topper9624beb2020-03-10 11:08:19 -07002535
2536.. option:: -ffixed-x18
2537
Fangrui Songd8c97292020-06-18 14:52:39 -07002538Reserve the x18 register (AArch64/RISC-V only)
Craig Topper9624beb2020-03-10 11:08:19 -07002539
2540.. option:: -ffixed-x19
2541
Fangrui Songd8c97292020-06-18 14:52:39 -07002542Reserve the x19 register (AArch64/RISC-V only)
Craig Topper9624beb2020-03-10 11:08:19 -07002543
2544.. option:: -ffixed-x2
2545
Fangrui Songd8c97292020-06-18 14:52:39 -07002546Reserve the x2 register (AArch64/RISC-V only)
Craig Topper9624beb2020-03-10 11:08:19 -07002547
2548.. option:: -ffixed-x20
2549
Fangrui Songd8c97292020-06-18 14:52:39 -07002550Reserve the x20 register (AArch64/RISC-V only)
Craig Topper9624beb2020-03-10 11:08:19 -07002551
2552.. option:: -ffixed-x21
2553
Fangrui Songd8c97292020-06-18 14:52:39 -07002554Reserve the x21 register (AArch64/RISC-V only)
Craig Topper9624beb2020-03-10 11:08:19 -07002555
2556.. option:: -ffixed-x22
2557
Fangrui Songd8c97292020-06-18 14:52:39 -07002558Reserve the x22 register (AArch64/RISC-V only)
Craig Topper9624beb2020-03-10 11:08:19 -07002559
2560.. option:: -ffixed-x23
2561
Fangrui Songd8c97292020-06-18 14:52:39 -07002562Reserve the x23 register (AArch64/RISC-V only)
Craig Topper9624beb2020-03-10 11:08:19 -07002563
2564.. option:: -ffixed-x24
2565
Fangrui Songd8c97292020-06-18 14:52:39 -07002566Reserve the x24 register (AArch64/RISC-V only)
Craig Topper9624beb2020-03-10 11:08:19 -07002567
2568.. option:: -ffixed-x25
2569
Fangrui Songd8c97292020-06-18 14:52:39 -07002570Reserve the x25 register (AArch64/RISC-V only)
Craig Topper9624beb2020-03-10 11:08:19 -07002571
2572.. option:: -ffixed-x26
2573
Fangrui Songd8c97292020-06-18 14:52:39 -07002574Reserve the x26 register (AArch64/RISC-V only)
Craig Topper9624beb2020-03-10 11:08:19 -07002575
2576.. option:: -ffixed-x27
2577
Fangrui Songd8c97292020-06-18 14:52:39 -07002578Reserve the x27 register (AArch64/RISC-V only)
Craig Topper9624beb2020-03-10 11:08:19 -07002579
2580.. option:: -ffixed-x28
2581
Fangrui Songd8c97292020-06-18 14:52:39 -07002582Reserve the x28 register (AArch64/RISC-V only)
Craig Topper9624beb2020-03-10 11:08:19 -07002583
2584.. option:: -ffixed-x29
2585
Fangrui Songd8c97292020-06-18 14:52:39 -07002586Reserve the x29 register (AArch64/RISC-V only)
Craig Topper9624beb2020-03-10 11:08:19 -07002587
2588.. option:: -ffixed-x3
2589
Fangrui Songd8c97292020-06-18 14:52:39 -07002590Reserve the x3 register (AArch64/RISC-V only)
Craig Topper9624beb2020-03-10 11:08:19 -07002591
2592.. option:: -ffixed-x30
2593
Fangrui Songd8c97292020-06-18 14:52:39 -07002594Reserve the x30 register (AArch64/RISC-V only)
Craig Topper9624beb2020-03-10 11:08:19 -07002595
2596.. option:: -ffixed-x31
2597
Fangrui Songd8c97292020-06-18 14:52:39 -07002598Reserve the x31 register (AArch64/RISC-V only)
Craig Topper9624beb2020-03-10 11:08:19 -07002599
2600.. option:: -ffixed-x4
2601
Fangrui Songd8c97292020-06-18 14:52:39 -07002602Reserve the x4 register (AArch64/RISC-V only)
Craig Topper9624beb2020-03-10 11:08:19 -07002603
2604.. option:: -ffixed-x5
2605
Fangrui Songd8c97292020-06-18 14:52:39 -07002606Reserve the x5 register (AArch64/RISC-V only)
Craig Topper9624beb2020-03-10 11:08:19 -07002607
2608.. option:: -ffixed-x6
2609
Fangrui Songd8c97292020-06-18 14:52:39 -07002610Reserve the x6 register (AArch64/RISC-V only)
Craig Topper9624beb2020-03-10 11:08:19 -07002611
2612.. option:: -ffixed-x7
2613
Fangrui Songd8c97292020-06-18 14:52:39 -07002614Reserve the x7 register (AArch64/RISC-V only)
Craig Topper9624beb2020-03-10 11:08:19 -07002615
2616.. option:: -ffixed-x8
2617
Fangrui Songd8c97292020-06-18 14:52:39 -07002618Reserve the x8 register (AArch64/RISC-V only)
Craig Topper9624beb2020-03-10 11:08:19 -07002619
2620.. option:: -ffixed-x9
2621
Fangrui Songd8c97292020-06-18 14:52:39 -07002622Reserve the x9 register (AArch64/RISC-V only)
Craig Topper9624beb2020-03-10 11:08:19 -07002623
Richard Smith081ad4d2017-01-24 19:39:46 +00002624.. option:: -m16
2625
Richard Smith081ad4d2017-01-24 19:39:46 +00002626.. option:: -m32
2627
Richard Smith081ad4d2017-01-24 19:39:46 +00002628.. option:: -m64
2629
Richard Smith081ad4d2017-01-24 19:39:46 +00002630.. option:: -mabi=<arg>
2631
Fangrui Songd8c97292020-06-18 14:52:39 -07002632.. option:: -maix-struct-return
2633
2634Return all structs in memory (PPC32 only)
2635
Craig Topper9624beb2020-03-10 11:08:19 -07002636.. option:: -malign-branch-boundary=<arg>
2637
2638Specify the boundary's size to align branches
2639
Craig Topper9624beb2020-03-10 11:08:19 -07002640.. option:: -malign-branch=<arg1>,<arg2>...
2641
2642Specify types of branches to align
2643
Richard Smith081ad4d2017-01-24 19:39:46 +00002644.. option:: -malign-double
2645
2646Align doubles to two words in structs (x86 only)
2647
Richard Smith081ad4d2017-01-24 19:39:46 +00002648.. option:: -march=<arg>
2649
Richard Smith081ad4d2017-01-24 19:39:46 +00002650.. option:: -masm=<arg>
2651
Richard Smith081ad4d2017-01-24 19:39:46 +00002652.. option:: -mbackchain, -mno-backchain
2653
2654Link stack frames through backchain on System Z
2655
Craig Topper9624beb2020-03-10 11:08:19 -07002656.. option:: -mbranches-within-32B-boundaries
2657
2658Align selected branches (fused, jcc, jmp) within 32-byte boundary
2659
2660.. option:: -mcmodel=<arg>, -mcmodel=medany (equivalent to -mcmodel=medium), -mcmodel=medlow (equivalent to -mcmodel=small)
Richard Smith081ad4d2017-01-24 19:39:46 +00002661
Tony661797b2020-10-28 22:20:51 +00002662.. option:: -mcode-object-v3, -mno-code-object-v3
2663
2664Legacy option to specify code object ABI V2 (-mnocode-object-v3) or V3 (-mcode-object-v3) (AMDGPU only)
2665
Richard Smith081ad4d2017-01-24 19:39:46 +00002666.. option:: -mconsole<arg>
2667
Craig Topper9624beb2020-03-10 11:08:19 -07002668.. program:: clang1
2669.. option:: -mcpu=<arg>, -mv5 (equivalent to -mcpu=hexagonv5), -mv55 (equivalent to -mcpu=hexagonv55), -mv60 (equivalent to -mcpu=hexagonv60), -mv62 (equivalent to -mcpu=hexagonv62), -mv65 (equivalent to -mcpu=hexagonv65), -mv66 (equivalent to -mcpu=hexagonv66), -mv67 (equivalent to -mcpu=hexagonv67), -mv67t (equivalent to -mcpu=hexagonv67t)
2670.. program:: clang
Ziang Wande94ac92019-06-25 23:57:14 +00002671
Vedant Kumar368540f2018-08-23 17:55:03 +00002672.. option:: -mcrc, -mno-crc
2673
2674Allow use of CRC instructions (ARM/Mips only)
2675
Craig Topperd23254a2017-07-20 17:52:48 +00002676.. option:: -mdefault-build-attributes<arg>, -mno-default-build-attributes<arg>
2677
Richard Smith081ad4d2017-01-24 19:39:46 +00002678.. option:: -mdll<arg>
2679
Fangrui Songd8c97292020-06-18 14:52:39 -07002680.. option:: -mdouble=<arg>
2681
2682Force double to be 32 bits or 64 bits
2683
Richard Smith081ad4d2017-01-24 19:39:46 +00002684.. option:: -mdynamic-no-pic<arg>
2685
Richard Smith081ad4d2017-01-24 19:39:46 +00002686.. option:: -meabi <arg>
2687
2688Set EABI type, e.g. 4, 5 or gnu (default depends on triple)
2689
Fangrui Songd8c97292020-06-18 14:52:39 -07002690.. option:: -menable-experimental-extensions
2691
2692Enable use of experimental RISC-V extensions.
2693
Richard Smith78e23fd2017-04-13 22:39:49 +00002694.. option:: -mfentry
2695
Jonas Paulsson81aa62a2019-09-20 13:13:50 +00002696Insert calls to fentry at function entry (x86/SystemZ only)
Richard Smith78e23fd2017-04-13 22:39:49 +00002697
Richard Smith081ad4d2017-01-24 19:39:46 +00002698.. option:: -mfloat-abi=<arg>
2699
Richard Smith081ad4d2017-01-24 19:39:46 +00002700.. option:: -mfpmath=<arg>
2701
Richard Smith081ad4d2017-01-24 19:39:46 +00002702.. option:: -mfpu=<arg>
2703
Richard Smith081ad4d2017-01-24 19:39:46 +00002704.. option:: -mglobal-merge, -mno-global-merge
2705
2706Enable merging of globals
2707
Richard Smith081ad4d2017-01-24 19:39:46 +00002708.. option:: -mhard-float
2709
Richard Smith081ad4d2017-01-24 19:39:46 +00002710.. option:: -mhwdiv=<arg>, --mhwdiv <arg>, --mhwdiv=<arg>
2711
Craig Topper9624beb2020-03-10 11:08:19 -07002712.. option:: -mhwmult=<arg>
2713
Richard Smith081ad4d2017-01-24 19:39:46 +00002714.. option:: -miamcu, -mno-iamcu
2715
2716Use Intel MCU ABI
2717
Konstantin Zhuravlyovb581c5a2020-10-09 08:29:53 -04002718.. option:: -mignore-xcoff-visibility
2719
2720Not emit the visibility attribute for asm in AIX OS or give all symbols 'unspecified' visibility in XCOFF object file
2721
Richard Smith081ad4d2017-01-24 19:39:46 +00002722.. option:: -mimplicit-float, -mno-implicit-float
2723
Richard Smith081ad4d2017-01-24 19:39:46 +00002724.. option:: -mimplicit-it=<arg>
2725
Richard Smith081ad4d2017-01-24 19:39:46 +00002726.. option:: -mincremental-linker-compatible, -mno-incremental-linker-compatible
2727
2728(integrated-as) Emit an object file which can be used with an incremental linker
2729
Richard Smith78e23fd2017-04-13 22:39:49 +00002730.. option:: -miphoneos-version-min=<arg>, -mios-version-min=<arg>
Richard Smith081ad4d2017-01-24 19:39:46 +00002731
Richard Smith081ad4d2017-01-24 19:39:46 +00002732.. option:: -mkernel
2733
Richard Smith081ad4d2017-01-24 19:39:46 +00002734.. option:: -mlong-calls, -mno-long-calls
2735
2736Generate branches with extended addressability, usually via indirect jumps.
2737
Scott Constable5b519cf2020-04-02 21:59:47 -07002738.. option:: -mlvi-cfi, -mno-lvi-cfi
2739
2740Enable only control-flow mitigations for Load Value Injection (LVI)
2741
Fangrui Songd8c97292020-06-18 14:52:39 -07002742.. option:: -mlvi-hardening, -mno-lvi-hardening
2743
2744Enable all mitigations for Load Value Injection (LVI)
2745
Craig Topperd23254a2017-07-20 17:52:48 +00002746.. option:: -mmacosx-version-min=<arg>, -mmacos-version-min=<arg>
Richard Smith081ad4d2017-01-24 19:39:46 +00002747
Craig Topper9624beb2020-03-10 11:08:19 -07002748Set Mac OS X deployment target
Richard Smith081ad4d2017-01-24 19:39:46 +00002749
Craig Topperd23254a2017-07-20 17:52:48 +00002750.. option:: -mmcu=<arg>
2751
Richard Smith081ad4d2017-01-24 19:39:46 +00002752.. option:: -mms-bitfields, -mno-ms-bitfields
2753
2754Set the default structure layout to be compatible with the Microsoft compiler standard
2755
Craig Topper9624beb2020-03-10 11:08:19 -07002756.. option:: -mnop-mcount
2757
2758Generate mcount/\_\_fentry\_\_ calls as nops. To activate they need to be patched in.
2759
Richard Smith081ad4d2017-01-24 19:39:46 +00002760.. option:: -momit-leaf-frame-pointer, -mno-omit-leaf-frame-pointer
2761
2762Omit frame pointer setup for leaf functions
2763
Richard Smith081ad4d2017-01-24 19:39:46 +00002764.. option:: -moslib=<arg>
2765
Craig Topper9624beb2020-03-10 11:08:19 -07002766.. option:: -mpacked-stack, -mno-packed-stack
2767
2768Use packed stack layout (SystemZ only).
2769
Fangrui Songd8c97292020-06-18 14:52:39 -07002770.. option:: -mpad-max-prefix-size=<arg>
2771
2772Specify maximum number of prefixes to use for padding
2773
Richard Smith081ad4d2017-01-24 19:39:46 +00002774.. option:: -mpie-copy-relocations, -mno-pie-copy-relocations
2775
2776Use copy relocations support for PIE builds
2777
Craig Topper9a724aa2017-12-11 21:09:19 +00002778.. option:: -mprefer-vector-width=<arg>
2779
2780Specifies preferred vector width for auto-vectorization. Defaults to 'none' which allows target specific decisions.
2781
Richard Smith081ad4d2017-01-24 19:39:46 +00002782.. option:: -mqdsp6-compat
2783
2784Enable hexagon-qdsp6 backward compatibility
2785
Richard Smith081ad4d2017-01-24 19:39:46 +00002786.. option:: -mrecip
2787
Richard Smithb2c82a62017-01-27 01:54:42 +00002788.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00002789.. option:: -mrecip=<arg1>,<arg2>...
Richard Smithb2c82a62017-01-27 01:54:42 +00002790.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00002791
Craig Topper9624beb2020-03-10 11:08:19 -07002792.. option:: -mrecord-mcount
2793
2794Generate a \_\_mcount\_loc section entry for each \_\_fentry\_\_ call.
2795
Richard Smith081ad4d2017-01-24 19:39:46 +00002796.. option:: -mred-zone, -mno-red-zone
2797
Richard Smith081ad4d2017-01-24 19:39:46 +00002798.. option:: -mregparm=<arg>
2799
Konstantin Zhuravlyovb581c5a2020-10-09 08:29:53 -04002800.. option:: -mrelax, -mno-relax
2801
2802Enable linker relaxation
2803
Richard Smith081ad4d2017-01-24 19:39:46 +00002804.. option:: -mrelax-all, -mno-relax-all
2805
2806(integrated-as) Relax all machine instructions
2807
Vedant Kumar368540f2018-08-23 17:55:03 +00002808.. option:: -mretpoline, -mno-retpoline
2809
Richard Smith081ad4d2017-01-24 19:39:46 +00002810.. option:: -mrtd, -mno-rtd
2811
2812Make StdCall calling convention the default
2813
Zola Bridges9d9e4992020-05-13 11:25:08 -07002814.. option:: -mseses, -mno-seses
2815
2816Enable speculative execution side effect suppression (SESES). Includes LVI control flow integrity mitigations
2817
Vedant Kumar368540f2018-08-23 17:55:03 +00002818.. option:: -msign-return-address=<arg>
2819
2820Select return address signing scope
Richard Smith081ad4d2017-01-24 19:39:46 +00002821
Konstantin Zhuravlyovb581c5a2020-10-09 08:29:53 -04002822.. option:: -msim
2823
Richard Smith081ad4d2017-01-24 19:39:46 +00002824.. option:: -msoft-float, -mno-soft-float
2825
2826Use software floating point
2827
Craig Topper9624beb2020-03-10 11:08:19 -07002828.. option:: -mspeculative-load-hardening, -mno-speculative-load-hardening
2829
Richard Smith081ad4d2017-01-24 19:39:46 +00002830.. option:: -mstack-alignment=<arg>
2831
2832Set the stack alignment
2833
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00002834.. option:: -mstack-arg-probe, -mno-stack-arg-probe
2835
2836Enable stack probes
2837
Richard Smith081ad4d2017-01-24 19:39:46 +00002838.. option:: -mstack-probe-size=<arg>
2839
2840Set the stack probe size
2841
Tony661797b2020-10-28 22:20:51 +00002842.. option:: -mstack-protector-guard-offset=<arg>
2843
2844Use the given offset for addressing the stack-protector guard
2845
2846.. option:: -mstack-protector-guard-reg=<arg>
2847
2848Use the given reg for addressing the stack-protector guard
2849
2850.. option:: -mstack-protector-guard=<arg>
2851
2852Use the given guard (global, tls) for addressing the stack-protector guard
2853
Richard Smith081ad4d2017-01-24 19:39:46 +00002854.. option:: -mstackrealign, -mno-stackrealign
2855
2856Force realign the stack at entry to every function
2857
Fangrui Songd8c97292020-06-18 14:52:39 -07002858.. option:: -msvr4-struct-return
2859
2860Return small structs in registers (PPC32 only)
2861
Richard Smith081ad4d2017-01-24 19:39:46 +00002862.. option:: -mthread-model <arg>
2863
2864The thread model to use, e.g. posix, single (posix by default)
2865
Richard Smith081ad4d2017-01-24 19:39:46 +00002866.. option:: -mthreads<arg>
2867
Richard Smith081ad4d2017-01-24 19:39:46 +00002868.. option:: -mthumb, -mno-thumb
2869
Craig Topper9624beb2020-03-10 11:08:19 -07002870.. option:: -mtls-direct-seg-refs, -mno-tls-direct-seg-refs
Richard Smith081ad4d2017-01-24 19:39:46 +00002871
Craig Topper9624beb2020-03-10 11:08:19 -07002872Enable direct TLS access through segment registers (default)
2873
2874.. option:: -mtls-size=<arg>
2875
2876Specify bit size of immediate TLS offsets (AArch64 ELF only): 12 (for 4KB) \| 24 (for 16MB, default) \| 32 (for 4GB) \| 48 (for 256TB, needs -mcmodel=large)
2877
2878.. program:: clang1
2879.. option:: -mtune=<arg>
2880.. program:: clang
Ziang Wande94ac92019-06-25 23:57:14 +00002881
Tony661797b2020-10-28 22:20:51 +00002882Only supported on X86 and RISC-V. Otherwise accepted for compatibility with GCC.
Sjoerd Meijer35cf2f42020-04-22 08:49:02 +01002883
Richard Smith78e23fd2017-04-13 22:39:49 +00002884.. option:: -mtvos-version-min=<arg>, -mappletvos-version-min=<arg>
Richard Smith081ad4d2017-01-24 19:39:46 +00002885
Richard Smith081ad4d2017-01-24 19:39:46 +00002886.. option:: -municode<arg>
2887
Richard Smith081ad4d2017-01-24 19:39:46 +00002888.. option:: -mvx, -mno-vx
2889
Richard Smith081ad4d2017-01-24 19:39:46 +00002890.. option:: -mwarn-nonportable-cfstrings, -mno-warn-nonportable-cfstrings
2891
Richard Smith78e23fd2017-04-13 22:39:49 +00002892.. option:: -mwatchos-version-min=<arg>
Richard Smith081ad4d2017-01-24 19:39:46 +00002893
Craig Topper9624beb2020-03-10 11:08:19 -07002894.. option:: -mwavefrontsize64, -mno-wavefrontsize64
2895
Tony661797b2020-10-28 22:20:51 +00002896Specify wavefront size 64 mode (AMDGPU only)
Craig Topper9624beb2020-03-10 11:08:19 -07002897
Richard Smith081ad4d2017-01-24 19:39:46 +00002898.. option:: -mwindows<arg>
2899
Richard Smith081ad4d2017-01-24 19:39:46 +00002900.. option:: -mx32
2901
Richard Smith081ad4d2017-01-24 19:39:46 +00002902AARCH64
2903-------
Tri Vo28e7e602018-09-25 16:48:40 +00002904.. option:: -fcall-saved-x10
2905
2906Make the x10 register call-saved (AArch64 only)
2907
2908.. option:: -fcall-saved-x11
2909
2910Make the x11 register call-saved (AArch64 only)
2911
2912.. option:: -fcall-saved-x12
2913
2914Make the x12 register call-saved (AArch64 only)
2915
2916.. option:: -fcall-saved-x13
2917
2918Make the x13 register call-saved (AArch64 only)
2919
2920.. option:: -fcall-saved-x14
2921
2922Make the x14 register call-saved (AArch64 only)
2923
2924.. option:: -fcall-saved-x15
2925
2926Make the x15 register call-saved (AArch64 only)
2927
2928.. option:: -fcall-saved-x18
2929
2930Make the x18 register call-saved (AArch64 only)
2931
Craig Topper9624beb2020-03-10 11:08:19 -07002932.. option:: -fcall-saved-x8
2933
2934Make the x8 register call-saved (AArch64 only)
2935
2936.. option:: -fcall-saved-x9
2937
2938Make the x9 register call-saved (AArch64 only)
2939
Richard Smith081ad4d2017-01-24 19:39:46 +00002940.. option:: -mfix-cortex-a53-835769, -mno-fix-cortex-a53-835769
2941
2942Workaround Cortex-A53 erratum 835769 (AArch64 only)
2943
Richard Smith081ad4d2017-01-24 19:39:46 +00002944.. option:: -mgeneral-regs-only
2945
2946Generate code which only uses the general purpose registers (AArch64 only)
2947
Konstantin Zhuravlyovb581c5a2020-10-09 08:29:53 -04002948.. option:: -mmark-bti-property
2949
2950Add .note.gnu.property with BTI to assembly files (AArch64 only)
2951
2952.. option:: -msve-vector-bits=<arg>
2953
2954Specify the size in bits of an SVE vector register. Defaults to the vector length agnostic value of "scalable". (AArch64 only)
2955
Richard Smith081ad4d2017-01-24 19:39:46 +00002956AMDGPU
2957------
Stanislav Mekhanoshin91792f12019-05-13 23:15:59 +00002958.. option:: -mcumode, -mno-cumode
2959
Tony661797b2020-10-28 22:20:51 +00002960Specify CU (-mcumode) or WGP (-mno-cumode) wavefront execution mode (AMDGPU only)
Stanislav Mekhanoshin91792f12019-05-13 23:15:59 +00002961
Craig Topper9624beb2020-03-10 11:08:19 -07002962.. option:: -msram-ecc, -mno-sram-ecc
Stanislav Mekhanoshin8a8131a2019-06-13 23:47:59 +00002963
Tony661797b2020-10-28 22:20:51 +00002964Specify SRAM ECC mode (AMDGPU only)
Stanislav Mekhanoshin8a8131a2019-06-13 23:47:59 +00002965
Craig Topper16418662017-11-20 18:07:43 +00002966.. option:: -mxnack, -mno-xnack
2967
Tony661797b2020-10-28 22:20:51 +00002968Specify XNACK mode (AMDGPU only)
Craig Topper16418662017-11-20 18:07:43 +00002969
Richard Smith081ad4d2017-01-24 19:39:46 +00002970ARM
2971---
Tony661797b2020-10-28 22:20:51 +00002972.. option:: -faapcs-bitfield-load
Craig Topper9624beb2020-03-10 11:08:19 -07002973
2974Follows the AAPCS standard that all volatile bit-field write generates at least one load. (ARM only).
2975
Tony661797b2020-10-28 22:20:51 +00002976.. option:: -faapcs-bitfield-width, -fno-aapcs-bitfield-width
2977
2978Follow the AAPCS standard requirement stating that volatile bit-field width is dictated by the field container type. (ARM only).
2979
Richard Smith081ad4d2017-01-24 19:39:46 +00002980.. option:: -ffixed-r9
2981
2982Reserve the r9 register (ARM only)
2983
Craig Topper9624beb2020-03-10 11:08:19 -07002984.. option:: -mcmse
Momchil Velikovac215352020-01-29 10:38:10 +00002985
Craig Topper9624beb2020-03-10 11:08:19 -07002986Allow use of CMSE (Armv8-M Security Extensions)
Momchil Velikovac215352020-01-29 10:38:10 +00002987
Richard Smith081ad4d2017-01-24 19:39:46 +00002988.. option:: -mexecute-only, -mno-execute-only, -mpure-code
2989
2990Disallow generation of data access to code sections (ARM only)
2991
Richard Smith081ad4d2017-01-24 19:39:46 +00002992.. option:: -mno-movt
2993
2994Disallow use of movt/movw pairs (ARM only)
2995
Richard Smith78e23fd2017-04-13 22:39:49 +00002996.. option:: -mno-neg-immediates
2997
2998Disallow converting instructions with negative immediates to their negation or inversion.
2999
Richard Smith081ad4d2017-01-24 19:39:46 +00003000.. option:: -mnocrc
3001
3002Disallow use of CRC instructions (ARM only)
3003
Richard Smith081ad4d2017-01-24 19:39:46 +00003004.. option:: -mrestrict-it, -mno-restrict-it
3005
3006Disallow generation of deprecated IT blocks for ARMv8. It is on by default for ARMv8 Thumb mode.
3007
Craig Topper16418662017-11-20 18:07:43 +00003008.. option:: -mtp=<arg>
3009
Craig Topper9624beb2020-03-10 11:08:19 -07003010Thread pointer access method (AArch32/AArch64 only)
Craig Topper16418662017-11-20 18:07:43 +00003011
Richard Smith081ad4d2017-01-24 19:39:46 +00003012.. option:: -munaligned-access, -mno-unaligned-access
3013
3014Allow memory accesses to be unaligned (AArch32/AArch64 only)
3015
3016Hexagon
3017-------
Craig Topper16418662017-11-20 18:07:43 +00003018.. option:: -mieee-rnd-near
3019
Vedant Kumar368540f2018-08-23 17:55:03 +00003020.. option:: -mmemops, -mno-memops
3021
3022Enable generation of memop instructions
3023
3024.. option:: -mnvj, -mno-nvj
3025
3026Enable generation of new-value jumps
3027
3028.. option:: -mnvs, -mno-nvs
3029
3030Enable generation of new-value stores
3031
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00003032.. option:: -mpackets, -mno-packets
3033
3034Enable generation of instruction packets
3035
Craig Topper16418662017-11-20 18:07:43 +00003036Hexagon
3037-------
Richard Smith081ad4d2017-01-24 19:39:46 +00003038.. option:: -mhvx, -mno-hvx
3039
3040Enable Hexagon Vector eXtensions
3041
Craig Topper16418662017-11-20 18:07:43 +00003042.. option:: -mhvx-length=<arg>
3043
3044Set Hexagon Vector Length
3045
3046.. program:: clang1
3047.. option:: -mhvx=<arg>
3048.. program:: clang
3049
3050Enable Hexagon Vector eXtensions
Richard Smith081ad4d2017-01-24 19:39:46 +00003051
Vedant Kumar368540f2018-08-23 17:55:03 +00003052MIPS
3053----
3054.. option:: -mabicalls, -mno-abicalls
3055
3056Enable SVR4-style position-independent code (Mips only)
3057
3058.. option:: -mabs=<arg>
3059
3060.. option:: -mcheck-zero-division, -mno-check-zero-division
3061
3062.. option:: -mcompact-branches=<arg>
3063
3064.. option:: -mdouble-float
3065
3066.. option:: -mdsp, -mno-dsp
3067
3068.. option:: -mdspr2, -mno-dspr2
3069
3070.. option:: -membedded-data, -mno-embedded-data
3071
3072Place constants in the .rodata section instead of the .sdata section even if they meet the -G <size> threshold (MIPS)
3073
3074.. option:: -mextern-sdata, -mno-extern-sdata
3075
3076Assume that externally defined data is in the small data if it meets the -G <size> threshold (MIPS)
3077
3078.. option:: -mfp32
3079
3080Use 32-bit floating point registers (MIPS only)
3081
3082.. option:: -mfp64
3083
3084Use 64-bit floating point registers (MIPS only)
3085
3086.. option:: -mginv, -mno-ginv
3087
3088.. option:: -mgpopt, -mno-gpopt
3089
3090Use GP relative accesses for symbols known to be in a small data section (MIPS)
3091
3092.. option:: -mindirect-jump=<arg>
3093
3094Change indirect jump instructions to inhibit speculation
3095
3096.. option:: -mips16
3097
3098.. option:: -mldc1-sdc1, -mno-ldc1-sdc1
3099
3100.. option:: -mlocal-sdata, -mno-local-sdata
3101
3102Extend the -G behaviour to object local data (MIPS)
3103
3104.. option:: -mmadd4, -mno-madd4
3105
3106Enable the generation of 4-operand madd.s, madd.d and related instructions.
3107
3108.. option:: -mmicromips, -mno-micromips
3109
3110.. option:: -mmsa, -mno-msa
3111
3112Enable MSA ASE (MIPS only)
3113
3114.. option:: -mmt, -mno-mt
3115
3116Enable MT ASE (MIPS only)
3117
3118.. option:: -mnan=<arg>
3119
3120.. option:: -mno-mips16
3121
3122.. option:: -msingle-float
3123
3124.. option:: -mvirt, -mno-virt
3125
3126.. option:: -mxgot, -mno-xgot
3127
Richard Smith081ad4d2017-01-24 19:39:46 +00003128PowerPC
3129-------
Richard Smith78e23fd2017-04-13 22:39:49 +00003130.. option:: -maltivec, -mno-altivec
3131
Richard Smith081ad4d2017-01-24 19:39:46 +00003132.. option:: -mcmpb, -mno-cmpb
3133
Richard Smith081ad4d2017-01-24 19:39:46 +00003134.. option:: -mcrbits, -mno-crbits
3135
Richard Smith081ad4d2017-01-24 19:39:46 +00003136.. option:: -mcrypto, -mno-crypto
3137
Richard Smith081ad4d2017-01-24 19:39:46 +00003138.. option:: -mdirect-move, -mno-direct-move
3139
Richard Smith081ad4d2017-01-24 19:39:46 +00003140.. option:: -mfloat128, -mno-float128
3141
Richard Smith081ad4d2017-01-24 19:39:46 +00003142.. option:: -mfprnd, -mno-fprnd
3143
Richard Smith081ad4d2017-01-24 19:39:46 +00003144.. option:: -mhtm, -mno-htm
3145
Richard Smith081ad4d2017-01-24 19:39:46 +00003146.. option:: -minvariant-function-descriptors, -mno-invariant-function-descriptors
3147
Richard Smith081ad4d2017-01-24 19:39:46 +00003148.. option:: -misel, -mno-isel
3149
Richard Smith081ad4d2017-01-24 19:39:46 +00003150.. option:: -mlongcall, -mno-longcall
3151
Richard Smith081ad4d2017-01-24 19:39:46 +00003152.. option:: -mmfocrf, -mmfcrf, -mno-mfocrf
3153
Konstantin Zhuravlyovb581c5a2020-10-09 08:29:53 -04003154.. option:: -mmma, -mno-mma
3155
3156.. option:: -mpaired-vector-memops, -mno-paired-vector-memops
3157
Fangrui Songd8c97292020-06-18 14:52:39 -07003158.. option:: -mpcrel, -mno-pcrel
3159
Richard Smith081ad4d2017-01-24 19:39:46 +00003160.. option:: -mpopcntd, -mno-popcntd
3161
Fangrui Songd8c97292020-06-18 14:52:39 -07003162.. option:: -mpower10-vector, -mno-power10-vector
3163
Richard Smith081ad4d2017-01-24 19:39:46 +00003164.. option:: -mpower8-vector, -mno-power8-vector
3165
Richard Smith081ad4d2017-01-24 19:39:46 +00003166.. option:: -mpower9-vector, -mno-power9-vector
3167
Richard Smith081ad4d2017-01-24 19:39:46 +00003168.. option:: -mqpx, -mno-qpx
3169
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00003170.. option:: -msecure-plt
3171
Craig Topper9624beb2020-03-10 11:08:19 -07003172.. option:: -mspe, -mno-spe
3173
Richard Smith081ad4d2017-01-24 19:39:46 +00003174.. option:: -mvsx, -mno-vsx
3175
3176WebAssembly
3177-----------
Craig Topper9624beb2020-03-10 11:08:19 -07003178.. option:: -matomics, -mno-atomics
3179
3180.. option:: -mbulk-memory, -mno-bulk-memory
3181
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00003182.. option:: -mexception-handling, -mno-exception-handling
3183
Craig Topper9624beb2020-03-10 11:08:19 -07003184.. option:: -mmultivalue, -mno-multivalue
3185
3186.. option:: -mmutable-globals, -mno-mutable-globals
3187
Craig Topper188252d2017-12-11 21:09:16 +00003188.. option:: -mnontrapping-fptoint, -mno-nontrapping-fptoint
3189
Craig Topper9624beb2020-03-10 11:08:19 -07003190.. option:: -mreference-types, -mno-reference-types
3191
Dan Gohmand0c4e1e2018-01-19 17:16:32 +00003192.. option:: -msign-ext, -mno-sign-ext
3193
Richard Smith081ad4d2017-01-24 19:39:46 +00003194.. option:: -msimd128, -mno-simd128
3195
Craig Topper9624beb2020-03-10 11:08:19 -07003196.. option:: -mtail-call, -mno-tail-call
3197
3198.. option:: -munimplemented-simd128, -mno-unimplemented-simd128
3199
Fangrui Songd8c97292020-06-18 14:52:39 -07003200WebAssembly Driver
3201------------------
Dan Gohmand4964372020-04-21 10:35:10 -07003202.. option:: -mexec-model=<arg>
3203
Fangrui Songd8c97292020-06-18 14:52:39 -07003204Execution model (WebAssembly only)
Dan Gohmand4964372020-04-21 10:35:10 -07003205
Richard Smith081ad4d2017-01-24 19:39:46 +00003206X86
3207---
Richard Smith081ad4d2017-01-24 19:39:46 +00003208.. option:: -m3dnow, -mno-3dnow
3209
Richard Smith081ad4d2017-01-24 19:39:46 +00003210.. option:: -m3dnowa, -mno-3dnowa
3211
Richard Smith081ad4d2017-01-24 19:39:46 +00003212.. option:: -madx, -mno-adx
3213
Richard Smith081ad4d2017-01-24 19:39:46 +00003214.. option:: -maes, -mno-aes
3215
Xiang1 Zhang939d8302020-07-07 09:50:17 +08003216.. option:: -mamx-bf16, -mno-amx-bf16
3217
3218.. option:: -mamx-int8, -mno-amx-int8
3219
3220.. option:: -mamx-tile, -mno-amx-tile
3221
Richard Smith081ad4d2017-01-24 19:39:46 +00003222.. option:: -mavx, -mno-avx
3223
Richard Smith081ad4d2017-01-24 19:39:46 +00003224.. option:: -mavx2, -mno-avx2
3225
Luo, Yuanke844f6622019-05-06 08:25:11 +00003226.. option:: -mavx512bf16, -mno-avx512bf16
3227
Craig Topper9624beb2020-03-10 11:08:19 -07003228.. option:: -mavx512bitalg, -mno-avx512bitalg
3229
Richard Smith081ad4d2017-01-24 19:39:46 +00003230.. option:: -mavx512bw, -mno-avx512bw
3231
Richard Smith081ad4d2017-01-24 19:39:46 +00003232.. option:: -mavx512cd, -mno-avx512cd
3233
Richard Smith081ad4d2017-01-24 19:39:46 +00003234.. option:: -mavx512dq, -mno-avx512dq
3235
Richard Smith081ad4d2017-01-24 19:39:46 +00003236.. option:: -mavx512er, -mno-avx512er
3237
Richard Smith081ad4d2017-01-24 19:39:46 +00003238.. option:: -mavx512f, -mno-avx512f
3239
Richard Smith081ad4d2017-01-24 19:39:46 +00003240.. option:: -mavx512ifma, -mno-avx512ifma
3241
Richard Smith081ad4d2017-01-24 19:39:46 +00003242.. option:: -mavx512pf, -mno-avx512pf
3243
Richard Smith081ad4d2017-01-24 19:39:46 +00003244.. option:: -mavx512vbmi, -mno-avx512vbmi
3245
Craig Topper287c8012018-01-03 18:29:12 +00003246.. option:: -mavx512vbmi2, -mno-avx512vbmi2
3247
Richard Smith081ad4d2017-01-24 19:39:46 +00003248.. option:: -mavx512vl, -mno-avx512vl
3249
Craig Topper287c8012018-01-03 18:29:12 +00003250.. option:: -mavx512vnni, -mno-avx512vnni
3251
Pengfei Wangcc3629d2019-05-31 06:09:35 +00003252.. option:: -mavx512vp2intersect, -mno-avx512vp2intersect
3253
Craig Topperd23254a2017-07-20 17:52:48 +00003254.. option:: -mavx512vpopcntdq, -mno-avx512vpopcntdq
3255
Richard Smith081ad4d2017-01-24 19:39:46 +00003256.. option:: -mbmi, -mno-bmi
3257
Richard Smith081ad4d2017-01-24 19:39:46 +00003258.. option:: -mbmi2, -mno-bmi2
3259
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00003260.. option:: -mcldemote, -mno-cldemote
3261
Craig Topper78b47872017-02-08 06:48:58 +00003262.. option:: -mclflushopt, -mno-clflushopt
3263
Craig Topper177a57c2017-02-08 07:57:01 +00003264.. option:: -mclwb, -mno-clwb
3265
Richard Smith78e23fd2017-04-13 22:39:49 +00003266.. option:: -mclzero, -mno-clzero
3267
Richard Smith081ad4d2017-01-24 19:39:46 +00003268.. option:: -mcx16, -mno-cx16
3269
Pengfei Wang3a29f7c2019-06-06 08:28:42 +00003270.. option:: -menqcmd, -mno-enqcmd
3271
Richard Smith081ad4d2017-01-24 19:39:46 +00003272.. option:: -mf16c, -mno-f16c
3273
Richard Smith081ad4d2017-01-24 19:39:46 +00003274.. option:: -mfma, -mno-fma
3275
Richard Smith081ad4d2017-01-24 19:39:46 +00003276.. option:: -mfma4, -mno-fma4
3277
Richard Smith081ad4d2017-01-24 19:39:46 +00003278.. option:: -mfsgsbase, -mno-fsgsbase
3279
Richard Smith081ad4d2017-01-24 19:39:46 +00003280.. option:: -mfxsr, -mno-fxsr
3281
Craig Topper287c8012018-01-03 18:29:12 +00003282.. option:: -mgfni, -mno-gfni
3283
Wang, Pengfei412cdcf2020-10-13 08:42:46 +08003284.. option:: -mhreset, -mno-hreset
3285
Vedant Kumar368540f2018-08-23 17:55:03 +00003286.. option:: -minvpcid, -mno-invpcid
3287
Konstantin Zhuravlyovb581c5a2020-10-09 08:29:53 -04003288.. option:: -mkl, -mno-kl
3289
Craig Topperd23254a2017-07-20 17:52:48 +00003290.. option:: -mlwp, -mno-lwp
3291
Richard Smith081ad4d2017-01-24 19:39:46 +00003292.. option:: -mlzcnt, -mno-lzcnt
3293
Richard Smith081ad4d2017-01-24 19:39:46 +00003294.. option:: -mmmx, -mno-mmx
3295
Craig Topper177a57c2017-02-08 07:57:01 +00003296.. option:: -mmovbe, -mno-movbe
3297
Gabor Buellaa51e0c22018-05-01 10:05:42 +00003298.. option:: -mmovdir64b, -mno-movdir64b
3299
Vedant Kumar368540f2018-08-23 17:55:03 +00003300.. option:: -mmovdiri, -mno-movdiri
3301
Richard Smith081ad4d2017-01-24 19:39:46 +00003302.. option:: -mmwaitx, -mno-mwaitx
3303
Richard Smith081ad4d2017-01-24 19:39:46 +00003304.. option:: -mpclmul, -mno-pclmul
3305
Vedant Kumar368540f2018-08-23 17:55:03 +00003306.. option:: -mpconfig, -mno-pconfig
3307
Richard Smith081ad4d2017-01-24 19:39:46 +00003308.. option:: -mpku, -mno-pku
3309
Richard Smith081ad4d2017-01-24 19:39:46 +00003310.. option:: -mpopcnt, -mno-popcnt
3311
Craig Topperd2bf7b02017-02-08 08:23:40 +00003312.. option:: -mprefetchwt1, -mno-prefetchwt1
3313
Richard Smith081ad4d2017-01-24 19:39:46 +00003314.. option:: -mprfchw, -mno-prfchw
3315
Vedant Kumar368540f2018-08-23 17:55:03 +00003316.. option:: -mptwrite, -mno-ptwrite
3317
Craig Topper596527b2018-01-23 18:40:15 +00003318.. option:: -mrdpid, -mno-rdpid
3319
Richard Smith081ad4d2017-01-24 19:39:46 +00003320.. option:: -mrdrnd, -mno-rdrnd
3321
Richard Smith081ad4d2017-01-24 19:39:46 +00003322.. option:: -mrdseed, -mno-rdseed
3323
Craig Topper596527b2018-01-23 18:40:15 +00003324.. option:: -mretpoline-external-thunk, -mno-retpoline-external-thunk
3325
Richard Smith081ad4d2017-01-24 19:39:46 +00003326.. option:: -mrtm, -mno-rtm
3327
Jonas Hahnfelda180fc42018-02-22 17:10:28 +00003328.. option:: -msahf, -mno-sahf
3329
WangTianQingd08fadd2020-04-02 16:15:34 +08003330.. option:: -mserialize, -mno-serialize
3331
Craig Topper204ecff2017-02-08 08:23:17 +00003332.. option:: -msgx, -mno-sgx
3333
Richard Smith081ad4d2017-01-24 19:39:46 +00003334.. option:: -msha, -mno-sha
3335
Craig Topper188252d2017-12-11 21:09:16 +00003336.. option:: -mshstk, -mno-shstk
3337
Richard Smith081ad4d2017-01-24 19:39:46 +00003338.. option:: -msse, -mno-sse
3339
Richard Smith081ad4d2017-01-24 19:39:46 +00003340.. option:: -msse2, -mno-sse2
3341
Richard Smith081ad4d2017-01-24 19:39:46 +00003342.. option:: -msse3, -mno-sse3
3343
Richard Smith081ad4d2017-01-24 19:39:46 +00003344.. option:: -msse4.1, -mno-sse4.1
3345
Richard Smithb2c82a62017-01-27 01:54:42 +00003346.. program:: clang1
Richard Smith081ad4d2017-01-24 19:39:46 +00003347.. option:: -msse4.2, -mno-sse4.2, -msse4
Richard Smithb2c82a62017-01-27 01:54:42 +00003348.. program:: clang
Richard Smith081ad4d2017-01-24 19:39:46 +00003349
Richard Smith081ad4d2017-01-24 19:39:46 +00003350.. option:: -msse4a, -mno-sse4a
3351
Richard Smith081ad4d2017-01-24 19:39:46 +00003352.. option:: -mssse3, -mno-ssse3
3353
Richard Smith081ad4d2017-01-24 19:39:46 +00003354.. option:: -mtbm, -mno-tbm
3355
WangTianQinga3dc9492020-04-09 13:15:42 +08003356.. option:: -mtsxldtrk, -mno-tsxldtrk
3357
Tianqing Wangbe39a6f2020-10-22 16:46:07 +08003358.. option:: -muintr, -mno-uintr
3359
Craig Topper287c8012018-01-03 18:29:12 +00003360.. option:: -mvaes, -mno-vaes
3361
3362.. option:: -mvpclmulqdq, -mno-vpclmulqdq
3363
Craig Topper9624beb2020-03-10 11:08:19 -07003364.. option:: -mvzeroupper, -mno-vzeroupper
3365
Craig Topper42da9cb2018-04-23 21:41:06 +00003366.. option:: -mwaitpkg, -mno-waitpkg
3367
Gabor Buellaa0520162018-04-11 20:09:09 +00003368.. option:: -mwbnoinvd, -mno-wbnoinvd
3369
Konstantin Zhuravlyovb581c5a2020-10-09 08:29:53 -04003370.. option:: -mwidekl, -mno-widekl
3371
Richard Smith081ad4d2017-01-24 19:39:46 +00003372.. option:: -mx87, -m80387, -mno-x87
3373
Richard Smith081ad4d2017-01-24 19:39:46 +00003374.. option:: -mxop, -mno-xop
3375
Richard Smith081ad4d2017-01-24 19:39:46 +00003376.. option:: -mxsave, -mno-xsave
3377
Richard Smith081ad4d2017-01-24 19:39:46 +00003378.. option:: -mxsavec, -mno-xsavec
3379
Richard Smith081ad4d2017-01-24 19:39:46 +00003380.. option:: -mxsaveopt, -mno-xsaveopt
3381
Richard Smith081ad4d2017-01-24 19:39:46 +00003382.. option:: -mxsaves, -mno-xsaves
3383
Vedant Kumar368540f2018-08-23 17:55:03 +00003384RISCV
3385-----
Craig Topper9624beb2020-03-10 11:08:19 -07003386.. option:: -msave-restore, -mno-save-restore
3387
3388Enable using library calls for save and restore
3389
3390Long double flags
3391-----------------
3392Selects the long double implementation
3393
3394.. option:: -mlong-double-128
3395
3396Force long double to be 128 bits
3397
3398.. option:: -mlong-double-64
3399
3400Force long double to be 64 bits
3401
3402.. option:: -mlong-double-80
3403
3404Force long double to be 80 bits, padded to 128 bits for storage
3405
Richard Smith081ad4d2017-01-24 19:39:46 +00003406Optimization level
3407~~~~~~~~~~~~~~~~~~
3408
3409Flags controlling how much optimization should be performed.
3410
Fangrui Songd8c97292020-06-18 14:52:39 -07003411.. option:: -O<arg>, -O (equivalent to -O1), --optimize, --optimize=<arg>
Richard Smith081ad4d2017-01-24 19:39:46 +00003412
Richard Smith081ad4d2017-01-24 19:39:46 +00003413.. option:: -Ofast<arg>
3414
3415Debug information generation
3416~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3417
3418Flags controlling how much and what kind of debug information should be
3419generated.
3420
3421Kind and level of debug information
3422-----------------------------------
Richard Smith081ad4d2017-01-24 19:39:46 +00003423.. option:: -g, --debug, --debug=<arg>
3424
3425Generate source-level debug information
3426
Craig Topper9624beb2020-03-10 11:08:19 -07003427.. option:: -gdwarf
3428
3429Generate source-level debug information with the default dwarf version
3430
Richard Smith081ad4d2017-01-24 19:39:46 +00003431.. option:: -gdwarf-2
3432
3433Generate source-level debug information with dwarf version 2
3434
Richard Smith081ad4d2017-01-24 19:39:46 +00003435.. option:: -gdwarf-3
3436
3437Generate source-level debug information with dwarf version 3
3438
Craig Topper9624beb2020-03-10 11:08:19 -07003439.. option:: -gdwarf-4
Richard Smith081ad4d2017-01-24 19:39:46 +00003440
3441Generate source-level debug information with dwarf version 4
3442
Richard Smith081ad4d2017-01-24 19:39:46 +00003443.. option:: -gdwarf-5
3444
3445Generate source-level debug information with dwarf version 5
3446
Richard Smith081ad4d2017-01-24 19:39:46 +00003447.. option:: -gfull
3448
Richard Smith081ad4d2017-01-24 19:39:46 +00003449.. option:: -gused
3450
3451Debug level
3452___________
Richard Smith081ad4d2017-01-24 19:39:46 +00003453.. option:: -g0
3454
Richard Smith081ad4d2017-01-24 19:39:46 +00003455.. option:: -g2
3456
Richard Smith081ad4d2017-01-24 19:39:46 +00003457.. option:: -g3
3458
Richard Smith081ad4d2017-01-24 19:39:46 +00003459.. option:: -ggdb0
3460
Richard Smith081ad4d2017-01-24 19:39:46 +00003461.. option:: -ggdb1
3462
Richard Smith081ad4d2017-01-24 19:39:46 +00003463.. option:: -ggdb2
3464
Richard Smith081ad4d2017-01-24 19:39:46 +00003465.. option:: -ggdb3
3466
Craig Topper9624beb2020-03-10 11:08:19 -07003467.. option:: -gline-directives-only
3468
3469Emit debug line info directives only
3470
Richard Smith081ad4d2017-01-24 19:39:46 +00003471.. option:: -gline-tables-only, -g1, -gmlt
3472
3473Emit debug line number tables only
3474
Richard Smith081ad4d2017-01-24 19:39:46 +00003475.. option:: -gmodules
3476
3477Generate debug info with external references to clang modules or precompiled headers
3478
3479Debugger to tune debug information for
3480______________________________________
Richard Smith081ad4d2017-01-24 19:39:46 +00003481.. option:: -ggdb
3482
Richard Smith081ad4d2017-01-24 19:39:46 +00003483.. option:: -glldb
3484
Richard Smith081ad4d2017-01-24 19:39:46 +00003485.. option:: -gsce
3486
3487Debug information flags
3488-----------------------
Richard Smith081ad4d2017-01-24 19:39:46 +00003489.. option:: -gcolumn-info, -gno-column-info
3490
Richard Smith081ad4d2017-01-24 19:39:46 +00003491.. option:: -gdwarf-aranges
3492
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00003493.. option:: -gembed-source, -gno-embed-source
Scott Lindera2fbcef2018-02-26 17:32:31 +00003494
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00003495Embed source text in DWARF debug sections
Scott Lindera2fbcef2018-02-26 17:32:31 +00003496
Vedant Kumar368540f2018-08-23 17:55:03 +00003497.. option:: -ggnu-pubnames, -gno-gnu-pubnames
3498
3499.. option:: -gpubnames, -gno-pubnames
Richard Smith081ad4d2017-01-24 19:39:46 +00003500
Craig Topper9624beb2020-03-10 11:08:19 -07003501.. option:: -grecord-command-line, -gno-record-command-line, -grecord-gcc-switches
Richard Smith081ad4d2017-01-24 19:39:46 +00003502
Richard Smith081ad4d2017-01-24 19:39:46 +00003503.. option:: -gsplit-dwarf
3504
Craig Topper9624beb2020-03-10 11:08:19 -07003505.. program:: clang1
3506.. option:: -gsplit-dwarf=<arg>
3507.. program:: clang
3508
3509Set DWARF fission mode to either 'split' or 'single'
3510
Richard Smith081ad4d2017-01-24 19:39:46 +00003511.. option:: -gstrict-dwarf, -gno-strict-dwarf
3512
Tony661797b2020-10-28 22:20:51 +00003513.. option:: -gz=<arg>, -gz (equivalent to -gz=zlib)
Craig Topperd23254a2017-07-20 17:52:48 +00003514
3515DWARF debug sections compression type
3516
Richard Smithc5b2e002017-01-27 02:08:37 +00003517Static analyzer flags
3518=====================
Richard Smith081ad4d2017-01-24 19:39:46 +00003519
Richard Smithc5b2e002017-01-27 02:08:37 +00003520Flags controlling the behavior of the Clang Static Analyzer.
Richard Smith081ad4d2017-01-24 19:39:46 +00003521
Richard Smithc5b2e002017-01-27 02:08:37 +00003522.. option:: -Xanalyzer <arg>
Richard Smith081ad4d2017-01-24 19:39:46 +00003523
Richard Smithc5b2e002017-01-27 02:08:37 +00003524Pass <arg> to the static analyzer
Richard Smith081ad4d2017-01-24 19:39:46 +00003525
3526Fortran compilation flags
3527=========================
3528
3529Flags that will be passed onto the ``gfortran`` compiler when Clang is given
3530a Fortran input.
3531
Richard Smithc5b2e002017-01-27 02:08:37 +00003532.. option:: -A<arg>, --assert <arg>, --assert=<arg>
3533
Richard Smith081ad4d2017-01-24 19:39:46 +00003534.. option:: -A-<arg>
3535
Richard Smith081ad4d2017-01-24 19:39:46 +00003536.. option:: -J<arg>
3537
Richard Smith081ad4d2017-01-24 19:39:46 +00003538.. option:: -cpp
3539
Richard Smith081ad4d2017-01-24 19:39:46 +00003540.. option:: -faggressive-function-elimination, -fno-aggressive-function-elimination
3541
Richard Smith081ad4d2017-01-24 19:39:46 +00003542.. option:: -falign-commons, -fno-align-commons
3543
Richard Smith081ad4d2017-01-24 19:39:46 +00003544.. option:: -fall-intrinsics, -fno-all-intrinsics
3545
Richard Smith081ad4d2017-01-24 19:39:46 +00003546.. option:: -fautomatic, -fno-automatic
3547
Richard Smith081ad4d2017-01-24 19:39:46 +00003548.. option:: -fbackslash, -fno-backslash
3549
Richard Smith081ad4d2017-01-24 19:39:46 +00003550.. option:: -fbacktrace, -fno-backtrace
3551
Richard Smith081ad4d2017-01-24 19:39:46 +00003552.. option:: -fblas-matmul-limit=<arg>
3553
Richard Smith081ad4d2017-01-24 19:39:46 +00003554.. option:: -fbounds-check, -fno-bounds-check
3555
Richard Smith081ad4d2017-01-24 19:39:46 +00003556.. option:: -fcheck-array-temporaries, -fno-check-array-temporaries
3557
Richard Smith081ad4d2017-01-24 19:39:46 +00003558.. option:: -fcheck=<arg>
3559
Richard Smith081ad4d2017-01-24 19:39:46 +00003560.. option:: -fcoarray=<arg>
3561
Richard Smith081ad4d2017-01-24 19:39:46 +00003562.. option:: -fconvert=<arg>
3563
Richard Smith081ad4d2017-01-24 19:39:46 +00003564.. option:: -fcray-pointer, -fno-cray-pointer
3565
Richard Smith081ad4d2017-01-24 19:39:46 +00003566.. option:: -fd-lines-as-code, -fno-d-lines-as-code
3567
Richard Smith081ad4d2017-01-24 19:39:46 +00003568.. option:: -fd-lines-as-comments, -fno-d-lines-as-comments
3569
Richard Smith081ad4d2017-01-24 19:39:46 +00003570.. option:: -fdefault-double-8, -fno-default-double-8
3571
Richard Smith081ad4d2017-01-24 19:39:46 +00003572.. option:: -fdefault-integer-8, -fno-default-integer-8
3573
Richard Smith081ad4d2017-01-24 19:39:46 +00003574.. option:: -fdefault-real-8, -fno-default-real-8
3575
Richard Smith081ad4d2017-01-24 19:39:46 +00003576.. option:: -fdollar-ok, -fno-dollar-ok
3577
Richard Smith081ad4d2017-01-24 19:39:46 +00003578.. option:: -fdump-fortran-optimized, -fno-dump-fortran-optimized
3579
Richard Smith081ad4d2017-01-24 19:39:46 +00003580.. option:: -fdump-fortran-original, -fno-dump-fortran-original
3581
Richard Smith081ad4d2017-01-24 19:39:46 +00003582.. option:: -fdump-parse-tree, -fno-dump-parse-tree
3583
Richard Smith081ad4d2017-01-24 19:39:46 +00003584.. option:: -fexternal-blas, -fno-external-blas
3585
Richard Smith081ad4d2017-01-24 19:39:46 +00003586.. option:: -ff2c, -fno-f2c
3587
Richard Smith081ad4d2017-01-24 19:39:46 +00003588.. option:: -ffixed-form, -fno-fixed-form
3589
Richard Smith081ad4d2017-01-24 19:39:46 +00003590.. option:: -ffixed-line-length-<arg>
3591
Richard Smith081ad4d2017-01-24 19:39:46 +00003592.. option:: -ffpe-trap=<arg>
3593
Richard Smith081ad4d2017-01-24 19:39:46 +00003594.. option:: -ffree-form, -fno-free-form
3595
Richard Smith081ad4d2017-01-24 19:39:46 +00003596.. option:: -ffree-line-length-<arg>
3597
Richard Smith081ad4d2017-01-24 19:39:46 +00003598.. option:: -ffrontend-optimize, -fno-frontend-optimize
3599
Richard Smith081ad4d2017-01-24 19:39:46 +00003600.. option:: -fimplicit-none, -fno-implicit-none
3601
Richard Smith081ad4d2017-01-24 19:39:46 +00003602.. option:: -finit-character=<arg>
3603
Richard Smith081ad4d2017-01-24 19:39:46 +00003604.. option:: -finit-integer=<arg>
3605
Richard Smith081ad4d2017-01-24 19:39:46 +00003606.. option:: -finit-local-zero, -fno-init-local-zero
3607
Richard Smith081ad4d2017-01-24 19:39:46 +00003608.. option:: -finit-logical=<arg>
3609
Richard Smith081ad4d2017-01-24 19:39:46 +00003610.. option:: -finit-real=<arg>
3611
Richard Smith081ad4d2017-01-24 19:39:46 +00003612.. option:: -finteger-4-integer-8, -fno-integer-4-integer-8
3613
Richard Smith081ad4d2017-01-24 19:39:46 +00003614.. option:: -fintrinsic-modules-path, -fno-intrinsic-modules-path
3615
Richard Smith081ad4d2017-01-24 19:39:46 +00003616.. option:: -fmax-array-constructor=<arg>
3617
Richard Smith081ad4d2017-01-24 19:39:46 +00003618.. option:: -fmax-errors=<arg>
3619
Richard Smith081ad4d2017-01-24 19:39:46 +00003620.. option:: -fmax-identifier-length, -fno-max-identifier-length
3621
Richard Smith081ad4d2017-01-24 19:39:46 +00003622.. option:: -fmax-stack-var-size=<arg>
3623
Richard Smith081ad4d2017-01-24 19:39:46 +00003624.. option:: -fmax-subrecord-length=<arg>
3625
Richard Smith081ad4d2017-01-24 19:39:46 +00003626.. option:: -fmodule-private, -fno-module-private
3627
Richard Smith081ad4d2017-01-24 19:39:46 +00003628.. option:: -fpack-derived, -fno-pack-derived
3629
Richard Smith081ad4d2017-01-24 19:39:46 +00003630.. option:: -fprotect-parens, -fno-protect-parens
3631
Richard Smith081ad4d2017-01-24 19:39:46 +00003632.. option:: -frange-check, -fno-range-check
3633
Richard Smith081ad4d2017-01-24 19:39:46 +00003634.. option:: -freal-4-real-10, -fno-real-4-real-10
3635
Richard Smith081ad4d2017-01-24 19:39:46 +00003636.. option:: -freal-4-real-16, -fno-real-4-real-16
3637
Richard Smith081ad4d2017-01-24 19:39:46 +00003638.. option:: -freal-4-real-8, -fno-real-4-real-8
3639
Richard Smith081ad4d2017-01-24 19:39:46 +00003640.. option:: -freal-8-real-10, -fno-real-8-real-10
3641
Richard Smith081ad4d2017-01-24 19:39:46 +00003642.. option:: -freal-8-real-16, -fno-real-8-real-16
3643
Richard Smith081ad4d2017-01-24 19:39:46 +00003644.. option:: -freal-8-real-4, -fno-real-8-real-4
3645
Richard Smith081ad4d2017-01-24 19:39:46 +00003646.. option:: -frealloc-lhs, -fno-realloc-lhs
3647
Richard Smith081ad4d2017-01-24 19:39:46 +00003648.. option:: -frecord-marker=<arg>
3649
Richard Smith081ad4d2017-01-24 19:39:46 +00003650.. option:: -frecursive, -fno-recursive
3651
Richard Smith081ad4d2017-01-24 19:39:46 +00003652.. option:: -frepack-arrays, -fno-repack-arrays
3653
Richard Smith081ad4d2017-01-24 19:39:46 +00003654.. option:: -fsecond-underscore, -fno-second-underscore
3655
Richard Smith081ad4d2017-01-24 19:39:46 +00003656.. option:: -fsign-zero, -fno-sign-zero
3657
Richard Smith081ad4d2017-01-24 19:39:46 +00003658.. option:: -fstack-arrays, -fno-stack-arrays
3659
Richard Smith081ad4d2017-01-24 19:39:46 +00003660.. option:: -funderscoring, -fno-underscoring
3661
Richard Smith081ad4d2017-01-24 19:39:46 +00003662.. option:: -fwhole-file, -fno-whole-file
3663
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00003664.. option:: -imultilib <arg>
3665
Richard Smith081ad4d2017-01-24 19:39:46 +00003666.. option:: -nocpp
3667
Richard Smith081ad4d2017-01-24 19:39:46 +00003668.. option:: -static-libgfortran
3669
Richard Smithc5b2e002017-01-27 02:08:37 +00003670Linker flags
3671============
3672Flags that are passed on to the linker
3673
3674.. option:: -L<dir>, --library-directory <arg>, --library-directory=<arg>
3675
3676Add directory to library search path
3677
3678.. option:: -Mach
3679
3680.. option:: -T<script>
3681
3682Specify <script> as linker script
3683
Richard Smith78e23fd2017-04-13 22:39:49 +00003684.. option:: -Tbss<addr>
Richard Smithc5b2e002017-01-27 02:08:37 +00003685
3686Set starting address of BSS to <addr>
3687
Richard Smith78e23fd2017-04-13 22:39:49 +00003688.. option:: -Tdata<addr>
Richard Smithc5b2e002017-01-27 02:08:37 +00003689
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00003690Set starting address of DATA to <addr>
Richard Smithc5b2e002017-01-27 02:08:37 +00003691
Richard Smith78e23fd2017-04-13 22:39:49 +00003692.. option:: -Ttext<addr>
Richard Smithc5b2e002017-01-27 02:08:37 +00003693
Jonas Hahnfeld06039e82018-04-20 13:26:03 +00003694Set starting address of TEXT to <addr>
Richard Smithc5b2e002017-01-27 02:08:37 +00003695
3696.. option:: -Wl,<arg>,<arg2>...
3697
3698Pass the comma separated arguments in <arg> to the linker
3699
3700.. option:: -X
3701
3702.. option:: -Xlinker <arg>, --for-linker <arg>, --for-linker=<arg>
3703
3704Pass <arg> to the linker
3705
3706.. program:: clang1
3707.. option:: -Z
3708.. program:: clang
3709
Konstantin Zhuravlyovb581c5a2020-10-09 08:29:53 -04003710.. option:: -coverage, --coverage
3711
Richard Smithc5b2e002017-01-27 02:08:37 +00003712.. option:: -e<arg>, --entry
3713
3714.. option:: -filelist <arg>
3715
Vedant Kumar368540f2018-08-23 17:55:03 +00003716.. option:: --hip-device-lib=<arg>
3717
3718HIP device library
3719
Richard Smithc5b2e002017-01-27 02:08:37 +00003720.. option:: -l<arg>
3721
Konstantin Zhuravlyovb581c5a2020-10-09 08:29:53 -04003722.. option:: --ld-path=<arg>
3723
3724.. option:: -nostartfiles
3725
3726.. program:: clang1
3727.. option:: -nostdlib, --no-standard-libraries
3728.. program:: clang
3729
3730.. option:: -pie
3731
Richard Smithc5b2e002017-01-27 02:08:37 +00003732.. option:: -r
3733
Konstantin Zhuravlyovb581c5a2020-10-09 08:29:53 -04003734.. option:: -rdynamic
3735
3736.. option:: --rocm-device-lib-path=<arg>, --hip-device-lib-path=<arg>
3737
3738ROCm device library path. Alternative to rocm-path.
3739
Richard Smithc5b2e002017-01-27 02:08:37 +00003740.. option:: -rpath <arg>
3741
3742.. option:: -s
3743
Konstantin Zhuravlyovb581c5a2020-10-09 08:29:53 -04003744.. option:: -shared, --shared
3745
3746.. option:: -specs=<arg>, --specs=<arg>
3747
3748.. option:: -static, --static
3749
3750.. option:: -static-pie
3751
Richard Smithc5b2e002017-01-27 02:08:37 +00003752.. option:: -t
3753
3754.. option:: -u<arg>, --force-link <arg>, --force-link=<arg>
3755
3756.. option:: -undef
3757
3758undef all system defines
3759
3760.. option:: -undefined<arg>, --no-undefined
3761
3762.. option:: -z <arg>
3763
3764Pass -z <arg> to the linker
3765