[PATCH] D21049: [LibFuzzer] Fix some unit test crashes on OSX.
Dan Liew via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 6 23:47:59 PDT 2016
delcypher added a comment.
In http://reviews.llvm.org/D21049#450646, @delcypher wrote:
> In http://reviews.llvm.org/D21049#450599, @kcc wrote:
>
> > and, btw, I don't think we should be building the unit tests with asan. Or should we?
>
>
> Unless in your unittests you need to interact with parts of the runtime provided by compiler-rt and/or need coverage to be tracked during execution of the unit tests then I would say you probably want ASan to ensure that LibFuzzer and the unit tests are built in the same way to avoid mixing ASan-ified and non-ASan-ified code.
>
> I suspect that not building the unittests with ASan would fix this issue but I haven't tested that yet. I've only tried the other way (i.e building both LibFuzzer and the unittests with ASan).
Eurgh. Just tried this. It doesn't work because
- libgtest and LLVMSupport (which libgtest depends on) are built with the ASan so the unittests will fail to link if we just pass `-fno-sanitize=all` to the compile and link command line for the unittests.
- The coverage runtime functions are missing too if ASan is not available (easy to fix, we just need to build and link the unittests with `-fno-sanitize-coverage=...`)
The first point is much more of a pain to deal with because LibFuzzer is coupled to LLVM's build system and building LibFuzzer is coupled with building LLVM with ASan and sanitizer coverage.
http://reviews.llvm.org/D21049
More information about the llvm-commits
mailing list