Skip to content
Snippets Groups Projects
Commit d9fc51f7 authored by Augie Fackler's avatar Augie Fackler
Browse files

tests: sniff for libfuzzer actually being available in test-fuzz-targets.t

When I upgraded the FreeBSD buildbot to 11.2 it seems we picked up
clang6, but the default clang on FreeBSD doesn't include libfuzzer. I
can't find a way to sniff for libfuzzer without running a compile, so
here we are.

Differential Revision: https://phab.mercurial-scm.org/D5270
parent 6c01fad8
No related branches found
No related tags found
No related merge requests found
......@@ -11,4 +11,18 @@
> MAKE=make
> fi
$ havefuzz() {
> cat > $TESTTMP/dummy.cc <<EOF
> #include <stdlib.h>
> #include <stdint.h>
> int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { return 0; }
> int main(int argc, char **argv) {
> const char data[] = "asdf";
> return LLVMFuzzerTestOneInput((const uint8_t *)data, 4);
> }
> EOF
> $CXX $TESTTMP/dummy.cc -o $TESTTMP/dummy \
> -fsanitize=fuzzer-no-link,address || return 1
> }
#if clang-libfuzzer
......@@ -14,4 +28,5 @@
#if clang-libfuzzer
$ CXX=clang++ havefuzz || exit 80
$ $MAKE -s clean all
#endif
#if no-clang-libfuzzer clang-6.0
......@@ -15,6 +30,7 @@
$ $MAKE -s clean all
#endif
#if no-clang-libfuzzer clang-6.0
$ CXX=clang++-6.0 havefuzz || exit 80
$ $MAKE -s clean all CC=clang-6.0 CXX=clang++-6.0
#endif
#if no-clang-libfuzzer no-clang-6.0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment