From 6f76a43cea4bb2d26d8c5c5054462197a33e085d Mon Sep 17 00:00:00 2001 From: George Karpenkov Date: Mon, 24 Apr 2017 18:39:52 +0000 Subject: [PATCH] Updates documentation for a syntax sugar libfuzzer flag, as implemented in https://reviews.llvm.org/D32193 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301217 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/LibFuzzer.rst | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/docs/LibFuzzer.rst b/docs/LibFuzzer.rst index c30eba8df96..a11baa720ec 100644 --- a/docs/LibFuzzer.rst +++ b/docs/LibFuzzer.rst @@ -87,10 +87,16 @@ Some important things to remember about fuzz targets: * Usually, the narrower the target the better. E.g. if your target can parse several data formats, split it into several targets, one per format. -Building --------- +Fuzzer Usage +------------ + +Very recent versions of Clang (> 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 -Next, build the libFuzzer library as a static archive, without any sanitizer +Otherwise, build the libFuzzer library as a static archive, without any sanitizer options. Note that the libFuzzer library contains the ``main()`` function: .. code-block:: console -- 2.40.0