]> granicus.if.org Git - clang/commitdiff
[Docs] One more cleanup of -fsanitize= section.
authorAlexey Samsonov <vonosmas@gmail.com>
Fri, 4 Dec 2015 23:13:14 +0000 (23:13 +0000)
committerAlexey Samsonov <vonosmas@gmail.com>
Fri, 4 Dec 2015 23:13:14 +0000 (23:13 +0000)
Describe -fsanitize-blacklist flags in separate paragraphs, move
notes about importance of clang++ for vptr down to UBSan docs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@254798 91177308-0d34-0410-b5e6-96231b3b80d8

docs/UndefinedBehaviorSanitizer.rst
docs/UsersManual.rst

index c996ea3341fa81ebadb9b12d90295bef2d71a29b..37ff16d9a9e9b5925af5ff3709fcf52cd8e2e54c 100644 (file)
@@ -119,7 +119,9 @@ Available checks are:
      does not evaluate to a positive value.
   -  ``-fsanitize=vptr``: Use of an object whose vptr indicates that
      it is of the wrong dynamic type, or that its lifetime has not
-     begun or has ended. Incompatible with ``-fno-rtti``.
+     begun or has ended. Incompatible with ``-fno-rtti``. Link must
+     be performed by ``clang++``, not ``clang``, to make sure C++-specific
+     parts of the runtime library and C++ standard libraries are present.
 
 You can also use the following check groups:
   -  ``-fsanitize=undefined``: All of the checks listed above other than
index c103ef6c5b45adee3ba773c071e39060fa2a0187..5e1a6cfad89eaf4729ec68315b71308b3f8d4028 100644 (file)
@@ -977,21 +977,8 @@ are listed below.
    undefined behavior that can be detected and the :ref:`list <cfi-schemes>`
    of control flow integrity schemes.
 
-   You can turn off or modify checks for certain source files, functions
-   or even variables by providing a special file:
-
-   -  ``-fsanitize-blacklist=/path/to/blacklist/file``: disable or modify
-      sanitizer checks for objects listed in the file. See
-      :doc:`SanitizerSpecialCaseList` for file format description.
-   -  ``-fno-sanitize-blacklist``: don't use blacklist file, if it was
-      specified earlier in the command line.
-
    The ``-fsanitize=`` argument must also be provided when linking, in
-   order to link to the appropriate runtime library. When using
-   ``-fsanitize=vptr`` (or a group that includes it, such as
-   ``-fsanitize=undefined``) with a C++ program, the link must be
-   performed by ``clang++``, not ``clang``, in order to link against the
-   C++-specific parts of the runtime library.
+   order to link to the appropriate runtime library.
 
    It is not possible to combine more than one of the ``-fsanitize=address``,
    ``-fsanitize=thread``, and ``-fsanitize=memory`` checkers in the same
@@ -1028,14 +1015,24 @@ are listed below.
    be used (for instance, when building libc or a kernel module), or where
    the binary size increase caused by the sanitizer runtime is a concern.
 
-   This flag is only compatible with ``local-bounds``,
-   ``unsigned-integer-overflow``, sanitizers in the ``cfi`` group and
-   sanitizers in the ``undefined`` group other than ``vptr``. If this flag
+   This flag is only compatible with :doc:`control flow integrity
+   <ControlFlowIntegrity>` schemes and :doc:`UndefinedBehaviorSanitizer`
+   checks other than ``vptr``. If this flag
    is supplied together with ``-fsanitize=undefined``, the ``vptr`` sanitizer
    will be implicitly disabled.
 
    This flag is enabled by default for sanitizers in the ``cfi`` group.
 
+.. option:: -fsanitize-blacklist=/path/to/blacklist/file
+
+   Disable or modify sanitizer checks for objects (source files, functions,
+   variables, types) listed in the file. See
+   :doc:`SanitizerSpecialCaseList` for file format description.
+
+.. option:: -fno-sanitize-blacklist
+
+   Don't use blacklist file, if it was specified earlier in the command line.
+
 **-f[no-]sanitize-coverage=[type,features,...]**
 
    Enable simple code coverage in addition to certain sanitizers.