diff --git a/clang/docs/ClangCommandLineReference.rst b/clang/docs/ClangCommandLineReference.rst --- a/clang/docs/ClangCommandLineReference.rst +++ b/clang/docs/ClangCommandLineReference.rst @@ -5,7 +5,7 @@ ------------------------------------------------------------------- ===================================== -Clang command line argument reference +Clang command line reference ===================================== .. contents:: :local: @@ -13,7 +13,7 @@ Introduction ============ -This page lists the command line arguments currently supported by the +This page lists the command line arguments and environment variables currently supported by the GCC-compatible ``clang`` and ``clang++`` drivers. @@ -22,6 +22,11 @@ Search $prefix$file for executables, libraries, and data files. If $prefix is a directory, search $prefix/$file +.. envvar:: COMPILER_PATH= + +Search $paths for executables, libraries, and data files. The value is a list of paths separated by a system standard +separator. On Windows and Unix, this separator should be colon, just like ``PATH``. + .. option:: -F Add directory to framework include search path @@ -349,8 +354,51 @@ Run the migrator +.. option:: -mmacosx-version-min= + +Sets the deployment target version (macOS only) + +.. evnvar:: MACOSX_DEPLOYMENT_TARGET + +Sets the deployment target version (macOS only). +This variable might not correctly handle non-ASCII characters in some hosts. + .. option:: -mios-simulator-version-min=, -miphonesimulator-version-min= +Sets the deployment target version (iOS only) + +.. evnvar:: IPHONEOS_DEPLOYMENT_TARGET + +Sets the deployment target version (iOS only). +This variable might not correctly handle non-ASCII characters in some hosts. + +.. option:: -mtvos-version-min= + +Sets the deployment target version (tvOS only) + +.. evnvar:: TVOS_DEPLOYMENT_TARGET + +Sets the deployment target version (tvOS only). +This variable might not correctly handle non-ASCII characters in some hosts. + +.. option:: -mwatchos-version-min= + +Sets the deployment target version (watchOS only) + +.. evnvar:: WATCHOS_DEPLOYMENT_TARGET + +Sets the deployment target version (watchOS only). +This variable might not correctly handle non-ASCII characters in some hosts. + +.. option:: -mdriverkit-version-min= + +Sets the deployment target version (DriverKit only) + +.. evnvar:: DRIVERKIT_DEPLOYMENT_TARGET + +Sets the deployment target version (DriverKit only). +This variable might not correctly handle non-ASCII characters in some hosts. + .. option:: -mlinker-version= .. option:: -mlittle-endian, -EL @@ -1166,6 +1214,14 @@ paths, for example if also specified with -isystem, the -I option will be ignored +.. envvar:: CPATH= + +Takes a list of paths to add to the include search path, like :option:`-I`. +The value is a list of paths separated by a system standard separator. +On Windows and Unix, this separator should be colon, just like ``PATH``. + +This variable might not correctly handle non-ASCII characters in some hosts. + .. option:: -I-, --include-barrier Restrict all prior -I flags to double-quoted inclusion and remove current directory from include path @@ -1182,10 +1238,6 @@ CUDA installation path -.. option:: -cxx-isystem - -Add directory to the C++ SYSTEM include search path - .. option:: -fbuild-session-file= Use the last modification time of as the build session timestamp @@ -1202,6 +1254,12 @@ Specify the module cache path +.. envvar:: CLANG_MODULE_CACHE_PATH= + +Specify the module cache path. +Will be used as a fallback if ::option::`-fmodules-cache-path=` is not specified. +This variable might not correctly handle non-ASCII characters in some hosts. + .. option:: -fmodules-disable-diagnostic-validation Disable validation of the diagnostic options when loading the module @@ -1270,6 +1328,31 @@ Set the system root directory (usually /) +.. envvar:: SDKROOT= + +Set the system root directory, with a lower precedence than :option:`-isysroot` (Darwin only). +This variable might not correctly handle non-ASCII characters in some hosts. + +.. envvar:: RC_DEBUG_OPTIONS= + +Sets DWARF debug flag if $val is not empty (Darwin only). +This variable might not correctly handle non-ASCII characters in some hosts. + +.. envvar:: RC_DEBUG_PREFIX_MAP= + +Sets debug path remapping (Darwin only). +This variable might not correctly handle non-ASCII characters in some hosts. + +.. envvar:: SCE_ORBIS_SDK_DIR= + +Determine where to find the libraries (PS4 only). +This variable might not correctly handle non-ASCII characters in some hosts. + +.. envvar:: SCE_PROSPERO_SDK_DIR= + +Determine where to find the libraries (PS5 only). +This variable might not correctly handle non-ASCII characters in some hosts. + .. option:: -isystem Add directory to SYSTEM include search path @@ -1278,6 +1361,86 @@ Add directory to end of the SYSTEM include search path +.. option:: -c-isystem + +Add directory to the C SYSTEM include search path + +.. envvar:: C_INCLUDE_PATH= + +Takes a list of paths to add to the C SYSTEM include search path, like :option:`-c-isystem`. +The value is a list of paths separated by a system standard separator. +On Windows and Unix, this separator should be colon, just like ``PATH``. + +This variable might not correctly handle non-ASCII characters in some hosts. + +.. option:: -cxx-isystem + +Add directory to the C++ SYSTEM include search path + +.. envvar:: CPLUS_INCLUDE_PATH= + +Takes a list of paths to add to the C++ SYSTEM include search path, like :option:`-cxx-isystem`. +The value is a list of paths separated by a system standard separator. +On Windows and Unix, this separator should be colon, just like ``PATH``. + +This variable might not correctly handle non-ASCII characters in some hosts. + +.. option:: -objc-isystem + +Add directory to the Objective-C SYSTEM include search path + +.. envvar:: OBJC_INCLUDE_PATH= + +Takes a list of paths to add to the Objective-C SYSTEM include search path, like :option:`-objc-isystem`. +The value is a list of paths separated by a system standard separator. +On Windows and Unix, this separator should be colon, just like ``PATH``. + +This variable might not correctly handle non-ASCII characters in some hosts. + +.. option:: -objcxx-isystem + +Add directory to the Objective-C++ SYSTEM include search path + +.. envvar:: OBJCPLUS_INCLUDE_PATH= + +Takes a list of paths to add to the Objective-C++ SYSTEM include search path, like :option:`-objcxx-isystem`. +The value is a list of paths separated by a system standard separator. +On Windows and Unix, this separator should be colon, just like ``PATH``. + +This variable might not correctly handle non-ASCII characters in some hosts. + +.. envvar:: NCC_C_INCLUDE_PATH= + +Takes a list of paths to add to the C SYSTEM include search path, like :option:`-c-isystem` (VE only). +The value is a list of paths separated by a system standard separator. +On Windows and Unix, this separator should be colon, just like ``PATH``. + +This variable might not correctly handle non-ASCII characters in some hosts. + +.. envvar:: NCC_CPLUS_INCLUDE_PATH= + +Takes a list of paths to add to the C++ SYSTEM include search path, like :option:`-cxx-isystem` (VE only). +The value is a list of paths separated by a system standard separator. +On Windows and Unix, this separator should be colon, just like ``PATH``. + +This variable might not correctly handle non-ASCII characters in some hosts. + +.. envvar:: XCC_C_INCLUDE_PATH= + +Takes a list of paths to add to the C SYSTEM include search path, like :option:`-c-isystem` (XCore only). +The value is a list of paths separated by a system standard separator. +On Windows and Unix, this separator should be colon, just like ``PATH``. + +This variable might not correctly handle non-ASCII characters in some hosts. + +.. envvar:: XCC_CPLUS_INCLUDE_PATH= + +Takes a list of paths to add to the C++ SYSTEM include search path, like :option:`-cxx-isystem` (XCore only). +The value is a list of paths separated by a system standard separator. +On Windows and Unix, this separator should be colon, just like ``PATH``. + +This variable might not correctly handle non-ASCII characters in some hosts. + .. option:: -ivfsoverlay Overlay the virtual filesystem described by file over the real file system @@ -3053,10 +3216,21 @@ .. option:: -m16 +Generate code for a 16-bit environment. + .. option:: -m32 +Generate code for a 32-bit environment. + .. option:: -m64 +Generate code for a 64-bit environment. + +.. envvar:: OBJECT_MODE= + +Changes the code generation based on $mode (AIX only). +Possible values are ``32``, for a 32-bit environment, and ``64`` for a 64-bit one. + .. option:: -mabi= .. program:: clang1 @@ -4269,6 +4443,13 @@ Add directory to library search path +.. envvar:: LIBRARY_PATH= + +Add $paths to the library search path. The value is a list of paths separated by a system standard +separator. On Windows and Unix, this separator should be colon, just like ``PATH``. + +This variable might not correctly handle non-ASCII characters in some hosts under some circumstances. + .. option:: -Mach .. option:: -T