From d641186cb61e149ecbe23ddc0432df76425bffbd Mon Sep 17 00:00:00 2001 From: Lucas Colley Date: Thu, 19 Mar 2026 13:03:20 +0000 Subject: [PATCH] [clang-cl] test that `-Xlinker` works, update supported options docs (#187395) closes #119179 --- clang/docs/UsersManual.rst | 804 +++++++++++++++++++++++++++++++----- clang/test/Driver/cl-link.c | 5 + 2 files changed, 714 insertions(+), 95 deletions(-) diff --git a/clang/docs/UsersManual.rst b/clang/docs/UsersManual.rst index 5d7a124679d8..41f9f2896bae 100644 --- a/clang/docs/UsersManual.rst +++ b/clang/docs/UsersManual.rst @@ -5036,60 +5036,72 @@ Execute ``clang-cl /?`` to see a list of supported options: CL.EXE COMPATIBILITY OPTIONS: /? Display available options /arch: Set architecture for code generation - /Brepro- Emit an object file which cannot be reproduced over time - /Brepro Emit an object file which can be reproduced over time + /arm64EC Set build target to arm64ec + /Brepro- Write current time into COFF output (default) + /Brepro Do not write current time into COFF output (breaks link.exe /incremental) /clang: Pass to the clang driver - /C Don't discard comments when preprocessing + /C Do not discard comments when preprocessing /c Compile only /d1PP Retain macro definitions in /E mode /d1reportAllClassLayout Dump record layout information - /diagnostics:caret Enable caret and column diagnostics (on by default) + /d2epilogunwindrequirev2 + Require generation of unwind v2 (epilog) information for x64 Windows + /d2epilogunwind Best effort generate unwind v2 (epilog) information for x64 Windows + /diagnostics:caret Enable caret and column diagnostics (default) /diagnostics:classic Disable column and caret diagnostics /diagnostics:column Disable caret diagnostics but keep column info + /diasdkdir Path to the DIA SDK /D Define macro - /EH Exception handling model + /EH Set exception handling model /EP Disable linemarker output and preprocess to stdout /execution-charset: - Runtime encoding, supports only UTF-8 + Set runtime encoding, supports only UTF-8 + /external:env: Add dirs in env var to include search path with warnings suppressed + /external:I Add directory to include search path with warnings suppressed + /external:W0 Ignore warnings from system headers (default) + /external:W1 Enable -Wsystem-headers + /external:W2 Enable -Wsystem-headers + /external:W3 Enable -Wsystem-headers + /external:W4 Enable -Wsystem-headers /E Preprocess to stdout - /FA Output assembly code file during compilation - /Fa Output assembly code to this file during compilation (with /FA) - /Fe Set output executable file or directory (ends in / or \) + /FA Output assembly code file during compilation + /Fa Set assembly output file name (with /FA) + /Fe Set output executable file name /FI Include file before parsing /Fi Set preprocess output file name (with /P) - /Fo Set output object file, or directory (ends in / or \) (with /c) - /fp:except- - /fp:except - /fp:fast - /fp:precise - /fp:strict - /Fp Set pch filename (with /Yc and /Yu) + /Fo Set output object file (with /c) + /Fp Set pch file name (with /Yc and /Yu) + /fsanitize=address Enable AddressSanitizer + /funcoverride: + Mark as being replaceable by the Windows kernel loader /GA Assume thread-local variables are defined in the executable /Gd Set __cdecl as a default calling convention /GF- Disable string pooling /GF Enable string pooling (default) - /GR- Disable emission of RTTI data + /GR- Do not emit RTTI data + /Gregcall4 Set __regcall4 as a default calling convention to respect __regcall ABI v.4 /Gregcall Set __regcall as a default calling convention - /GR Enable emission of RTTI data + /GR Emit RTTI data (default) /Gr Set __fastcall as a default calling convention /GS- Disable buffer security check /GS Enable buffer security check (default) /Gs Use stack probes (default) /Gs Set stack probe size (default 4096) - /guard: Enable Control Flow Guard with /guard:cf, - or only the table with /guard:cf,nochecks. - Enable EH Continuation Guard with /guard:ehcont + /guard: Enable Control Flow Guard with /guard:cf, or only the table with /guard:cf,nochecks. Enable EH Continuation Guard with /guard:ehcont /Gv Set __vectorcall as a default calling convention - /Gw- Don't put each data item in its own section + /Gw- Do not put each data item in its own section (default) /Gw Put each data item in its own section - /GX- Disable exception handling - /GX Enable exception handling - /Gy- Don't put each function in its own section (default) + /GX- Deprecated (like not passing /EH) + /GX Deprecated; use /EHsc + /Gy- Do not put each function in its own section (default) /Gy Put each function in its own section /Gz Set __stdcall as a default calling convention /help Display available options - /imsvc Add directory to system include search path, as if part of %INCLUDE% + /hotpatch Create hotpatchable image + /imsvc Add to system include search path, as if in %INCLUDE% /I Add directory to include search path + /JMC- Disable just-my-code debugging (default) + /JMC Enable just-my-code debugging /J Make char type unsigned /LDd Create debug DLL /LD Create DLL @@ -5098,143 +5110,364 @@ Execute ``clang-cl /?`` to see a list of supported options: /MD Use DLL run-time /MTd Use static debug run-time /MT Use static run-time - /O0 Disable optimization - /O1 Optimize for size (same as /Og /Os /Oy /Ob2 /GF /Gy) - /O2 Optimize for speed (same as /Og /Oi /Ot /Oy /Ob2 /GF /Gy) + /O1 Optimize for size (like /Og /Os /Oy /Ob2 /GF /Gy) + /O2 Optimize for speed (like /Og /Oi /Ot /Oy /Ob2 /GF /Gy) /Ob0 Disable function inlining - /Ob1 Only inline functions which are (explicitly or implicitly) marked inline + /Ob1 Only inline functions explicitly or implicitly marked inline /Ob2 Inline functions as deemed beneficial by the compiler /Ob3 Same as /Ob2 /Od Disable optimization /Og No effect /Oi- Disable use of builtin functions /Oi Enable use of builtin functions + /openmp- Disable OpenMP support + /openmp:experimental Enable OpenMP support with experimental SIMD support + /openmp Enable OpenMP support /Os Optimize for size (like clang -Os) /Ot Optimize for speed (like clang -O3) - /Ox Deprecated (same as /Og /Oi /Ot /Oy /Ob2); use /O2 instead + /Ox Deprecated (like /Og /Oi /Ot /Oy /Ob2); use /O2 /Oy- Disable frame pointer omission (x86 only, default) /Oy Enable frame pointer omission (x86 only) /O Set multiple /O flags at once; e.g. '/O2y-' for '/O2 /Oy-' - /o Set output file or directory (ends in / or \) + /o Deprecated (set output file name); use /Fe or /Fe + /permissive- Disable non conforming code from compiling (default) + /permissive Enable some non conforming code to compile /P Preprocess to file + /Qgather- Disable generation of gather instructions in auto-vectorization(x86 only) + /QIntel-jcc-erratum Align branches within 32-byte boundaries to mitigate the performance impact of the Intel JCC erratum. + /Qscatter- Disable generation of scatter instructions in auto-vectorization(x86 only) /Qvec- Disable the loop vectorization passes /Qvec Enable the loop vectorization passes - /showFilenames- Don't print the name of each compiled file (default) + /showFilenames- Do not print the name of each compiled file (default) /showFilenames Print the name of each compiled file + /showIncludes:user Like /showIncludes but omit system headers /showIncludes Print info about included files to stderr - /source-charset: Source encoding, supports only UTF-8 - /std: Language standard to compile for + /source-charset: Set source encoding, supports only UTF-8 + /std: Set language version (c++14,c++17,c++20,c++23preview,c++latest,c11,c17) /TC Treat all source files as C - /Tc Specify a C source file + /Tc Treat as C source file /TP Treat all source files as C++ - /Tp Specify a C++ source file + /Tp Treat as C++ source file + /tune: Set CPU for optimization without affecting instruction set /utf-8 Set source and runtime encoding to UTF-8 (default) /U Undefine macro + /vctoolsdir Path to the VCToolChain + /vctoolsversion For use with /winsysroot, defaults to newest found /vd Control vtordisp placement + /vlen=256 Set vector length of 256 bits for autovectorization and other optimizations + /vlen=512 Set vector length of 512 bits for autovectorization and other optimizations + /vlen Set default vector length for autovectorization and other optimizations /vmb Use a best-case representation method for member pointers /vmg Use a most-general representation for member pointers /vmm Set the default most-general representation to multiple inheritance /vms Set the default most-general representation to single inheritance /vmv Set the default most-general representation to virtual inheritance - /volatile:iso Volatile loads and stores have standard semantics - /volatile:ms Volatile loads and stores have acquire and release semantics /W0 Disable all warnings /W1 Enable -Wall /W2 Enable -Wall /W3 Enable -Wall /W4 Enable -Wall and -Wextra /Wall Enable -Weverything - /WX- Do not treat warnings as errors + /winsdkdir Path to the Windows SDK + /winsdkversion Full version of the Windows SDK, defaults to newest found + /winsysroot Same as "/diasdkdir /DIA SDK" /vctoolsdir /VC/Tools/MSVC/ "/winsdkdir /Windows Kits/10" + /WX- Do not treat warnings as errors (default) /WX Treat warnings as errors /w Disable all warnings - /X Don't add %INCLUDE% to the include search path + /X Do not add %INCLUDE% to include search path /Y- Disable precompiled headers, overrides /Yc and /Yu /Yc Generate a pch file for all code up to and including /Yu Load a pch file and use it instead of all code up to and including /Z7 Enable CodeView debug information in object files - /Zc:char8_t Enable C++20 char8_t type - /Zc:char8_t- Disable C++20 char8_t type - /Zc:dllexportInlines- Don't dllexport/dllimport inline member functions of dllexport/import classes + /Zc:__STDC__ Define __STDC__ + /Zc:alignedNew- Disable C++17 aligned allocation functions + /Zc:alignedNew Enable C++17 aligned allocation functions + /Zc:char8_t- Disable char8_t from c++2a + /Zc:char8_t Enable char8_t from C++2a + /Zc:dllexportInlines- Do not dllexport/dllimport inline member functions of dllexport/import classes /Zc:dllexportInlines dllexport/dllimport inline member functions of dllexport/import classes (default) /Zc:sizedDealloc- Disable C++14 sized global deallocation functions /Zc:sizedDealloc Enable C++14 sized global deallocation functions /Zc:strictStrings Treat string literals as const /Zc:threadSafeInit- Disable thread-safe initialization of static variables /Zc:threadSafeInit Enable thread-safe initialization of static variables + /Zc:tlsGuards- Disable on-demand initialization of thread-local variables + /Zc:tlsGuards Enable on-demand initialization of thread-local variables /Zc:trigraphs- Disable trigraphs (default) /Zc:trigraphs Enable trigraphs - /Zc:twoPhase- Disable two-phase name lookup in templates + /Zc:twoPhase- Disable two-phase name lookup in templates (default) /Zc:twoPhase Enable two-phase name lookup in templates - /Zi Alias for /Z7. Does not produce PDBs. - /Zl Don't mention any default libraries in the object file - /Zp Set the default maximum struct packing alignment to 1 - /Zp Specify the default maximum struct packing alignment + /Zc:wchar_t- Disable C++ builtin type wchar_t + /Zc:wchar_t Enable C++ builtin type wchar_t (default) + /ZH:MD5 Use MD5 for file checksums in debug info (default) + /ZH:SHA1 Use SHA1 for file checksums in debug info + /ZH:SHA_256 Use SHA256 for file checksums in debug info + /Zi Like /Z7 + /Zl Do not let object file auto-link default libraries + /Zp Set default maximum struct packing alignment to 1 + /Zp Set default maximum struct packing alignment /Zs Run the preprocessor, parser and semantic analysis stages OPTIONS: -### Print (but do not run) the commands to run for this compilation --analyze Run the static analyzer + --config= Specify configuration file + --cuda-compile-host-device + Compile CUDA code for both host and device (default). Has no effect on non-CUDA compilations. + --cuda-device-only Compile CUDA code for device only + --cuda-feature= Manually specify the CUDA feature to use + --cuda-host-only Compile CUDA code for host only. Has no effect on non-CUDA compilations. + --cuda-include-ptx= + Include PTX for the following GPU architecture (e.g. sm_35) or 'all'. May be specified more than once. + --cuda-noopt-device-debug + Enable device-side debug info generation. Disables ptxas optimizations. + --cuda-path-ignore-env Ignore environment variables to detect CUDA installation + --cuda-path= CUDA installation path + -cuid= An 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. + -darwin-target-variant + Generate code for an additional runtime variant of the deployment target + -emit-ast Emit Clang AST files for source inputs + --end-no-unused-arguments + Start emitting warnings for unused driver arguments -faddrsig Emit an address-significance table -fansi-escape-codes Use ANSI escape codes for diagnostics -fblocks Enable the 'blocks' language feature - -fcf-protection= Instrument control-flow architecture protection. Options: return, branch, full, none. + -fcaret-diagnostics-max-lines= + Set the maximum number of source lines to show in a caret diagnostic (0 = no limit). + -fcf-protection= Instrument control-flow architecture protection -fcf-protection Enable cf-protection in 'full' mode - -fcolor-diagnostics Use colors in diagnostics + -fcodegen-data-generate= + Emit codegen data into the object file. LLD for MachO (currently) merges them into the specified . + -fcodegen-data-generate Emit codegen data into the object file. LLD for MachO (currently) merges them into default.cgdata. + -fcodegen-data-use= + Use codegen data read from the specified . + -fcodegen-data-use Use codegen data read from default.cgdata to optimize the binary + -fcolor-diagnostics Enable colors in diagnostics + -fcommon Place uninitialized global variables in a common block -fcomplete-member-pointers Require member pointer base types to be complete if they would be significant under the Microsoft ABI + -fcoverage-compilation-dir= + The compilation directory to embed in the coverage mapping. -fcoverage-mapping Generate coverage mapping to enable code coverage analysis + -fcoverage-mcdc Enable MC/DC criteria when generating code coverage -fcrash-diagnostics-dir= Put crash-report files in + -fcrash-diagnostics= + Set level of crash diagnostic reporting, (option: off, compiler, all) + -fcrash-diagnostics Enable crash diagnostic reporting (default) + -fcs-profile-generate= + Generate instrumented code to collect context sensitive execution counts into /default.profraw (overridden by LLVM_PROFILE_FILE env var) + -fcs-profile-generate Generate instrumented code to collect context sensitive execution counts into default.profraw (overridden by LLVM_PROFILE_FILE env var) + -fcuda-short-ptr Use 32-bit pointers for accessing const/local/shared address spaces + -fdebug-compilation-dir= + The compilation directory to embed in the debug info -fdebug-macro Emit macro debug information -fdelayed-template-parsing Parse templated function definitions at the end of the translation unit + -fdelete-null-pointer-checks + Treat usage of null pointers as undefined behavior (default) + -fdevirtualize-speculatively + Enables speculative devirtualization optimization. -fdiagnostics-absolute-paths Print absolute paths in diagnostics + -fdiagnostics-color= + When to use colors in diagnostics -fdiagnostics-parseable-fixits Print fix-its in machine parseable form - -flto= Set LTO mode to either 'full' or 'thin' + -fdriver-only Only run the driver. + -feliminate-unused-debug-types + Do not emit debug info for defined but unused types + -fexcess-precision= + Allows control over excess precision on targets where native support for the precision types is not available. By default, excess precision is used to calculate intermediate results following the rules specified in ISO C99. + -fexperimental-library Control whether unstable and experimental library features are enabled. This option enables various library features that are either experimental (also known as TSes), or have been but are not stable yet in the selected Standard Library implementation. It is not recommended to use this option in production code, since neither ABI nor API stability are guaranteed. This is intended to provide a preview of features that will ship in the future for experimentation purposes + -fexperimental-sanitize-metadata-ignorelist= + Disable sanitizer metadata for modules and functions that match the provided special case list + -fexperimental-sanitize-metadata= + Specify the type of metadata to emit for binary analysis sanitizers + -ffile-compilation-dir= + The compilation directory to embed in the debug info and coverage mapping. + -ffile-reproducible Use the target's platform-specific path separator character when expanding the __FILE__ macro + -ffixed-x10 Reserve the x10 register (AArch64/RISC-V only) + -ffixed-x11 Reserve the x11 register (AArch64/RISC-V only) + -ffixed-x12 Reserve the x12 register (AArch64/RISC-V only) + -ffixed-x13 Reserve the x13 register (AArch64/RISC-V only) + -ffixed-x14 Reserve the x14 register (AArch64/RISC-V only) + -ffixed-x15 Reserve the x15 register (AArch64/RISC-V only) + -ffixed-x16 Reserve the x16 register (AArch64/RISC-V only) + -ffixed-x17 Reserve the x17 register (AArch64/RISC-V only) + -ffixed-x18 Reserve the x18 register (AArch64/RISC-V only) + -ffixed-x19 Reserve the x19 register (AArch64/RISC-V only) + -ffixed-x1 Reserve the x1 register (AArch64/RISC-V only) + -ffixed-x20 Reserve the x20 register (AArch64/RISC-V only) + -ffixed-x21 Reserve the x21 register (AArch64/RISC-V only) + -ffixed-x22 Reserve the x22 register (AArch64/RISC-V only) + -ffixed-x23 Reserve the x23 register (AArch64/RISC-V only) + -ffixed-x24 Reserve the x24 register (AArch64/RISC-V only) + -ffixed-x25 Reserve the x25 register (AArch64/RISC-V only) + -ffixed-x26 Reserve the x26 register (AArch64/RISC-V only) + -ffixed-x27 Reserve the x27 register (AArch64/RISC-V only) + -ffixed-x28 Reserve the x28 register (AArch64/RISC-V only) + -ffixed-x29 Reserve the x29 register (AArch64/RISC-V only) + -ffixed-x2 Reserve the x2 register (AArch64/RISC-V only) + -ffixed-x30 Reserve the x30 register (AArch64/RISC-V only) + -ffixed-x31 Reserve the x31 register (AArch64/RISC-V only) + -ffixed-x3 Reserve the x3 register (AArch64/RISC-V only) + -ffixed-x4 Reserve the x4 register (AArch64/RISC-V only) + -ffixed-x5 Reserve the x5 register (AArch64/RISC-V only) + -ffixed-x6 Reserve the x6 register (AArch64/RISC-V only) + -ffixed-x7 Reserve the x7 register (AArch64/RISC-V only) + -ffixed-x8 Reserve the x8 register (AArch64/RISC-V only) + -ffixed-x9 Reserve the x9 register (AArch64/RISC-V only) + -fforce-emit-vtables Emits more virtual tables to improve devirtualization + -ffuchsia-api-level= + Set Fuchsia API level + -fgnuc-version= Sets various macros to claim compatibility with the given GCC version (default is 4.2.1) + -fgpu-allow-device-init Allow device side init function in HIP (experimental) + -fgpu-default-stream= + Specify default stream. The default value is 'legacy'. (CUDA/HIP only) + -fgpu-defer-diag Defer host/device related diagnostic messages for CUDA/HIP + -fgpu-flush-denormals-to-zero + Flush denormal floating point values to zero in CUDA/HIP device mode. + -fgpu-rdc Generate relocatable device code, also known as separate compilation mode + -fgpu-sanitize Enable sanitizer for supported offloading devices + -fhip-emit-relocatable Compile HIP source to relocatable + -fhip-fp32-correctly-rounded-divide-sqrt + Specify that single precision floating-point divide and sqrt used in the program source are correctly rounded (HIP device compilation only) + -fhip-kernel-arg-name Specify that kernel argument names are preserved (HIP only) + -fhip-new-launch-api Use new kernel launching API for HIP + -fimplicit-module-maps Implicitly search the file system for module map files. + -finline-max-stacksize= + Suppress inlining of functions whose stack size exceeds the given value + -fintegrated-cc1 Run cc1 in-process + -fintegrated-objemitter Use internal machine object code emitter. + -flto= Set LTO mode -flto Enable LTO in 'full' mode + -fmacro-backtrace-limit= + Set the maximum number of entries to print in a macro expansion backtrace (0 = no limit) + -fmemory-profile-use= + Use memory profile for profile-guided memory optimization -fmerge-all-constants Allow merging of constants - -fmodule-file== - Use the specified module file that provides the module - -fmodule-header=
- Build
as a C++20 header unit - -fmodule-output= - Save intermediate module file results when compiling a standard C++ module unit. + -fmodule-file=[=] + Specify the mapping of module name to precompiled module file, or load a module file if name is omitted. + -fmodule-header= Build a C++20 Header Unit from a header that should be found in the user (fmodule-header=user) or system (fmodule-header=system) search path. + -fmodule-header Build a C++20 Header Unit from a header + -fmodule-map-file= + Load this module map file + -fmodule-name= Specify the name of the module to build + -fmodule-output= Save intermediate module file results when compiling a standard C++ module unit. + -fmodule-output Save intermediate module file results when compiling a standard C++ module unit. + -fmodules-decluse Require declaration of modules used within a module + -fmodules-embed-all-files + Embed the contents of all files read by this compilation into the produced module file. + -fmodules-ignore-macro= + Ignore the definition of the given macro when building and loading modules + -fmodules-search-all Search even non-imported modules to resolve references + -fmodules-strict-decluse + Like -fmodules-decluse but requires all headers to be in modules + -fmodules Enable the 'modules' language feature -fms-compatibility-version= - Dot-separated value representing the Microsoft compiler version - number to report in _MSC_VER (0 = don't define it; default is same value as installed cl.exe, or 1933) + Dot-separated value representing the Microsoft compiler version number to report in _MSC_VER (0 = don't define it (default)) -fms-compatibility Enable full Microsoft Visual C++ compatibility + -fms-define-stdc Define '__STDC__' to '1' in MSVC Compatibility mode -fms-extensions Accept some non-standard constructs supported by the Microsoft compiler - -fmsc-version= Microsoft compiler version number to report in _MSC_VER - (0 = don't define it; default is same value as installed cl.exe, or 1933) + -fms-hotpatch Ensure that all functions can be hotpatched at runtime + -fms-runtime-lib= + Select Windows run-time library + -fms-secure-hotpatch-functions-file= + Path to a file that contains a list of mangled names of functions that should be hot-patched for Windows Secure Hot-Patching + -fms-secure-hotpatch-functions-list= + List of mangled symbol names of functions that should be hot-patched for Windows Secure Hot-Patching + -fmsc-version= Microsoft compiler version number to report in _MSC_VER (0 = don't define it (default)) -fno-addrsig Don't emit an address-significance table + -fno-assume-unique-vtables + Disable optimizations based on vtable pointer identity -fno-builtin- Disable implicit builtin knowledge of a specific function -fno-builtin Disable implicit builtin knowledge of functions + -fno-color-diagnostics Disable colors in diagnostics -fno-complete-member-pointers Do not require member pointer base types to be complete if they would be significant under the Microsoft ABI -fno-coverage-mapping Disable code coverage analysis + -fno-coverage-mcdc Disable MC/DC coverage criteria -fno-crash-diagnostics Disable auto-generation of preprocessed source files and a script for reproduction during a clang crash -fno-debug-macro Do not emit macro debug information -fno-delayed-template-parsing Disable delayed template parsing + -fno-delete-null-pointer-checks + Do not treat usage of null pointers as undefined behavior + -fno-eliminate-unused-debug-types + Emit debug info for defined but unused types + -fno-experimental-sanitize-metadata= + Disable emitting metadata for binary analysis sanitizers + -fno-file-reproducible Use the host's platform-specific path separator character when expanding the __FILE__ macro + -fno-gpu-allow-device-init + Don't allow device side init function in HIP (experimental) + -fno-gpu-defer-diag Don't defer host/device related diagnostic messages for CUDA/HIP + -fno-hip-emit-relocatable + Do not override toolchain to compile HIP source to relocatable + -fno-hip-fp32-correctly-rounded-divide-sqrt + Don't specify that single precision floating-point divide and sqrt used in the program source are correctly rounded (HIP device compilation only) + -fno-hip-kernel-arg-name + Don't specify that kernel argument names are preserved (HIP only) + -fno-hip-new-launch-api Don't use new kernel launching API for HIP + -fno-integrated-cc1 Spawn a separate process for each cc1 + -fno-integrated-objemitter + Use external machine object code emitter. + -fno-knr-functions Disable support for K&R C function declarations + -fno-lto Disable LTO mode (default) + -fno-offload-lto Disable LTO mode (default) for offload compilation + -fno-offload-via-llvm Don't use LLVM/Offload as portable offloading runtime. + -fno-profile-generate Disable generation of profile instrumentation. + -fno-profile-instr-generate + Disable generation of profile instrumentation. + -fno-profile-instr-use Disable using instrumentation data for profile-guided optimization + -fno-pseudo-probe-for-profiling + Do not emit pseudo probes for sample profiling + -fno-rtlib-defaultlib On Windows, do not emit /defaultlib: directives to link compiler-rt libraries + -fno-sanitize-address-globals-dead-stripping + Disable linker dead stripping of globals in AddressSanitizer + -fno-sanitize-address-outline-instrumentation + Use default code inlining logic for the address sanitizer -fno-sanitize-address-poison-custom-array-cookie Disable poisoning array cookies when using custom operator new[] in AddressSanitizer -fno-sanitize-address-use-after-scope Disable use-after-scope detection in AddressSanitizer -fno-sanitize-address-use-odr-indicator - Disable ODR indicator globals - -fno-sanitize-ignorelist Don't use ignorelist file for sanitizers + Disable ODR indicator globals + -fno-sanitize-alloc-token-extended + Disable extended coverage to custom allocation functions + -fno-sanitize-alloc-token-fast-abi + Use the default AllocToken ABI + -fno-sanitize-annotate-debug-info= + Do not allow compiler to annotate sanitizer instrumentation with extra debug info for the specified sanitizers + -fno-sanitize-annotate-debug-info + Do not allow compiler to annotate sanitizer instrumentation with extra debug info for any sanitizers + -fno-sanitize-cfi-canonical-jump-tables + Do not make the jump table addresses canonical in the symbol table -fno-sanitize-cfi-cross-dso Disable control flow integrity (CFI) checks for cross-DSO calls. -fno-sanitize-coverage= - Disable specified features of coverage instrumentation for Sanitizers + Disable features of coverage instrumentation for Sanitizers + -fno-sanitize-debug-trap-reasons + Alias for -fsanitize-debug-trap-reasons=none + -fno-sanitize-handler-preserve-all-regs + Disable handlers with preserve_all calling convention + -fno-sanitize-hwaddress-experimental-aliasing + Disable aliasing mode in HWAddressSanitizer + -fno-sanitize-ignorelist + Don't use ignorelist file for sanitizers + -fno-sanitize-memory-param-retval + Disable detection of uninitialized parameters and return values -fno-sanitize-memory-track-origins Disable origins tracking in MemorySanitizer -fno-sanitize-memory-use-after-dtor Disable use-after-destroy detection in MemorySanitizer + -fno-sanitize-merge= + Do not allow compiler to merge handlers for specified sanitizers + -fno-sanitize-merge Do not allow compiler to merge handlers for any sanitizers -fno-sanitize-recover= Disable recovery for specified sanitizers + -fno-sanitize-stable-abi + Conventional ABI instrumentation for sanitizer runtime. Default: Conventional -fno-sanitize-stats Disable sanitizer statistics gathering. -fno-sanitize-thread-atomics Disable atomic operations instrumentation in ThreadSanitizer @@ -5244,64 +5477,132 @@ Execute ``clang-cl /?`` to see a list of supported options: Disable memory access instrumentation in ThreadSanitizer -fno-sanitize-trap= Disable trapping for specified sanitizers + -fno-sanitize-trap Disable trapping for all sanitizers + -fno-sanitize-type-outline-instrumentation + Use code inlining logic for the type sanitizer -fno-standalone-debug Limit debug information produced to reduce size of debug binary - -fno-strict-aliasing Disable optimizations based on strict aliasing rules (default) + -fno-strict-aliasing Disable optimizations based on strict aliasing rules + -fno-sycl Disable SYCL C++ extensions + -fno-temp-file Directly create compilation output files. This may lead to incorrect incremental builds if the compiler crashes + -fno-verify-intermediate-code + Disable verification of LLVM IR -fobjc-runtime= Specify the target Objective-C runtime kind and version + -foffload-implicit-host-device-templates + Template functions or specializations without host, device and global attributes have implicit host device attributes (CUDA/HIP only) + -foffload-lto= Set LTO mode for offload compilation + -foffload-lto Enable LTO in 'full' mode for offload compilation + -foffload-via-llvm Use LLVM/Offload as portable offloading runtime. + -fopenmp-target-jit Emit code that can be JIT compiled for OpenMP offloading. Implies -foffload-lto=full + -fpch-instantiate-templates + Instantiate templates already while building a PCH + -fprebuilt-module-path= + Specify the prebuilt module path -fprofile-exclude-files= Instrument only functions from files where names don't match all the regexes separated by a semi-colon -fprofile-filter-files= Instrument only functions from files where names match any regex separated by a semi-colon - -fprofile-generate= - Generate instrumented code to collect execution counts into a raw profile file in the directory specified by the argument. The filename uses default_%m.profraw pattern - (overridden by ``LLVM_PROFILE_FILE`` env var) - -fprofile-generate - Generate instrumented code to collect execution counts into default_%m.profraw file - (overridden by '=' form of option or ``LLVM_PROFILE_FILE`` env var) - -fprofile-instr-generate= - Generate instrumented code to collect execution counts into the file whose name pattern is specified as the argument - (overridden by ``LLVM_PROFILE_FILE`` env var) + -fprofile-generate-cold-function-coverage= + Generate instrumented code to collect coverage info for cold functions into /default.profraw (overridden by LLVM_PROFILE_FILE env var) + -fprofile-generate-cold-function-coverage + Generate instrumented code to collect coverage info for cold functions into default.profraw file (overridden by '=' form of option or LLVM_PROFILE_FILE env var) + -fprofile-generate= + Generate instrumented code to collect execution counts into /default.profraw (overridden by LLVM_PROFILE_FILE env var) + -fprofile-generate Generate instrumented code to collect execution counts into default.profraw (overridden by LLVM_PROFILE_FILE env var) + -fprofile-instr-generate= + Generate instrumented code to collect execution counts into (overridden by LLVM_PROFILE_FILE env var) -fprofile-instr-generate - Generate instrumented code to collect execution counts into default.profraw file - (overridden by '=' form of option or ``LLVM_PROFILE_FILE`` env var) + Generate instrumented code to collect execution counts into default.profraw file (overridden by '=' form of option or LLVM_PROFILE_FILE env var) -fprofile-instr-use= - Use instrumentation data for coverage testing or profile-guided optimization - -fprofile-use= Use instrumentation data for profile-guided optimization + -fprofile-list= Filename defining the list of functions/files to instrument. The file uses the sanitizer special case list format. -fprofile-remapping-file= Use the remappings described in to match the profile data against names in the program - -fprofile-list= - Filename defining the list of functions/files to instrument + -fprofile-sample-use= + Enable sample-based profile guided optimizations + -fprofile-update= + Set update method of profile counters + -fprofile-use= + Use instrumentation data for profile-guided optimization. If pathname is a directory, it reads from /default.profdata. Otherwise, it reads from file . + -fprotect-parens Determines whether the optimizer honors parentheses when floating-point expressions are evaluated + -fpseudo-probe-for-profiling + Emit pseudo probes for sample profiling + -frtlib-defaultlib On Windows, emit /defaultlib: directives to link compiler-rt libraries (default) + -fsanitize-address-destructor= + Set the kind of module destructors emitted by AddressSanitizer instrumentation. These destructors are emitted to unregister instrumented global variables when code is unloaded (e.g. via `dlclose()`). -fsanitize-address-field-padding= Level of field padding for AddressSanitizer -fsanitize-address-globals-dead-stripping Enable linker dead stripping of globals in AddressSanitizer + -fsanitize-address-outline-instrumentation + Always generate function calls for address sanitizer instrumentation -fsanitize-address-poison-custom-array-cookie Enable poisoning array cookies when using custom operator new[] in AddressSanitizer -fsanitize-address-use-after-return= - Select the mode of detecting stack use-after-return in AddressSanitizer: never | runtime (default) | always + Select the mode of detecting stack use-after-return in AddressSanitizer -fsanitize-address-use-after-scope Enable use-after-scope detection in AddressSanitizer -fsanitize-address-use-odr-indicator Enable ODR indicator globals to avoid false ODR violation reports in partially sanitized programs at the cost of an increase in binary size - -fsanitize-ignorelist= - Path to ignorelist file for sanitizers + -fsanitize-alloc-token-extended + Enable extended coverage to custom allocation functions + -fsanitize-alloc-token-fast-abi + Use the AllocToken fast ABI + -fsanitize-annotate-debug-info= + Annotate sanitizer instrumentation with extra debug info for the specified sanitizers, if supported + -fsanitize-annotate-debug-info + Allow compiler to annotate sanitizer instrumentation with extra debug info for all sanitizers, where supported + -fsanitize-cfi-canonical-jump-tables + Make the jump table addresses canonical in the symbol table -fsanitize-cfi-cross-dso Enable control flow integrity (CFI) checks for cross-DSO calls. + -fsanitize-cfi-icall-experimental-normalize-integers + Normalize integers in CFI indirect call type signature checks -fsanitize-cfi-icall-generalize-pointers Generalize pointers in CFI indirect call type signature checks + -fsanitize-coverage-allowlist= + Restrict sanitizer coverage instrumentation exclusively to modules and functions that match the provided special case list, except the blocked ones + -fsanitize-coverage-ignorelist= + Disable sanitizer coverage instrumentation for modules and functions that match the provided special case list, even the allowed ones + -fsanitize-coverage-stack-depth-callback-min= + Use callback for max stack depth tracing with minimum stack depth M -fsanitize-coverage= Specify the type of coverage instrumentation for Sanitizers + -fsanitize-debug-trap-reasons= + Set how trap reasons are emitted. `none` - Not emitted. This gives the smallest debug info; `basic` - Emit a fixed trap message per check type. This increases the debug info size but not as much as `detailed`; `detailed` - Emit a more detailed trap message. This increases the debug info size the most. Default is `detailed`. + -fsanitize-debug-trap-reasons + Alias for -fsanitize-debug-trap-reasons=detailed + -fsanitize-handler-preserve-all-regs + Enable handlers with preserve_all calling convention -fsanitize-hwaddress-abi= - Select the HWAddressSanitizer ABI to target (interceptor or platform, default interceptor) + Select the HWAddressSanitizer ABI to target (interceptor or platform, default interceptor). This option is currently unused. + -fsanitize-hwaddress-experimental-aliasing + Enable aliasing mode in HWAddressSanitizer + -fsanitize-ignorelist= + Path to ignorelist file for sanitizers + -fsanitize-kcfi-arity Embed function arity information into the KCFI patchable function prefix + -fsanitize-kcfi-hash= + Select hash algorithm for KCFI type IDs (xxHash64, FNV-1a) + -fsanitize-memory-param-retval + Enable detection of uninitialized parameters and return values -fsanitize-memory-track-origins= Enable origins tracking in MemorySanitizer -fsanitize-memory-track-origins Enable origins tracking in MemorySanitizer -fsanitize-memory-use-after-dtor Enable use-after-destroy detection in MemorySanitizer + -fsanitize-memtag-mode= + Set default MTE mode to 'sync' (default) or 'async' + -fsanitize-merge= + Allow compiler to merge handlers for specified sanitizers + -fsanitize-merge Allow compiler to merge handlers for all sanitizers -fsanitize-recover= Enable recovery for specified sanitizers + -fsanitize-skip-hot-cutoff= + Exclude sanitization for the top hottest code responsible for the given fraction of PGO counters (0.0 [default] = skip none; 1.0 = skip all). Argument format: =,=,... + -fsanitize-stable-abi Stable ABI instrumentation for sanitizer runtime. Default: Conventional -fsanitize-stats Enable sanitizer statistics gathering. + -fsanitize-system-ignorelist= + Path to system ignorelist file for sanitizers -fsanitize-thread-atomics Enable atomic operations instrumentation in ThreadSanitizer (default) -fsanitize-thread-func-entry-exit @@ -5309,32 +5610,345 @@ Execute ``clang-cl /?`` to see a list of supported options: -fsanitize-thread-memory-access Enable memory access instrumentation in ThreadSanitizer (default) -fsanitize-trap= Enable trapping for specified sanitizers + -fsanitize-trap Enable trapping for all sanitizers + -fsanitize-type-outline-instrumentation + Always generate function calls for type sanitizer instrumentation + -fsanitize-undefined-ignore-overflow-pattern= + Specify the overflow patterns to exclude from arithmetic sanitizer instrumentation -fsanitize-undefined-strip-path-components= Strip (or keep only, if negative) a given number of path components when emitting check metadata. - -fsanitize= Turn on runtime checks for various forms of undefined or suspicious - behavior. See user manual for available checks - -fsplit-lto-unit Enables splitting of the LTO unit. + -fsanitize= Turn on runtime checks for various forms of undefined or suspicious behavior. See user manual for available checks + -fsplit-lto-unit Enables splitting of the LTO unit -fstandalone-debug Emit full debug info for all types used by the program - -fstrict-aliasing Enable optimizations based on strict aliasing rules + -fstrict-aliasing Enable optimizations based on strict aliasing rules + -fswift-async-fp=