diff options
author | Michael Hanselmann <public@hansmi.ch> | 2019-04-04 00:23:07 +0200 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2019-08-07 06:07:28 +0000 |
commit | dd5f8732d8b2ac6cd86e5d7dc8a9498d2b951a43 (patch) | |
tree | 543610a4c04c3a6be9094e1ea3573cee7f52284d /buildtools/wafsamba/wscript | |
parent | aab17124785b6e4c004368b69bee28fb6cad55c3 (diff) | |
download | samba-dd5f8732d8b2ac6cd86e5d7dc8a9498d2b951a43.tar.gz |
Add fuzzing support to build system
LibFuzzer, Honggfuzz and other programs implement simple interfaces for
fuzzing appropriately prepared code. Samba contains quite a lot of
parsing code, often a good target for fuzzing.
With this change the build system is amended to support building fuzzing
binaries (added in later changes).
Signed-off-by: Michael Hanselmann <public@hansmi.ch>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Diffstat (limited to 'buildtools/wafsamba/wscript')
-rw-r--r-- | buildtools/wafsamba/wscript | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/buildtools/wafsamba/wscript b/buildtools/wafsamba/wscript index e5017a4a02f..ce5e0b48fc1 100644 --- a/buildtools/wafsamba/wscript +++ b/buildtools/wafsamba/wscript @@ -129,6 +129,9 @@ def options(opt): action="store_true", dest='undefined_sanitizer', default=False) + gr.add_option('--enable-libfuzzer', + help=("Build fuzzing binaries (requires compiler options for libFuzzer or compiler wrapper such as honggfuzz/hfuzz-cc)"), + action="store_true", dest='enable_libfuzzer', default=False) gr.add_option('--abi-check', help=("Check ABI signatures for libraries"), @@ -590,6 +593,10 @@ struct foo bar = { .y = 'X', .x = 1 }; eprintf("bla", "bar") ''', define='HAVE__VA_ARGS__MACRO') + conf.env.enable_libfuzzer = Options.options.enable_libfuzzer + if conf.env.enable_libfuzzer: + conf.DEFINE('ENABLE_LIBFUZZER', 1) + conf.SAMBA_BUILD_ENV() |