diff options
author | Michael Hanselmann <public@hansmi.ch> | 2021-03-31 23:39:49 +0200 |
---|---|---|
committer | Victor Toso <me@victortoso.com> | 2021-04-27 17:17:40 +0000 |
commit | 5eac609af24b7459f18df5df2607d9bf8e022fc7 (patch) | |
tree | b852569b11918d3968f9126f4d4293e2b0c4e661 /meson_options.txt | |
parent | c55b77549f8ca8d8797a7379a9e9bb2aa47dfeb9 (diff) |
Make fuzzing with meson build work
TL;DR: Update build system and utility script such invoking
`build-aux/oss-fuzz.sh` is all that's needed to build fuzzers in an OSS-Fuzz
compatible environment.
`.gitlab-ci.yml`: Build three variants of fuzzers: using autoconf as before,
libFuzzer via Clang and using the standalone driver.
`build-aux/oss-fuzz.sh`: Remove compiler-specific code. The fuzzing environment
should control the compiler via `$CC`/`$CXX` along with flags in
`$CFLAGS`/`$CXXFLAGS`. Make code actually build by overriding `b_lundef` default
value, otherwise fuzzing-related symbols would cause linker errors during
compilation. Pass fuzzing engine via option; the default would be to use the
built-in standalone engine.
`meson.build`: Remove all fuzzing-related logic except to detect whether fuzzing
should be enabled at all.
`fuzzing/meson.build`: If fuzzing engine `standalone` is selected the build
behaves as any other C program build. When another fuzzing engine is to be used,
e.g. from `$LIB_FUZZING_ENGINE` in `build-aux/oss-fuzz.sh`, a test program is
compiled and linked to ensure that linking suceeds (in particular whether
a `main` function is provided). Prepare for the addition of more fuzzing
binaries by using a loop. Add OSS-Fuzz configuration file for binaries.
Signed-off-by: Michael Hanselmann <public@hansmi.ch>
Diffstat (limited to 'meson_options.txt')
-rw-r--r-- | meson_options.txt | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/meson_options.txt b/meson_options.txt index 96dfef0..535d07e 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -3,11 +3,20 @@ option('git_werror', value: 'auto', description: 'use -Werror if building from GIT') -option('llvm-fuzz', +option('fuzzing', type : 'feature', value : 'auto', description : 'Enable libFuzzer integration') +option('fuzzing-engine', + type : 'string', + value : 'standalone', + description : 'Location of prebuilt fuzzing engine library or "standalone" for built-in driver') + +option('fuzzing-install-dir', + type : 'string', + description : 'Installation directory for fuzzing binaries') + option('tools', type : 'feature', value : 'enabled', |