git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Update 'make fuzz-all' docs to reflect modern clang

From
Josh Steadmon <steadmon@google.com>
Date
Mar 1, 2021, 22:39 UTC
Message-ID
<YD1tJlY/mqZOmTNm@google.com>
In-Reply-To
<pull.889.git.1614514959347.gitgitgadget@gmail.com>
On 2021.02.28 12:22, Andrzej Hunt via GitGitGadget wrote:
Show 25 quoted lines
> From: Andrzej Hunt <ajrhunt@google.com>
> 
> Clang no longer produces a libFuzzer.a, instead you can include
> libFuzzer by using -fsanitize=fuzzer. Therefore we should use
> that in the example command for building fuzzers.
> 
> I happen to have tested with LLVM 11 - however -fsanitize=fuzzer appears to
> work in a wide range of reasonably modern clangs.
> 
> (On my system what used to be libFuzzer.a now lives under the following path,
>  which is tricky albeit not impossible for a novice such as myself to find:
> /usr/lib64/clang/11.0.0/lib/linux/libclang_rt.fuzzer-x86_64.a )
> 
> Signed-off-by: Andrzej Hunt <ajrhunt@google.com>
> ---
>     Update 'make fuzz-all' docs to reflect modern clang
>     
>     I would like to update the examples for 'make fuzz-all' to make it
>     easier to build fuzzers locally.
>     
>     This change should make it easier for the uninitiated to build fuzzers
>     locally without first having to figure out what LIB_FUZZING_ENGINE is
>     for.
>     
>     ATB, Andrzej

Thanks for taking a look at this! This looked correct to me, but when I tried to run the fuzzers I got an error about "-fsanitize-coverage=trace-pc-guard" not being supported any longer. Looking at the LLVM 11.0.0 docs [1], I see that it recommends using "-fsanitize=fuzzer-no-link" instead (the "-no-link" is because we're also building executables that have their own main()).

So we'd also want to change CFLAGS to "-fsanitize=fuzzer-no-link,address".

[1]: https://releases.llvm.org/11.0.0/docs/LibFuzzer.html#fuzzer-usage
Previous: Andrzej Hunt via GitGitGadgetNext: Andrzej Hunt
Message 2 of 10 in “Update 'make fuzz-all' docs to reflect modern clang”
  1. Update 'make fuzz-all' docs to reflect modern clangAndrzej Hunt via GitGitGadget, Feb 28, 2021
  2. Josh SteadmonMar 1, 2021
  3. Andrzej HuntMar 4, 2021
  4. Update 'make fuzz-all' docs to reflect modern clangAndrzej Hunt via GitGitGadget, Mar 4, 2021
  5. Junio C HamanoMar 4, 2021
  6. Andrzej HuntMar 8, 2021
  7. Junio C HamanoMar 8, 2021
  8. Josh SteadmonMar 10, 2021
  9. Makefile: update 'make fuzz-all' docs to reflect modern clangAndrzej Hunt via GitGitGadget, Mar 8, 2021
  10. Josh SteadmonMar 10, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.