From 858689e1dfb0f910834bd19bcf3e5270482fc8f8 Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: Tue, 2 Oct 2018 19:20:52 +0200 Subject: tests: add libfuzzer test target Disabled by default, enabble with `meson -Dbuild_libfuzzer=true -Db_lundef=false ...`. Fuzz target improved by the paralell work by Thierry Foucu in !138. --- meson.build | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'meson.build') diff --git a/meson.build b/meson.build index da95f66..4231b84 100644 --- a/meson.build +++ b/meson.build @@ -64,6 +64,9 @@ is_asm_enabled = (get_option('build_asm') == true and host_machine.cpu_family().startswith('arm')) cdata.set10('HAVE_ASM', is_asm_enabled) +# libFuzzer target +is_libfuzzer_enabled = (get_option('build_libfuzzer')) + # @@ -156,6 +159,14 @@ endif add_project_arguments(cc.get_supported_arguments(optional_arguments), language : 'c') +# libFuzzer related things +if is_libfuzzer_enabled + if not cc.has_argument('-fsanitize=fuzzer') + error('build_libfuzzer requires "-fsanitize=fuzzer"') + endif + fuzzer_args = ['-fsanitize=fuzzer-no-link', '-fsanitize=fuzzer'] + add_project_arguments(cc.first_supported_argument(fuzzer_args), language : 'c') +endif # Stack alignments flags -- cgit v1.2.3