1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00

Make tools/target_dec_*_fuzzer buildable with configure and make

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2017-04-21 23:58:32 +02:00
parent d976d2ec78
commit 5b499bf4a0
3 changed files with 26 additions and 0 deletions

View File

@ -77,9 +77,13 @@ all: $(AVPROGS)
$(TOOLS): %$(EXESUF): %.o $(TOOLS): %$(EXESUF): %.o
$(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(ELIBS) $(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(ELIBS)
target_dec_%_fuzzer$(EXESUF): target_dec_%_fuzzer.o $(FF_DEP_LIBS)
$(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(ELIBS) $(FF_EXTRALIBS) $(LIBFUZZER_PATH)
tools/cws2fws$(EXESUF): ELIBS = $(ZLIB) tools/cws2fws$(EXESUF): ELIBS = $(ZLIB)
tools/uncoded_frame$(EXESUF): $(FF_DEP_LIBS) tools/uncoded_frame$(EXESUF): $(FF_DEP_LIBS)
tools/uncoded_frame$(EXESUF): ELIBS = $(FF_EXTRALIBS) tools/uncoded_frame$(EXESUF): ELIBS = $(FF_EXTRALIBS)
tools/target_dec_%_fuzzer$(EXESUF): $(FF_DEP_LIBS)
CONFIGURABLE_COMPONENTS = \ CONFIGURABLE_COMPONENTS = \
$(wildcard $(FFLIBS:%=$(SRC_PATH)/lib%/all*.c)) \ $(wildcard $(FFLIBS:%=$(SRC_PATH)/lib%/all*.c)) \

12
configure vendored
View File

@ -438,6 +438,8 @@ Developer options (useful when working on FFmpeg itself):
--random-seed=VALUE seed value for --enable/disable-random --random-seed=VALUE seed value for --enable/disable-random
--disable-valgrind-backtrace do not print a backtrace under Valgrind --disable-valgrind-backtrace do not print a backtrace under Valgrind
(only applies to --disable-optimizations builds) (only applies to --disable-optimizations builds)
--enable-osfuzz Enable building fuzzer tool
--libfuzzer=PATH path to libfuzzer
NOTE: Object files are built at the place where configure is launched. NOTE: Object files are built at the place where configure is launched.
EOF EOF
@ -1676,6 +1678,7 @@ CONFIG_LIST="
fontconfig fontconfig
memory_poisoning memory_poisoning
neon_clobber_test neon_clobber_test
ossfuzz
pic pic
raise_major raise_major
thumb thumb
@ -3509,6 +3512,9 @@ for opt do
;; ;;
--fatal-warnings) enable fatal_warnings --fatal-warnings) enable fatal_warnings
;; ;;
--libfuzzer=*)
libfuzzer_path="$optval"
;;
*) *)
optname="${opt%%=*}" optname="${opt%%=*}"
optname="${optname#--}" optname="${optname#--}"
@ -3577,6 +3583,11 @@ set >> $logfile
test -n "$valgrind" && toolchain="valgrind-memcheck" test -n "$valgrind" && toolchain="valgrind-memcheck"
enabled ossfuzz && {
add_cflags -fsanitize=address,undefined -fsanitize-coverage=trace-pc-guard,trace-cmp -fno-omit-frame-pointer
add_ldflags -fsanitize=address,undefined -fsanitize-coverage=trace-pc-guard,trace-cmp
}
case "$toolchain" in case "$toolchain" in
*-asan) *-asan)
cc_default="${toolchain%-asan}" cc_default="${toolchain%-asan}"
@ -6737,6 +6748,7 @@ SLIB_INSTALL_EXTRA_SHLIB=${SLIB_INSTALL_EXTRA_SHLIB}
VERSION_SCRIPT_POSTPROCESS_CMD=${VERSION_SCRIPT_POSTPROCESS_CMD} VERSION_SCRIPT_POSTPROCESS_CMD=${VERSION_SCRIPT_POSTPROCESS_CMD}
SAMPLES:=${samples:-\$(FATE_SAMPLES)} SAMPLES:=${samples:-\$(FATE_SAMPLES)}
NOREDZONE_FLAGS=$noredzone_flags NOREDZONE_FLAGS=$noredzone_flags
LIBFUZZER_PATH=$libfuzzer_path
EOF EOF
get_version(){ get_version(){

View File

@ -1,6 +1,16 @@
TOOLS = qt-faststart trasher uncoded_frame TOOLS = qt-faststart trasher uncoded_frame
TOOLS-$(CONFIG_ZLIB) += cws2fws TOOLS-$(CONFIG_ZLIB) += cws2fws
tools/target_dec_video_%_fuzzer.o: tools/target_dec_fuzzer.c
$(COMPILE_C) -DFFMPEG_CODEC=AV_CODEC_ID_$* -DFUZZ_FFMPEG_VIDEO
tools/target_dec_audio_%_fuzzer.o: tools/target_dec_fuzzer.c
$(COMPILE_C) -DFFMPEG_CODEC=AV_CODEC_ID_$* -DFUZZ_FFMPEG_AUDIO
tools/target_dec_subtitle_%_fuzzer.o: tools/target_dec_fuzzer.c
$(COMPILE_C) -DFFMPEG_CODEC=AV_CODEC_ID_$* -DFUZZ_FFMPEG_SUBTITLE
OBJDIRS += tools OBJDIRS += tools
clean:: clean::