Skip to content

Commit

Permalink
fuzzers: use -fsanitizer=fuzzer if clang supports it
Browse files Browse the repository at this point in the history
  • Loading branch information
evverx authored and Yamakuzure committed Sep 21, 2019
1 parent 1df40f2 commit 0620c05
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,6 @@ substs.set('VARLOGDIR', varlogdir)
# substs.set('MEMORY_ACCOUNTING_DEFAULT', memory_accounting_default ? 'yes' : 'no')
#endif // 0
substs.set('HIGH_RLIMIT_NOFILE', conf.get('HIGH_RLIMIT_NOFILE'))
substs.set('BUILD_ROOT', meson.current_build_dir())

#####################################################################

Expand All @@ -375,7 +374,14 @@ install_tests = get_option('install-tests')
# endif
#
# if want_libfuzzer
# fuzzing_engine = meson.get_compiler('cpp').find_library('Fuzzer')
# fuzzing_engine = meson.get_compiler('cpp').find_library('Fuzzer', required : false)
# if fuzzing_engine.found()
# add_project_arguments('-fsanitize-coverage=trace-pc-guard,trace-cmp', language : 'c')
# elif cc.has_argument('-fsanitize=fuzzer-no-link')
# add_project_arguments('-fsanitize=fuzzer-no-link', language : 'c')
# else
# error('Looks like neither libFuzzer nor -fsanitize=fuzzer-no-link is supported')
# endif
# elif want_ossfuzz
# fuzzing_engine = meson.get_compiler('cpp').find_library('FuzzingEngine')
# elif want_fuzzbuzz
Expand Down Expand Up @@ -3199,9 +3205,16 @@ endforeach
# dependencies = tuple[2]
# defs = tuple.length() >= 4 ? tuple[3] : []
# incs = tuple.length() >= 5 ? tuple[4] : includes
# link_args = []
#
# if fuzzer_build
# if want_ossfuzz or want_fuzzbuzz
# dependencies += fuzzing_engine
# elif want_libfuzzer
# if fuzzing_engine.found()
# dependencies += fuzzing_engine
# else
# link_args += ['-fsanitize=fuzzer']
# endif
# else
# sources += 'src/fuzz/fuzz-main.c'
# endif
Expand All @@ -3219,6 +3232,7 @@ endforeach
# link_with : link_with,
# dependencies : dependencies,
# c_args : defs,
# link_args: link_args,
# install : false)
# endforeach
# endif
Expand Down

0 comments on commit 0620c05

Please sign in to comment.