[c-ares] Update build script for upstream changes (#4441)

* [c-ares] Update build script for upstream changes

Upstream https://github.com/c-ares/c-ares/pull/349 re-organized the
c-ares source tree, so update build.sh to find things in their new
places.

Also remove the CFLAGS workaround, which seems to be no longer needed
(and also seems to result in a malformed test/Makefile being generated).

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=25566

* [c-ares] Disable dataflow config

Has link errors due to https://github.com/google/oss-fuzz/issues/3388
This commit is contained in:
David Drysdale 2020-09-11 14:57:27 +01:00 committed by GitHub
parent 9180b87233
commit 008f2177e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 12 deletions

View File

@ -15,12 +15,6 @@
#
################################################################################
# Remove -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION from CFLAGS
# as a workaround for https://github.com/google/oss-fuzz/issues/413.
# It's unclear why the c-ares configure is that picky;
# a better fix would probably be in the c-ares build system.
CFLAGS=$(for f in $CFLAGS; do [ $f != "-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION" ] && echo $f; done);
# Build the project.
./buildconf
./configure --enable-debug
@ -28,16 +22,16 @@ make clean
make -j$(nproc) V=1 all
# Build the fuzzers.
$CC $CFLAGS -I. -c $SRC/c-ares/test/ares-test-fuzz.c -o $WORK/ares-test-fuzz.o
$CC $CFLAGS -Iinclude -Isrc/lib -c $SRC/c-ares/test/ares-test-fuzz.c -o $WORK/ares-test-fuzz.o
$CXX $CXXFLAGS -std=c++11 $WORK/ares-test-fuzz.o \
-o $OUT/ares_parse_reply_fuzzer \
$LIB_FUZZING_ENGINE $SRC/c-ares/.libs/libcares.a
$LIB_FUZZING_ENGINE $SRC/c-ares/src/lib/.libs/libcares.a
$CC $CFLAGS -I. -c $SRC/c-ares/test/ares-test-fuzz-name.c \
$CC $CFLAGS -Iinclude -Isrc/lib -c $SRC/c-ares/test/ares-test-fuzz-name.c \
-o $WORK/ares-test-fuzz-name.o
$CXX $CXXFLAGS -std=c++11 $WORK/ares-test-fuzz-name.o \
-o $OUT/ares_create_query_fuzzer \
$LIB_FUZZING_ENGINE $SRC/c-ares/.libs/libcares.a
$LIB_FUZZING_ENGINE $SRC/c-ares/src/lib/.libs/libcares.a
# Archive and copy to $OUT seed corpus if the build succeeded.
zip -j $OUT/ares_parse_reply_fuzzer_seed_corpus.zip $SRC/c-ares/test/fuzzinput/*

View File

@ -5,12 +5,10 @@ fuzzing_engines:
- afl
- libfuzzer
- honggfuzz
- dataflow
sanitizers:
- address
- memory
- undefined
- dataflow
architectures:
- x86_64
- i386