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.
Details
- Reviewers
- None
- Group Reviewers
hg-reviewers - Commits
- rHGd9fc51f77cc5: tests: sniff for libfuzzer actually being available in test-fuzz-targets.t
Diff Detail
- Repository
- rHG Mercurial
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Event Timeline
+ $ havefuzz() {
+ > cat > dummy.cc <<EOF
Missing includes of stdint.h and stddef.h (or stdlib.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
+ > cat dummy.cc
+ > $CXX dummy.cc -fsanitize=fuzzer-no-link,address || return 1
+ > }
+
#if clang-libfuzzer
+ $ CXX=clang++ havefuzz || exit 80
This leaves dummy.cc in the fuzz directory. Perhaps, we should compile it
before cd.
+ $ havefuzz() {
+ > cat > $TESTTMP/dummy.cc <<EOF
+ > #include <stdlib.h>
+ > int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { return 0; }
Still stdint.h is missing.