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