[PATCH] D27993: [libFuzzer] Diff 44 - Update cmake for libFuzzer. Remove requiring LLVM_USE_SANITIZE_COVERAGE .

Marcos Pividori via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 28 15:12:38 PST 2016


mpividori added a comment.

In https://reviews.llvm.org/D27993#631931, @kcc wrote:

> In https://reviews.llvm.org/D27993#631795, @mpividori wrote:
>
> > @kcc Ok. So, I see two options to achieve both goals:
> >
> >   + Force the user to read the docs.
>
>
> Never works.
>
> >   + Make it work on Windows (don't use instrumentation for FileCheck target).
>
> One option that you proposed off-line is to remove dependency on FileCheck (win-only) and rely on having it in PATH. 
>  Hacky, but simple.
>
> > Or remove these flags, (as this diff does), and add a new cmake flag: `ENABLE_LIBFUZZER` , with default value false.
>
> Mmmm. What will it change?


By default cmake won't build libFuzzer. So, this will achieve your original intention, users need to read the documentation to build libFuzzer.
Also, with the advantage that we don't need `LLVM_USE_SANITIZE_COVERAGE`, so we avoid including instrumentation in all the repository, which is not required for libFuzzer.
So, using `ENABLE_LIBFUZZER`, it will work for both, Linux and Windows.
I think this is a good solution, since we need a specific flag to enable / disable libFuzzer, independent of `LLVM_USE_SANITIZE_COVERAGE`.

> 
> 
>> Or modify `./modules/HandleLLVMOptions.cmake`, to not append "-fsanitize-coverage=trace-pc-guard,indirect-calls,trace-cmp" when `LLVM_USE_SANITIZE_COVERAGE` is true.
> 
> The purpose of LLVM_USE_SANITIZE_COVERAGE is to build the rest of llvm with sanitizer coverage so that we can build things like tools/clang/tools/clang-fuzzer
> 
> All this means that we can't bootstrap llvm with asan on windows, right? 
>  I wonder if someone wants to solve this problem too...




Repository:
  rL LLVM

https://reviews.llvm.org/D27993





More information about the llvm-commits mailing list