Enable building a bounded version of the library for fuzzing
test/fuzzing/hb-fuzzer links against libharfbuzz-fuzzing.so now.
This commit is contained in:
parent
e0082ae60d
commit
ff16ef3379
|
@ -15,6 +15,7 @@ DISTCHECK_CONFIGURE_FLAGS = --enable-introspection
|
||||||
|
|
||||||
# Convenience targets:
|
# Convenience targets:
|
||||||
lib: $(BUILT_SOURCES) libharfbuzz.la
|
lib: $(BUILT_SOURCES) libharfbuzz.la
|
||||||
|
fuzzing: $(BUILT_SOURCES) libharfbuzz-fuzzing.la
|
||||||
|
|
||||||
lib_LTLIBRARIES = libharfbuzz.la
|
lib_LTLIBRARIES = libharfbuzz.la
|
||||||
|
|
||||||
|
@ -219,6 +220,21 @@ pkgconfigdir = $(libdir)/pkgconfig
|
||||||
pkgconfig_DATA = harfbuzz.pc
|
pkgconfig_DATA = harfbuzz.pc
|
||||||
EXTRA_DIST += harfbuzz.pc.in
|
EXTRA_DIST += harfbuzz.pc.in
|
||||||
|
|
||||||
|
FUZZING_CPPFLAGS= \
|
||||||
|
-DHB_MAX_NESTING_LEVEL=3 \
|
||||||
|
-DHB_SANITIZE_MAX_EDITS=3 \
|
||||||
|
-DHB_BUFFER_MAX_EXPANSION_FACTOR=3 \
|
||||||
|
-DHB_BUFFER_MAX_LEN_MIN=8 \
|
||||||
|
-DHB_BUFFER_MAX_LEN_DEFAULT=128 \
|
||||||
|
$(NULL)
|
||||||
|
EXTRA_LTLIBRARIES = libharfbuzz-fuzzing.la
|
||||||
|
libharfbuzz_fuzzing_la_LINK = $(libharfbuzz_la_LINK)
|
||||||
|
libharfbuzz_fuzzing_la_SOURCES = $(libharfbuzz_la_SOURCES)
|
||||||
|
libharfbuzz_fuzzing_la_CPPFLAGS = $(libharfbuzz_la_CPPFLAGS) $(FUZZING_CPPFLAGS)
|
||||||
|
libharfbuzz_fuzzing_la_LDFLAGS = $(libharfbuzz_la_LDFLAGS)
|
||||||
|
libharfbuzz_fuzzing_la_LIBADD = $(libharfbuzz_la_LIBADD)
|
||||||
|
EXTRA_libharfbuzz_fuzzing_la_DEPENDENCIES = $(EXTRA_libharfbuzz_la_DEPENDENCIES)
|
||||||
|
|
||||||
if HAVE_ICU
|
if HAVE_ICU
|
||||||
lib_LTLIBRARIES += libharfbuzz-icu.la
|
lib_LTLIBRARIES += libharfbuzz-icu.la
|
||||||
libharfbuzz_icu_la_SOURCES = hb-icu.cc
|
libharfbuzz_icu_la_SOURCES = hb-icu.cc
|
||||||
|
|
|
@ -8,7 +8,7 @@ MAINTAINERCLEANFILES =
|
||||||
|
|
||||||
# Convenience targets:
|
# Convenience targets:
|
||||||
lib:
|
lib:
|
||||||
@$(MAKE) $(AM_MAKEFLAGS) -C $(top_builddir)/src lib
|
@$(MAKE) $(AM_MAKEFLAGS) -C $(top_builddir)/src fuzzing
|
||||||
|
|
||||||
EXTRA_DIST += \
|
EXTRA_DIST += \
|
||||||
README \
|
README \
|
||||||
|
@ -25,7 +25,7 @@ AM_CPPFLAGS = \
|
||||||
-I$(top_builddir)/src/ \
|
-I$(top_builddir)/src/ \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
LDADD = \
|
LDADD = \
|
||||||
$(top_builddir)/src/libharfbuzz.la \
|
$(top_builddir)/src/libharfbuzz-fuzzing.la \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
hb_fuzzer_SOURCES = \
|
hb_fuzzer_SOURCES = \
|
||||||
|
@ -37,11 +37,6 @@ hb_fuzzer_LDADD = \
|
||||||
hb_fuzzer_CPPFLAGS = \
|
hb_fuzzer_CPPFLAGS = \
|
||||||
$(AM_CPPFLAGS) \
|
$(AM_CPPFLAGS) \
|
||||||
-DMAIN \
|
-DMAIN \
|
||||||
-DHB_MAX_NESTING_LEVEL=3 \
|
|
||||||
-DHB_SANITIZE_MAX_EDITS=3 \
|
|
||||||
-DHB_BUFFER_MAX_EXPANSION_FACTOR=3 \
|
|
||||||
-DHB_BUFFER_MAX_LEN_MIN=8 \
|
|
||||||
-DHB_BUFFER_MAX_LEN_DEFAULT=128 \
|
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
-include $(top_srcdir)/git.mk
|
-include $(top_srcdir)/git.mk
|
||||||
|
|
|
@ -3,10 +3,8 @@ harfbuzz/test/fuzzing/hb-fuzzer.cc with:
|
||||||
- Using the most recent Clang
|
- Using the most recent Clang
|
||||||
- With -fsanitize=address (or =undefined, or a combination)
|
- With -fsanitize=address (or =undefined, or a combination)
|
||||||
- With -fsanitize-coverage=edge[,8bit-counters,trace-cmp]
|
- With -fsanitize-coverage=edge[,8bit-counters,trace-cmp]
|
||||||
- With various defines that limit worst case exponential behavior:
|
- With various defines that limit worst case exponential behavior.
|
||||||
* -DHB_MAX_NESTING_LEVEL=3
|
See FUZZING_CPPFLAGS in harfbuzz/src/Makefile.am for the list.
|
||||||
* -DHB_SANITIZE_MAX_EDITS=3
|
|
||||||
* See Makefile.am for full list of flags
|
|
||||||
- link against libFuzzer
|
- link against libFuzzer
|
||||||
|
|
||||||
To run the fuzzer one needs to first obtain a test corpus as a directory
|
To run the fuzzer one needs to first obtain a test corpus as a directory
|
||||||
|
|
Loading…
Reference in New Issue