1..
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
21.. option:: -B<dir>, --prefix <arg>, --prefix=<arg>
22
23Add <dir> to search path for binaries and object files used implicitly
24
25.. option:: -F<arg>
26
27Add directory to framework include search path
28
29.. option:: -ObjC
30
31Treat source input files as Objective-C inputs
32
33.. program:: clang1
34.. option:: -ObjC++
35.. program:: clang
36
37Treat source input files as Objective-C++ inputs
38
39.. option:: -Qn, -fno-ident
40
41Do not emit metadata containing compiler name and version
42
43.. option:: -Qunused-arguments
44
45Don't emit warning for unused driver arguments
46
47.. option:: -Qy, -fident
48
49Emit metadata containing compiler name and version
50
51.. option:: -Wa,<arg>,<arg2>...
52
53Pass the comma separated arguments in <arg> to the assembler
54
55.. option:: -Wlarge-by-value-copy=<arg>
56
57.. option:: -Xarch\_<arg1> <arg2>
58
59.. option:: -Xcuda-fatbinary <arg>
60
61Pass <arg> to fatbinary invocation
62
63.. option:: -Xcuda-ptxas <arg>
64
65Pass <arg> to the ptxas assembler
66
67.. option:: -Xopenmp-target <arg>
68
69Pass <arg> to the target offloading toolchain.
70
71.. program:: clang1
72.. option:: -Xopenmp-target=<triple> <arg>
73.. program:: clang
74
75Pass <arg> to the target offloading toolchain identified by <triple>.
76
77.. option:: -Z<arg>
78
79.. option:: -a<arg>, --profile-blocks
80
81.. option:: -all\_load
82
83.. option:: -allowable\_client <arg>
84
85.. option:: --analyze
86
87Run the static analyzer
88
89.. option:: --analyzer-no-default-checks
90
91.. option:: --analyzer-output<arg>
92
93Static analyzer report output format (html\|plist\|plist-multi-file\|plist-html\|text).
94
95.. option:: -ansi, --ansi
96
97.. option:: -arch <arg>
98
99.. program:: clang1
100.. option:: -arch\_errors\_fatal
101.. program:: clang
102
103.. program:: clang2
104.. option:: -arch\_only <arg>
105.. program:: clang
106
107.. option:: -arcmt-migrate-emit-errors
108
109Emit ARC errors even if the migrator can fix them
110
111.. option:: -arcmt-migrate-report-output <arg>
112
113Output path for the plist report
114
115.. option:: --autocomplete=<arg>
116
117.. option:: -bind\_at\_load
118
119.. option:: -bundle
120
121.. program:: clang1
122.. option:: -bundle\_loader <arg>
123.. program:: clang
124
125.. option:: -cfguard
126
127Emit tables required for Windows Control Flow Guard.
128
129.. option:: -client\_name<arg>
130
131.. option:: -compatibility\_version<arg>
132
133.. option:: --config <arg>
134
135Specifies configuration file
136
137.. option:: --constant-cfstrings
138
139.. option:: -coverage, --coverage
140
141.. option:: --cuda-compile-host-device
142
143Compile CUDA code for both host and device (default).  Has no effect on non-CUDA compilations.
144
145.. option:: --cuda-device-only
146
147Compile CUDA code for device only
148
149.. option:: --cuda-gpu-arch=<arg>, --no-cuda-gpu-arch=<arg>
150
151CUDA GPU architecture (e.g. sm\_35).  May be specified more than once.
152
153.. option:: --cuda-host-only
154
155Compile CUDA code for host only.  Has no effect on non-CUDA compilations.
156
157.. option:: --cuda-include-ptx=<arg>, --no-cuda-include-ptx=<arg>
158
159Include PTX for the following GPU architecture (e.g. sm\_35) or 'all'. May be specified more than once.
160
161.. option:: --cuda-noopt-device-debug, --no-cuda-noopt-device-debug
162
163Enable device-side debug info generation. Disables ptxas optimizations.
164
165.. option:: -current\_version<arg>
166
167.. option:: -dead\_strip
168
169.. option:: -dependency-dot <arg>
170
171Filename to write DOT-formatted header dependencies to
172
173.. option:: -dependency-file <arg>
174
175Filename (or -) to write dependency output to
176
177.. option:: -dumpmachine
178
179.. option:: -dumpversion
180
181.. option:: --dyld-prefix=<arg>, --dyld-prefix <arg>
182
183.. option:: -dylib\_file <arg>
184
185.. option:: -dylinker
186
187.. program:: clang1
188.. option:: -dylinker\_install\_name<arg>
189.. program:: clang
190
191.. option:: -dynamic
192
193.. option:: -dynamiclib
194
195.. option:: -emit-ast
196
197Emit Clang AST files for source inputs
198
199.. option:: -exported\_symbols\_list <arg>
200
201.. option:: -faligned-new=<arg>
202
203.. option:: -fcuda-approx-transcendentals, -fno-cuda-approx-transcendentals
204
205Use approximate transcendental functions
206
207.. option:: -fcuda-flush-denormals-to-zero, -fno-cuda-flush-denormals-to-zero
208
209Flush denormal floating point values to zero in CUDA device mode.
210
211.. option:: -fcuda-rdc, -fno-cuda-rdc
212
213Generate relocatable device code, also known as separate compilation mode.
214
215.. option:: -fcuda-short-ptr, -fno-cuda-short-ptr
216
217Use 32-bit pointers for accessing const/local/shared address spaces.
218
219.. option:: -ffixed-r19
220
221Reserve register r19 (Hexagon only)
222
223.. option:: -fheinous-gnu-extensions
224
225.. option:: -flat\_namespace
226
227.. option:: -fopenmp-targets=<arg1>,<arg2>...
228
229Specify comma-separated list of triples OpenMP offloading targets to be supported
230
231.. option:: -force\_cpusubtype\_ALL
232
233.. program:: clang1
234.. option:: -force\_flat\_namespace
235.. program:: clang
236
237.. program:: clang2
238.. option:: -force\_load <arg>
239.. program:: clang
240
241.. option:: -framework <arg>
242
243.. option:: -frtlib-add-rpath, -fno-rtlib-add-rpath
244
245Add -rpath with architecture-specific resource directory to the linker flags
246
247.. option:: --gcc-toolchain=<arg>, -gcc-toolchain <arg>
248
249Use the gcc toolchain at the given directory
250
251.. option:: -gcodeview
252
253Generate CodeView debug information
254
255.. option:: -headerpad\_max\_install\_names<arg>
256
257.. option:: -help, --help
258
259Display available options
260
261.. option:: --help-hidden
262
263Display help for hidden options
264
265.. option:: --hip-link
266
267Link clang-offload-bundler bundles for HIP
268
269.. option:: -image\_base <arg>
270
271.. option:: -index-header-map
272
273Make the next included directory (-I or -F) an indexer header map
274
275.. option:: -init <arg>
276
277.. option:: -install\_name <arg>
278
279.. option:: -keep\_private\_externs
280
281.. option:: -lazy\_framework <arg>
282
283.. program:: clang1
284.. option:: -lazy\_library <arg>
285.. program:: clang
286
287.. option:: -mbig-endian, -EB
288
289.. option:: --migrate
290
291Run the migrator
292
293.. option:: -mios-simulator-version-min=<arg>, -miphonesimulator-version-min=<arg>
294
295.. option:: -mlinker-version=<arg>
296
297.. option:: -mlittle-endian, -EL
298
299.. option:: -mllvm <arg>
300
301Additional arguments to forward to LLVM's option processing
302
303.. option:: -module-dependency-dir <arg>
304
305Directory to dump module dependencies to
306
307.. option:: -mtvos-simulator-version-min=<arg>, -mappletvsimulator-version-min=<arg>
308
309.. option:: -multi\_module
310
311.. option:: -multiply\_defined <arg>
312
313.. program:: clang1
314.. option:: -multiply\_defined\_unused <arg>
315.. program:: clang
316
317.. option:: -mwatchos-simulator-version-min=<arg>, -mwatchsimulator-version-min=<arg>
318
319.. option:: --no-cuda-version-check
320
321Don't error out if the detected version of the CUDA install is too low for the requested CUDA gpu architecture.
322
323.. option:: -no-integrated-cpp, --no-integrated-cpp
324
325.. option:: -no\_dead\_strip\_inits\_and\_terms
326
327.. option:: -nobuiltininc
328
329Disable builtin #include directories
330
331.. option:: -nocudainc
332
333.. option:: -nocudalib
334
335.. option:: -nodefaultlibs
336
337.. option:: -nofixprebinding
338
339.. option:: -nolibc
340
341.. option:: -nomultidefs
342
343.. option:: -nopie, -no-pie
344
345.. option:: -noprebind
346
347.. option:: -noprofilelib
348
349.. option:: -noseglinkedit
350
351.. option:: -nostartfiles
352
353.. option:: -nostdinc, --no-standard-includes
354
355.. program:: clang1
356.. option:: -nostdinc++
357.. program:: clang
358
359Disable standard #include directories for the C++ standard library
360
361.. option:: -nostdlib, --no-standard-libraries
362
363.. program:: clang1
364.. option:: -nostdlib++
365.. program:: clang
366
367.. option:: -nostdlibinc
368
369.. option:: -o<file>, --output <arg>, --output=<arg>
370
371Write output to <file>
372
373.. option:: -objcmt-atomic-property
374
375Make migration to 'atomic' properties
376
377.. option:: -objcmt-migrate-all
378
379Enable migration to modern ObjC
380
381.. option:: -objcmt-migrate-annotation
382
383Enable migration to property and method annotations
384
385.. option:: -objcmt-migrate-designated-init
386
387Enable migration to infer NS\_DESIGNATED\_INITIALIZER for initializer methods
388
389.. option:: -objcmt-migrate-instancetype
390
391Enable migration to infer instancetype for method result type
392
393.. option:: -objcmt-migrate-literals
394
395Enable migration to modern ObjC literals
396
397.. option:: -objcmt-migrate-ns-macros
398
399Enable migration to NS\_ENUM/NS\_OPTIONS macros
400
401.. option:: -objcmt-migrate-property
402
403Enable migration to modern ObjC property
404
405.. option:: -objcmt-migrate-property-dot-syntax
406
407Enable migration of setter/getter messages to property-dot syntax
408
409.. option:: -objcmt-migrate-protocol-conformance
410
411Enable migration to add protocol conformance on classes
412
413.. option:: -objcmt-migrate-readonly-property
414
415Enable migration to modern ObjC readonly property
416
417.. option:: -objcmt-migrate-readwrite-property
418
419Enable migration to modern ObjC readwrite property
420
421.. option:: -objcmt-migrate-subscripting
422
423Enable migration to modern ObjC subscripting
424
425.. option:: -objcmt-ns-nonatomic-iosonly
426
427Enable migration to use NS\_NONATOMIC\_IOSONLY macro for setting property's 'atomic' attribute
428
429.. option:: -objcmt-returns-innerpointer-property
430
431Enable migration to annotate property with NS\_RETURNS\_INNER\_POINTER
432
433.. option:: -objcmt-whitelist-dir-path=<arg>, -objcmt-white-list-dir-path=<arg>
434
435Only modify files with a filename contained in the provided directory path
436
437.. option:: -object
438
439.. option:: -p, --profile
440
441.. option:: -pagezero\_size<arg>
442
443.. option:: -pg
444
445Enable mcount instrumentation
446
447.. option:: -pie
448
449.. option:: -pipe, --pipe
450
451Use pipes between commands, when possible
452
453.. option:: -prebind
454
455.. program:: clang1
456.. option:: -prebind\_all\_twolevel\_modules
457.. program:: clang
458
459.. option:: -preload
460
461.. option:: --print-diagnostic-categories
462
463.. option:: -print-effective-triple, --print-effective-triple
464
465Print the effective target triple
466
467.. option:: -print-file-name=<file>, --print-file-name=<file>, --print-file-name <arg>
468
469Print the full library path of <file>
470
471.. option:: -print-ivar-layout
472
473Enable Objective-C Ivar layout bitmap print trace
474
475.. option:: -print-libgcc-file-name, --print-libgcc-file-name
476
477Print the library path for the currently used compiler runtime library ("libgcc.a" or "libclang\_rt.builtins.\*.a")
478
479.. option:: -print-multi-directory, --print-multi-directory
480
481.. option:: -print-multi-lib, --print-multi-lib
482
483.. option:: -print-prog-name=<name>, --print-prog-name=<name>, --print-prog-name <arg>
484
485Print the full program path of <name>
486
487.. option:: -print-resource-dir, --print-resource-dir
488
489Print the resource directory pathname
490
491.. option:: -print-search-dirs, --print-search-dirs
492
493Print the paths used for finding libraries and programs
494
495.. option:: -print-target-triple, --print-target-triple
496
497Print the normalized target triple
498
499.. option:: -private\_bundle
500
501.. option:: -pthread, -no-pthread
502
503Support POSIX threads in generated code
504
505.. option:: -pthreads
506
507.. option:: -rdynamic
508
509.. option:: -read\_only\_relocs <arg>
510
511.. option:: -relocatable-pch, --relocatable-pch
512
513Whether to build a relocatable precompiled header
514
515.. option:: -remap
516
517.. option:: -rewrite-legacy-objc
518
519Rewrite Legacy Objective-C source to C++
520
521.. option:: -rtlib=<arg>, --rtlib=<arg>, --rtlib <arg>
522
523Compiler runtime library to use
524
525.. option:: -save-stats=<arg>, --save-stats=<arg>, -save-stats (equivalent to -save-stats=cwd), --save-stats (equivalent to -save-stats=cwd)
526
527Save llvm statistics.
528
529.. option:: -save-temps=<arg>, --save-temps=<arg>, -save-temps (equivalent to -save-temps=cwd), --save-temps (equivalent to -save-temps=cwd)
530
531Save intermediate compilation results.
532
533.. option:: -sectalign <arg1> <arg2> <arg3>
534
535.. option:: -sectcreate <arg1> <arg2> <arg3>
536
537.. option:: -sectobjectsymbols <arg1> <arg2>
538
539.. option:: -sectorder <arg1> <arg2> <arg3>
540
541.. option:: -seg1addr<arg>
542
543.. option:: -seg\_addr\_table <arg>
544
545.. program:: clang1
546.. option:: -seg\_addr\_table\_filename <arg>
547.. program:: clang
548
549.. option:: -segaddr <arg1> <arg2>
550
551.. option:: -segcreate <arg1> <arg2> <arg3>
552
553.. option:: -seglinkedit
554
555.. option:: -segprot <arg1> <arg2> <arg3>
556
557.. option:: -segs\_read\_<arg>
558
559.. program:: clang1
560.. option:: -segs\_read\_only\_addr <arg>
561.. program:: clang
562
563.. program:: clang2
564.. option:: -segs\_read\_write\_addr <arg>
565.. program:: clang
566
567.. option:: -serialize-diagnostics <arg>, --serialize-diagnostics <arg>
568
569Serialize compiler diagnostics to a file
570
571.. option:: -shared, --shared
572
573.. option:: -shared-libgcc
574
575.. option:: -shared-libsan, -shared-libasan
576
577Dynamically link the sanitizer runtime
578
579.. option:: -single\_module
580
581.. option:: -specs=<arg>, --specs=<arg>
582
583.. option:: -static, --static
584
585.. option:: -static-libgcc
586
587.. option:: -static-libsan
588
589Statically link the sanitizer runtime
590
591.. option:: -static-libstdc++
592
593.. option:: -std-default=<arg>
594
595.. option:: -stdlib=<arg>, --stdlib=<arg>, --stdlib <arg>
596
597C++ standard library to use
598
599.. option:: -sub\_library<arg>
600
601.. program:: clang1
602.. option:: -sub\_umbrella<arg>
603.. program:: clang
604
605.. option:: --sysroot=<arg>, --sysroot <arg>
606
607.. option:: --target-help
608
609.. option:: --target=<arg>, -target <arg>
610
611Generate code for the given target
612
613.. option:: --print-supported-cpus
614
615Print supported cpu models for the given target
616
617.. option:: -time
618
619Time individual commands
620
621.. option:: -traditional, --traditional
622
623.. option:: -traditional-cpp, --traditional-cpp
624
625Enable some traditional CPP emulation
626
627.. option:: -twolevel\_namespace
628
629.. program:: clang1
630.. option:: -twolevel\_namespace\_hints
631.. program:: clang
632
633.. option:: -umbrella <arg>
634
635.. option:: -unexported\_symbols\_list <arg>
636
637.. option:: -v, --verbose
638
639Show commands to run and use verbose output
640
641.. option:: --verify-debug-info
642
643Verify the binary representation of debug output
644
645.. option:: --version
646
647Print version information
648
649.. option:: -w, --no-warnings
650
651Suppress all warnings
652
653.. option:: -weak-l<arg>
654
655.. option:: -weak\_framework <arg>
656
657.. program:: clang1
658.. option:: -weak\_library <arg>
659.. program:: clang
660
661.. program:: clang2
662.. option:: -weak\_reference\_mismatches <arg>
663.. program:: clang
664
665.. option:: -whatsloaded
666
667.. option:: -whyload
668
669.. option:: -working-directory<arg>, -working-directory=<arg>
670
671Resolve file paths relative to the specified directory
672
673.. option:: -x<language>, --language <arg>, --language=<arg>
674
675Treat subsequent input files as having type <language>
676
677.. option:: -y<arg>
678
679Actions
680=======
681The action to perform on the input.
682
683.. option:: -E, --preprocess
684
685Only run the preprocessor
686
687.. option:: -S, --assemble
688
689Only run preprocess and compilation steps
690
691.. option:: -c, --compile
692
693Only run preprocess, compile, and assemble steps
694
695.. option:: -emit-llvm
696
697Use the LLVM representation for assembler and object files
698
699.. option:: -fsyntax-only
700
701.. option:: -module-file-info
702
703Provide information about a particular module file
704
705.. option:: --precompile
706
707Only precompile the input
708
709.. option:: -rewrite-objc
710
711Rewrite Objective-C source to C++
712
713.. option:: -verify-pch
714
715Load and verify that a pre-compiled header file is not stale
716
717Compilation flags
718=================
719
720Flags controlling the behavior of Clang during compilation. These flags have
721no effect during actions that do not perform compilation.
722
723.. option:: -Xassembler <arg>
724
725Pass <arg> to the assembler
726
727.. option:: -Xclang <arg>
728
729Pass <arg> to the clang compiler
730
731.. option:: -fclang-abi-compat=<version>
732
733Attempt to match the ABI of Clang <version>
734
735.. option:: -fcomment-block-commands=<arg>,<arg2>...
736
737Treat each comma separated argument in <arg> as a documentation comment block command
738
739.. option:: -fcomplete-member-pointers, -fno-complete-member-pointers
740
741Require member pointer base types to be complete if they would be significant under the Microsoft ABI
742
743.. option:: -fcrash-diagnostics-dir=<arg>
744
745.. option:: -fdeclspec, -fno-declspec
746
747Allow \_\_declspec as a keyword
748
749.. option:: -fdepfile-entry=<arg>
750
751.. option:: -fdiagnostics-fixit-info, -fno-diagnostics-fixit-info
752
753.. option:: -fdiagnostics-format=<arg>
754
755.. option:: -fdiagnostics-parseable-fixits
756
757Print fix-its in machine parseable form
758
759.. option:: -fdiagnostics-print-source-range-info
760
761Print source range spans in numeric form
762
763.. option:: -fdiagnostics-show-category=<arg>
764
765.. option:: -fdiscard-value-names, -fno-discard-value-names
766
767Discard value names in LLVM IR
768
769.. option:: -fexperimental-isel, -fno-experimental-isel
770
771Enables the experimental global instruction selector
772
773.. option:: -fexperimental-new-pass-manager, -fno-experimental-new-pass-manager
774
775Enables an experimental new pass manager in LLVM.
776
777.. option:: -ffine-grained-bitfield-accesses, -fno-fine-grained-bitfield-accesses
778
779Use separate accesses for consecutive bitfield runs with legal widths and alignments.
780
781.. option:: -finline-functions, -fno-inline-functions
782
783Inline suitable functions
784
785.. option:: -finline-hint-functions
786
787Inline functions which are (explicitly or implicitly) marked inline
788
789.. option:: -fno-crash-diagnostics
790
791Disable auto-generation of preprocessed source files and a script for reproduction during a clang crash
792
793.. option:: -fno-sanitize-blacklist
794
795Don't use blacklist file for sanitizers
796
797.. option:: -fparse-all-comments
798
799.. option:: -frecord-command-line, -frecord-gcc-switches, -fno-record-command-line, -fno-record-gcc-switches
800
801Generate a section named ".GCC.command.line" containing the clang driver
802command-line. After linking, the section may contain multiple command lines,
803which will be individually terminated by null bytes. Separate arguments within
804a command line are combined with spaces; spaces and backslashes within an
805argument are escaped with backslashes. This format differs from the format of
806the equivalent section produced by GCC with the -frecord-gcc-switches flag.
807This option is currently only supported on ELF targets.
808
809.. option:: -fsanitize-address-field-padding=<arg>
810
811Level of field padding for AddressSanitizer
812
813.. option:: -fsanitize-address-globals-dead-stripping
814
815Enable linker dead stripping of globals in AddressSanitizer
816
817.. option:: -fsanitize-address-use-odr-indicator, -fno-sanitize-address-use-odr-indicator
818
819Enable ODR indicator globals to avoid false ODR violation reports in partially sanitized programs at the cost of an increase in binary size
820
821.. option:: -fsanitize-address-poison-custom-array-cookie, -fno-sanitize-address-poison-custom-array-cookie
822
823Enable "poisoning" array cookies when allocating arrays with a custom operator new\[\] in Address Sanitizer, preventing accesses to the cookies from user code. An array cookie is a small implementation-defined header added to certain array allocations to record metadata such as the length of the array. Accesses to array cookies from user code are technically allowed by the standard but are more likely to be the result of an out-of-bounds array access.
824
825An operator new\[\] is "custom" if it is not one of the allocation functions provided by the C++ standard library. Array cookies from non-custom allocation functions are always poisoned.
826
827.. option:: -fsanitize-address-use-after-scope, -fno-sanitize-address-use-after-scope
828
829Enable use-after-scope detection in AddressSanitizer
830
831.. option:: -fsanitize-blacklist=<arg>
832
833Path to blacklist file for sanitizers
834
835.. option:: -fsanitize-cfi-cross-dso, -fno-sanitize-cfi-cross-dso
836
837Enable control flow integrity (CFI) checks for cross-DSO calls.
838
839.. option:: -fsanitize-cfi-icall-generalize-pointers
840
841Generalize pointers in CFI indirect call type signature checks
842
843.. option:: -fsanitize-coverage=<arg1>,<arg2>..., -fno-sanitize-coverage=<arg1>,<arg2>...
844
845Specify the type of coverage instrumentation for Sanitizers
846
847.. option:: -fsanitize-link-c++-runtime
848
849.. option:: -fsanitize-memory-track-origins, -fno-sanitize-memory-track-origins
850
851Enable origins tracking in MemorySanitizer
852
853.. program:: clang1
854.. option:: -fsanitize-memory-track-origins=<arg>
855.. program:: clang
856
857Enable origins tracking in MemorySanitizer
858
859.. option:: -fsanitize-memory-use-after-dtor, -fno-sanitize-memory-use-after-dtor
860
861Enable use-after-destroy detection in MemorySanitizer
862
863.. option:: -fsanitize-minimal-runtime, -fno-sanitize-minimal-runtime
864
865.. option:: -fsanitize-recover, -fno-sanitize-recover
866
867.. program:: clang1
868.. option:: -fsanitize-recover=<arg1>,<arg2>..., -fno-sanitize-recover=<arg1>,<arg2>...
869.. program:: clang
870
871Enable recovery for specified sanitizers
872
873.. option:: -fsanitize-stats, -fno-sanitize-stats
874
875Enable sanitizer statistics gathering.
876
877.. option:: -fsanitize-thread-atomics, -fno-sanitize-thread-atomics
878
879Enable atomic operations instrumentation in ThreadSanitizer (default)
880
881.. option:: -fsanitize-thread-func-entry-exit, -fno-sanitize-thread-func-entry-exit
882
883Enable function entry/exit instrumentation in ThreadSanitizer (default)
884
885.. option:: -fsanitize-thread-memory-access, -fno-sanitize-thread-memory-access
886
887Enable memory access instrumentation in ThreadSanitizer (default)
888
889.. option:: -fsanitize-trap=<arg1>,<arg2>..., -fno-sanitize-trap=<arg1>,<arg2>...
890
891Enable trapping for specified sanitizers
892
893.. option:: -fsanitize-undefined-strip-path-components=<number>
894
895Strip (or keep only, if negative) a given number of path components when emitting check metadata.
896
897.. option:: -fsanitize-undefined-trap-on-error, -fno-sanitize-undefined-trap-on-error
898
899.. option:: -fsanitize=<check>,<arg2>..., -fno-sanitize=<arg1>,<arg2>...
900
901Turn on runtime checks for various forms of undefined or suspicious behavior. See user manual for available checks
902
903.. option:: -moutline, -mno-outline
904
905Enable function outlining (AArch64 only)
906
907.. option:: --param <arg>, --param=<arg>
908
909.. option:: -std=<arg>, --std=<arg>, --std <arg>
910
911Language standard to compile for
912
913Preprocessor flags
914~~~~~~~~~~~~~~~~~~
915
916Flags controlling the behavior of the Clang preprocessor.
917
918.. option:: -C, --comments
919
920Include comments in preprocessed output
921
922.. option:: -CC, --comments-in-macros
923
924Include comments from within macros in preprocessed output
925
926.. option:: -D<macro>=<value>, --define-macro <arg>, --define-macro=<arg>
927
928Define <macro> to <value> (or 1 if <value> omitted)
929
930.. option:: -H, --trace-includes
931
932Show header includes and nesting depth
933
934.. option:: -P, --no-line-commands
935
936Disable linemarker output in -E mode
937
938.. option:: -U<macro>, --undefine-macro <arg>, --undefine-macro=<arg>
939
940Undefine macro <macro>
941
942.. option:: -Wp,<arg>,<arg2>...
943
944Pass the comma separated arguments in <arg> to the preprocessor
945
946.. option:: -Xpreprocessor <arg>
947
948Pass <arg> to the preprocessor
949
950Include path management
951-----------------------
952
953Flags controlling how ``#include``\s are resolved to files.
954
955.. option:: -I<dir>, --include-directory <arg>, --include-directory=<arg>
956
957Add directory to include search path
958
959.. option:: -I-, --include-barrier
960
961Restrict all prior -I flags to double-quoted inclusion and remove current directory from include path
962
963.. option:: --cuda-path-ignore-env
964
965Ignore environment variables to detect CUDA installation
966
967.. option:: --cuda-path=<arg>
968
969CUDA installation path
970
971.. option:: -cxx-isystem<directory>
972
973Add directory to the C++ SYSTEM include search path
974
975.. option:: -fbuild-session-file=<file>
976
977Use the last modification time of <file> as the build session timestamp
978
979.. option:: -fbuild-session-timestamp=<time since Epoch in seconds>
980
981Time when the current build session started
982
983.. option:: -fmodule-file=\[<name>=\]<file>
984
985Specify the mapping of module name to precompiled module file, or load a module file if name is omitted.
986
987.. option:: -fmodules-cache-path=<directory>
988
989Specify the module cache path
990
991.. option:: -fmodules-disable-diagnostic-validation
992
993Disable validation of the diagnostic options when loading the module
994
995.. option:: -fmodules-prune-after=<seconds>
996
997Specify the interval (in seconds) after which a module file will be considered unused
998
999.. option:: -fmodules-prune-interval=<seconds>
1000
1001Specify the interval (in seconds) between attempts to prune the module cache
1002
1003.. option:: -fmodules-user-build-path <directory>
1004
1005Specify the module user build path
1006
1007.. option:: -fmodules-validate-once-per-build-session
1008
1009Don't verify input files for the modules if the module has been successfully validated or loaded during this build session
1010
1011.. option:: -fmodules-validate-system-headers, -fno-modules-validate-system-headers
1012
1013Validate the system headers that a module depends on when loading the module
1014
1015.. option:: -fprebuilt-module-path=<directory>
1016
1017Specify the prebuilt module path
1018
1019.. option:: -idirafter<arg>, --include-directory-after <arg>, --include-directory-after=<arg>
1020
1021Add directory to AFTER include search path
1022
1023.. option:: -iframework<arg>
1024
1025Add directory to SYSTEM framework search path
1026
1027.. option:: -iframeworkwithsysroot<directory>
1028
1029Add directory to SYSTEM framework search path, absolute paths are relative to -isysroot
1030
1031.. option:: -imacros<file>, --imacros<file>, --imacros=<arg>
1032
1033Include macros from file before parsing
1034
1035.. option:: -include<file>, --include<file>, --include=<arg>
1036
1037Include file before parsing
1038
1039.. option:: -include-pch <file>
1040
1041Include precompiled header file
1042
1043.. option:: -iprefix<dir>, --include-prefix <arg>, --include-prefix=<arg>
1044
1045Set the -iwithprefix/-iwithprefixbefore prefix
1046
1047.. option:: -iquote<directory>
1048
1049Add directory to QUOTE include search path
1050
1051.. option:: -isysroot<dir>
1052
1053Set the system root directory (usually /)
1054
1055.. option:: -isystem<directory>
1056
1057Add directory to SYSTEM include search path
1058
1059.. option:: -isystem-after<directory>
1060
1061Add directory to end of the SYSTEM include search path
1062
1063.. option:: -ivfsoverlay<arg>
1064
1065Overlay the virtual filesystem described by file over the real file system
1066
1067.. option:: -iwithprefix<dir>, --include-with-prefix <arg>, --include-with-prefix-after <arg>, --include-with-prefix-after=<arg>, --include-with-prefix=<arg>
1068
1069Set directory to SYSTEM include search path with prefix
1070
1071.. option:: -iwithprefixbefore<dir>, --include-with-prefix-before <arg>, --include-with-prefix-before=<arg>
1072
1073Set directory to include search path with prefix
1074
1075.. option:: -iwithsysroot<directory>
1076
1077Add directory to SYSTEM include search path, absolute paths are relative to -isysroot
1078
1079.. option:: --ptxas-path=<arg>
1080
1081Path to ptxas (used for compiling CUDA code)
1082
1083.. option:: --system-header-prefix=<prefix>, --no-system-header-prefix=<prefix>, --system-header-prefix <arg>
1084
1085Treat all #include paths starting with <prefix> as including a system header.
1086
1087Dependency file generation
1088--------------------------
1089
1090Flags controlling generation of a dependency file for ``make``-like build
1091systems.
1092
1093.. option:: -M, --dependencies
1094
1095Like -MD, but also implies -E and writes to stdout by default
1096
1097.. option:: -MD, --write-dependencies
1098
1099Write a depfile containing user and system headers
1100
1101.. option:: -MF<file>
1102
1103Write depfile output from -MMD, -MD, -MM, or -M to <file>
1104
1105.. option:: -MG, --print-missing-file-dependencies
1106
1107Add missing headers to depfile
1108
1109.. option:: -MJ<arg>
1110
1111Write a compilation database entry per input
1112
1113.. option:: -MM, --user-dependencies
1114
1115Like -MMD, but also implies -E and writes to stdout by default
1116
1117.. option:: -MMD, --write-user-dependencies
1118
1119Write a depfile containing user headers
1120
1121.. option:: -MP
1122
1123Create phony target for each dependency (other than main file)
1124
1125.. option:: -MQ<arg>
1126
1127Specify name of main file output to quote in depfile
1128
1129.. option:: -MT<arg>
1130
1131Specify name of main file output in depfile
1132
1133.. option:: -MV
1134
1135Use NMake/Jom format for the depfile
1136
1137Dumping preprocessor state
1138--------------------------
1139
1140Flags allowing the state of the preprocessor to be dumped in various ways.
1141
1142.. option:: -d
1143
1144.. program:: clang1
1145.. option:: -d<arg>
1146.. program:: clang
1147
1148.. option:: -dD
1149
1150Print macro definitions in -E mode in addition to normal output
1151
1152.. option:: -dI
1153
1154Print include directives in -E mode in addition to normal output
1155
1156.. option:: -dM
1157
1158Print macro definitions in -E mode instead of normal output
1159
1160Diagnostic flags
1161~~~~~~~~~~~~~~~~
1162
1163Flags controlling which warnings, errors, and remarks Clang will generate.
1164See the :doc:`full list of warning and remark flags <DiagnosticsReference>`.
1165
1166.. option:: -R<remark>
1167
1168Enable the specified remark
1169
1170.. option:: -Rpass-analysis=<arg>
1171
1172Report transformation analysis from optimization passes whose name matches the given POSIX regular expression
1173
1174.. option:: -Rpass-missed=<arg>
1175
1176Report missed transformations by optimization passes whose name matches the given POSIX regular expression
1177
1178.. option:: -Rpass=<arg>
1179
1180Report transformations performed by optimization passes whose name matches the given POSIX regular expression
1181
1182.. option:: -W<warning>, --extra-warnings, --warn-<arg>, --warn-=<arg>
1183
1184Enable the specified warning
1185
1186.. option:: -Wdeprecated, -Wno-deprecated
1187
1188Enable warnings for deprecated constructs and define \_\_DEPRECATED
1189
1190.. option:: -Wnonportable-cfstrings<arg>, -Wno-nonportable-cfstrings<arg>
1191
1192Target-independent compilation options
1193~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1194.. option:: -Wframe-larger-than=<arg>
1195
1196.. option:: -fPIC, -fno-PIC
1197
1198.. option:: -fPIE, -fno-PIE
1199
1200.. option:: -faccess-control, -fno-access-control
1201
1202.. option:: -faddrsig, -fno-addrsig
1203
1204Emit an address-significance table
1205
1206.. option:: -falign-functions, -fno-align-functions
1207
1208.. program:: clang1
1209.. option:: -falign-functions=<arg>
1210.. program:: clang
1211
1212.. program:: clang1
1213.. option:: -faligned-allocation, -faligned-new, -fno-aligned-allocation
1214.. program:: clang
1215
1216Enable C++17 aligned allocation functions
1217
1218.. option:: -fallow-editor-placeholders, -fno-allow-editor-placeholders
1219
1220Treat editor placeholders as valid source code
1221
1222.. option:: -fallow-unsupported
1223
1224.. option:: -faltivec, -fno-altivec
1225
1226.. option:: -fansi-escape-codes
1227
1228Use ANSI escape codes for diagnostics
1229
1230.. option:: -fapple-kext, -findirect-virtual-calls, -fterminated-vtables
1231
1232Use Apple's kernel extensions ABI
1233
1234.. option:: -fapple-pragma-pack, -fno-apple-pragma-pack
1235
1236Enable Apple gcc-compatible #pragma pack handling
1237
1238.. option:: -fapplication-extension, -fno-application-extension
1239
1240Restrict code to those available for App Extensions
1241
1242.. option:: -fasm, -fno-asm
1243
1244.. option:: -fasm-blocks, -fno-asm-blocks
1245
1246.. option:: -fassociative-math, -fno-associative-math
1247
1248.. option:: -fassume-sane-operator-new, -fno-assume-sane-operator-new
1249
1250.. option:: -fast
1251
1252.. option:: -fastcp
1253
1254.. option:: -fastf
1255
1256.. option:: -fasynchronous-unwind-tables, -fno-asynchronous-unwind-tables
1257
1258.. option:: -fautolink, -fno-autolink
1259
1260.. option:: -fblocks, -fno-blocks
1261
1262Enable the 'blocks' language feature
1263
1264.. option:: -fbootclasspath=<arg>, --bootclasspath <arg>, --bootclasspath=<arg>
1265
1266.. option:: -fborland-extensions, -fno-borland-extensions
1267
1268Accept non-standard constructs supported by the Borland compiler
1269
1270.. option:: -fbracket-depth=<arg>
1271
1272.. option:: -fbuiltin, -fno-builtin
1273
1274.. option:: -fbuiltin-module-map
1275
1276Load the clang builtins module map file.
1277
1278.. option:: -fc++-static-destructors, -fno-c++-static-destructors
1279
1280Enable C++ static destructor registration (the default)
1281
1282.. option:: -fcaret-diagnostics, -fno-caret-diagnostics
1283
1284.. option:: -fcf-protection=<arg>, -fcf-protection (equivalent to -fcf-protection=full)
1285
1286Instrument control-flow architecture protection. Options: return, branch, full, none.
1287
1288.. option:: -fchar8\_t, -fno-char8\_t
1289
1290Enable C++ builtin type char8\_t
1291
1292.. option:: -fclasspath=<arg>, --CLASSPATH <arg>, --CLASSPATH=<arg>, --classpath <arg>, --classpath=<arg>
1293
1294.. option:: -fcolor-diagnostics, -fno-color-diagnostics
1295
1296Use colors in diagnostics
1297
1298.. option:: -fcommon, -fno-common
1299
1300.. option:: -fcompile-resource=<arg>, --resource <arg>, --resource=<arg>
1301
1302.. option:: -fconstant-cfstrings, -fno-constant-cfstrings
1303
1304.. option:: -fconstant-string-class=<arg>
1305
1306.. option:: -fconstexpr-backtrace-limit=<arg>
1307
1308.. option:: -fconstexpr-depth=<arg>
1309
1310.. option:: -fconstexpr-steps=<arg>
1311
1312.. option:: -fcoroutines-ts, -fno-coroutines-ts
1313
1314Enable support for the C++ Coroutines TS
1315
1316.. option:: -fcoverage-mapping, -fno-coverage-mapping
1317
1318Generate coverage mapping to enable code coverage analysis
1319
1320.. option:: -fcreate-profile
1321
1322.. option:: -fcxx-exceptions, -fno-cxx-exceptions
1323
1324Enable C++ exceptions
1325
1326.. option:: -fcxx-modules, -fno-cxx-modules
1327
1328.. option:: -fdata-sections, -fno-data-sections
1329
1330Place each data in its own section (ELF Only)
1331
1332.. option:: -fdebug-info-for-profiling, -fno-debug-info-for-profiling
1333
1334Emit extra debug info to make sample profile more accurate.
1335
1336.. option:: -fdebug-macro, -fno-debug-macro
1337
1338Emit macro debug information
1339
1340.. option:: -fdebug-pass-arguments
1341
1342.. option:: -fdebug-pass-structure
1343
1344.. option:: -fdebug-prefix-map=<arg>
1345
1346remap file source paths in debug info
1347
1348.. option:: -fdebug-types-section, -fno-debug-types-section
1349
1350Place debug types in their own section (ELF Only)
1351
1352.. option:: -fdelayed-template-parsing, -fno-delayed-template-parsing
1353
1354Parse templated function definitions at the end of the translation unit
1355
1356.. option:: -fdelete-null-pointer-checks, -fno-delete-null-pointer-checks
1357
1358Treat usage of null pointers as undefined behavior.
1359
1360.. option:: -fdenormal-fp-math=<arg>
1361
1362.. option:: -fdiagnostics-absolute-paths
1363
1364Print absolute paths in diagnostics
1365
1366.. option:: -fdiagnostics-color, -fno-diagnostics-color
1367
1368.. program:: clang1
1369.. option:: -fdiagnostics-color=<arg>
1370.. program:: clang
1371
1372.. option:: -fdiagnostics-hotness-threshold=<number>
1373
1374Prevent optimization remarks from being output if they do not have at least this profile count
1375
1376.. option:: -fdiagnostics-show-hotness, -fno-diagnostics-show-hotness
1377
1378Enable profile hotness information in diagnostic line
1379
1380.. option:: -fdiagnostics-show-note-include-stack, -fno-diagnostics-show-note-include-stack
1381
1382Display include stacks for diagnostic notes
1383
1384.. option:: -fdiagnostics-show-option, -fno-diagnostics-show-option
1385
1386Print option name with mappable diagnostics
1387
1388.. option:: -fdiagnostics-show-template-tree
1389
1390Print a template comparison tree for differing templates
1391
1392.. option:: -fdigraphs, -fno-digraphs
1393
1394Enable alternative token representations '<:', ':>', '<%', '%>', '%:', '%:%:' (default)
1395
1396.. option:: -fdollars-in-identifiers, -fno-dollars-in-identifiers
1397
1398Allow '$' in identifiers
1399
1400.. option:: -fdouble-square-bracket-attributes, -fno-double-square-bracket-attributes
1401
1402Enable '\[\[\]\]' attributes in all C and C++ language modes
1403
1404.. option:: -fdwarf-directory-asm, -fno-dwarf-directory-asm
1405
1406.. option:: -fdwarf-exceptions
1407
1408Use DWARF style exceptions
1409
1410.. option:: -felide-constructors, -fno-elide-constructors
1411
1412.. option:: -feliminate-unused-debug-symbols, -fno-eliminate-unused-debug-symbols
1413
1414.. option:: -fembed-bitcode=<option>, -fembed-bitcode (equivalent to -fembed-bitcode=all), -fembed-bitcode-marker (equivalent to -fembed-bitcode=marker)
1415
1416Embed LLVM bitcode (option: off, all, bitcode, marker)
1417
1418.. option:: -femit-all-decls
1419
1420Emit all declarations, even if unused
1421
1422.. option:: -femulated-tls, -fno-emulated-tls
1423
1424Use emutls functions to access thread\_local variables
1425
1426.. option:: -fencoding=<arg>, --encoding <arg>, --encoding=<arg>
1427
1428.. option:: -ferror-limit=<arg>
1429
1430.. option:: -fescaping-block-tail-calls, -fno-escaping-block-tail-calls
1431
1432.. option:: -fexceptions, -fno-exceptions
1433
1434Enable support for exception handling
1435
1436.. option:: -fexec-charset=<arg>
1437
1438.. option:: -fextdirs=<arg>, --extdirs <arg>, --extdirs=<arg>
1439
1440.. option:: -ffast-math, -fno-fast-math
1441
1442Allow aggressive, lossy floating-point optimizations
1443
1444.. option:: -ffinite-math-only, -fno-finite-math-only
1445
1446.. option:: -ffixed-point, -fno-fixed-point
1447
1448Enable fixed point types
1449
1450.. option:: -ffor-scope, -fno-for-scope
1451
1452.. option:: -fforce-emit-vtables, -fno-force-emit-vtables
1453
1454Emits more virtual tables to improve devirtualization
1455
1456.. option:: -fforce-enable-int128, -fno-force-enable-int128
1457
1458Enable support for int128\_t type
1459
1460.. option:: -ffp-contract=<arg>
1461
1462Form fused FP ops (e.g. FMAs): fast (everywhere) \| on (according to FP\_CONTRACT pragma, default) \| off (never fuse)
1463
1464.. option:: -ffreestanding
1465
1466Assert that the compilation takes place in a freestanding environment
1467
1468.. option:: -ffunction-sections, -fno-function-sections
1469
1470Place each function in its own section (ELF Only)
1471
1472.. option:: -fgnu-inline-asm, -fno-gnu-inline-asm
1473
1474.. option:: -fgnu-keywords, -fno-gnu-keywords
1475
1476Allow GNU-extension keywords regardless of language standard
1477
1478.. option:: -fgnu-runtime
1479
1480Generate output compatible with the standard GNU Objective-C runtime
1481
1482.. option:: -fgnu89-inline, -fno-gnu89-inline
1483
1484Use the gnu89 inline semantics
1485
1486.. option:: -fhonor-infinities, -fhonor-infinites, -fno-honor-infinities
1487
1488.. option:: -fhonor-nans, -fno-honor-nans
1489
1490.. option:: -fhosted
1491
1492.. option:: -fimplicit-module-maps, -fmodule-maps, -fno-implicit-module-maps
1493
1494Implicitly search the file system for module map files.
1495
1496.. option:: -fimplicit-modules, -fno-implicit-modules
1497
1498.. option:: -finput-charset=<arg>
1499
1500.. option:: -finstrument-function-entry-bare
1501
1502Instrument function entry only, after inlining, without arguments to the instrumentation call
1503
1504.. option:: -finstrument-functions
1505
1506Generate calls to instrument function entry and exit
1507
1508.. option:: -finstrument-functions-after-inlining
1509
1510Like -finstrument-functions, but insert the calls after inlining
1511
1512.. option:: -fintegrated-as, -fno-integrated-as, -integrated-as
1513
1514Enable the integrated assembler
1515
1516.. option:: -fjump-tables, -fno-jump-tables
1517
1518.. option:: -fkeep-static-consts
1519
1520Keep static const variables even if unused
1521
1522.. option:: -flax-vector-conversions, -fno-lax-vector-conversions
1523
1524.. option:: -flimited-precision=<arg>
1525
1526.. option:: -flto, -fno-lto
1527
1528Enable LTO in 'full' mode
1529
1530.. option:: -flto-jobs=<arg>
1531
1532Controls the backend parallelism of -flto=thin (default of 0 means the number of threads will be derived from the number of CPUs detected)
1533
1534.. program:: clang1
1535.. option:: -flto=<arg>
1536.. program:: clang
1537
1538Set LTO mode to either 'full' or 'thin'
1539
1540.. option:: -fmacro-backtrace-limit=<arg>
1541
1542.. option:: -fmath-errno, -fno-math-errno
1543
1544Require math functions to indicate errors by setting errno
1545
1546.. option:: -fmax-type-align=<arg>
1547
1548Specify the maximum alignment to enforce on pointers lacking an explicit alignment
1549
1550.. option:: -fmerge-all-constants, -fno-merge-all-constants
1551
1552Allow merging of constants
1553
1554.. option:: -fmessage-length=<arg>
1555
1556.. option:: -fmodule-file-deps, -fno-module-file-deps
1557
1558.. option:: -fmodule-map-file=<file>
1559
1560Load this module map file
1561
1562.. option:: -fmodule-name=<name>, -fmodule-implementation-of <arg>, -fmodule-name <arg>
1563
1564Specify the name of the module to build
1565
1566.. option:: -fmodules, -fno-modules
1567
1568Enable the 'modules' language feature
1569
1570.. option:: -fmodules-decluse, -fno-modules-decluse
1571
1572Require declaration of modules used within a module
1573
1574.. option:: -fmodules-ignore-macro=<arg>
1575
1576Ignore the definition of the given macro when building and loading modules
1577
1578.. option:: -fmodules-search-all, -fno-modules-search-all
1579
1580Search even non-imported modules to resolve references
1581
1582.. option:: -fmodules-strict-decluse
1583
1584Like -fmodules-decluse but requires all headers to be in modules
1585
1586.. option:: -fmodules-ts
1587
1588Enable support for the C++ Modules TS
1589
1590.. option:: -fms-compatibility, -fno-ms-compatibility
1591
1592Enable full Microsoft Visual C++ compatibility
1593
1594.. option:: -fms-compatibility-version=<arg>
1595
1596Dot-separated value representing the Microsoft compiler version number to report in \_MSC\_VER (0 = don't define it (default))
1597
1598.. option:: -fms-extensions, -fno-ms-extensions
1599
1600Accept some non-standard constructs supported by the Microsoft compiler
1601
1602.. option:: -fms-memptr-rep=<arg>
1603
1604.. option:: -fms-volatile<arg>
1605
1606.. option:: -fmsc-version=<arg>
1607
1608Microsoft compiler version number to report in \_MSC\_VER (0 = don't define it (default))
1609
1610.. option:: -fmudflap
1611
1612.. option:: -fmudflapth
1613
1614.. option:: -fnested-functions
1615
1616.. option:: -fnew-alignment=<align>, -fnew-alignment <arg>
1617
1618Specifies the largest alignment guaranteed by '::operator new(size\_t)'
1619
1620.. option:: -fnext-runtime
1621
1622.. option:: -fno-builtin-<arg>
1623
1624Disable implicit builtin knowledge of a specific function
1625
1626.. option:: -fno-elide-type
1627
1628Do not elide types when printing diagnostics
1629
1630.. option:: -fno-max-type-align
1631
1632.. option:: -fno-operator-names
1633
1634Do not treat C++ operator name keywords as synonyms for operators
1635
1636.. option:: -fno-rtti-data
1637
1638Control emission of RTTI data
1639
1640.. option:: -fno-strict-modules-decluse
1641
1642.. option:: -fno-working-directory
1643
1644.. option:: -fnoxray-link-deps
1645
1646.. option:: -fobjc-abi-version=<arg>
1647
1648.. option:: -fobjc-arc, -fno-objc-arc
1649
1650Synthesize retain and release calls for Objective-C pointers
1651
1652.. option:: -fobjc-arc-exceptions, -fno-objc-arc-exceptions
1653
1654Use EH-safe code when synthesizing retains and releases in -fobjc-arc
1655
1656.. option:: -fobjc-exceptions, -fno-objc-exceptions
1657
1658Enable Objective-C exceptions
1659
1660.. option:: -fobjc-infer-related-result-type, -fno-objc-infer-related-result-type
1661
1662.. option:: -fobjc-legacy-dispatch, -fno-objc-legacy-dispatch
1663
1664.. option:: -fobjc-link-runtime
1665
1666.. option:: -fobjc-nonfragile-abi, -fno-objc-nonfragile-abi
1667
1668.. option:: -fobjc-nonfragile-abi-version=<arg>
1669
1670.. option:: -fobjc-runtime=<arg>
1671
1672Specify the target Objective-C runtime kind and version
1673
1674.. option:: -fobjc-sender-dependent-dispatch
1675
1676.. option:: -fobjc-weak, -fno-objc-weak
1677
1678Enable ARC-style weak references in Objective-C
1679
1680.. option:: -fomit-frame-pointer, -fno-omit-frame-pointer
1681
1682.. option:: -fopenmp, -fno-openmp
1683
1684Parse OpenMP pragmas and generate parallel code.
1685
1686.. option:: -fopenmp-simd, -fno-openmp-simd
1687
1688Emit OpenMP code only for SIMD-based constructs.
1689
1690.. option:: -fopenmp-version=<arg>
1691
1692.. program:: clang1
1693.. option:: -fopenmp=<arg>
1694.. program:: clang
1695
1696.. option:: -foperator-arrow-depth=<arg>
1697
1698.. option:: -foptimization-record-file=<arg>
1699
1700Specify the file name of any generated YAML optimization record
1701
1702.. option:: -foptimize-sibling-calls, -fno-optimize-sibling-calls
1703
1704.. option:: -foutput-class-dir=<arg>, --output-class-directory <arg>, --output-class-directory=<arg>
1705
1706.. option:: -fpack-struct, -fno-pack-struct
1707
1708.. program:: clang1
1709.. option:: -fpack-struct=<arg>
1710.. program:: clang
1711
1712Specify the default maximum struct packing alignment
1713
1714.. option:: -fpascal-strings, -fno-pascal-strings, -mpascal-strings
1715
1716Recognize and construct Pascal-style string literals
1717
1718.. option:: -fpcc-struct-return
1719
1720Override the default ABI to return all structs on the stack
1721
1722.. option:: -fpch-preprocess
1723
1724.. option:: -fpic, -fno-pic
1725
1726.. option:: -fpie, -fno-pie
1727
1728.. option:: -fplt, -fno-plt
1729
1730Use the PLT to make function calls
1731
1732.. option:: -fplugin=<dsopath>
1733
1734Load the named plugin (dynamic shared object)
1735
1736.. option:: -fpreserve-as-comments, -fno-preserve-as-comments
1737
1738.. option:: -fprofile-arcs, -fno-profile-arcs
1739
1740.. option:: -fprofile-dir=<arg>
1741
1742.. option:: -fprofile-generate, -fno-profile-generate
1743
1744Generate instrumented code to collect execution counts into default.profraw (overridden by LLVM\_PROFILE\_FILE env var)
1745
1746.. program:: clang1
1747.. option:: -fprofile-generate=<directory>
1748.. program:: clang
1749
1750Generate instrumented code to collect execution counts into <directory>/default.profraw (overridden by LLVM\_PROFILE\_FILE env var)
1751
1752.. option:: -fprofile-instr-generate, -fno-profile-instr-generate
1753
1754Generate instrumented code to collect execution counts into default.profraw file (overridden by '=' form of option or LLVM\_PROFILE\_FILE env var)
1755
1756.. program:: clang1
1757.. option:: -fprofile-instr-generate=<file>
1758.. program:: clang
1759
1760Generate instrumented code to collect execution counts into <file> (overridden by LLVM\_PROFILE\_FILE env var)
1761
1762.. option:: -fprofile-instr-use, -fno-profile-instr-use, -fprofile-use
1763
1764.. program:: clang1
1765.. option:: -fprofile-instr-use=<arg>
1766.. program:: clang
1767
1768Use instrumentation data for profile-guided optimization
1769
1770.. option:: -fprofile-sample-accurate, -fauto-profile-accurate, -fno-profile-sample-accurate
1771
1772Specifies that the sample profile is accurate. If the sample
1773               profile is accurate, callsites without profile samples are marked
1774               as cold. Otherwise, treat callsites without profile samples as if
1775               we have no profile
1776
1777.. option:: -fprofile-sample-use, -fauto-profile, -fno-profile-sample-use
1778
1779.. program:: clang1
1780.. option:: -fprofile-sample-use=<arg>, -fauto-profile=<arg>
1781.. program:: clang
1782
1783Enable sample-based profile guided optimizations
1784
1785.. program:: clang1
1786.. option:: -fprofile-use=<pathname>
1787.. program:: clang
1788
1789Use instrumentation data for profile-guided optimization. If pathname is a directory, it reads from <pathname>/default.profdata. Otherwise, it reads from file <pathname>.
1790
1791.. option:: -freciprocal-math, -fno-reciprocal-math
1792
1793Allow division operations to be reassociated
1794
1795.. option:: -freg-struct-return
1796
1797Override the default ABI to return small structs in registers
1798
1799.. option:: -fregister-global-dtors-with-atexit, -fno-register-global-dtors-with-atexit
1800
1801Use atexit or \_\_cxa\_atexit to register global destructors
1802
1803.. option:: -frelaxed-template-template-args, -fno-relaxed-template-template-args
1804
1805Enable C++17 relaxed template template argument matching
1806
1807.. option:: -freroll-loops, -fno-reroll-loops
1808
1809Turn on loop reroller
1810
1811.. option:: -fretain-comments-from-system-headers
1812
1813.. option:: -frewrite-imports, -fno-rewrite-imports
1814
1815.. option:: -frewrite-includes, -fno-rewrite-includes
1816
1817.. option:: -frewrite-map-file <arg>
1818
1819.. program:: clang1
1820.. option:: -frewrite-map-file=<arg>
1821.. program:: clang
1822
1823.. option:: -fropi, -fno-ropi
1824
1825.. option:: -frtti, -fno-rtti
1826
1827.. option:: -frwpi, -fno-rwpi
1828
1829.. option:: -fsave-optimization-record, -fno-save-optimization-record
1830
1831Generate a YAML optimization record file
1832
1833.. option:: -fseh-exceptions
1834
1835Use SEH style exceptions
1836
1837.. option:: -fshort-enums, -fno-short-enums
1838
1839Allocate to an enum type only as many bytes as it needs for the declared range of possible values
1840
1841.. option:: -fshort-wchar, -fno-short-wchar
1842
1843Force wchar\_t to be a short unsigned int
1844
1845.. option:: -fshow-column, -fno-show-column
1846
1847.. option:: -fshow-overloads=<arg>
1848
1849Which overload candidates to show when overload resolution fails: best\|all; defaults to all
1850
1851.. option:: -fshow-source-location, -fno-show-source-location
1852
1853.. option:: -fsignaling-math, -fno-signaling-math
1854
1855.. option:: -fsigned-bitfields
1856
1857.. option:: -fsigned-char, -fno-signed-char, --signed-char
1858
1859.. option:: -fsigned-zeros, -fno-signed-zeros
1860
1861.. option:: -fsized-deallocation, -fno-sized-deallocation
1862
1863Enable C++14 sized global deallocation functions
1864
1865.. option:: -fsjlj-exceptions
1866
1867Use SjLj style exceptions
1868
1869.. option:: -fslp-vectorize, -fno-slp-vectorize, -ftree-slp-vectorize
1870
1871Enable the superword-level parallelism vectorization passes
1872
1873.. option:: -fspell-checking, -fno-spell-checking
1874
1875.. option:: -fspell-checking-limit=<arg>
1876
1877.. option:: -fsplit-dwarf-inlining, -fno-split-dwarf-inlining
1878
1879Provide minimal debug info in the object/executable to facilitate online symbolication/stack traces in the absence of .dwo/.dwp files when using Split DWARF
1880
1881.. option:: -fsplit-stack
1882
1883.. option:: -fstack-protector, -fno-stack-protector
1884
1885Enable stack protectors for functions potentially vulnerable to stack smashing
1886
1887.. option:: -fstack-protector-all
1888
1889Force the usage of stack protectors for all functions
1890
1891.. option:: -fstack-protector-strong
1892
1893Use a strong heuristic to apply stack protectors to functions
1894
1895.. option:: -fstack-size-section, -fno-stack-size-section
1896
1897Emit section containing metadata on function stack sizes
1898
1899.. option:: -fstandalone-debug, -fno-limit-debug-info, -fno-standalone-debug
1900
1901Emit full debug info for all types used by the program
1902
1903.. option:: -fstrict-aliasing, -fno-strict-aliasing
1904
1905.. option:: -fstrict-enums, -fno-strict-enums
1906
1907Enable optimizations based on the strict definition of an enum's value range
1908
1909.. option:: -fstrict-float-cast-overflow, -fno-strict-float-cast-overflow
1910
1911Assume that overflowing float-to-int casts are undefined (default)
1912
1913.. option:: -fstrict-overflow, -fno-strict-overflow
1914
1915.. option:: -fstrict-return, -fno-strict-return
1916
1917Always treat control flow paths that fall off the end of a non-void function as unreachable
1918
1919.. option:: -fstrict-vtable-pointers, -fno-strict-vtable-pointers
1920
1921Enable optimizations based on the strict rules for overwriting polymorphic C++ objects
1922
1923.. option:: -fstruct-path-tbaa, -fno-struct-path-tbaa
1924
1925.. option:: -ftabstop=<arg>
1926
1927.. option:: -ftemplate-backtrace-limit=<arg>
1928
1929.. option:: -ftemplate-depth-<arg>
1930
1931.. option:: -ftemplate-depth=<arg>
1932
1933.. option:: -ftest-coverage
1934
1935.. option:: -fthinlto-index=<arg>
1936
1937Perform ThinLTO importing using provided function summary index
1938
1939.. option:: -fthreadsafe-statics, -fno-threadsafe-statics
1940
1941.. option:: -ftime-report
1942
1943.. option:: -ftime-trace
1944
1945Turn on time profiler. Results can be analyzed with chrome://tracing or
1946`Speedscope App <https://www.speedscope.app>`_ for flamegraph visualization
1947
1948.. option:: -ftime-trace-granularity=<arg>
1949
1950Minimum time granularity (in microseconds) traced by time profiler
1951
1952.. option:: -ftls-model=<arg>
1953
1954.. option:: -ftrap-function=<arg>
1955
1956Issue call to specified function rather than a trap instruction
1957
1958.. option:: -ftrapping-math, -fno-trapping-math
1959
1960.. option:: -ftrapv
1961
1962Trap on integer overflow
1963
1964.. option:: -ftrapv-handler <arg>
1965
1966.. program:: clang1
1967.. option:: -ftrapv-handler=<function name>
1968.. program:: clang
1969
1970Specify the function to be called on overflow
1971
1972.. option:: -ftrigraphs, -fno-trigraphs, -trigraphs, --trigraphs
1973
1974Process trigraph sequences
1975
1976.. option:: -funique-section-names, -fno-unique-section-names
1977
1978Use unique names for text and data sections (ELF Only)
1979
1980.. option:: -funit-at-a-time, -fno-unit-at-a-time
1981
1982.. option:: -funroll-loops, -fno-unroll-loops
1983
1984Turn on loop unroller
1985
1986.. option:: -funsafe-math-optimizations, -fno-unsafe-math-optimizations
1987
1988.. option:: -funsigned-bitfields
1989
1990.. option:: -funsigned-char, -fno-unsigned-char, --unsigned-char
1991
1992.. option:: -funwind-tables, -fno-unwind-tables
1993
1994.. option:: -fuse-cxa-atexit, -fno-use-cxa-atexit
1995
1996.. option:: -fuse-init-array, -fno-use-init-array
1997
1998Use .init\_array instead of .ctors
1999
2000.. option:: -fuse-ld=<arg>
2001
2002.. option:: -fuse-line-directives, -fno-use-line-directives
2003
2004.. option:: -fveclib=<arg>
2005
2006Use the given vector functions library
2007
2008.. option:: -fvectorize, -fno-vectorize, -ftree-vectorize
2009
2010Enable the loop vectorization passes
2011
2012.. option:: -fverbose-asm, -fno-verbose-asm, -dA
2013
2014.. option:: -fvisibility-inlines-hidden
2015
2016Give inline C++ member functions hidden visibility by default
2017
2018.. option:: -fvisibility-ms-compat
2019
2020Give global types 'default' visibility and global functions and variables 'hidden' visibility by default
2021
2022.. option:: -fvisibility=<arg>
2023
2024Set the default symbol visibility for all global declarations
2025
2026.. option:: -fwhole-program-vtables, -fno-whole-program-vtables
2027
2028Enables whole-program vtable optimization. Requires -flto
2029
2030.. option:: -fwrapv, -fno-wrapv
2031
2032Treat signed integer overflow as two's complement
2033
2034.. option:: -fwritable-strings
2035
2036Store string literals as writable data
2037
2038.. option:: -fxray-always-emit-customevents, -fno-xray-always-emit-customevents
2039
2040Determine whether to always emit \_\_xray\_customevent(...) calls even if the function it appears in is not always instrumented.
2041
2042.. option:: -fxray-always-emit-typedevents, -fno-xray-always-emit-typedevents
2043
2044Determine whether to always emit \_\_xray\_typedevent(...) calls even if the function it appears in is not always instrumented.
2045
2046.. option:: -fxray-always-instrument=<arg>
2047
2048DEPRECATED: Filename defining the whitelist for imbuing the 'always instrument' XRay attribute.
2049
2050.. option:: -fxray-attr-list=<arg>
2051
2052Filename defining the list of functions/types for imbuing XRay attributes.
2053
2054.. option:: -fxray-instruction-threshold<arg>
2055
2056.. program:: clang1
2057.. option:: -fxray-instruction-threshold=<arg>
2058.. program:: clang
2059
2060Sets the minimum function size to instrument with XRay
2061
2062.. option:: -fxray-instrument, -fno-xray-instrument
2063
2064Generate XRay instrumentation sleds on function entry and exit
2065
2066.. option:: -fxray-instrumentation-bundle=<arg>
2067
2068Select which XRay instrumentation points to emit. Options: all, none, function, custom. Default is 'all'.
2069
2070.. option:: -fxray-link-deps
2071
2072Tells clang to add the link dependencies for XRay.
2073
2074.. option:: -fxray-modes=<arg>
2075
2076List of modes to link in by default into XRay instrumented binaries.
2077
2078.. option:: -fxray-never-instrument=<arg>
2079
2080DEPRECATED: Filename defining the whitelist for imbuing the 'never instrument' XRay attribute.
2081
2082.. option:: -fzero-initialized-in-bss, -fno-zero-initialized-in-bss
2083
2084.. option:: -fzvector, -fno-zvector, -mzvector
2085
2086Enable System z vector language extension
2087
2088.. option:: -pedantic, --pedantic, -no-pedantic, --no-pedantic
2089
2090.. option:: -pedantic-errors, --pedantic-errors
2091
2092OpenCL flags
2093------------
2094.. option:: -cl-denorms-are-zero
2095
2096OpenCL only. Allow denormals to be flushed to zero.
2097
2098.. option:: -cl-fast-relaxed-math
2099
2100OpenCL only. Sets -cl-finite-math-only and -cl-unsafe-math-optimizations, and defines \_\_FAST\_RELAXED\_MATH\_\_.
2101
2102.. option:: -cl-finite-math-only
2103
2104OpenCL only. Allow floating-point optimizations that assume arguments and results are not NaNs or +-Inf.
2105
2106.. option:: -cl-fp32-correctly-rounded-divide-sqrt
2107
2108OpenCL only. Specify that single precision floating-point divide and sqrt used in the program source are correctly rounded.
2109
2110.. option:: -cl-kernel-arg-info
2111
2112OpenCL only. Generate kernel argument metadata.
2113
2114.. option:: -cl-mad-enable
2115
2116OpenCL only. Allow use of less precise MAD computations in the generated binary.
2117
2118.. option:: -cl-no-signed-zeros
2119
2120OpenCL only. Allow use of less precise no signed zeros computations in the generated binary.
2121
2122.. option:: -cl-opt-disable
2123
2124OpenCL only. This option disables all optimizations. By default optimizations are enabled.
2125
2126.. option:: -cl-single-precision-constant
2127
2128OpenCL only. Treat double precision floating-point constant as single precision constant.
2129
2130.. option:: -cl-std=<arg>
2131
2132OpenCL language standard to compile for.
2133
2134.. option:: -cl-strict-aliasing
2135
2136OpenCL only. This option is added for compatibility with OpenCL 1.0.
2137
2138.. option:: -cl-uniform-work-group-size
2139
2140OpenCL only. Defines that the global work-size be a multiple of the work-group size specified to clEnqueueNDRangeKernel
2141
2142.. option:: -cl-unsafe-math-optimizations
2143
2144OpenCL only. Allow unsafe floating-point optimizations.  Also implies -cl-no-signed-zeros and -cl-mad-enable.
2145
2146Target-dependent compilation options
2147~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2148.. option:: -G<size>, -G=<arg>, -msmall-data-threshold=<arg>
2149
2150Put objects of at most <size> bytes into small data section (MIPS / Hexagon)
2151
2152.. option:: -m16
2153
2154.. option:: -m32
2155
2156.. option:: -m64
2157
2158.. option:: -mabi=<arg>
2159
2160.. option:: -malign-double
2161
2162Align doubles to two words in structs (x86 only)
2163
2164.. option:: -march=<arg>
2165
2166.. option:: -masm=<arg>
2167
2168.. option:: -mbackchain, -mno-backchain
2169
2170Link stack frames through backchain on System Z
2171
2172.. option:: -mcmodel=<arg>
2173
2174.. option:: -mconsole<arg>
2175
2176.. 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)
2177
2178Use -mcpu=? to see a list of supported cpu models.
2179
2180.. option:: -mcrc, -mno-crc
2181
2182Allow use of CRC instructions (ARM/Mips only)
2183
2184.. option:: -mdefault-build-attributes<arg>, -mno-default-build-attributes<arg>
2185
2186.. option:: -mdll<arg>
2187
2188.. option:: -mdynamic-no-pic<arg>
2189
2190.. option:: -meabi <arg>
2191
2192Set EABI type, e.g. 4, 5 or gnu (default depends on triple)
2193
2194.. option:: -mfentry
2195
2196Insert calls to fentry at function entry (x86/SystemZ only)
2197
2198.. option:: -mfloat-abi=<arg>
2199
2200.. option:: -mfpmath=<arg>
2201
2202.. option:: -mfpu=<arg>
2203
2204.. option:: -mglobal-merge, -mno-global-merge
2205
2206Enable merging of globals
2207
2208.. option:: -mhard-float
2209
2210.. option:: -mhwdiv=<arg>, --mhwdiv <arg>, --mhwdiv=<arg>
2211
2212.. option:: -miamcu, -mno-iamcu
2213
2214Use Intel MCU ABI
2215
2216.. option:: -mimplicit-float, -mno-implicit-float
2217
2218.. option:: -mimplicit-it=<arg>
2219
2220.. option:: -mincremental-linker-compatible, -mno-incremental-linker-compatible
2221
2222(integrated-as) Emit an object file which can be used with an incremental linker
2223
2224.. option:: -miphoneos-version-min=<arg>, -mios-version-min=<arg>
2225
2226.. option:: -mkernel
2227
2228.. option:: -mlong-calls, -mno-long-calls
2229
2230Generate branches with extended addressability, usually via indirect jumps.
2231
2232.. option:: -mmacosx-version-min=<arg>, -mmacos-version-min=<arg>
2233
2234Set macOS deployment target
2235
2236.. option:: -mmcu=<arg>
2237
2238.. option:: -mms-bitfields, -mno-ms-bitfields
2239
2240Set the default structure layout to be compatible with the Microsoft compiler standard
2241
2242.. option:: -momit-leaf-frame-pointer, -mno-omit-leaf-frame-pointer
2243
2244Omit frame pointer setup for leaf functions
2245
2246.. option:: -moslib=<arg>
2247
2248.. option:: -mpie-copy-relocations, -mno-pie-copy-relocations
2249
2250Use copy relocations support for PIE builds
2251
2252.. option:: -mprefer-vector-width=<arg>
2253
2254Specifies preferred vector width for auto-vectorization. Defaults to 'none' which allows target specific decisions.
2255
2256.. option:: -mqdsp6-compat
2257
2258Enable hexagon-qdsp6 backward compatibility
2259
2260.. option:: -mrecip
2261
2262.. program:: clang1
2263.. option:: -mrecip=<arg1>,<arg2>...
2264.. program:: clang
2265
2266.. option:: -mred-zone, -mno-red-zone
2267
2268.. option:: -mregparm=<arg>
2269
2270.. option:: -mrelax-all, -mno-relax-all
2271
2272(integrated-as) Relax all machine instructions
2273
2274.. option:: -mretpoline, -mno-retpoline
2275
2276.. option:: -mrtd, -mno-rtd
2277
2278Make StdCall calling convention the default
2279
2280.. option:: -msign-return-address=<arg>
2281
2282Select return address signing scope
2283
2284.. option:: -msoft-float, -mno-soft-float
2285
2286Use software floating point
2287
2288.. option:: -mstack-alignment=<arg>
2289
2290Set the stack alignment
2291
2292.. option:: -mstack-arg-probe, -mno-stack-arg-probe
2293
2294Enable stack probes
2295
2296.. option:: -mstack-probe-size=<arg>
2297
2298Set the stack probe size
2299
2300.. option:: -mstackrealign, -mno-stackrealign
2301
2302Force realign the stack at entry to every function
2303
2304.. option:: -mthread-model <arg>
2305
2306The thread model to use, e.g. posix, single (posix by default)
2307
2308.. option:: -mthreads<arg>
2309
2310.. option:: -mthumb, -mno-thumb
2311
2312.. option:: -mtune=<arg>
2313
2314Use -mtune=? to see a list of supported cpu models.
2315
2316.. option:: -mtvos-version-min=<arg>, -mappletvos-version-min=<arg>
2317
2318.. option:: -municode<arg>
2319
2320.. option:: -mvx, -mno-vx
2321
2322.. option:: -mwarn-nonportable-cfstrings, -mno-warn-nonportable-cfstrings
2323
2324.. option:: -mwatchos-version-min=<arg>
2325
2326.. option:: -mwindows<arg>
2327
2328.. option:: -mx32
2329
2330AARCH64
2331-------
2332.. option:: -ffixed-x1
2333
2334Reserve the x1 register (AArch64 only)
2335
2336.. option:: -ffixed-x2
2337
2338Reserve the x2 register (AArch64 only)
2339
2340.. option:: -ffixed-x3
2341
2342Reserve the x3 register (AArch64 only)
2343
2344.. option:: -ffixed-x4
2345
2346Reserve the x4 register (AArch64 only)
2347
2348.. option:: -ffixed-x5
2349
2350Reserve the x5 register (AArch64 only)
2351
2352.. option:: -ffixed-x6
2353
2354Reserve the x6 register (AArch64 only)
2355
2356.. option:: -ffixed-x7
2357
2358Reserve the x7 register (AArch64 only)
2359
2360.. option:: -ffixed-x18
2361
2362Reserve the x18 register (AArch64 only)
2363
2364.. option:: -ffixed-x20
2365
2366Reserve the x20 register (AArch64 only)
2367
2368.. option:: -fcall-saved-x8
2369
2370Make the x8 register call-saved (AArch64 only)
2371
2372.. option:: -fcall-saved-x9
2373
2374Make the x9 register call-saved (AArch64 only)
2375
2376.. option:: -fcall-saved-x10
2377
2378Make the x10 register call-saved (AArch64 only)
2379
2380.. option:: -fcall-saved-x11
2381
2382Make the x11 register call-saved (AArch64 only)
2383
2384.. option:: -fcall-saved-x12
2385
2386Make the x12 register call-saved (AArch64 only)
2387
2388.. option:: -fcall-saved-x13
2389
2390Make the x13 register call-saved (AArch64 only)
2391
2392.. option:: -fcall-saved-x14
2393
2394Make the x14 register call-saved (AArch64 only)
2395
2396.. option:: -fcall-saved-x15
2397
2398Make the x15 register call-saved (AArch64 only)
2399
2400.. option:: -fcall-saved-x18
2401
2402Make the x18 register call-saved (AArch64 only)
2403
2404.. option:: -mfix-cortex-a53-835769, -mno-fix-cortex-a53-835769
2405
2406Workaround Cortex-A53 erratum 835769 (AArch64 only)
2407
2408.. option:: -mgeneral-regs-only
2409
2410Generate code which only uses the general purpose registers (AArch64 only)
2411
2412AMDGPU
2413------
2414.. option:: -mcumode, -mno-cumode
2415
2416CU wavefront execution mode is used if enabled and WGP wavefront execution mode
2417is used if disabled (AMDGPU only)
2418
2419.. option:: -mwavefrontsize64, -mno-wavefrontsize64
2420
2421Wavefront size 64 is used if enabled and wavefront size 32 if disabled (AMDGPU only)
2422
2423.. option:: -mxnack, -mno-xnack
2424
2425Enable XNACK (AMDGPU only)
2426
2427ARM
2428---
2429.. option:: -ffixed-r9
2430
2431Reserve the r9 register (ARM only)
2432
2433.. option:: -mexecute-only, -mno-execute-only, -mpure-code
2434
2435Disallow generation of data access to code sections (ARM only)
2436
2437.. option:: -mno-movt
2438
2439Disallow use of movt/movw pairs (ARM only)
2440
2441.. option:: -mno-neg-immediates
2442
2443Disallow converting instructions with negative immediates to their negation or inversion.
2444
2445.. option:: -mnocrc
2446
2447Disallow use of CRC instructions (ARM only)
2448
2449.. option:: -mrestrict-it, -mno-restrict-it
2450
2451Disallow generation of deprecated IT blocks for ARMv8. It is on by default for ARMv8 Thumb mode.
2452
2453.. option:: -mtp=<arg>
2454
2455Read thread pointer from coprocessor register (ARM only)
2456
2457.. option:: -munaligned-access, -mno-unaligned-access
2458
2459Allow memory accesses to be unaligned (AArch32/AArch64 only)
2460
2461Hexagon
2462-------
2463.. option:: -mieee-rnd-near
2464
2465.. option:: -mmemops, -mno-memops
2466
2467Enable generation of memop instructions
2468
2469.. option:: -mnvj, -mno-nvj
2470
2471Enable generation of new-value jumps
2472
2473.. option:: -mnvs, -mno-nvs
2474
2475Enable generation of new-value stores
2476
2477.. option:: -mpackets, -mno-packets
2478
2479Enable generation of instruction packets
2480
2481Hexagon
2482-------
2483.. option:: -mhvx, -mno-hvx
2484
2485Enable Hexagon Vector eXtensions
2486
2487.. option:: -mhvx-length=<arg>
2488
2489Set Hexagon Vector Length
2490
2491.. program:: clang1
2492.. option:: -mhvx=<arg>
2493.. program:: clang
2494
2495Enable Hexagon Vector eXtensions
2496
2497MIPS
2498----
2499.. option:: -mabicalls, -mno-abicalls
2500
2501Enable SVR4-style position-independent code (Mips only)
2502
2503.. option:: -mabs=<arg>
2504
2505.. option:: -mcheck-zero-division, -mno-check-zero-division
2506
2507.. option:: -mcompact-branches=<arg>
2508
2509.. option:: -mdouble-float
2510
2511.. option:: -mdsp, -mno-dsp
2512
2513.. option:: -mdspr2, -mno-dspr2
2514
2515.. option:: -membedded-data, -mno-embedded-data
2516
2517Place constants in the .rodata section instead of the .sdata section even if they meet the -G <size> threshold (MIPS)
2518
2519.. option:: -mextern-sdata, -mno-extern-sdata
2520
2521Assume that externally defined data is in the small data if it meets the -G <size> threshold (MIPS)
2522
2523.. option:: -mfp32
2524
2525Use 32-bit floating point registers (MIPS only)
2526
2527.. option:: -mfp64
2528
2529Use 64-bit floating point registers (MIPS only)
2530
2531.. option:: -mginv, -mno-ginv
2532
2533.. option:: -mgpopt, -mno-gpopt
2534
2535Use GP relative accesses for symbols known to be in a small data section (MIPS)
2536
2537.. option:: -mindirect-jump=<arg>
2538
2539Change indirect jump instructions to inhibit speculation
2540
2541.. option:: -mips16
2542
2543.. option:: -mldc1-sdc1, -mno-ldc1-sdc1
2544
2545.. option:: -mlocal-sdata, -mno-local-sdata
2546
2547Extend the -G behaviour to object local data (MIPS)
2548
2549.. option:: -mmadd4, -mno-madd4
2550
2551Enable the generation of 4-operand madd.s, madd.d and related instructions.
2552
2553.. option:: -mmicromips, -mno-micromips
2554
2555.. option:: -mmsa, -mno-msa
2556
2557Enable MSA ASE (MIPS only)
2558
2559.. option:: -mmt, -mno-mt
2560
2561Enable MT ASE (MIPS only)
2562
2563.. option:: -mnan=<arg>
2564
2565.. option:: -mno-mips16
2566
2567.. option:: -msingle-float
2568
2569.. option:: -mvirt, -mno-virt
2570
2571.. option:: -mxgot, -mno-xgot
2572
2573PowerPC
2574-------
2575.. option:: -maltivec, -mno-altivec
2576
2577.. option:: -mcmpb, -mno-cmpb
2578
2579.. option:: -mcrbits, -mno-crbits
2580
2581.. option:: -mcrypto, -mno-crypto
2582
2583.. option:: -mdirect-move, -mno-direct-move
2584
2585.. option:: -mfloat128, -mno-float128
2586
2587.. option:: -mfprnd, -mno-fprnd
2588
2589.. option:: -mhtm, -mno-htm
2590
2591.. option:: -minvariant-function-descriptors, -mno-invariant-function-descriptors
2592
2593.. option:: -misel, -mno-isel
2594
2595.. option:: -mlongcall, -mno-longcall
2596
2597.. option:: -mmfocrf, -mmfcrf, -mno-mfocrf
2598
2599.. option:: -mpopcntd, -mno-popcntd
2600
2601.. option:: -mpower8-vector, -mno-power8-vector
2602
2603.. option:: -mpower9-vector, -mno-power9-vector
2604
2605.. option:: -mqpx, -mno-qpx
2606
2607.. option:: -msecure-plt
2608
2609.. option:: -mvsx, -mno-vsx
2610
2611WebAssembly
2612-----------
2613.. option:: -mexception-handling, -mno-exception-handling
2614
2615.. option:: -mnontrapping-fptoint, -mno-nontrapping-fptoint
2616
2617.. option:: -msign-ext, -mno-sign-ext
2618
2619.. option:: -msimd128, -mno-simd128
2620
2621X86
2622---
2623.. option:: -m3dnow, -mno-3dnow
2624
2625.. option:: -m3dnowa, -mno-3dnowa
2626
2627.. option:: -madx, -mno-adx
2628
2629.. option:: -maes, -mno-aes
2630
2631.. option:: -mavx, -mno-avx
2632
2633.. option:: -mavx2, -mno-avx2
2634
2635.. option:: -mavx512bitalg, -mno-avx512bitalg
2636
2637.. option:: -mavx512bf16, -mno-avx512bf16
2638
2639.. option:: -mavx512bw, -mno-avx512bw
2640
2641.. option:: -mavx512cd, -mno-avx512cd
2642
2643.. option:: -mavx512dq, -mno-avx512dq
2644
2645.. option:: -mavx512er, -mno-avx512er
2646
2647.. option:: -mavx512f, -mno-avx512f
2648
2649.. option:: -mavx512ifma, -mno-avx512ifma
2650
2651.. option:: -mavx512pf, -mno-avx512pf
2652
2653.. option:: -mavx512vbmi, -mno-avx512vbmi
2654
2655.. option:: -mavx512vbmi2, -mno-avx512vbmi2
2656
2657.. option:: -mavx512vl, -mno-avx512vl
2658
2659.. option:: -mavx512vnni, -mno-avx512vnni
2660
2661.. option:: -mavx512vp2intersect, -mno-avx512vp2intersect
2662
2663.. option:: -mavx512vpopcntdq, -mno-avx512vpopcntdq
2664
2665.. option:: -mbmi, -mno-bmi
2666
2667.. option:: -mbmi2, -mno-bmi2
2668
2669.. option:: -mcldemote, -mno-cldemote
2670
2671.. option:: -mclflushopt, -mno-clflushopt
2672
2673.. option:: -mclwb, -mno-clwb
2674
2675.. option:: -mclzero, -mno-clzero
2676
2677.. option:: -mcx16, -mno-cx16
2678
2679.. option:: -menqcmd, -mno-enqcmd
2680
2681.. option:: -mf16c, -mno-f16c
2682
2683.. option:: -mfma, -mno-fma
2684
2685.. option:: -mfma4, -mno-fma4
2686
2687.. option:: -mfsgsbase, -mno-fsgsbase
2688
2689.. option:: -mfxsr, -mno-fxsr
2690
2691.. option:: -mgfni, -mno-gfni
2692
2693.. option:: -minvpcid, -mno-invpcid
2694
2695.. option:: -mlwp, -mno-lwp
2696
2697.. option:: -mlzcnt, -mno-lzcnt
2698
2699.. option:: -mmmx, -mno-mmx
2700
2701.. option:: -mmovbe, -mno-movbe
2702
2703.. option:: -mmovdir64b, -mno-movdir64b
2704
2705.. option:: -mmovdiri, -mno-movdiri
2706
2707.. option:: -mmpx, -mno-mpx
2708
2709.. option:: -mmwaitx, -mno-mwaitx
2710
2711.. option:: -mpclmul, -mno-pclmul
2712
2713.. option:: -mpconfig, -mno-pconfig
2714
2715.. option:: -mpku, -mno-pku
2716
2717.. option:: -mpopcnt, -mno-popcnt
2718
2719.. option:: -mprefetchwt1, -mno-prefetchwt1
2720
2721.. option:: -mprfchw, -mno-prfchw
2722
2723.. option:: -mptwrite, -mno-ptwrite
2724
2725.. option:: -mrdpid, -mno-rdpid
2726
2727.. option:: -mrdrnd, -mno-rdrnd
2728
2729.. option:: -mrdseed, -mno-rdseed
2730
2731.. option:: -mretpoline-external-thunk, -mno-retpoline-external-thunk
2732
2733.. option:: -mrtm, -mno-rtm
2734
2735.. option:: -msahf, -mno-sahf
2736
2737.. option:: -msgx, -mno-sgx
2738
2739.. option:: -msha, -mno-sha
2740
2741.. option:: -mshstk, -mno-shstk
2742
2743.. option:: -msse, -mno-sse
2744
2745.. option:: -msse2, -mno-sse2
2746
2747.. option:: -msse3, -mno-sse3
2748
2749.. option:: -msse4.1, -mno-sse4.1
2750
2751.. program:: clang1
2752.. option:: -msse4.2, -mno-sse4.2, -msse4
2753.. program:: clang
2754
2755.. option:: -msse4a, -mno-sse4a
2756
2757.. option:: -mssse3, -mno-ssse3
2758
2759.. option:: -mtbm, -mno-tbm
2760
2761.. option:: -mvaes, -mno-vaes
2762
2763.. option:: -mvpclmulqdq, -mno-vpclmulqdq
2764
2765.. option:: -mwaitpkg, -mno-waitpkg
2766
2767.. option:: -mwbnoinvd, -mno-wbnoinvd
2768
2769.. option:: -mx87, -m80387, -mno-x87
2770
2771.. option:: -mxop, -mno-xop
2772
2773.. option:: -mxsave, -mno-xsave
2774
2775.. option:: -mxsavec, -mno-xsavec
2776
2777.. option:: -mxsaveopt, -mno-xsaveopt
2778
2779.. option:: -mxsaves, -mno-xsaves
2780
2781RISCV
2782-----
2783.. option:: -mrelax, -mno-relax
2784
2785Enable linker relaxation
2786
2787Optimization level
2788~~~~~~~~~~~~~~~~~~
2789
2790Flags controlling how much optimization should be performed.
2791
2792.. option:: -O<arg>, -O (equivalent to -O2), --optimize, --optimize=<arg>
2793
2794.. option:: -Ofast<arg>
2795
2796Debug information generation
2797~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2798
2799Flags controlling how much and what kind of debug information should be
2800generated.
2801
2802Kind and level of debug information
2803-----------------------------------
2804.. option:: -g, --debug, --debug=<arg>
2805
2806Generate source-level debug information
2807
2808.. option:: -gdwarf-2
2809
2810Generate source-level debug information with dwarf version 2
2811
2812.. option:: -gdwarf-3
2813
2814Generate source-level debug information with dwarf version 3
2815
2816.. option:: -gdwarf-4, -gdwarf
2817
2818Generate source-level debug information with dwarf version 4
2819
2820.. option:: -gdwarf-5
2821
2822Generate source-level debug information with dwarf version 5
2823
2824.. option:: -gfull
2825
2826.. option:: -gused
2827
2828Debug level
2829___________
2830.. option:: -g0
2831
2832.. option:: -g2
2833
2834.. option:: -g3
2835
2836.. option:: -ggdb0
2837
2838.. option:: -ggdb1
2839
2840.. option:: -ggdb2
2841
2842.. option:: -ggdb3
2843
2844.. option:: -gline-tables-only, -g1, -gmlt
2845
2846Emit debug line number tables only
2847
2848.. option:: -gmodules
2849
2850Generate debug info with external references to clang modules or precompiled headers
2851
2852Debugger to tune debug information for
2853______________________________________
2854.. option:: -ggdb
2855
2856.. option:: -glldb
2857
2858.. option:: -gsce
2859
2860Debug information flags
2861-----------------------
2862.. option:: -gcolumn-info, -gno-column-info
2863
2864.. option:: -gdwarf-aranges
2865
2866.. option:: -gembed-source, -gno-embed-source
2867
2868Embed source text in DWARF debug sections
2869
2870.. option:: -ggnu-pubnames, -gno-gnu-pubnames
2871
2872.. option:: -gpubnames, -gno-pubnames
2873
2874.. option:: -grecord-command-line, -grecord-gcc-switches, -gno-record-command-line, -gno-record-gcc-switches
2875
2876.. option:: -gsplit-dwarf
2877
2878.. option:: -gstrict-dwarf, -gno-strict-dwarf
2879
2880.. option:: -gz
2881
2882DWARF debug sections compression type
2883
2884.. program:: clang1
2885.. option:: -gz=<arg>
2886.. program:: clang
2887
2888DWARF debug sections compression type
2889
2890Static analyzer flags
2891=====================
2892
2893Flags controlling the behavior of the Clang Static Analyzer.
2894
2895.. option:: -Xanalyzer <arg>
2896
2897Pass <arg> to the static analyzer
2898
2899Fortran compilation flags
2900=========================
2901
2902Flags that will be passed onto the ``gfortran`` compiler when Clang is given
2903a Fortran input.
2904
2905.. option:: -A<arg>, --assert <arg>, --assert=<arg>
2906
2907.. option:: -A-<arg>
2908
2909.. option:: -J<arg>
2910
2911.. option:: -cpp
2912
2913.. option:: -faggressive-function-elimination, -fno-aggressive-function-elimination
2914
2915.. option:: -falign-commons, -fno-align-commons
2916
2917.. option:: -fall-intrinsics, -fno-all-intrinsics
2918
2919.. option:: -fautomatic, -fno-automatic
2920
2921.. option:: -fbackslash, -fno-backslash
2922
2923.. option:: -fbacktrace, -fno-backtrace
2924
2925.. option:: -fblas-matmul-limit=<arg>
2926
2927.. option:: -fbounds-check, -fno-bounds-check
2928
2929.. option:: -fcheck-array-temporaries, -fno-check-array-temporaries
2930
2931.. option:: -fcheck=<arg>
2932
2933.. option:: -fcoarray=<arg>
2934
2935.. option:: -fconvert=<arg>
2936
2937.. option:: -fcray-pointer, -fno-cray-pointer
2938
2939.. option:: -fd-lines-as-code, -fno-d-lines-as-code
2940
2941.. option:: -fd-lines-as-comments, -fno-d-lines-as-comments
2942
2943.. option:: -fdefault-double-8, -fno-default-double-8
2944
2945.. option:: -fdefault-integer-8, -fno-default-integer-8
2946
2947.. option:: -fdefault-real-8, -fno-default-real-8
2948
2949.. option:: -fdollar-ok, -fno-dollar-ok
2950
2951.. option:: -fdump-fortran-optimized, -fno-dump-fortran-optimized
2952
2953.. option:: -fdump-fortran-original, -fno-dump-fortran-original
2954
2955.. option:: -fdump-parse-tree, -fno-dump-parse-tree
2956
2957.. option:: -fexternal-blas, -fno-external-blas
2958
2959.. option:: -ff2c, -fno-f2c
2960
2961.. option:: -ffixed-form, -fno-fixed-form
2962
2963.. option:: -ffixed-line-length-<arg>
2964
2965.. option:: -ffpe-trap=<arg>
2966
2967.. option:: -ffree-form, -fno-free-form
2968
2969.. option:: -ffree-line-length-<arg>
2970
2971.. option:: -ffrontend-optimize, -fno-frontend-optimize
2972
2973.. option:: -fimplicit-none, -fno-implicit-none
2974
2975.. option:: -finit-character=<arg>
2976
2977.. option:: -finit-integer=<arg>
2978
2979.. option:: -finit-local-zero, -fno-init-local-zero
2980
2981.. option:: -finit-logical=<arg>
2982
2983.. option:: -finit-real=<arg>
2984
2985.. option:: -finteger-4-integer-8, -fno-integer-4-integer-8
2986
2987.. option:: -fintrinsic-modules-path, -fno-intrinsic-modules-path
2988
2989.. option:: -fmax-array-constructor=<arg>
2990
2991.. option:: -fmax-errors=<arg>
2992
2993.. option:: -fmax-identifier-length, -fno-max-identifier-length
2994
2995.. option:: -fmax-stack-var-size=<arg>
2996
2997.. option:: -fmax-subrecord-length=<arg>
2998
2999.. option:: -fmodule-private, -fno-module-private
3000
3001.. option:: -fpack-derived, -fno-pack-derived
3002
3003.. option:: -fprotect-parens, -fno-protect-parens
3004
3005.. option:: -frange-check, -fno-range-check
3006
3007.. option:: -freal-4-real-10, -fno-real-4-real-10
3008
3009.. option:: -freal-4-real-16, -fno-real-4-real-16
3010
3011.. option:: -freal-4-real-8, -fno-real-4-real-8
3012
3013.. option:: -freal-8-real-10, -fno-real-8-real-10
3014
3015.. option:: -freal-8-real-16, -fno-real-8-real-16
3016
3017.. option:: -freal-8-real-4, -fno-real-8-real-4
3018
3019.. option:: -frealloc-lhs, -fno-realloc-lhs
3020
3021.. option:: -frecord-marker=<arg>
3022
3023.. option:: -frecursive, -fno-recursive
3024
3025.. option:: -frepack-arrays, -fno-repack-arrays
3026
3027.. option:: -fsecond-underscore, -fno-second-underscore
3028
3029.. option:: -fsign-zero, -fno-sign-zero
3030
3031.. option:: -fstack-arrays, -fno-stack-arrays
3032
3033.. option:: -funderscoring, -fno-underscoring
3034
3035.. option:: -fwhole-file, -fno-whole-file
3036
3037.. option:: -imultilib <arg>
3038
3039.. option:: -nocpp
3040
3041.. option:: -static-libgfortran
3042
3043Linker flags
3044============
3045Flags that are passed on to the linker
3046
3047.. option:: -L<dir>, --library-directory <arg>, --library-directory=<arg>
3048
3049Add directory to library search path
3050
3051.. option:: -Mach
3052
3053.. option:: -T<script>
3054
3055Specify <script> as linker script
3056
3057.. option:: -Tbss<addr>
3058
3059Set starting address of BSS to <addr>
3060
3061.. option:: -Tdata<addr>
3062
3063Set starting address of DATA to <addr>
3064
3065.. option:: -Ttext<addr>
3066
3067Set starting address of TEXT to <addr>
3068
3069.. option:: -Wl,<arg>,<arg2>...
3070
3071Pass the comma separated arguments in <arg> to the linker
3072
3073.. option:: -X
3074
3075.. option:: -Xlinker <arg>, --for-linker <arg>, --for-linker=<arg>
3076
3077Pass <arg> to the linker
3078
3079.. program:: clang1
3080.. option:: -Z
3081.. program:: clang
3082
3083.. option:: -e<arg>, --entry
3084
3085.. option:: -filelist <arg>
3086
3087.. option:: --hip-device-lib-path=<arg>
3088
3089HIP device library path
3090
3091.. option:: --hip-device-lib=<arg>
3092
3093HIP device library
3094
3095.. option:: -l<arg>
3096
3097.. option:: -r
3098
3099.. option:: -rpath <arg>
3100
3101.. option:: -s
3102
3103.. option:: -t
3104
3105.. option:: -u<arg>, --force-link <arg>, --force-link=<arg>
3106
3107.. option:: -undef
3108
3109undef all system defines
3110
3111.. option:: -undefined<arg>, --no-undefined
3112
3113.. option:: -z <arg>
3114
3115Pass -z <arg> to the linker
3116
3117