23 $(src_test_AM_CPPFLAGS) $(TEST_CPPFLAGS)
25 $(AM_CFLAGS) $(TEST_CFLAGS)
27 @TOR_LDFLAGS_zlib@ $(TOR_LDFLAGS_CRYPTLIB) @TOR_LDFLAGS_libevent@
29 $(TOR_INTERNAL_TESTING_LIBS) \
31 @TOR_ZLIB_LIBS@ @TOR_LIB_MATH@ \
32 @TOR_LIBEVENT_LIBS@ $(TOR_LIBS_CRYPTLIB) \
33 @TOR_LIB_WS32@ @TOR_LIB_IPHLPAPI@ @TOR_LIB_GDI@ @TOR_LIB_USERENV@ @CURVE25519_LIBS@ \
39 $(TOR_INTERNAL_TESTING_LIBS)
42 src/test/fuzz/fuzzing.h
45 LIBFUZZER_CPPFLAGS = $(FUZZING_CPPFLAGS) -DLLVM_FUZZ
46 LIBFUZZER_CFLAGS = $(FUZZING_CFLAGS)
47 LIBFUZZER_LDFLAG = $(FUZZING_LDFLAG)
48 LIBFUZZER_LIBS = $(FUZZING_LIBS) $(LIBFUZZER) -lstdc++
50 LIBOSS_FUZZ_CPPFLAGS = $(FUZZING_CPPFLAGS) -DLLVM_FUZZ
51 LIBOSS_FUZZ_CFLAGS = $(FUZZING_CFLAGS)
55 noinst_PROGRAMS += $(FUZZERS) $(LIBFUZZER_FUZZERS)
56 noinst_LIBRARIES += $(OSS_FUZZ_FUZZERS)
57 oss-fuzz-fuzzers: oss-fuzz-prereqs $(OSS_FUZZ_FUZZERS)
58 fuzzers: $(FUZZERS) $(LIBFUZZER_FUZZERS)
60 test-fuzz-corpora: $(FUZZERS)
61 $(top_srcdir)/src/test/fuzz_static_testcases.sh
64 ########### No user serviceable parts will follow.
66 PREAMBLE
= PREAMBLE
.strip()
67 POSTAMBLE
= POSTAMBLE
.strip() # If I use it, it's a word!
68 FUZZERS
= FUZZERS
.split()
72 # This file was generated by fuzzing_include_am.py; do not hand-edit unless
73 # you enjoy having your changes erased.
80 print("\n# ===== AFL fuzzers")
83 return s
.replace("-", "_")
85 for fuzzer
in FUZZERS
:
86 idname
= get_id_name(fuzzer
)
89 src_test_fuzz_fuzz_{name}_SOURCES = \\
90 src/test/fuzz/fuzzing_common.c \\
91 src/test/fuzz/fuzz_{name}.c
92 src_test_fuzz_fuzz_{name}_CPPFLAGS = $(FUZZING_CPPFLAGS)
93 src_test_fuzz_fuzz_{name}_CFLAGS = $(FUZZING_CFLAGS)
94 src_test_fuzz_fuzz_{name}_LDFLAGS = $(FUZZING_LDFLAG)
95 src_test_fuzz_fuzz_{name}_LDADD = $(FUZZING_LIBS)
97 """.format(name
=idname
))
99 print("if UNITTESTS_ENABLED")
100 print("FUZZERS = \\")
101 print(" \\\n".join("\tsrc/test/fuzz/fuzz-{name}".format(name
=fuzzer
)
102 for fuzzer
in FUZZERS
))
105 print("\n# ===== libfuzzer")
106 print("\nif LIBFUZZER_ENABLED")
108 for fuzzer
in FUZZERS
:
109 idname
= get_id_name(fuzzer
)
112 src_test_fuzz_lf_fuzz_{name}_SOURCES = \\
113 $(src_test_fuzz_fuzz_{name}_SOURCES)
114 src_test_fuzz_lf_fuzz_{name}_CPPFLAGS = $(LIBFUZZER_CPPFLAGS)
115 src_test_fuzz_lf_fuzz_{name}_CFLAGS = $(LIBFUZZER_CFLAGS)
116 src_test_fuzz_lf_fuzz_{name}_LDFLAGS = $(LIBFUZZER_LDFLAG)
117 src_test_fuzz_lf_fuzz_{name}_LDADD = $(LIBFUZZER_LIBS)
119 """.format(name
=idname
))
121 print("LIBFUZZER_FUZZERS = \\")
122 print(" \\\n".join("\tsrc/test/fuzz/lf-fuzz-{name}".format(name
=fuzzer
)
123 for fuzzer
in FUZZERS
))
130 print("\n# ===== oss-fuzz\n")
131 print("if OSS_FUZZ_ENABLED")
133 for fuzzer
in FUZZERS
:
134 idname
= get_id_name(fuzzer
)
137 src_test_fuzz_liboss_fuzz_{name}_a_SOURCES = \\
138 $(src_test_fuzz_fuzz_{name}_SOURCES)
139 src_test_fuzz_liboss_fuzz_{name}_a_CPPFLAGS = $(LIBOSS_FUZZ_CPPFLAGS)
140 src_test_fuzz_liboss_fuzz_{name}_a_CFLAGS = $(LIBOSS_FUZZ_CFLAGS)
142 """.format(name
=idname
))
144 print("OSS_FUZZ_FUZZERS = \\")
145 print(" \\\n".join("\tsrc/test/fuzz/liboss-fuzz-{name}.a".format(name
=fuzzer
)
146 for fuzzer
in FUZZERS
))