diff options
author | Andrew Bartlett <abartlet@samba.org> | 2019-12-04 21:23:06 +1300 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2019-12-10 07:50:29 +0000 |
commit | 1d98ced841f83d7305a570297908fd1270de42e0 (patch) | |
tree | e08abd292d32f7c24951246896ff91f0006ac312 /buildtools | |
parent | f4ff9a079414953b17f49857ecfca6c0e479c32f (diff) | |
download | samba-1d98ced841f83d7305a570297908fd1270de42e0.tar.gz |
lib/fuzzing: Add mode for the AFL fuzzer
This is helpful for ensuring the fuzzers still compile in autobuild as no
library support is required.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Diffstat (limited to 'buildtools')
-rw-r--r-- | buildtools/wafsamba/wafsamba.py | 2 | ||||
-rw-r--r-- | buildtools/wafsamba/wscript | 11 |
2 files changed, 10 insertions, 3 deletions
diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py index 5bbcc156fe7..7827d374654 100644 --- a/buildtools/wafsamba/wafsamba.py +++ b/buildtools/wafsamba/wafsamba.py @@ -375,7 +375,7 @@ def SAMBA_BINARY(bld, binname, source, # Fuzzing builds do not build normal binaries # however we must build asn1compile etc - if not use_hostcc and bld.env.enable_libfuzzer != fuzzer: + if not use_hostcc and bld.env.enable_fuzzing != fuzzer: SET_TARGET_TYPE(bld, binname, 'DISABLED') return diff --git a/buildtools/wafsamba/wscript b/buildtools/wafsamba/wscript index 764e357cc87..f0b679257b7 100644 --- a/buildtools/wafsamba/wscript +++ b/buildtools/wafsamba/wscript @@ -133,8 +133,11 @@ def options(opt): dest='undefined_sanitizer', default=False) gr.add_option('--enable-libfuzzer', - help=("Build fuzzing binaries (use ADDITIONAL_CFLAGS to specify compiler options for libFuzzer or use a compiler wrapper such as honggfuzz/hfuzz-cc)"), + help=("Build fuzzing binaries (use ADDITIONAL_CFLAGS to specify compiler options for libFuzzer or use CC=honggfuzz/hfuzz-cc)"), action="store_true", dest='enable_libfuzzer', default=False) + gr.add_option('--enable-afl-fuzzer', + help=("Build fuzzing binaries AFL-style (typically use with CC=afl-gcc)"), + action="store_true", dest='enable_afl_fuzzer', default=False) # Fuzz targets may need additional LDFLAGS that we can't use on # internal binaries like asn1_compile @@ -603,8 +606,12 @@ struct foo bar = { .y = 'X', .x = 1 }; eprintf("bla", "bar") ''', define='HAVE__VA_ARGS__MACRO') + conf.env.enable_fuzzing = False + conf.env.enable_libfuzzer = Options.options.enable_libfuzzer - if conf.env.enable_libfuzzer: + conf.env.enable_afl_fuzzer = Options.options.enable_afl_fuzzer + if conf.env.enable_libfuzzer or conf.env.enable_afl_fuzzer: + conf.env.enable_fuzzing = True conf.DEFINE('FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION', 1) conf.env.FUZZ_TARGET_LDFLAGS = Options.options.FUZZ_TARGET_LDFLAGS |