Update oss-fuzz target for static linking

This commit is contained in:
Tim Rühsen 2017-07-08 18:02:52 +02:00
parent 467f035f0a
commit d583db99b8
2 changed files with 7 additions and 8 deletions

View File

@ -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; \

View File

@ -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