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