From f59d0131cb6fc224aee0a0a92de1f04cdebe97c8 Mon Sep 17 00:00:00 2001 From: Kurt Roeckx Date: Sat, 7 May 2016 22:09:13 +0200 Subject: Add support for fuzzing with AFL Reviewed-by: Ben Laurie MR: #2740 --- Configure | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'Configure') diff --git a/Configure b/Configure index e8fc933872..3064151fe4 100755 --- a/Configure +++ b/Configure @@ -301,7 +301,8 @@ my @disablables = ( "engine", "err", "filenames", - "fuzz", + "fuzz-libfuzzer", + "fuzz-afl", "gost", "heartbeats", "hw(-.+)?", @@ -365,7 +366,8 @@ our %disabled = ( # "what" => "comment" "asan" => "default", "ec_nistp_64_gcc_128" => "default", "egd" => "default", - "fuzz" => "default", + "fuzz-libfuzzer" => "default", + "fuzz-afl" => "default", "md2" => "default", "rc5" => "default", "sctp" => "default", @@ -698,6 +700,14 @@ foreach (@argvcopy) { $withargs{zlib_include}=$1; } + elsif (/^--with-fuzzer-lib=(.*)$/) + { + $withargs{fuzzer_lib}=$1; + } + elsif (/^--with-fuzzer-include=(.*)$/) + { + $withargs{fuzzer_include}=$1; + } elsif (/^--with-fipslibdir=(.*)$/) { $config{fipslibdir}="$1/"; @@ -1042,11 +1052,15 @@ if ($disabled{"dynamic-engine"}) { $config{dynamic_engines} = 1; } -unless ($disabled{fuzz}) { +unless ($disabled{"fuzz-libfuzzer"}) { push @{$config{dirs}}, "fuzz"; $config{cflags} .= "-fsanitize-coverage=edge,indirect-calls "; } +unless ($disabled{"fuzz-afl"}) { + push @{$config{dirs}}, "fuzz"; +} + unless ($disabled{asan}) { $config{cflags} .= "-fsanitize=address "; } @@ -1379,6 +1393,7 @@ if ($builder eq "unified") { $template->fill_in(HASH => { config => \%config, target => \%target, disabled => \%disabled, + withargs => \%withargs, builddir => abs2rel($buildd, $blddir), sourcedir => abs2rel($sourced, $blddir), buildtop => abs2rel($blddir, $blddir), -- cgit v1.2.3