summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorOneric <oneric@oneric.stub>2021-08-26 23:02:31 +0200
committerOneric <oneric@oneric.stub>2022-07-03 16:19:06 +0200
commit9987eef44384b368670d962fca57b5994b216499 (patch)
tree07c6e526a03faa2d02b3d437fc79720b01a4e43c /configure.ac
parentf1d19df9011ba5824bed137f4cc170d882514f33 (diff)
downloadlibass-9987eef44384b368670d962fca57b5994b216499.tar.bz2
libass-9987eef44384b368670d962fca57b5994b216499.tar.xz
Add fuzzing utility
Parses its input and renders every event at its start, middle and end. By default it is built as a simple standalone program, similar to profile to consume a single already existing input. By setting ASS_FUZZMODE in FUZZ_CPPFLAGS alternative buildmodes offering integration into AFL++ or LLVM's libFuzzer can be selected. As libFuzzer links in its own main function, it cannot be used during configure else the tests fail. Instead 'clang -fsanitize=fuzzer-no-link' can be set together with FUZZ_LDFLAGS='-fsanitize=fuzzer' to only link in the main function into the desired binary. As an alternative to FUZZ_LDFLAGS, it is also possible to change the compiler after configure via make CC=...
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac9
1 files changed, 9 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 7bfd625..f87f855 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,6 +22,8 @@ AC_ARG_ENABLE([compare], AS_HELP_STRING([--enable-compare],
[enable compare program (requires libpng) @<:@default=no@:>@]))
AC_ARG_ENABLE([profile], AS_HELP_STRING([--enable-profile],
[enable profiling program @<:@default=no@:>@]))
+AC_ARG_ENABLE([fuzz], AS_HELP_STRING([--enable-fuzz],
+ [enable fuzzing consumer @<:@default=no@:>@]))
AC_ARG_ENABLE([fontconfig], AS_HELP_STRING([--disable-fontconfig],
[disable fontconfig support @<:@default=check@:>@]))
AC_ARG_ENABLE([directwrite], AS_HELP_STRING([--disable-directwrite],
@@ -35,6 +37,12 @@ AC_ARG_ENABLE([asm], AS_HELP_STRING([--disable-asm],
AC_ARG_ENABLE([large-tiles], AS_HELP_STRING([--enable-large-tiles],
[use larger tiles in the rasterizer (better performance, slightly worse quality) @<:@default=disabled@:>@]))
+AC_ARG_VAR([FUZZ_LDFLAGS],
+ [Optional special linking flags only used for the fuzzer binary.])
+AC_ARG_VAR([FUZZ_CPPFLAGS],
+ [If fuzzing program is enabled, set this to select alternative modes; see fuzzer source for options.])
+FUZZ_CPPFLAGS="${FUZZ_CPPFLAGS:--DASS_FUZZMODE=0}"
+
# Checks for available libraries and define corresponding C Macros
# Start with system libs, then check everything else via pkg-config
AS_IF([test "x$ac_cv_header_iconv_h" = xyes], [
@@ -323,6 +331,7 @@ AM_CONDITIONAL([ENABLE_LARGE_TILES], [test "x$enable_large_tiles" = xyes])
AM_CONDITIONAL([ENABLE_COMPARE], [test "x$enable_compare" = xyes && test "x$libpng" = xtrue])
AM_CONDITIONAL([ENABLE_TEST], [test "x$enable_test" = xyes && test "x$libpng" = xtrue])
AM_CONDITIONAL([ENABLE_PROFILE], [test "x$enable_profile" = xyes])
+AM_CONDITIONAL([ENABLE_FUZZ], [test "x$enable_fuzz" = xyes])
AM_CONDITIONAL([FONTCONFIG], [test "x$fontconfig" = xtrue])
AM_CONDITIONAL([CORETEXT], [test "x$coretext" = xtrue])