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:: -fblocks, -fno-blocks
1335
1336Enable the 'blocks' language feature
1337
1338.. option:: -fbootclasspath=<arg>, --bootclasspath <arg>, --bootclasspath=<arg>
1339
1340.. option:: -fborland-extensions, -fno-borland-extensions
1341
1342Accept non-standard constructs supported by the Borland compiler
1343
1344.. option:: -fbracket-depth=<arg>
1345
1346.. option:: -fbuiltin, -fno-builtin
1347
1348.. option:: -fbuiltin-module-map
1349
1350Load the clang builtins module map file.
1351
1352.. option:: -fc++-static-destructors, -fno-c++-static-destructors
1353
1354Enable C++ static destructor registration (the default)
1355
1356.. option:: -fcaret-diagnostics, -fno-caret-diagnostics
1357
1358.. option:: -fcf-protection=<arg>, -fcf-protection (equivalent to -fcf-protection=full)
1359
1360Instrument control-flow architecture protection. Options: return, branch, full, none.
1361
1362.. option:: -fcf-runtime-abi=<arg>
1363
1364.. option:: -fchar8\_t, -fno-char8\_t
1365
1366Enable C++ builtin type char8\_t
1367
1368.. option:: -fclasspath=<arg>, --CLASSPATH <arg>, --CLASSPATH=<arg>, --classpath <arg>, --classpath=<arg>
1369
1370.. option:: -fcolor-diagnostics, -fno-color-diagnostics
1371
1372Use colors in diagnostics
1373
1374.. option:: -fcommon, -fno-common
1375
1376Place uninitialized global variables in a common block
1377
1378.. option:: -fcompile-resource=<arg>, --resource <arg>, --resource=<arg>
1379
1380.. option:: -fconstant-cfstrings, -fno-constant-cfstrings
1381
1382.. option:: -fconstant-string-class=<arg>
1383
1384.. option:: -fconstexpr-backtrace-limit=<arg>
1385
1386.. option:: -fconstexpr-depth=<arg>
1387
1388.. option:: -fconstexpr-steps=<arg>
1389
1390.. option:: -fconvergent-functions
1391
1392Assume functions may be convergent
1393
1394.. option:: -fcoroutines-ts, -fno-coroutines-ts
1395
1396Enable support for the C++ Coroutines TS
1397
1398.. option:: -fcoverage-mapping, -fno-coverage-mapping
1399
1400Generate coverage mapping to enable code coverage analysis
1401
1402.. option:: -fcreate-profile
1403
1404.. option:: -fcs-profile-generate
1405
1406Generate instrumented code to collect context sensitive execution counts into default.profraw (overridden by LLVM\_PROFILE\_FILE env var)
1407
1408.. program:: clang1
1409.. option:: -fcs-profile-generate=<directory>
1410.. program:: clang
1411
1412Generate instrumented code to collect context sensitive execution counts into <directory>/default.profraw (overridden by LLVM\_PROFILE\_FILE env var)
1413
1414.. option:: -fcxx-exceptions, -fno-cxx-exceptions
1415
1416Enable C++ exceptions
1417
1418.. option:: -fcxx-modules, -fno-cxx-modules
1419
1420.. option:: -fdata-sections, -fno-data-sections
1421
1422Place each data in its own section
1423
1424.. option:: -fdebug-compilation-dir <arg>, -fdebug-compilation-dir=<arg>
1425
1426The compilation directory to embed in the debug info.
1427
1428.. option:: -fdebug-default-version=<arg>
1429
1430Default DWARF version to use, if a -g option caused DWARF debug info to be produced
1431
1432.. option:: -fdebug-info-for-profiling, -fno-debug-info-for-profiling
1433
1434Emit extra debug info to make sample profile more accurate.
1435
1436.. option:: -fdebug-macro, -fno-debug-macro
1437
1438Emit macro debug information
1439
1440.. option:: -fdebug-pass-arguments
1441
1442.. option:: -fdebug-pass-structure
1443
1444.. option:: -fdebug-prefix-map=<arg>
1445
1446remap file source paths in debug info
1447
1448.. option:: -fdebug-ranges-base-address, -fno-debug-ranges-base-address
1449
1450Use DWARF base address selection entries in debug\_ranges
1451
1452.. option:: -fdebug-types-section, -fno-debug-types-section
1453
1454Place debug types in their own section (ELF Only)
1455
1456.. option:: -fdelayed-template-parsing, -fno-delayed-template-parsing
1457
1458Parse templated function definitions at the end of the translation unit
1459
1460.. option:: -fdelete-null-pointer-checks, -fno-delete-null-pointer-checks
1461
1462Treat usage of null pointers as undefined behavior.
1463
1464.. option:: -fdenormal-fp-math=<arg>
1465
1466.. option:: -fdiagnostics-absolute-paths
1467
1468Print absolute paths in diagnostics
1469
1470.. option:: -fdiagnostics-color, -fno-diagnostics-color
1471
1472.. program:: clang1
1473.. option:: -fdiagnostics-color=<arg>
1474.. program:: clang
1475
1476.. option:: -fdiagnostics-hotness-threshold=<number>
1477
1478Prevent optimization remarks from being output if they do not have at least this profile count
1479
1480.. option:: -fdiagnostics-show-hotness, -fno-diagnostics-show-hotness
1481
1482Enable profile hotness information in diagnostic line
1483
1484.. option:: -fdiagnostics-show-note-include-stack, -fno-diagnostics-show-note-include-stack
1485
1486Display include stacks for diagnostic notes
1487
1488.. option:: -fdiagnostics-show-option, -fno-diagnostics-show-option
1489
1490Print option name with mappable diagnostics
1491
1492.. option:: -fdiagnostics-show-template-tree
1493
1494Print a template comparison tree for differing templates
1495
1496.. option:: -fdigraphs, -fno-digraphs
1497
1498Enable alternative token representations '<:', ':>', '<%', '%>', '%:', '%:%:' (default)
1499
1500.. option:: -fdollars-in-identifiers, -fno-dollars-in-identifiers
1501
1502Allow '$' in identifiers
1503
1504.. option:: -fdouble-square-bracket-attributes, -fno-double-square-bracket-attributes
1505
1506Enable '\[\[\]\]' attributes in all C and C++ language modes
1507
1508.. option:: -fdwarf-directory-asm, -fno-dwarf-directory-asm
1509
1510.. option:: -fdwarf-exceptions
1511
1512Use DWARF style exceptions
1513
1514.. option:: -felide-constructors, -fno-elide-constructors
1515
1516.. option:: -feliminate-unused-debug-symbols, -fno-eliminate-unused-debug-symbols
1517
1518.. option:: -fembed-bitcode=<option>, -fembed-bitcode (equivalent to -fembed-bitcode=all), -fembed-bitcode-marker (equivalent to -fembed-bitcode=marker)
1519
1520Embed LLVM bitcode (option: off, all, bitcode, marker)
1521
1522.. option:: -femit-all-decls
1523
1524Emit all declarations, even if unused
1525
1526.. option:: -femulated-tls, -fno-emulated-tls
1527
1528Use emutls functions to access thread\_local variables
1529
1530.. option:: -fencoding=<arg>, --encoding <arg>, --encoding=<arg>
1531
1532.. option:: -ferror-limit=<arg>
1533
1534.. option:: -fescaping-block-tail-calls, -fno-escaping-block-tail-calls
1535
1536.. option:: -fexceptions, -fno-exceptions
1537
1538Enable support for exception handling
1539
1540.. option:: -fexec-charset=<arg>
1541
1542.. option:: -fexperimental-new-constant-interpreter
1543
1544Enable the experimental new constant interpreter
1545
1546.. option:: -fextdirs=<arg>, --extdirs <arg>, --extdirs=<arg>
1547
1548.. option:: -ffast-math, -fno-fast-math
1549
1550Allow aggressive, lossy floating-point optimizations
1551
1552.. option:: -ffile-prefix-map=<arg>
1553
1554remap file source paths in debug info and predefined preprocessor macros
1555
1556.. option:: -ffinite-math-only, -fno-finite-math-only
1557
1558.. option:: -ffixed-point, -fno-fixed-point
1559
1560Enable fixed point types
1561
1562.. option:: -ffor-scope, -fno-for-scope
1563
1564.. option:: -fforce-dwarf-frame, -fno-force-dwarf-frame
1565
1566Always emit a debug frame section
1567
1568.. option:: -fforce-emit-vtables, -fno-force-emit-vtables
1569
1570Emits more virtual tables to improve devirtualization
1571
1572.. option:: -fforce-enable-int128, -fno-force-enable-int128
1573
1574Enable support for int128\_t type
1575
1576.. option:: -ffp-contract=<arg>
1577
1578Form 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.
1579
1580.. option:: -ffp-exception-behavior=<arg>
1581
1582Specifies the exception behavior of floating-point operations.
1583
1584.. option:: -ffp-model=<arg>
1585
1586Controls the semantics of floating-point calculations.
1587
1588.. option:: -ffreestanding
1589
1590Assert that the compilation takes place in a freestanding environment
1591
1592.. option:: -ffunction-sections, -fno-function-sections
1593
1594Place each function in its own section
1595
1596.. option:: -fgnu-inline-asm, -fno-gnu-inline-asm
1597
1598.. option:: -fgnu-keywords, -fno-gnu-keywords
1599
1600Allow GNU-extension keywords regardless of language standard
1601
1602.. option:: -fgnu-runtime
1603
1604Generate output compatible with the standard GNU Objective-C runtime
1605
1606.. option:: -fgnu89-inline, -fno-gnu89-inline
1607
1608Use the gnu89 inline semantics
1609
1610.. option:: -fgnuc-version=<arg>
1611
1612Sets various macros to claim compatibility with the given GCC version (default is 4.2.1)
1613
1614.. option:: -fhonor-infinities, -fhonor-infinites, -fno-honor-infinities
1615
1616.. option:: -fhonor-nans, -fno-honor-nans
1617
1618.. option:: -fhosted
1619
1620.. option:: -fignore-exceptions
1621
1622Enable support for ignoring exception handling constructs
1623
1624.. option:: -fimplicit-module-maps, -fmodule-maps, -fno-implicit-module-maps
1625
1626Implicitly search the file system for module map files.
1627
1628.. option:: -fimplicit-modules, -fno-implicit-modules
1629
1630.. option:: -finput-charset=<arg>
1631
1632.. option:: -finstrument-function-entry-bare
1633
1634Instrument function entry only, after inlining, without arguments to the instrumentation call
1635
1636.. option:: -finstrument-functions
1637
1638Generate calls to instrument function entry and exit
1639
1640.. option:: -finstrument-functions-after-inlining
1641
1642Like -finstrument-functions, but insert the calls after inlining
1643
1644.. option:: -fintegrated-as, -fno-integrated-as, -integrated-as
1645
1646Enable the integrated assembler
1647
1648.. option:: -fintegrated-cc1, -fno-integrated-cc1
1649
1650Run cc1 in-process
1651
1652.. option:: -fjump-tables, -fno-jump-tables
1653
1654.. option:: -fkeep-static-consts
1655
1656Keep static const variables even if unused
1657
1658.. option:: -flax-vector-conversions=<arg>, -flax-vector-conversions (equivalent to -flax-vector-conversions=integer), -fno-lax-vector-conversions (equivalent to -flax-vector-conversions=none)
1659
1660Enable implicit vector bit-casts
1661
1662.. option:: -flimited-precision=<arg>
1663
1664.. option:: -flto, -fno-lto
1665
1666Enable LTO in 'full' mode
1667
1668.. option:: -flto-jobs=<arg>
1669
1670Controls the backend parallelism of -flto=thin (default of 0 means the number of threads will be derived from the number of CPUs detected)
1671
1672.. program:: clang1
1673.. option:: -flto=<arg>
1674.. program:: clang
1675
1676Set LTO mode to either 'full' or 'thin'
1677
1678.. option:: -fmacro-backtrace-limit=<arg>
1679
1680.. option:: -fmath-errno, -fno-math-errno
1681
1682Require math functions to indicate errors by setting errno
1683
1684.. option:: -fmax-tokens=<arg>
1685
1686Max total number of preprocessed tokens for -Wmax-tokens.
1687
1688.. option:: -fmax-type-align=<arg>
1689
1690Specify the maximum alignment to enforce on pointers lacking an explicit alignment
1691
1692.. option:: -fmerge-all-constants, -fno-merge-all-constants
1693
1694Allow merging of constants
1695
1696.. option:: -fmessage-length=<arg>
1697
1698.. option:: -fmodule-file-deps, -fno-module-file-deps
1699
1700.. option:: -fmodule-map-file=<file>
1701
1702Load this module map file
1703
1704.. option:: -fmodule-name=<name>, -fmodule-implementation-of <arg>, -fmodule-name <arg>
1705
1706Specify the name of the module to build
1707
1708.. option:: -fmodules, -fno-modules
1709
1710Enable the 'modules' language feature
1711
1712.. option:: -fmodules-decluse, -fno-modules-decluse
1713
1714Require declaration of modules used within a module
1715
1716.. option:: -fmodules-ignore-macro=<arg>
1717
1718Ignore the definition of the given macro when building and loading modules
1719
1720.. option:: -fmodules-search-all, -fno-modules-search-all
1721
1722Search even non-imported modules to resolve references
1723
1724.. option:: -fmodules-strict-decluse
1725
1726Like -fmodules-decluse but requires all headers to be in modules
1727
1728.. option:: -fmodules-ts
1729
1730Enable support for the C++ Modules TS
1731
1732.. option:: -fmodules-validate-input-files-content
1733
1734Validate PCM input files based on content if mtime differs
1735
1736.. option:: -fms-compatibility, -fno-ms-compatibility
1737
1738Enable full Microsoft Visual C++ compatibility
1739
1740.. option:: -fms-compatibility-version=<arg>
1741
1742Dot-separated value representing the Microsoft compiler version number to report in \_MSC\_VER (0 = don't define it (default))
1743
1744.. option:: -fms-extensions, -fno-ms-extensions
1745
1746Accept some non-standard constructs supported by the Microsoft compiler
1747
1748.. option:: -fms-memptr-rep=<arg>
1749
1750.. option:: -fms-volatile
1751
1752.. option:: -fmsc-version=<arg>
1753
1754Microsoft compiler version number to report in \_MSC\_VER (0 = don't define it (default))
1755
1756.. option:: -fmudflap
1757
1758.. option:: -fmudflapth
1759
1760.. option:: -fnested-functions
1761
1762.. option:: -fnew-alignment=<align>, -fnew-alignment <arg>
1763
1764Specifies the largest alignment guaranteed by '::operator new(size\_t)'
1765
1766.. option:: -fnext-runtime
1767
1768.. option:: -fno-builtin-<arg>
1769
1770Disable implicit builtin knowledge of a specific function
1771
1772.. option:: -fno-elide-type
1773
1774Do not elide types when printing diagnostics
1775
1776.. option:: -fno-max-type-align
1777
1778.. option:: -fno-operator-names
1779
1780Do not treat C++ operator name keywords as synonyms for operators
1781
1782.. option:: -fno-rtti-data
1783
1784Control emission of RTTI data
1785
1786.. option:: -fno-strict-modules-decluse
1787
1788.. option:: -fno-temp-file
1789
1790Directly create compilation output files. This may lead to incorrect incremental builds if the compiler crashes
1791
1792.. option:: -fno-virtual-function\_elimination
1793
1794.. option:: -fno-working-directory
1795
1796.. option:: -fno\_modules-validate-input-files-content
1797
1798.. program:: clang1
1799.. option:: -fno\_pch-validate-input-files-content
1800.. program:: clang
1801
1802.. option:: -fnostack-clash-protection
1803
1804Disable stack clash protection
1805
1806.. option:: -fnoxray-link-deps
1807
1808.. option:: -fobjc-abi-version=<arg>
1809
1810.. option:: -fobjc-arc, -fno-objc-arc
1811
1812Synthesize retain and release calls for Objective-C pointers
1813
1814.. option:: -fobjc-arc-exceptions, -fno-objc-arc-exceptions
1815
1816Use EH-safe code when synthesizing retains and releases in -fobjc-arc
1817
1818.. option:: -fobjc-convert-messages-to-runtime-calls, -fno-objc-convert-messages-to-runtime-calls
1819
1820.. option:: -fobjc-exceptions, -fno-objc-exceptions
1821
1822Enable Objective-C exceptions
1823
1824.. option:: -fobjc-infer-related-result-type, -fno-objc-infer-related-result-type
1825
1826.. option:: -fobjc-legacy-dispatch, -fno-objc-legacy-dispatch
1827
1828.. option:: -fobjc-link-runtime
1829
1830.. option:: -fobjc-nonfragile-abi, -fno-objc-nonfragile-abi
1831
1832.. option:: -fobjc-nonfragile-abi-version=<arg>
1833
1834.. option:: -fobjc-runtime=<arg>
1835
1836Specify the target Objective-C runtime kind and version
1837
1838.. option:: -fobjc-sender-dependent-dispatch
1839
1840.. option:: -fobjc-weak, -fno-objc-weak
1841
1842Enable ARC-style weak references in Objective-C
1843
1844.. option:: -fomit-frame-pointer, -fno-omit-frame-pointer
1845
1846.. option:: -fopenmp, -fno-openmp
1847
1848Parse OpenMP pragmas and generate parallel code.
1849
1850.. option:: -fopenmp-simd, -fno-openmp-simd
1851
1852Emit OpenMP code only for SIMD-based constructs.
1853
1854.. option:: -fopenmp-version=<arg>
1855
1856.. program:: clang1
1857.. option:: -fopenmp=<arg>
1858.. program:: clang
1859
1860.. option:: -foperator-arrow-depth=<arg>
1861
1862.. option:: -foptimization-record-file=<file>
1863
1864Specify 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.
1865
1866.. option:: -foptimization-record-passes=<regex>
1867
1868Only include passes which match a specified regular expression in the generated optimization record (by default, include all passes)
1869
1870.. option:: -foptimize-sibling-calls, -fno-optimize-sibling-calls
1871
1872.. option:: -forder-file-instrumentation
1873
1874Generate instrumented code to collect order file into default.profraw file (overridden by '=' form of option or LLVM\_PROFILE\_FILE env var)
1875
1876.. option:: -foutput-class-dir=<arg>, --output-class-directory <arg>, --output-class-directory=<arg>
1877
1878.. option:: -fpack-struct, -fno-pack-struct
1879
1880.. program:: clang1
1881.. option:: -fpack-struct=<arg>
1882.. program:: clang
1883
1884Specify the default maximum struct packing alignment
1885
1886.. option:: -fpascal-strings, -fno-pascal-strings, -mpascal-strings
1887
1888Recognize and construct Pascal-style string literals
1889
1890.. option:: -fpass-plugin=<dsopath>
1891
1892Load pass plugin from a dynamic shared object file (only with new pass manager).
1893
1894.. option:: -fpatchable-function-entry=<N,M>
1895
1896Generate M NOPs before function entry and N-M NOPs after function entry
1897
1898.. option:: -fpcc-struct-return
1899
1900Override the default ABI to return all structs on the stack
1901
1902.. option:: -fpch-preprocess
1903
1904.. option:: -fpch-validate-input-files-content
1905
1906Validate PCH input files based on content if mtime differs
1907
1908.. option:: -fpic, -fno-pic
1909
1910.. option:: -fpie, -fno-pie
1911
1912.. option:: -fplt, -fno-plt
1913
1914Use the PLT to make function calls
1915
1916.. option:: -fplugin=<dsopath>
1917
1918Load the named plugin (dynamic shared object)
1919
1920.. option:: -fpreserve-as-comments, -fno-preserve-as-comments
1921
1922.. option:: -fprofile-arcs, -fno-profile-arcs
1923
1924.. option:: -fprofile-dir=<arg>
1925
1926.. option:: -fprofile-exclude-files=<arg>
1927
1928Instrument only functions from files where names don't match all the regexes separated by a semi-colon
1929
1930.. option:: -fprofile-filter-files=<arg>
1931
1932Instrument only functions from files where names match any regex separated by a semi-colon
1933
1934.. option:: -fprofile-generate, -fno-profile-generate
1935
1936Generate instrumented code to collect execution counts into default.profraw (overridden by LLVM\_PROFILE\_FILE env var)
1937
1938.. program:: clang1
1939.. option:: -fprofile-generate=<directory>
1940.. program:: clang
1941
1942Generate instrumented code to collect execution counts into <directory>/default.profraw (overridden by LLVM\_PROFILE\_FILE env var)
1943
1944.. option:: -fprofile-instr-generate, -fno-profile-instr-generate
1945
1946Generate instrumented code to collect execution counts into default.profraw file (overridden by '=' form of option or LLVM\_PROFILE\_FILE env var)
1947
1948.. program:: clang1
1949.. option:: -fprofile-instr-generate=<file>
1950.. program:: clang
1951
1952Generate instrumented code to collect execution counts into <file> (overridden by LLVM\_PROFILE\_FILE env var)
1953
1954.. option:: -fprofile-instr-use, -fno-profile-instr-use, -fprofile-use
1955
1956.. program:: clang1
1957.. option:: -fprofile-instr-use=<arg>
1958.. program:: clang
1959
1960Use instrumentation data for profile-guided optimization
1961
1962.. option:: -fprofile-remapping-file=<file>, -fprofile-remapping-file <arg>
1963
1964Use the remappings described in <file> to match the profile data against names in the program
1965
1966.. option:: -fprofile-sample-accurate, -fauto-profile-accurate, -fno-profile-sample-accurate
1967
1968Specifies that the sample profile is accurate. If the sample
1969               profile is accurate, callsites without profile samples are marked
1970               as cold. Otherwise, treat callsites without profile samples as if
1971               we have no profile
1972
1973.. option:: -fprofile-sample-use, -fauto-profile, -fno-profile-sample-use
1974
1975.. program:: clang1
1976.. option:: -fprofile-sample-use=<arg>, -fauto-profile=<arg>
1977.. program:: clang
1978
1979Enable sample-based profile guided optimizations
1980
1981.. program:: clang1
1982.. option:: -fprofile-use=<pathname>
1983.. program:: clang
1984
1985Use instrumentation data for profile-guided optimization. If pathname is a directory, it reads from <pathname>/default.profdata. Otherwise, it reads from file <pathname>.
1986
1987.. option:: -freciprocal-math, -fno-reciprocal-math
1988
1989Allow division operations to be reassociated
1990
1991.. option:: -freg-struct-return
1992
1993Override the default ABI to return small structs in registers
1994
1995.. option:: -fregister-global-dtors-with-atexit, -fno-register-global-dtors-with-atexit
1996
1997Use atexit or \_\_cxa\_atexit to register global destructors
1998
1999.. option:: -frelaxed-template-template-args, -fno-relaxed-template-template-args
2000
2001Enable C++17 relaxed template template argument matching
2002
2003.. option:: -freroll-loops, -fno-reroll-loops
2004
2005Turn on loop reroller
2006
2007.. option:: -fretain-comments-from-system-headers
2008
2009.. option:: -frewrite-imports, -fno-rewrite-imports
2010
2011.. option:: -frewrite-includes, -fno-rewrite-includes
2012
2013.. option:: -frewrite-map-file <arg>
2014
2015.. program:: clang1
2016.. option:: -frewrite-map-file=<arg>
2017.. program:: clang
2018
2019.. option:: -fropi, -fno-ropi
2020
2021.. option:: -frounding-math, -fno-rounding-math
2022
2023.. option:: -frtti, -fno-rtti
2024
2025.. option:: -frwpi, -fno-rwpi
2026
2027.. option:: -fsave-optimization-record, -fno-save-optimization-record
2028
2029Generate a YAML optimization record file
2030
2031.. program:: clang1
2032.. option:: -fsave-optimization-record=<format>
2033.. program:: clang
2034
2035Generate an optimization record file in a specific format
2036
2037.. option:: -fseh-exceptions
2038
2039Use SEH style exceptions
2040
2041.. option:: -fsemantic-interposition, -fno-semantic-interposition
2042
2043.. option:: -fshort-enums, -fno-short-enums
2044
2045Allocate to an enum type only as many bytes as it needs for the declared range of possible values
2046
2047.. option:: -fshort-wchar, -fno-short-wchar
2048
2049Force wchar\_t to be a short unsigned int
2050
2051.. option:: -fshow-column, -fno-show-column
2052
2053.. option:: -fshow-overloads=<arg>
2054
2055Which overload candidates to show when overload resolution fails: best\|all; defaults to all
2056
2057.. option:: -fshow-source-location, -fno-show-source-location
2058
2059.. option:: -fsignaling-math, -fno-signaling-math
2060
2061.. option:: -fsigned-bitfields
2062
2063.. option:: -fsigned-char, -fno-signed-char, --signed-char
2064
2065.. option:: -fsigned-zeros, -fno-signed-zeros
2066
2067.. option:: -fsized-deallocation, -fno-sized-deallocation
2068
2069Enable C++14 sized global deallocation functions
2070
2071.. option:: -fsjlj-exceptions
2072
2073Use SjLj style exceptions
2074
2075.. option:: -fslp-vectorize, -fno-slp-vectorize, -ftree-slp-vectorize
2076
2077Enable the superword-level parallelism vectorization passes
2078
2079.. option:: -fspell-checking, -fno-spell-checking
2080
2081.. option:: -fspell-checking-limit=<arg>
2082
2083.. option:: -fsplit-dwarf-inlining, -fno-split-dwarf-inlining
2084
2085Provide minimal debug info in the object/executable to facilitate online symbolication/stack traces in the absence of .dwo/.dwp files when using Split DWARF
2086
2087.. option:: -fsplit-lto-unit, -fno-split-lto-unit
2088
2089Enables splitting of the LTO unit.
2090
2091.. option:: -fsplit-stack
2092
2093.. option:: -fstack-clash-protection
2094
2095Enable stack clash protection
2096
2097.. option:: -fstack-protector, -fno-stack-protector
2098
2099Enable 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
2100
2101.. option:: -fstack-protector-all
2102
2103Enable stack protectors for all functions
2104
2105.. option:: -fstack-protector-strong
2106
2107Enable 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
2108
2109.. option:: -fstack-size-section, -fno-stack-size-section
2110
2111Emit section containing metadata on function stack sizes
2112
2113.. option:: -fstandalone-debug, -fno-limit-debug-info, -fno-standalone-debug
2114
2115Emit full debug info for all types used by the program
2116
2117.. option:: -fstrict-aliasing, -fno-strict-aliasing
2118
2119.. option:: -fstrict-enums, -fno-strict-enums
2120
2121Enable optimizations based on the strict definition of an enum's value range
2122
2123.. option:: -fstrict-float-cast-overflow, -fno-strict-float-cast-overflow
2124
2125Assume that overflowing float-to-int casts are undefined (default)
2126
2127.. option:: -fstrict-overflow, -fno-strict-overflow
2128
2129.. option:: -fstrict-return, -fno-strict-return
2130
2131Always treat control flow paths that fall off the end of a non-void function as unreachable
2132
2133.. option:: -fstrict-vtable-pointers, -fno-strict-vtable-pointers
2134
2135Enable optimizations based on the strict rules for overwriting polymorphic C++ objects
2136
2137.. option:: -fstruct-path-tbaa, -fno-struct-path-tbaa
2138
2139.. option:: -fsymbol-partition=<arg>
2140
2141.. option:: -ftabstop=<arg>
2142
2143.. option:: -ftemplate-backtrace-limit=<arg>
2144
2145.. option:: -ftemplate-depth-<arg>
2146
2147.. option:: -ftemplate-depth=<arg>
2148
2149.. option:: -ftest-coverage
2150
2151.. option:: -fthin-link-bitcode=<arg>
2152
2153Write minimized bitcode to <file> for the ThinLTO thin link only
2154
2155.. option:: -fthinlto-index=<arg>
2156
2157Perform ThinLTO importing using provided function summary index
2158
2159.. option:: -fthreadsafe-statics, -fno-threadsafe-statics
2160
2161.. option:: -ftime-report
2162
2163.. option:: -ftime-trace
2164
2165
2166Turn on time profiler. Generates JSON file based on output filename. Results
2167can be analyzed with chrome://tracing or `Speedscope App
2168<https://www.speedscope.app>`_ for flamegraph visualization.
2169
2170.. option:: -ftime-trace-granularity=<arg>
2171
2172Minimum time granularity (in microseconds) traced by time profiler
2173
2174.. option:: -ftls-model=<arg>
2175
2176.. option:: -ftrap-function=<arg>
2177
2178Issue call to specified function rather than a trap instruction
2179
2180.. option:: -ftrapping-math, -fno-trapping-math
2181
2182.. option:: -ftrapv
2183
2184Trap on integer overflow
2185
2186.. option:: -ftrapv-handler <arg>
2187
2188.. program:: clang1
2189.. option:: -ftrapv-handler=<function name>
2190.. program:: clang
2191
2192Specify the function to be called on overflow
2193
2194.. option:: -ftrigraphs, -fno-trigraphs, -trigraphs, --trigraphs
2195
2196Process trigraph sequences
2197
2198.. option:: -ftrivial-auto-var-init=<arg>
2199
2200Initialize trivial automatic stack variables: uninitialized (default) \| pattern
2201
2202.. option:: -funique-section-names, -fno-unique-section-names
2203
2204Use unique names for text and data sections
2205
2206.. option:: -funit-at-a-time, -fno-unit-at-a-time
2207
2208.. option:: -funroll-loops, -fno-unroll-loops
2209
2210Turn on loop unroller
2211
2212.. option:: -funsafe-math-optimizations, -fno-unsafe-math-optimizations
2213
2214.. option:: -funsigned-bitfields
2215
2216.. option:: -funsigned-char, -fno-unsigned-char, --unsigned-char
2217
2218.. option:: -funwind-tables, -fno-unwind-tables
2219
2220.. option:: -fuse-cxa-atexit, -fno-use-cxa-atexit
2221
2222.. option:: -fuse-init-array, -fno-use-init-array
2223
2224Use .init\_array instead of .ctors
2225
2226.. option:: -fuse-ld=<arg>
2227
2228.. option:: -fuse-line-directives, -fno-use-line-directives
2229
2230.. option:: -fvalidate-ast-input-files-content
2231
2232Compute 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
2233
2234.. option:: -fveclib=<arg>
2235
2236Use the given vector functions library
2237
2238.. option:: -fvectorize, -fno-vectorize, -ftree-vectorize
2239
2240Enable the loop vectorization passes
2241
2242.. option:: -fverbose-asm, -dA, -fno-verbose-asm
2243
2244.. option:: -fvirtual-function-elimination
2245
2246Enables dead virtual function elimination optimization. Requires -flto=full
2247
2248.. option:: -fvisibility-global-new-delete-hidden
2249
2250Give global C++ operator new and delete declarations hidden visibility
2251
2252.. option:: -fvisibility-inlines-hidden
2253
2254Give inline C++ member functions hidden visibility by default
2255
2256.. option:: -fvisibility-ms-compat
2257
2258Give global types 'default' visibility and global functions and variables 'hidden' visibility by default
2259
2260.. option:: -fvisibility=<arg>
2261
2262Set the default symbol visibility for all global declarations
2263
2264.. option:: -fwasm-exceptions
2265
2266Use WebAssembly style exceptions
2267
2268.. option:: -fwhole-program-vtables, -fno-whole-program-vtables
2269
2270Enables whole-program vtable optimization. Requires -flto
2271
2272.. option:: -fwrapv, -fno-wrapv
2273
2274Treat signed integer overflow as two's complement
2275
2276.. option:: -fwritable-strings
2277
2278Store string literals as writable data
2279
2280.. option:: -fxray-always-emit-customevents, -fno-xray-always-emit-customevents
2281
2282Determine whether to always emit \_\_xray\_customevent(...) calls even if the function it appears in is not always instrumented.
2283
2284.. option:: -fxray-always-emit-typedevents, -fno-xray-always-emit-typedevents
2285
2286Determine whether to always emit \_\_xray\_typedevent(...) calls even if the function it appears in is not always instrumented.
2287
2288.. option:: -fxray-always-instrument=<arg>
2289
2290DEPRECATED: Filename defining the whitelist for imbuing the 'always instrument' XRay attribute.
2291
2292.. option:: -fxray-attr-list=<arg>
2293
2294Filename defining the list of functions/types for imbuing XRay attributes.
2295
2296.. option:: -fxray-ignore-loops, -fno-xray-ignore-loops
2297
2298Don't instrument functions with loops unless they also meet the minimum function size
2299
2300.. option:: -fxray-instruction-threshold<arg>
2301
2302.. program:: clang1
2303.. option:: -fxray-instruction-threshold=<arg>
2304.. program:: clang
2305
2306Sets the minimum function size to instrument with XRay
2307
2308.. option:: -fxray-instrument, -fno-xray-instrument
2309
2310Generate XRay instrumentation sleds on function entry and exit
2311
2312.. option:: -fxray-instrumentation-bundle=<arg>
2313
2314Select 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'.
2315
2316.. option:: -fxray-link-deps
2317
2318Tells clang to add the link dependencies for XRay.
2319
2320.. option:: -fxray-modes=<arg>
2321
2322List of modes to link in by default into XRay instrumented binaries.
2323
2324.. option:: -fxray-never-instrument=<arg>
2325
2326DEPRECATED: Filename defining the whitelist for imbuing the 'never instrument' XRay attribute.
2327
2328.. option:: -fzero-initialized-in-bss, -fno-zero-initialized-in-bss
2329
2330.. option:: -fzvector, -fno-zvector, -mzvector
2331
2332Enable System z vector language extension
2333
2334.. option:: -pedantic, --pedantic, -no-pedantic, --no-pedantic
2335
2336.. option:: -pedantic-errors, --pedantic-errors
2337
2338OpenCL flags
2339------------
2340.. option:: -cl-denorms-are-zero
2341
2342OpenCL only. Allow denormals to be flushed to zero.
2343
2344.. option:: -cl-fast-relaxed-math
2345
2346OpenCL only. Sets -cl-finite-math-only and -cl-unsafe-math-optimizations, and defines \_\_FAST\_RELAXED\_MATH\_\_.
2347
2348.. option:: -cl-finite-math-only
2349
2350OpenCL only. Allow floating-point optimizations that assume arguments and results are not NaNs or +-Inf.
2351
2352.. option:: -cl-fp32-correctly-rounded-divide-sqrt
2353
2354OpenCL only. Specify that single precision floating-point divide and sqrt used in the program source are correctly rounded.
2355
2356.. option:: -cl-kernel-arg-info
2357
2358OpenCL only. Generate kernel argument metadata.
2359
2360.. option:: -cl-mad-enable
2361
2362OpenCL only. Allow use of less precise MAD computations in the generated binary.
2363
2364.. option:: -cl-no-signed-zeros
2365
2366OpenCL only. Allow use of less precise no signed zeros computations in the generated binary.
2367
2368.. option:: -cl-opt-disable
2369
2370OpenCL only. This option disables all optimizations. By default optimizations are enabled.
2371
2372.. option:: -cl-single-precision-constant
2373
2374OpenCL only. Treat double precision floating-point constant as single precision constant.
2375
2376.. option:: -cl-std=<arg>
2377
2378OpenCL language standard to compile for.
2379
2380.. option:: -cl-strict-aliasing
2381
2382OpenCL only. This option is added for compatibility with OpenCL 1.0.
2383
2384.. option:: -cl-uniform-work-group-size
2385
2386OpenCL only. Defines that the global work-size be a multiple of the work-group size specified to clEnqueueNDRangeKernel
2387
2388.. option:: -cl-unsafe-math-optimizations
2389
2390OpenCL only. Allow unsafe floating-point optimizations.  Also implies -cl-no-signed-zeros and -cl-mad-enable.
2391
2392SYCL flags
2393----------
2394.. option:: -fsycl, -fno-sycl
2395
2396Enable SYCL kernels compilation for device
2397
2398.. option:: -sycl-std=<arg>
2399
2400SYCL language standard to compile for.
2401
2402Target-dependent compilation options
2403~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2404.. option:: -G<size>, -G=<arg>, -msmall-data-threshold=<arg>
2405
2406Put objects of at most <size> bytes into small data section (MIPS / Hexagon)
2407
2408.. option:: -ffixed-x1
2409
2410Reserve the 1 register (AArch64/RISC-V only)
2411
2412.. option:: -ffixed-x10
2413
2414Reserve the 10 register (AArch64/RISC-V only)
2415
2416.. option:: -ffixed-x11
2417
2418Reserve the 11 register (AArch64/RISC-V only)
2419
2420.. option:: -ffixed-x12
2421
2422Reserve the 12 register (AArch64/RISC-V only)
2423
2424.. option:: -ffixed-x13
2425
2426Reserve the 13 register (AArch64/RISC-V only)
2427
2428.. option:: -ffixed-x14
2429
2430Reserve the 14 register (AArch64/RISC-V only)
2431
2432.. option:: -ffixed-x15
2433
2434Reserve the 15 register (AArch64/RISC-V only)
2435
2436.. option:: -ffixed-x16
2437
2438Reserve the 16 register (AArch64/RISC-V only)
2439
2440.. option:: -ffixed-x17
2441
2442Reserve the 17 register (AArch64/RISC-V only)
2443
2444.. option:: -ffixed-x18
2445
2446Reserve the 18 register (AArch64/RISC-V only)
2447
2448.. option:: -ffixed-x19
2449
2450Reserve the 19 register (AArch64/RISC-V only)
2451
2452.. option:: -ffixed-x2
2453
2454Reserve the 2 register (AArch64/RISC-V only)
2455
2456.. option:: -ffixed-x20
2457
2458Reserve the 20 register (AArch64/RISC-V only)
2459
2460.. option:: -ffixed-x21
2461
2462Reserve the 21 register (AArch64/RISC-V only)
2463
2464.. option:: -ffixed-x22
2465
2466Reserve the 22 register (AArch64/RISC-V only)
2467
2468.. option:: -ffixed-x23
2469
2470Reserve the 23 register (AArch64/RISC-V only)
2471
2472.. option:: -ffixed-x24
2473
2474Reserve the 24 register (AArch64/RISC-V only)
2475
2476.. option:: -ffixed-x25
2477
2478Reserve the 25 register (AArch64/RISC-V only)
2479
2480.. option:: -ffixed-x26
2481
2482Reserve the 26 register (AArch64/RISC-V only)
2483
2484.. option:: -ffixed-x27
2485
2486Reserve the 27 register (AArch64/RISC-V only)
2487
2488.. option:: -ffixed-x28
2489
2490Reserve the 28 register (AArch64/RISC-V only)
2491
2492.. option:: -ffixed-x29
2493
2494Reserve the 29 register (AArch64/RISC-V only)
2495
2496.. option:: -ffixed-x3
2497
2498Reserve the 3 register (AArch64/RISC-V only)
2499
2500.. option:: -ffixed-x30
2501
2502Reserve the 30 register (AArch64/RISC-V only)
2503
2504.. option:: -ffixed-x31
2505
2506Reserve the 31 register (AArch64/RISC-V only)
2507
2508.. option:: -ffixed-x4
2509
2510Reserve the 4 register (AArch64/RISC-V only)
2511
2512.. option:: -ffixed-x5
2513
2514Reserve the 5 register (AArch64/RISC-V only)
2515
2516.. option:: -ffixed-x6
2517
2518Reserve the 6 register (AArch64/RISC-V only)
2519
2520.. option:: -ffixed-x7
2521
2522Reserve the 7 register (AArch64/RISC-V only)
2523
2524.. option:: -ffixed-x8
2525
2526Reserve the 8 register (AArch64/RISC-V only)
2527
2528.. option:: -ffixed-x9
2529
2530Reserve the 9 register (AArch64/RISC-V only)
2531
2532.. option:: -m16
2533
2534.. option:: -m32
2535
2536.. option:: -m64
2537
2538.. option:: -mabi=<arg>
2539
2540.. option:: -malign-branch-boundary=<arg>
2541
2542Specify the boundary's size to align branches
2543
2544.. option:: -malign-branch-prefix-size=<arg>
2545
2546.. option:: -malign-branch=<arg1>,<arg2>...
2547
2548Specify types of branches to align
2549
2550.. option:: -malign-double
2551
2552Align doubles to two words in structs (x86 only)
2553
2554.. option:: -march=<arg>
2555
2556.. option:: -masm=<arg>
2557
2558.. option:: -mbackchain, -mno-backchain
2559
2560Link stack frames through backchain on System Z
2561
2562.. option:: -mbranches-within-32B-boundaries
2563
2564Align selected branches (fused, jcc, jmp) within 32-byte boundary
2565
2566.. option:: -mcmodel=<arg>, -mcmodel=medany (equivalent to -mcmodel=medium), -mcmodel=medlow (equivalent to -mcmodel=small)
2567
2568.. option:: -mconsole<arg>
2569
2570.. program:: clang1
2571.. 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)
2572.. program:: clang
2573
2574.. option:: -mcrc, -mno-crc
2575
2576Allow use of CRC instructions (ARM/Mips only)
2577
2578.. option:: -mdefault-build-attributes<arg>, -mno-default-build-attributes<arg>
2579
2580.. option:: -mdll<arg>
2581
2582.. option:: -mdynamic-no-pic<arg>
2583
2584.. option:: -meabi <arg>
2585
2586Set EABI type, e.g. 4, 5 or gnu (default depends on triple)
2587
2588.. option:: -mfentry
2589
2590Insert calls to fentry at function entry (x86/SystemZ only)
2591
2592.. option:: -mfloat-abi=<arg>
2593
2594.. option:: -mfpmath=<arg>
2595
2596.. option:: -mfpu=<arg>
2597
2598.. option:: -mglobal-merge, -mno-global-merge
2599
2600Enable merging of globals
2601
2602.. option:: -mhard-float
2603
2604.. option:: -mhwdiv=<arg>, --mhwdiv <arg>, --mhwdiv=<arg>
2605
2606.. option:: -mhwmult=<arg>
2607
2608.. option:: -miamcu, -mno-iamcu
2609
2610Use Intel MCU ABI
2611
2612.. option:: -mimplicit-float, -mno-implicit-float
2613
2614.. option:: -mimplicit-it=<arg>
2615
2616.. option:: -mincremental-linker-compatible, -mno-incremental-linker-compatible
2617
2618(integrated-as) Emit an object file which can be used with an incremental linker
2619
2620.. option:: -miphoneos-version-min=<arg>, -mios-version-min=<arg>
2621
2622.. option:: -mkernel
2623
2624.. option:: -mlong-calls, -mno-long-calls
2625
2626Generate branches with extended addressability, usually via indirect jumps.
2627
2628.. option:: -mmacosx-version-min=<arg>, -mmacos-version-min=<arg>
2629
2630Set Mac OS X deployment target
2631
2632.. option:: -mmcu=<arg>
2633
2634.. option:: -mms-bitfields, -mno-ms-bitfields
2635
2636Set the default structure layout to be compatible with the Microsoft compiler standard
2637
2638.. option:: -mnop-mcount
2639
2640Generate mcount/\_\_fentry\_\_ calls as nops. To activate they need to be patched in.
2641
2642.. option:: -momit-leaf-frame-pointer, -mno-omit-leaf-frame-pointer
2643
2644Omit frame pointer setup for leaf functions
2645
2646.. option:: -moslib=<arg>
2647
2648.. option:: -mpacked-stack, -mno-packed-stack
2649
2650Use packed stack layout (SystemZ only).
2651
2652.. option:: -mpie-copy-relocations, -mno-pie-copy-relocations
2653
2654Use copy relocations support for PIE builds
2655
2656.. option:: -mprefer-vector-width=<arg>
2657
2658Specifies preferred vector width for auto-vectorization. Defaults to 'none' which allows target specific decisions.
2659
2660.. option:: -mqdsp6-compat
2661
2662Enable hexagon-qdsp6 backward compatibility
2663
2664.. option:: -mrecip
2665
2666.. program:: clang1
2667.. option:: -mrecip=<arg1>,<arg2>...
2668.. program:: clang
2669
2670.. option:: -mrecord-mcount
2671
2672Generate a \_\_mcount\_loc section entry for each \_\_fentry\_\_ call.
2673
2674.. option:: -mred-zone, -mno-red-zone
2675
2676.. option:: -mregparm=<arg>
2677
2678.. option:: -mrelax-all, -mno-relax-all
2679
2680(integrated-as) Relax all machine instructions
2681
2682.. option:: -mretpoline, -mno-retpoline
2683
2684.. option:: -mrtd, -mno-rtd
2685
2686Make StdCall calling convention the default
2687
2688.. option:: -msign-return-address=<arg>
2689
2690Select return address signing scope
2691
2692.. option:: -msoft-float, -mno-soft-float
2693
2694Use software floating point
2695
2696.. option:: -mspeculative-load-hardening, -mno-speculative-load-hardening
2697
2698.. option:: -mstack-alignment=<arg>
2699
2700Set the stack alignment
2701
2702.. option:: -mstack-arg-probe, -mno-stack-arg-probe
2703
2704Enable stack probes
2705
2706.. option:: -mstack-probe-size=<arg>
2707
2708Set the stack probe size
2709
2710.. option:: -mstackrealign, -mno-stackrealign
2711
2712Force realign the stack at entry to every function
2713
2714.. option:: -mthread-model <arg>
2715
2716The thread model to use, e.g. posix, single (posix by default)
2717
2718.. option:: -mthreads<arg>
2719
2720.. option:: -mthumb, -mno-thumb
2721
2722.. option:: -mtls-direct-seg-refs, -mno-tls-direct-seg-refs
2723
2724Enable direct TLS access through segment registers (default)
2725
2726.. option:: -mtls-size=<arg>
2727
2728Specify 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)
2729
2730.. program:: clang1
2731.. option:: -mtune=<arg>
2732.. program:: clang
2733
2734.. option:: -mtvos-version-min=<arg>, -mappletvos-version-min=<arg>
2735
2736.. option:: -municode<arg>
2737
2738.. option:: -mvx, -mno-vx
2739
2740.. option:: -mwarn-nonportable-cfstrings, -mno-warn-nonportable-cfstrings
2741
2742.. option:: -mwatchos-version-min=<arg>
2743
2744.. option:: -mwavefrontsize64, -mno-wavefrontsize64
2745
2746Wavefront size 64 is used
2747
2748.. option:: -mwindows<arg>
2749
2750.. option:: -mx32
2751
2752AARCH64
2753-------
2754.. option:: -fcall-saved-x10
2755
2756Make the x10 register call-saved (AArch64 only)
2757
2758.. option:: -fcall-saved-x11
2759
2760Make the x11 register call-saved (AArch64 only)
2761
2762.. option:: -fcall-saved-x12
2763
2764Make the x12 register call-saved (AArch64 only)
2765
2766.. option:: -fcall-saved-x13
2767
2768Make the x13 register call-saved (AArch64 only)
2769
2770.. option:: -fcall-saved-x14
2771
2772Make the x14 register call-saved (AArch64 only)
2773
2774.. option:: -fcall-saved-x15
2775
2776Make the x15 register call-saved (AArch64 only)
2777
2778.. option:: -fcall-saved-x18
2779
2780Make the x18 register call-saved (AArch64 only)
2781
2782.. option:: -fcall-saved-x8
2783
2784Make the x8 register call-saved (AArch64 only)
2785
2786.. option:: -fcall-saved-x9
2787
2788Make the x9 register call-saved (AArch64 only)
2789
2790.. option:: -mfix-cortex-a53-835769, -mno-fix-cortex-a53-835769
2791
2792Workaround Cortex-A53 erratum 835769 (AArch64 only)
2793
2794.. option:: -mgeneral-regs-only
2795
2796Generate code which only uses the general purpose registers (AArch64 only)
2797
2798AMDGPU
2799------
2800.. option:: -mcode-object-v3, -mno-code-object-v3
2801
2802Enable code object v3 (AMDGPU only)
2803
2804.. option:: -mcumode, -mno-cumode
2805
2806CU wavefront execution mode is used (AMDGPU only)
2807
2808.. option:: -msram-ecc, -mno-sram-ecc
2809
2810Enable SRAM ECC (AMDGPU only)
2811
2812.. option:: -mxnack, -mno-xnack
2813
2814Enable XNACK (AMDGPU only)
2815
2816ARM
2817---
2818.. option:: -fAAPCSBitfieldLoad
2819
2820Follows the AAPCS standard that all volatile bit-field write generates at least one load. (ARM only).
2821
2822.. option:: -ffixed-r9
2823
2824Reserve the r9 register (ARM only)
2825
2826.. option:: -mcmse
2827
2828Allow use of CMSE (Armv8-M Security Extensions)
2829
2830.. option:: -mexecute-only, -mno-execute-only, -mpure-code
2831
2832Disallow generation of data access to code sections (ARM only)
2833
2834.. option:: -mno-movt
2835
2836Disallow use of movt/movw pairs (ARM only)
2837
2838.. option:: -mno-neg-immediates
2839
2840Disallow converting instructions with negative immediates to their negation or inversion.
2841
2842.. option:: -mnocrc
2843
2844Disallow use of CRC instructions (ARM only)
2845
2846.. option:: -mrestrict-it, -mno-restrict-it
2847
2848Disallow generation of deprecated IT blocks for ARMv8. It is on by default for ARMv8 Thumb mode.
2849
2850.. option:: -mtp=<arg>
2851
2852Thread pointer access method (AArch32/AArch64 only)
2853
2854.. option:: -munaligned-access, -mno-unaligned-access
2855
2856Allow memory accesses to be unaligned (AArch32/AArch64 only)
2857
2858Hexagon
2859-------
2860.. option:: -mieee-rnd-near
2861
2862.. option:: -mmemops, -mno-memops
2863
2864Enable generation of memop instructions
2865
2866.. option:: -mnvj, -mno-nvj
2867
2868Enable generation of new-value jumps
2869
2870.. option:: -mnvs, -mno-nvs
2871
2872Enable generation of new-value stores
2873
2874.. option:: -mpackets, -mno-packets
2875
2876Enable generation of instruction packets
2877
2878Hexagon
2879-------
2880.. option:: -mhvx, -mno-hvx
2881
2882Enable Hexagon Vector eXtensions
2883
2884.. option:: -mhvx-length=<arg>
2885
2886Set Hexagon Vector Length
2887
2888.. program:: clang1
2889.. option:: -mhvx=<arg>
2890.. program:: clang
2891
2892Enable Hexagon Vector eXtensions
2893
2894MIPS
2895----
2896.. option:: -mabicalls, -mno-abicalls
2897
2898Enable SVR4-style position-independent code (Mips only)
2899
2900.. option:: -mabs=<arg>
2901
2902.. option:: -mcheck-zero-division, -mno-check-zero-division
2903
2904.. option:: -mcompact-branches=<arg>
2905
2906.. option:: -mdouble-float
2907
2908.. option:: -mdsp, -mno-dsp
2909
2910.. option:: -mdspr2, -mno-dspr2
2911
2912.. option:: -membedded-data, -mno-embedded-data
2913
2914Place constants in the .rodata section instead of the .sdata section even if they meet the -G <size> threshold (MIPS)
2915
2916.. option:: -mextern-sdata, -mno-extern-sdata
2917
2918Assume that externally defined data is in the small data if it meets the -G <size> threshold (MIPS)
2919
2920.. option:: -mfp32
2921
2922Use 32-bit floating point registers (MIPS only)
2923
2924.. option:: -mfp64
2925
2926Use 64-bit floating point registers (MIPS only)
2927
2928.. option:: -mginv, -mno-ginv
2929
2930.. option:: -mgpopt, -mno-gpopt
2931
2932Use GP relative accesses for symbols known to be in a small data section (MIPS)
2933
2934.. option:: -mindirect-jump=<arg>
2935
2936Change indirect jump instructions to inhibit speculation
2937
2938.. option:: -mips16
2939
2940.. option:: -mldc1-sdc1, -mno-ldc1-sdc1
2941
2942.. option:: -mlocal-sdata, -mno-local-sdata
2943
2944Extend the -G behaviour to object local data (MIPS)
2945
2946.. option:: -mmadd4, -mno-madd4
2947
2948Enable the generation of 4-operand madd.s, madd.d and related instructions.
2949
2950.. option:: -mmicromips, -mno-micromips
2951
2952.. option:: -mmsa, -mno-msa
2953
2954Enable MSA ASE (MIPS only)
2955
2956.. option:: -mmt, -mno-mt
2957
2958Enable MT ASE (MIPS only)
2959
2960.. option:: -mnan=<arg>
2961
2962.. option:: -mno-mips16
2963
2964.. option:: -msingle-float
2965
2966.. option:: -mvirt, -mno-virt
2967
2968.. option:: -mxgot, -mno-xgot
2969
2970PowerPC
2971-------
2972.. option:: -maltivec, -mno-altivec
2973
2974.. option:: -mcmpb, -mno-cmpb
2975
2976.. option:: -mcrbits, -mno-crbits
2977
2978.. option:: -mcrypto, -mno-crypto
2979
2980.. option:: -mdirect-move, -mno-direct-move
2981
2982.. option:: -mfloat128, -mno-float128
2983
2984.. option:: -mfprnd, -mno-fprnd
2985
2986.. option:: -mhtm, -mno-htm
2987
2988.. option:: -minvariant-function-descriptors, -mno-invariant-function-descriptors
2989
2990.. option:: -misel, -mno-isel
2991
2992.. option:: -mlongcall, -mno-longcall
2993
2994.. option:: -mmfocrf, -mmfcrf, -mno-mfocrf
2995
2996.. option:: -mpopcntd, -mno-popcntd
2997
2998.. option:: -mpower8-vector, -mno-power8-vector
2999
3000.. option:: -mpower9-vector, -mno-power9-vector
3001
3002.. option:: -mqpx, -mno-qpx
3003
3004.. option:: -msecure-plt
3005
3006.. option:: -mspe, -mno-spe
3007
3008.. option:: -mvsx, -mno-vsx
3009
3010WebAssembly
3011-----------
3012.. option:: -matomics, -mno-atomics
3013
3014.. option:: -mbulk-memory, -mno-bulk-memory
3015
3016.. option:: -mexception-handling, -mno-exception-handling
3017
3018.. option:: -mmultivalue, -mno-multivalue
3019
3020.. option:: -mmutable-globals, -mno-mutable-globals
3021
3022.. option:: -mnontrapping-fptoint, -mno-nontrapping-fptoint
3023
3024.. option:: -mreference-types, -mno-reference-types
3025
3026.. option:: -msign-ext, -mno-sign-ext
3027
3028.. option:: -msimd128, -mno-simd128
3029
3030.. option:: -mtail-call, -mno-tail-call
3031
3032.. option:: -munimplemented-simd128, -mno-unimplemented-simd128
3033
3034X86
3035---
3036.. option:: -m3dnow, -mno-3dnow
3037
3038.. option:: -m3dnowa, -mno-3dnowa
3039
3040.. option:: -madx, -mno-adx
3041
3042.. option:: -maes, -mno-aes
3043
3044.. option:: -mavx, -mno-avx
3045
3046.. option:: -mavx2, -mno-avx2
3047
3048.. option:: -mavx512bf16, -mno-avx512bf16
3049
3050.. option:: -mavx512bitalg, -mno-avx512bitalg
3051
3052.. option:: -mavx512bw, -mno-avx512bw
3053
3054.. option:: -mavx512cd, -mno-avx512cd
3055
3056.. option:: -mavx512dq, -mno-avx512dq
3057
3058.. option:: -mavx512er, -mno-avx512er
3059
3060.. option:: -mavx512f, -mno-avx512f
3061
3062.. option:: -mavx512ifma, -mno-avx512ifma
3063
3064.. option:: -mavx512pf, -mno-avx512pf
3065
3066.. option:: -mavx512vbmi, -mno-avx512vbmi
3067
3068.. option:: -mavx512vbmi2, -mno-avx512vbmi2
3069
3070.. option:: -mavx512vl, -mno-avx512vl
3071
3072.. option:: -mavx512vnni, -mno-avx512vnni
3073
3074.. option:: -mavx512vp2intersect, -mno-avx512vp2intersect
3075
3076.. option:: -mavx512vpopcntdq, -mno-avx512vpopcntdq
3077
3078.. option:: -mbmi, -mno-bmi
3079
3080.. option:: -mbmi2, -mno-bmi2
3081
3082.. option:: -mcldemote, -mno-cldemote
3083
3084.. option:: -mclflushopt, -mno-clflushopt
3085
3086.. option:: -mclwb, -mno-clwb
3087
3088.. option:: -mclzero, -mno-clzero
3089
3090.. option:: -mcx16, -mno-cx16
3091
3092.. option:: -menqcmd, -mno-enqcmd
3093
3094.. option:: -mf16c, -mno-f16c
3095
3096.. option:: -mfma, -mno-fma
3097
3098.. option:: -mfma4, -mno-fma4
3099
3100.. option:: -mfsgsbase, -mno-fsgsbase
3101
3102.. option:: -mfxsr, -mno-fxsr
3103
3104.. option:: -mgfni, -mno-gfni
3105
3106.. option:: -minvpcid, -mno-invpcid
3107
3108.. option:: -mlwp, -mno-lwp
3109
3110.. option:: -mlzcnt, -mno-lzcnt
3111
3112.. option:: -mmmx, -mno-mmx
3113
3114.. option:: -mmovbe, -mno-movbe
3115
3116.. option:: -mmovdir64b, -mno-movdir64b
3117
3118.. option:: -mmovdiri, -mno-movdiri
3119
3120.. option:: -mmwaitx, -mno-mwaitx
3121
3122.. option:: -mpclmul, -mno-pclmul
3123
3124.. option:: -mpconfig, -mno-pconfig
3125
3126.. option:: -mpku, -mno-pku
3127
3128.. option:: -mpopcnt, -mno-popcnt
3129
3130.. option:: -mprefetchwt1, -mno-prefetchwt1
3131
3132.. option:: -mprfchw, -mno-prfchw
3133
3134.. option:: -mptwrite, -mno-ptwrite
3135
3136.. option:: -mrdpid, -mno-rdpid
3137
3138.. option:: -mrdrnd, -mno-rdrnd
3139
3140.. option:: -mrdseed, -mno-rdseed
3141
3142.. option:: -mretpoline-external-thunk, -mno-retpoline-external-thunk
3143
3144.. option:: -mrtm, -mno-rtm
3145
3146.. option:: -msahf, -mno-sahf
3147
3148.. option:: -msgx, -mno-sgx
3149
3150.. option:: -msha, -mno-sha
3151
3152.. option:: -mshstk, -mno-shstk
3153
3154.. option:: -msse, -mno-sse
3155
3156.. option:: -msse2, -mno-sse2
3157
3158.. option:: -msse3, -mno-sse3
3159
3160.. option:: -msse4.1, -mno-sse4.1
3161
3162.. program:: clang1
3163.. option:: -msse4.2, -mno-sse4.2, -msse4
3164.. program:: clang
3165
3166.. option:: -msse4a, -mno-sse4a
3167
3168.. option:: -mssse3, -mno-ssse3
3169
3170.. option:: -mtbm, -mno-tbm
3171
3172.. option:: -mvaes, -mno-vaes
3173
3174.. option:: -mvpclmulqdq, -mno-vpclmulqdq
3175
3176.. option:: -mvzeroupper, -mno-vzeroupper
3177
3178.. option:: -mwaitpkg, -mno-waitpkg
3179
3180.. option:: -mwbnoinvd, -mno-wbnoinvd
3181
3182.. option:: -mx87, -m80387, -mno-x87
3183
3184.. option:: -mxop, -mno-xop
3185
3186.. option:: -mxsave, -mno-xsave
3187
3188.. option:: -mxsavec, -mno-xsavec
3189
3190.. option:: -mxsaveopt, -mno-xsaveopt
3191
3192.. option:: -mxsaves, -mno-xsaves
3193
3194RISCV
3195-----
3196.. option:: -mrelax, -mno-relax
3197
3198Enable linker relaxation
3199
3200.. option:: -msave-restore, -mno-save-restore
3201
3202Enable using library calls for save and restore
3203
3204Long double flags
3205-----------------
3206Selects the long double implementation
3207
3208.. option:: -mlong-double-128
3209
3210Force long double to be 128 bits
3211
3212.. option:: -mlong-double-64
3213
3214Force long double to be 64 bits
3215
3216.. option:: -mlong-double-80
3217
3218Force long double to be 80 bits, padded to 128 bits for storage
3219
3220Optimization level
3221~~~~~~~~~~~~~~~~~~
3222
3223Flags controlling how much optimization should be performed.
3224
3225.. option:: -O<arg>, -O (equivalent to -O2), --optimize, --optimize=<arg>
3226
3227.. option:: -Ofast<arg>
3228
3229Debug information generation
3230~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3231
3232Flags controlling how much and what kind of debug information should be
3233generated.
3234
3235Kind and level of debug information
3236-----------------------------------
3237.. option:: -g, --debug, --debug=<arg>
3238
3239Generate source-level debug information
3240
3241.. option:: -gdwarf
3242
3243Generate source-level debug information with the default dwarf version
3244
3245.. option:: -gdwarf-2
3246
3247Generate source-level debug information with dwarf version 2
3248
3249.. option:: -gdwarf-3
3250
3251Generate source-level debug information with dwarf version 3
3252
3253.. option:: -gdwarf-4
3254
3255Generate source-level debug information with dwarf version 4
3256
3257.. option:: -gdwarf-5
3258
3259Generate source-level debug information with dwarf version 5
3260
3261.. option:: -gfull
3262
3263.. option:: -gused
3264
3265Debug level
3266___________
3267.. option:: -g0
3268
3269.. option:: -g2
3270
3271.. option:: -g3
3272
3273.. option:: -ggdb0
3274
3275.. option:: -ggdb1
3276
3277.. option:: -ggdb2
3278
3279.. option:: -ggdb3
3280
3281.. option:: -gline-directives-only
3282
3283Emit debug line info directives only
3284
3285.. option:: -gline-tables-only, -g1, -gmlt
3286
3287Emit debug line number tables only
3288
3289.. option:: -gmodules
3290
3291Generate debug info with external references to clang modules or precompiled headers
3292
3293Debugger to tune debug information for
3294______________________________________
3295.. option:: -ggdb
3296
3297.. option:: -glldb
3298
3299.. option:: -gsce
3300
3301Debug information flags
3302-----------------------
3303.. option:: -gcolumn-info, -gno-column-info
3304
3305.. option:: -gdwarf-aranges
3306
3307.. option:: -gembed-source, -gno-embed-source
3308
3309Embed source text in DWARF debug sections
3310
3311.. option:: -ggnu-pubnames, -gno-gnu-pubnames
3312
3313.. option:: -gpubnames, -gno-pubnames
3314
3315.. option:: -grecord-command-line, -gno-record-command-line, -grecord-gcc-switches
3316
3317.. option:: -gsplit-dwarf
3318
3319.. program:: clang1
3320.. option:: -gsplit-dwarf=<arg>
3321.. program:: clang
3322
3323Set DWARF fission mode to either 'split' or 'single'
3324
3325.. option:: -gstrict-dwarf, -gno-strict-dwarf
3326
3327.. option:: -gz
3328
3329DWARF debug sections compression type
3330
3331.. program:: clang1
3332.. option:: -gz=<arg>
3333.. program:: clang
3334
3335DWARF debug sections compression type
3336
3337Static analyzer flags
3338=====================
3339
3340Flags controlling the behavior of the Clang Static Analyzer.
3341
3342.. option:: -Xanalyzer <arg>
3343
3344Pass <arg> to the static analyzer
3345
3346Fortran compilation flags
3347=========================
3348
3349Flags that will be passed onto the ``gfortran`` compiler when Clang is given
3350a Fortran input.
3351
3352.. option:: -A<arg>, --assert <arg>, --assert=<arg>
3353
3354.. option:: -A-<arg>
3355
3356.. option:: -J<arg>
3357
3358.. option:: -cpp
3359
3360.. option:: -faggressive-function-elimination, -fno-aggressive-function-elimination
3361
3362.. option:: -falign-commons, -fno-align-commons
3363
3364.. option:: -fall-intrinsics, -fno-all-intrinsics
3365
3366.. option:: -fautomatic, -fno-automatic
3367
3368.. option:: -fbackslash, -fno-backslash
3369
3370.. option:: -fbacktrace, -fno-backtrace
3371
3372.. option:: -fblas-matmul-limit=<arg>
3373
3374.. option:: -fbounds-check, -fno-bounds-check
3375
3376.. option:: -fcheck-array-temporaries, -fno-check-array-temporaries
3377
3378.. option:: -fcheck=<arg>
3379
3380.. option:: -fcoarray=<arg>
3381
3382.. option:: -fconvert=<arg>
3383
3384.. option:: -fcray-pointer, -fno-cray-pointer
3385
3386.. option:: -fd-lines-as-code, -fno-d-lines-as-code
3387
3388.. option:: -fd-lines-as-comments, -fno-d-lines-as-comments
3389
3390.. option:: -fdefault-double-8, -fno-default-double-8
3391
3392.. option:: -fdefault-integer-8, -fno-default-integer-8
3393
3394.. option:: -fdefault-real-8, -fno-default-real-8
3395
3396.. option:: -fdollar-ok, -fno-dollar-ok
3397
3398.. option:: -fdump-fortran-optimized, -fno-dump-fortran-optimized
3399
3400.. option:: -fdump-fortran-original, -fno-dump-fortran-original
3401
3402.. option:: -fdump-parse-tree, -fno-dump-parse-tree
3403
3404.. option:: -fexternal-blas, -fno-external-blas
3405
3406.. option:: -ff2c, -fno-f2c
3407
3408.. option:: -ffixed-form, -fno-fixed-form
3409
3410.. option:: -ffixed-line-length-<arg>
3411
3412.. option:: -ffpe-trap=<arg>
3413
3414.. option:: -ffree-form, -fno-free-form
3415
3416.. option:: -ffree-line-length-<arg>
3417
3418.. option:: -ffrontend-optimize, -fno-frontend-optimize
3419
3420.. option:: -fimplicit-none, -fno-implicit-none
3421
3422.. option:: -finit-character=<arg>
3423
3424.. option:: -finit-integer=<arg>
3425
3426.. option:: -finit-local-zero, -fno-init-local-zero
3427
3428.. option:: -finit-logical=<arg>
3429
3430.. option:: -finit-real=<arg>
3431
3432.. option:: -finteger-4-integer-8, -fno-integer-4-integer-8
3433
3434.. option:: -fintrinsic-modules-path, -fno-intrinsic-modules-path
3435
3436.. option:: -fmax-array-constructor=<arg>
3437
3438.. option:: -fmax-errors=<arg>
3439
3440.. option:: -fmax-identifier-length, -fno-max-identifier-length
3441
3442.. option:: -fmax-stack-var-size=<arg>
3443
3444.. option:: -fmax-subrecord-length=<arg>
3445
3446.. option:: -fmodule-private, -fno-module-private
3447
3448.. option:: -fpack-derived, -fno-pack-derived
3449
3450.. option:: -fprotect-parens, -fno-protect-parens
3451
3452.. option:: -frange-check, -fno-range-check
3453
3454.. option:: -freal-4-real-10, -fno-real-4-real-10
3455
3456.. option:: -freal-4-real-16, -fno-real-4-real-16
3457
3458.. option:: -freal-4-real-8, -fno-real-4-real-8
3459
3460.. option:: -freal-8-real-10, -fno-real-8-real-10
3461
3462.. option:: -freal-8-real-16, -fno-real-8-real-16
3463
3464.. option:: -freal-8-real-4, -fno-real-8-real-4
3465
3466.. option:: -frealloc-lhs, -fno-realloc-lhs
3467
3468.. option:: -frecord-marker=<arg>
3469
3470.. option:: -frecursive, -fno-recursive
3471
3472.. option:: -frepack-arrays, -fno-repack-arrays
3473
3474.. option:: -fsecond-underscore, -fno-second-underscore
3475
3476.. option:: -fsign-zero, -fno-sign-zero
3477
3478.. option:: -fstack-arrays, -fno-stack-arrays
3479
3480.. option:: -funderscoring, -fno-underscoring
3481
3482.. option:: -fwhole-file, -fno-whole-file
3483
3484.. option:: -imultilib <arg>
3485
3486.. option:: -nocpp
3487
3488.. option:: -static-libgfortran
3489
3490Linker flags
3491============
3492Flags that are passed on to the linker
3493
3494.. option:: -L<dir>, --library-directory <arg>, --library-directory=<arg>
3495
3496Add directory to library search path
3497
3498.. option:: -Mach
3499
3500.. option:: -T<script>
3501
3502Specify <script> as linker script
3503
3504.. option:: -Tbss<addr>
3505
3506Set starting address of BSS to <addr>
3507
3508.. option:: -Tdata<addr>
3509
3510Set starting address of DATA to <addr>
3511
3512.. option:: -Ttext<addr>
3513
3514Set starting address of TEXT to <addr>
3515
3516.. option:: -Wl,<arg>,<arg2>...
3517
3518Pass the comma separated arguments in <arg> to the linker
3519
3520.. option:: -X
3521
3522.. option:: -Xlinker <arg>, --for-linker <arg>, --for-linker=<arg>
3523
3524Pass <arg> to the linker
3525
3526.. program:: clang1
3527.. option:: -Z
3528.. program:: clang
3529
3530.. option:: -e<arg>, --entry
3531
3532.. option:: -filelist <arg>
3533
3534.. option:: --hip-device-lib-path=<arg>
3535
3536HIP device library path
3537
3538.. option:: --hip-device-lib=<arg>
3539
3540HIP device library
3541
3542.. option:: -l<arg>
3543
3544.. option:: -r
3545
3546.. option:: -rpath <arg>
3547
3548.. option:: -s
3549
3550.. option:: -t
3551
3552.. option:: -u<arg>, --force-link <arg>, --force-link=<arg>
3553
3554.. option:: -undef
3555
3556undef all system defines
3557
3558.. option:: -undefined<arg>, --no-undefined
3559
3560.. option:: -z <arg>
3561
3562Pass -z <arg> to the linker
3563
3564