[llvm] r310734 - Update libFuzzer documentation for -fsanitize=fuzzer-no-link flag

George Karpenkov via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 11 10:23:45 PDT 2017


Author: george.karpenkov
Date: Fri Aug 11 10:23:45 2017
New Revision: 310734

URL: http://llvm.org/viewvc/llvm-project?rev=310734&view=rev
Log:
Update libFuzzer documentation for -fsanitize=fuzzer-no-link flag

Differential Revision: https://reviews.llvm.org/D36602

Modified:
    llvm/trunk/docs/LibFuzzer.rst

Modified: llvm/trunk/docs/LibFuzzer.rst
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LibFuzzer.rst?rev=310734&r1=310733&r2=310734&view=diff
==============================================================================
--- llvm/trunk/docs/LibFuzzer.rst (original)
+++ llvm/trunk/docs/LibFuzzer.rst Fri Aug 11 10:23:45 2017
@@ -90,12 +90,24 @@ Some important things to remember about
 Fuzzer Usage
 ------------
 
-Very recent versions of Clang (> April 20 2017) include libFuzzer,
+Very recent versions of Clang (after April 20 2017) include libFuzzer,
 and no installation is necessary.
 In order to fuzz your binary, use the `-fsanitize=fuzzer` flag during the compilation::
 
    clang -fsanitize=fuzzer,address mytarget.c
 
+This will perform the necessary instrumentation, as well as linking in libFuzzer
+library.
+Note that linking in libFuzzer defines the ``main`` symbol.
+If modifying ``CFLAGS`` of a large project, which also compiles executables
+requiring their own ``main`` symbol, it may be desirable to request just the
+instrumentation without linking::
+
+   clang -fsanitize=fuzzer-no-link mytarget.c
+
+Then libFuzzer can be linked to the desired driver by passing in
+``-fsanitize=fuzzer`` during the linking stage.
+
 Otherwise, build the libFuzzer library as a static archive, without any sanitizer
 options. Note that the libFuzzer library contains the ``main()`` function:
 




More information about the llvm-commits mailing list