From d583db99b804c8301d40f125af38192438b36fbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20R=C3=BChsen?= Date: Sat, 8 Jul 2017 18:02:52 +0200 Subject: [PATCH] Update oss-fuzz target for static linking --- fuzz/Makefile.am | 9 +++++---- fuzz/run-clang.sh | 6 ++---- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/fuzz/Makefile.am b/fuzz/Makefile.am index 3c964b1..5461b79 100644 --- a/fuzz/Makefile.am +++ b/fuzz/Makefile.am @@ -32,15 +32,16 @@ fuzz-coverage: $(PSL_TESTS) oss-fuzz: if test "$$OUT" != ""; then \ - if $$(ldd ../src/.libs/libpsl.so|grep -q libidn2); then XLIBS="-lidn2 -lunistring"; \ - elif $$(ldd ../src/.libs/libpsl.so|grep -q libidn); then XLIBS="-lidn -lunistring"; \ - elif $$(ldd ../src/.libs/libpsl.so|grep -q libicu); then XLIBS="-licuuc -licudata"; \ + if $$(grep -q '^#define WITH_LIBIDN2 1' $(top_srcdir)/config.h); then XLIBS="-lidn2 -lunistring"; \ + elif $$(grep -q '^#define WITH_LIBIDN 1' $(top_srcdir)/config.h); then XLIBS="-lidn -lunistring"; \ + elif $$(grep -q '^#define WITH_LIBICU 1' $(top_srcdir)/config.h); then XLIBS="-licuuc -licudata"; \ else XLIBS=""; fi; \ for ccfile in *_fuzzer.c; do \ fuzzer=$$(basename $$ccfile .c); \ $$CXX $$CXXFLAGS -I$(top_srcdir)/include -I$(top_srcdir) \ "$${fuzzer}.c" -o "$${fuzzer}" \ - ../src/.libs/libpsl.a $${LIB_FUZZING_ENGINE} -Wl,-Bstatic \ + ../src/.libs/libpsl.a $${LIB_FUZZING_ENGINE} \ + -Wl,-Bstatic \ $$XLIBS \ -Wl,-Bdynamic; \ done; \ diff --git a/fuzz/run-clang.sh b/fuzz/run-clang.sh index 0b31557..b6bc9de 100755 --- a/fuzz/run-clang.sh +++ b/fuzz/run-clang.sh @@ -25,10 +25,8 @@ trap ctrl_c INT ctrl_c() { - if test -n "$sudo"; then - ./${fuzzer} -merge=1 ${fuzzer}.in ${fuzzer}.new - rm -rf ${fuzzer}.new - fi + ./${fuzzer} -merge=1 ${fuzzer}.in ${fuzzer}.new + rm -rf ${fuzzer}.new } if test -z "$1"; then