Add frontend for fuzzing

Use the following configure command:

$ ./configure --with-fuzzer --with-fuzzer-lib=/path/to/libFuzzer.a \
      CC=clang CXX=clang++

Places an irssi-fuzz in src/fe-fuzz/ after build.

Also can specify SANFLAGS to override the chosen sanitizer flags
(defaults to "-g -fsanitize=address -fsanitize-coverage=trace-pc-guard").
This commit is contained in:
Joseph Bisch 2017-01-07 20:01:07 -05:00
commit cf46907256
No known key found for this signature in database
GPG key ID: CF08FAC339AB7E8E
8 changed files with 415 additions and 1 deletions

25
src/fe-fuzz/Makefile.am Normal file
View file

@ -0,0 +1,25 @@
bin_PROGRAMS = irssi-fuzz
# Force link with clang++ for libfuzzer support
CCLD=clang++ $(CXXFLAGS)
AM_CPPFLAGS = \
-I$(top_srcdir)/src \
-I$(top_srcdir)/src/core/ \
-I$(top_srcdir)/src/irc/core/ \
-I$(top_srcdir)/src/fe-common/core/ \
$(GLIB_CFLAGS)
irssi_fuzz_DEPENDENCIES = @COMMON_LIBS@
irssi_fuzz_LDADD = \
@COMMON_LIBS@ \
@PROG_LIBS@ \
$(FUZZER_LIBS)
irssi_fuzz_SOURCES = \
irssi.c \
module-formats.c
noinst_HEADERS = \
module-formats.h