llvm.org GIT mirror llvm / 41ae605
Update libFuzzer documentation for -fsanitize=fuzzer-no-link flag Differential Revision: https://reviews.llvm.org/D36602 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310734 91177308-0d34-0410-b5e6-96231b3b80d8 George Karpenkov 2 years ago
1 changed file(s) with 13 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
8989 Fuzzer Usage
9090 ------------
9191
92 Very recent versions of Clang (> April 20 2017) include libFuzzer,
92 Very recent versions of Clang (after April 20 2017) include libFuzzer,
9393 and no installation is necessary.
9494 In order to fuzz your binary, use the `-fsanitize=fuzzer` flag during the compilation::
9595
9696 clang -fsanitize=fuzzer,address mytarget.c
97
98 This will perform the necessary instrumentation, as well as linking in libFuzzer
99 library.
100 Note that linking in libFuzzer defines the ``main`` symbol.
101 If modifying ``CFLAGS`` of a large project, which also compiles executables
102 requiring their own ``main`` symbol, it may be desirable to request just the
103 instrumentation without linking::
104
105 clang -fsanitize=fuzzer-no-link mytarget.c
106
107 Then libFuzzer can be linked to the desired driver by passing in
108 ``-fsanitize=fuzzer`` during the linking stage.
97109
98110 Otherwise, build the libFuzzer library as a static archive, without any sanitizer
99111 options. Note that the libFuzzer library contains the ``main()`` function: