From af7725c8060a8f1dd0716394f42205b5ad50bd42 Mon Sep 17 00:00:00 2001 From: Dmitry Baryshkov Date: Sun, 22 Mar 2020 16:05:40 +0300 Subject: oss-fuzz: use CC rather than CXX to compile fuzzers clang++ will choke on several fuzzer sources because C++ is stricter than C wrt. type conversion: gnutls_base64_decoder_fuzzer.c:26:63: error: non-constant-expression cannot be narrowed from type 'size_t' (aka 'unsigned long') to 'unsigned int' in initializer list [-Wc++11-narrowing] gnutls_datum_t raw = {.data = (unsigned char *)data, .size = size}; Signed-off-by: Dmitry Baryshkov --- fuzz/Makefile.am | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fuzz/Makefile.am b/fuzz/Makefile.am index 61a3a6b997..37c96f8286 100644 --- a/fuzz/Makefile.am +++ b/fuzz/Makefile.am @@ -88,8 +88,9 @@ oss-fuzz: for ccfile in *_fuzzer.c; do \ fuzzer=$$(basename $$ccfile .c); \ XLIBS="-lhogweed -lnettle -ltasn1 -lgmp -lidn2 -lunistring"; \ - $$CXX $$CXXFLAGS -I$(top_srcdir)/lib/includes/ -I$(top_srcdir) \ - "$${fuzzer}.c" -o "$${fuzzer}" \ + $$CC $$CFLAGS -I$(top_srcdir)/lib/includes/ -I$(top_srcdir) \ + -c "$${fuzzer}.c" -o "$${fuzzer}.o" ; \ + $$CXX $$CXXFLAGS "$${fuzzer}.o" -o "$${fuzzer}" \ ../lib/.libs/libgnutls.a $${LIB_FUZZING_ENGINE} \ -Wl,-Bstatic \ $${XLIBS} \ -- cgit v1.2.1 From 26fe9fd7b8393dff60de93e29585545ee357d264 Mon Sep 17 00:00:00 2001 From: Dmitry Baryshkov Date: Sun, 22 Mar 2020 16:07:12 +0300 Subject: oss-fuzz: return build error if fuzzers have failed to build Instead of silently ignoring build errors and running fewer fuzzers, exit on the first build error. Signed-off-by: Dmitry Baryshkov --- fuzz/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fuzz/Makefile.am b/fuzz/Makefile.am index 37c96f8286..cf7fab1072 100644 --- a/fuzz/Makefile.am +++ b/fuzz/Makefile.am @@ -94,7 +94,7 @@ oss-fuzz: ../lib/.libs/libgnutls.a $${LIB_FUZZING_ENGINE} \ -Wl,-Bstatic \ $${XLIBS} \ - -Wl,-Bdynamic; \ + -Wl,-Bdynamic || exit $?; \ done; \ fi -- cgit v1.2.1