shithub: dav1d

Download patch

ref: 785f00feccb5ed7c5739fc72bdcb9b422d8386ca
parent: 63eef332220ec5321a507280dbf4b2da02d1d1fe
author: Janne Grunau <[email protected]>
date: Fri May 24 16:53:55 EDT 2019

build: add option for fuzzer specific LDFLAGS

Needed for oss-fuzz after switching to '-fsanitize=fuzzer' for the
libfuzzer based build. Adding '-fsanitize=fuzzer' for all oss-fuzz based
build breaks afl.

--- a/meson_options.txt
+++ b/meson_options.txt
@@ -36,6 +36,10 @@
     value: 'none',
     description: 'Select the fuzzing engine')
 
+option('fuzzer_ldflags',
+    type: 'string',
+    description: 'Extra LDFLAGS used during linking of fuzzing binaries')
+
 option('stack_alignment',
     type: 'integer',
     value: 0)
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -98,6 +98,10 @@
 dav1d_fuzzer_sources =  files('libfuzzer/dav1d_fuzzer.c')
 fuzzer_ldflags = []
 
+if get_option('fuzzer_ldflags') != ''
+    fuzzer_ldflags += [get_option('fuzzer_ldflags')]
+endif
+
 if fuzzing_engine == 'none'
     dav1d_fuzzer_sources += files('libfuzzer/main.c')
 elif fuzzing_engine == 'libfuzzer'
@@ -104,7 +108,7 @@
     fuzzer_ldflags += ['-fsanitize=fuzzer']
 elif fuzzing_engine == 'oss-fuzz'
     # libFuzzingEngine needs libc++
-    fuzzer_ldflags += ['-fsanitize=fuzzer', '-lFuzzingEngine', '-lc++']
+    fuzzer_ldflags += ['-lc++']
 endif
 
 dav1d_fuzzer = executable('dav1d_fuzzer',