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