include.am 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305
  1. # This file was generated by fuzzing_include_am.py; do not hand-edit unless
  2. # you enjoy having your changes erased.
  3. FUZZING_CPPFLAGS = \
  4. $(src_test_AM_CPPFLAGS) $(TEST_CPPFLAGS)
  5. FUZZING_CFLAGS = \
  6. $(AM_CFLAGS) $(TEST_CFLAGS)
  7. FUZZING_LDFLAG = \
  8. @TOR_LDFLAGS_zlib@ @TOR_LDFLAGS_openssl@ @TOR_LDFLAGS_libevent@
  9. FUZZING_LIBS = \
  10. src/or/libtor-testing.a \
  11. src/common/libor-crypto-testing.a \
  12. $(LIBKECCAK_TINY) \
  13. $(LIBDONNA) \
  14. src/common/libor-testing.a \
  15. src/common/libor-ctime-testing.a \
  16. src/common/libor-event-testing.a \
  17. src/trunnel/libor-trunnel-testing.a \
  18. @TOR_ZLIB_LIBS@ @TOR_LIB_MATH@ \
  19. @TOR_LIBEVENT_LIBS@ \
  20. @TOR_OPENSSL_LIBS@ @TOR_LIB_WS32@ @TOR_LIB_GDI@ @CURVE25519_LIBS@ \
  21. @TOR_SYSTEMD_LIBS@ \
  22. @TOR_LZMA_LIBS@ \
  23. @TOR_ZSTD_LIBS@ \
  24. $(rust_ldadd)
  25. oss-fuzz-prereqs: \
  26. src/or/libtor-testing.a \
  27. src/common/libor-crypto-testing.a \
  28. $(LIBKECCAK_TINY) \
  29. $(LIBDONNA) \
  30. src/common/libor-testing.a \
  31. src/common/libor-ctime-testing.a \
  32. src/common/libor-event-testing.a \
  33. src/trunnel/libor-trunnel-testing.a
  34. noinst_HEADERS += \
  35. src/test/fuzz/fuzzing.h
  36. LIBFUZZER = -lFuzzer
  37. LIBFUZZER_CPPFLAGS = $(FUZZING_CPPFLAGS) -DLLVM_FUZZ
  38. LIBFUZZER_CFLAGS = $(FUZZING_CFLAGS)
  39. LIBFUZZER_LDFLAG = $(FUZZING_LDFLAG)
  40. LIBFUZZER_LIBS = $(FUZZING_LIBS) $(LIBFUZZER) -lstdc++
  41. LIBOSS_FUZZ_CPPFLAGS = $(FUZZING_CPPFLAGS) -DLLVM_FUZZ
  42. LIBOSS_FUZZ_CFLAGS = $(FUZZING_CFLAGS)
  43. # ===== AFL fuzzers
  44. src_test_fuzz_fuzz_consensus_SOURCES = \
  45. src/test/fuzz/fuzzing_common.c \
  46. src/test/fuzz/fuzz_consensus.c
  47. src_test_fuzz_fuzz_consensus_CPPFLAGS = $(FUZZING_CPPFLAGS)
  48. src_test_fuzz_fuzz_consensus_CFLAGS = $(FUZZING_CFLAGS)
  49. src_test_fuzz_fuzz_consensus_LDFLAGS = $(FUZZING_LDFLAG)
  50. src_test_fuzz_fuzz_consensus_LDADD = $(FUZZING_LIBS)
  51. src_test_fuzz_fuzz_descriptor_SOURCES = \
  52. src/test/fuzz/fuzzing_common.c \
  53. src/test/fuzz/fuzz_descriptor.c
  54. src_test_fuzz_fuzz_descriptor_CPPFLAGS = $(FUZZING_CPPFLAGS)
  55. src_test_fuzz_fuzz_descriptor_CFLAGS = $(FUZZING_CFLAGS)
  56. src_test_fuzz_fuzz_descriptor_LDFLAGS = $(FUZZING_LDFLAG)
  57. src_test_fuzz_fuzz_descriptor_LDADD = $(FUZZING_LIBS)
  58. src_test_fuzz_fuzz_diff_SOURCES = \
  59. src/test/fuzz/fuzzing_common.c \
  60. src/test/fuzz/fuzz_diff.c
  61. src_test_fuzz_fuzz_diff_CPPFLAGS = $(FUZZING_CPPFLAGS)
  62. src_test_fuzz_fuzz_diff_CFLAGS = $(FUZZING_CFLAGS)
  63. src_test_fuzz_fuzz_diff_LDFLAGS = $(FUZZING_LDFLAG)
  64. src_test_fuzz_fuzz_diff_LDADD = $(FUZZING_LIBS)
  65. src_test_fuzz_fuzz_diff_apply_SOURCES = \
  66. src/test/fuzz/fuzzing_common.c \
  67. src/test/fuzz/fuzz_diff_apply.c
  68. src_test_fuzz_fuzz_diff_apply_CPPFLAGS = $(FUZZING_CPPFLAGS)
  69. src_test_fuzz_fuzz_diff_apply_CFLAGS = $(FUZZING_CFLAGS)
  70. src_test_fuzz_fuzz_diff_apply_LDFLAGS = $(FUZZING_LDFLAG)
  71. src_test_fuzz_fuzz_diff_apply_LDADD = $(FUZZING_LIBS)
  72. src_test_fuzz_fuzz_extrainfo_SOURCES = \
  73. src/test/fuzz/fuzzing_common.c \
  74. src/test/fuzz/fuzz_extrainfo.c
  75. src_test_fuzz_fuzz_extrainfo_CPPFLAGS = $(FUZZING_CPPFLAGS)
  76. src_test_fuzz_fuzz_extrainfo_CFLAGS = $(FUZZING_CFLAGS)
  77. src_test_fuzz_fuzz_extrainfo_LDFLAGS = $(FUZZING_LDFLAG)
  78. src_test_fuzz_fuzz_extrainfo_LDADD = $(FUZZING_LIBS)
  79. src_test_fuzz_fuzz_hsdescv2_SOURCES = \
  80. src/test/fuzz/fuzzing_common.c \
  81. src/test/fuzz/fuzz_hsdescv2.c
  82. src_test_fuzz_fuzz_hsdescv2_CPPFLAGS = $(FUZZING_CPPFLAGS)
  83. src_test_fuzz_fuzz_hsdescv2_CFLAGS = $(FUZZING_CFLAGS)
  84. src_test_fuzz_fuzz_hsdescv2_LDFLAGS = $(FUZZING_LDFLAG)
  85. src_test_fuzz_fuzz_hsdescv2_LDADD = $(FUZZING_LIBS)
  86. src_test_fuzz_fuzz_http_SOURCES = \
  87. src/test/fuzz/fuzzing_common.c \
  88. src/test/fuzz/fuzz_http.c
  89. src_test_fuzz_fuzz_http_CPPFLAGS = $(FUZZING_CPPFLAGS)
  90. src_test_fuzz_fuzz_http_CFLAGS = $(FUZZING_CFLAGS)
  91. src_test_fuzz_fuzz_http_LDFLAGS = $(FUZZING_LDFLAG)
  92. src_test_fuzz_fuzz_http_LDADD = $(FUZZING_LIBS)
  93. src_test_fuzz_fuzz_iptsv2_SOURCES = \
  94. src/test/fuzz/fuzzing_common.c \
  95. src/test/fuzz/fuzz_iptsv2.c
  96. src_test_fuzz_fuzz_iptsv2_CPPFLAGS = $(FUZZING_CPPFLAGS)
  97. src_test_fuzz_fuzz_iptsv2_CFLAGS = $(FUZZING_CFLAGS)
  98. src_test_fuzz_fuzz_iptsv2_LDFLAGS = $(FUZZING_LDFLAG)
  99. src_test_fuzz_fuzz_iptsv2_LDADD = $(FUZZING_LIBS)
  100. src_test_fuzz_fuzz_microdesc_SOURCES = \
  101. src/test/fuzz/fuzzing_common.c \
  102. src/test/fuzz/fuzz_microdesc.c
  103. src_test_fuzz_fuzz_microdesc_CPPFLAGS = $(FUZZING_CPPFLAGS)
  104. src_test_fuzz_fuzz_microdesc_CFLAGS = $(FUZZING_CFLAGS)
  105. src_test_fuzz_fuzz_microdesc_LDFLAGS = $(FUZZING_LDFLAG)
  106. src_test_fuzz_fuzz_microdesc_LDADD = $(FUZZING_LIBS)
  107. src_test_fuzz_fuzz_vrs_SOURCES = \
  108. src/test/fuzz/fuzzing_common.c \
  109. src/test/fuzz/fuzz_vrs.c
  110. src_test_fuzz_fuzz_vrs_CPPFLAGS = $(FUZZING_CPPFLAGS)
  111. src_test_fuzz_fuzz_vrs_CFLAGS = $(FUZZING_CFLAGS)
  112. src_test_fuzz_fuzz_vrs_LDFLAGS = $(FUZZING_LDFLAG)
  113. src_test_fuzz_fuzz_vrs_LDADD = $(FUZZING_LIBS)
  114. FUZZERS = \
  115. src/test/fuzz/fuzz-consensus \
  116. src/test/fuzz/fuzz-descriptor \
  117. src/test/fuzz/fuzz-diff \
  118. src/test/fuzz/fuzz-diff-apply \
  119. src/test/fuzz/fuzz-extrainfo \
  120. src/test/fuzz/fuzz-hsdescv2 \
  121. src/test/fuzz/fuzz-http \
  122. src/test/fuzz/fuzz-iptsv2 \
  123. src/test/fuzz/fuzz-microdesc \
  124. src/test/fuzz/fuzz-vrs
  125. # ===== libfuzzer
  126. if LIBFUZZER_ENABLED
  127. src_test_fuzz_lf_fuzz_consensus_SOURCES = \
  128. $(src_test_fuzz_fuzz_consensus_SOURCES)
  129. src_test_fuzz_lf_fuzz_consensus_CPPFLAGS = $(LIBFUZZER_CPPFLAGS)
  130. src_test_fuzz_lf_fuzz_consensus_CFLAGS = $(LIBFUZZER_CFLAGS)
  131. src_test_fuzz_lf_fuzz_consensus_LDFLAGS = $(LIBFUZZER_LDFLAG)
  132. src_test_fuzz_lf_fuzz_consensus_LDADD = $(LIBFUZZER_LIBS)
  133. src_test_fuzz_lf_fuzz_descriptor_SOURCES = \
  134. $(src_test_fuzz_fuzz_descriptor_SOURCES)
  135. src_test_fuzz_lf_fuzz_descriptor_CPPFLAGS = $(LIBFUZZER_CPPFLAGS)
  136. src_test_fuzz_lf_fuzz_descriptor_CFLAGS = $(LIBFUZZER_CFLAGS)
  137. src_test_fuzz_lf_fuzz_descriptor_LDFLAGS = $(LIBFUZZER_LDFLAG)
  138. src_test_fuzz_lf_fuzz_descriptor_LDADD = $(LIBFUZZER_LIBS)
  139. src_test_fuzz_lf_fuzz_diff_SOURCES = \
  140. $(src_test_fuzz_fuzz_diff_SOURCES)
  141. src_test_fuzz_lf_fuzz_diff_CPPFLAGS = $(LIBFUZZER_CPPFLAGS)
  142. src_test_fuzz_lf_fuzz_diff_CFLAGS = $(LIBFUZZER_CFLAGS)
  143. src_test_fuzz_lf_fuzz_diff_LDFLAGS = $(LIBFUZZER_LDFLAG)
  144. src_test_fuzz_lf_fuzz_diff_LDADD = $(LIBFUZZER_LIBS)
  145. src_test_fuzz_lf_fuzz_diff_apply_SOURCES = \
  146. $(src_test_fuzz_fuzz_diff_apply_SOURCES)
  147. src_test_fuzz_lf_fuzz_diff_apply_CPPFLAGS = $(LIBFUZZER_CPPFLAGS)
  148. src_test_fuzz_lf_fuzz_diff_apply_CFLAGS = $(LIBFUZZER_CFLAGS)
  149. src_test_fuzz_lf_fuzz_diff_apply_LDFLAGS = $(LIBFUZZER_LDFLAG)
  150. src_test_fuzz_lf_fuzz_diff_apply_LDADD = $(LIBFUZZER_LIBS)
  151. src_test_fuzz_lf_fuzz_extrainfo_SOURCES = \
  152. $(src_test_fuzz_fuzz_extrainfo_SOURCES)
  153. src_test_fuzz_lf_fuzz_extrainfo_CPPFLAGS = $(LIBFUZZER_CPPFLAGS)
  154. src_test_fuzz_lf_fuzz_extrainfo_CFLAGS = $(LIBFUZZER_CFLAGS)
  155. src_test_fuzz_lf_fuzz_extrainfo_LDFLAGS = $(LIBFUZZER_LDFLAG)
  156. src_test_fuzz_lf_fuzz_extrainfo_LDADD = $(LIBFUZZER_LIBS)
  157. src_test_fuzz_lf_fuzz_hsdescv2_SOURCES = \
  158. $(src_test_fuzz_fuzz_hsdescv2_SOURCES)
  159. src_test_fuzz_lf_fuzz_hsdescv2_CPPFLAGS = $(LIBFUZZER_CPPFLAGS)
  160. src_test_fuzz_lf_fuzz_hsdescv2_CFLAGS = $(LIBFUZZER_CFLAGS)
  161. src_test_fuzz_lf_fuzz_hsdescv2_LDFLAGS = $(LIBFUZZER_LDFLAG)
  162. src_test_fuzz_lf_fuzz_hsdescv2_LDADD = $(LIBFUZZER_LIBS)
  163. src_test_fuzz_lf_fuzz_http_SOURCES = \
  164. $(src_test_fuzz_fuzz_http_SOURCES)
  165. src_test_fuzz_lf_fuzz_http_CPPFLAGS = $(LIBFUZZER_CPPFLAGS)
  166. src_test_fuzz_lf_fuzz_http_CFLAGS = $(LIBFUZZER_CFLAGS)
  167. src_test_fuzz_lf_fuzz_http_LDFLAGS = $(LIBFUZZER_LDFLAG)
  168. src_test_fuzz_lf_fuzz_http_LDADD = $(LIBFUZZER_LIBS)
  169. src_test_fuzz_lf_fuzz_iptsv2_SOURCES = \
  170. $(src_test_fuzz_fuzz_iptsv2_SOURCES)
  171. src_test_fuzz_lf_fuzz_iptsv2_CPPFLAGS = $(LIBFUZZER_CPPFLAGS)
  172. src_test_fuzz_lf_fuzz_iptsv2_CFLAGS = $(LIBFUZZER_CFLAGS)
  173. src_test_fuzz_lf_fuzz_iptsv2_LDFLAGS = $(LIBFUZZER_LDFLAG)
  174. src_test_fuzz_lf_fuzz_iptsv2_LDADD = $(LIBFUZZER_LIBS)
  175. src_test_fuzz_lf_fuzz_microdesc_SOURCES = \
  176. $(src_test_fuzz_fuzz_microdesc_SOURCES)
  177. src_test_fuzz_lf_fuzz_microdesc_CPPFLAGS = $(LIBFUZZER_CPPFLAGS)
  178. src_test_fuzz_lf_fuzz_microdesc_CFLAGS = $(LIBFUZZER_CFLAGS)
  179. src_test_fuzz_lf_fuzz_microdesc_LDFLAGS = $(LIBFUZZER_LDFLAG)
  180. src_test_fuzz_lf_fuzz_microdesc_LDADD = $(LIBFUZZER_LIBS)
  181. src_test_fuzz_lf_fuzz_vrs_SOURCES = \
  182. $(src_test_fuzz_fuzz_vrs_SOURCES)
  183. src_test_fuzz_lf_fuzz_vrs_CPPFLAGS = $(LIBFUZZER_CPPFLAGS)
  184. src_test_fuzz_lf_fuzz_vrs_CFLAGS = $(LIBFUZZER_CFLAGS)
  185. src_test_fuzz_lf_fuzz_vrs_LDFLAGS = $(LIBFUZZER_LDFLAG)
  186. src_test_fuzz_lf_fuzz_vrs_LDADD = $(LIBFUZZER_LIBS)
  187. LIBFUZZER_FUZZERS = \
  188. src/test/fuzz/lf-fuzz-consensus \
  189. src/test/fuzz/lf-fuzz-descriptor \
  190. src/test/fuzz/lf-fuzz-diff \
  191. src/test/fuzz/lf-fuzz-diff-apply \
  192. src/test/fuzz/lf-fuzz-extrainfo \
  193. src/test/fuzz/lf-fuzz-hsdescv2 \
  194. src/test/fuzz/lf-fuzz-http \
  195. src/test/fuzz/lf-fuzz-iptsv2 \
  196. src/test/fuzz/lf-fuzz-microdesc \
  197. src/test/fuzz/lf-fuzz-vrs
  198. else
  199. LIBFUZZER_FUZZERS =
  200. endif
  201. # ===== oss-fuzz
  202. if OSS_FUZZ_ENABLED
  203. src_test_fuzz_liboss_fuzz_consensus_a_SOURCES = \
  204. $(src_test_fuzz_fuzz_consensus_SOURCES)
  205. src_test_fuzz_liboss_fuzz_consensus_a_CPPFLAGS = $(LIBOSS_FUZZ_CPPFLAGS)
  206. src_test_fuzz_liboss_fuzz_consensus_a_CFLAGS = $(LIBOSS_FUZZ_CFLAGS)
  207. src_test_fuzz_liboss_fuzz_descriptor_a_SOURCES = \
  208. $(src_test_fuzz_fuzz_descriptor_SOURCES)
  209. src_test_fuzz_liboss_fuzz_descriptor_a_CPPFLAGS = $(LIBOSS_FUZZ_CPPFLAGS)
  210. src_test_fuzz_liboss_fuzz_descriptor_a_CFLAGS = $(LIBOSS_FUZZ_CFLAGS)
  211. src_test_fuzz_liboss_fuzz_diff_a_SOURCES = \
  212. $(src_test_fuzz_fuzz_diff_SOURCES)
  213. src_test_fuzz_liboss_fuzz_diff_a_CPPFLAGS = $(LIBOSS_FUZZ_CPPFLAGS)
  214. src_test_fuzz_liboss_fuzz_diff_a_CFLAGS = $(LIBOSS_FUZZ_CFLAGS)
  215. src_test_fuzz_liboss_fuzz_diff_apply_a_SOURCES = \
  216. $(src_test_fuzz_fuzz_diff_apply_SOURCES)
  217. src_test_fuzz_liboss_fuzz_diff_apply_a_CPPFLAGS = $(LIBOSS_FUZZ_CPPFLAGS)
  218. src_test_fuzz_liboss_fuzz_diff_apply_a_CFLAGS = $(LIBOSS_FUZZ_CFLAGS)
  219. src_test_fuzz_liboss_fuzz_extrainfo_a_SOURCES = \
  220. $(src_test_fuzz_fuzz_extrainfo_SOURCES)
  221. src_test_fuzz_liboss_fuzz_extrainfo_a_CPPFLAGS = $(LIBOSS_FUZZ_CPPFLAGS)
  222. src_test_fuzz_liboss_fuzz_extrainfo_a_CFLAGS = $(LIBOSS_FUZZ_CFLAGS)
  223. src_test_fuzz_liboss_fuzz_hsdescv2_a_SOURCES = \
  224. $(src_test_fuzz_fuzz_hsdescv2_SOURCES)
  225. src_test_fuzz_liboss_fuzz_hsdescv2_a_CPPFLAGS = $(LIBOSS_FUZZ_CPPFLAGS)
  226. src_test_fuzz_liboss_fuzz_hsdescv2_a_CFLAGS = $(LIBOSS_FUZZ_CFLAGS)
  227. src_test_fuzz_liboss_fuzz_http_a_SOURCES = \
  228. $(src_test_fuzz_fuzz_http_SOURCES)
  229. src_test_fuzz_liboss_fuzz_http_a_CPPFLAGS = $(LIBOSS_FUZZ_CPPFLAGS)
  230. src_test_fuzz_liboss_fuzz_http_a_CFLAGS = $(LIBOSS_FUZZ_CFLAGS)
  231. src_test_fuzz_liboss_fuzz_iptsv2_a_SOURCES = \
  232. $(src_test_fuzz_fuzz_iptsv2_SOURCES)
  233. src_test_fuzz_liboss_fuzz_iptsv2_a_CPPFLAGS = $(LIBOSS_FUZZ_CPPFLAGS)
  234. src_test_fuzz_liboss_fuzz_iptsv2_a_CFLAGS = $(LIBOSS_FUZZ_CFLAGS)
  235. src_test_fuzz_liboss_fuzz_microdesc_a_SOURCES = \
  236. $(src_test_fuzz_fuzz_microdesc_SOURCES)
  237. src_test_fuzz_liboss_fuzz_microdesc_a_CPPFLAGS = $(LIBOSS_FUZZ_CPPFLAGS)
  238. src_test_fuzz_liboss_fuzz_microdesc_a_CFLAGS = $(LIBOSS_FUZZ_CFLAGS)
  239. src_test_fuzz_liboss_fuzz_vrs_a_SOURCES = \
  240. $(src_test_fuzz_fuzz_vrs_SOURCES)
  241. src_test_fuzz_liboss_fuzz_vrs_a_CPPFLAGS = $(LIBOSS_FUZZ_CPPFLAGS)
  242. src_test_fuzz_liboss_fuzz_vrs_a_CFLAGS = $(LIBOSS_FUZZ_CFLAGS)
  243. OSS_FUZZ_FUZZERS = \
  244. src/test/fuzz/liboss-fuzz-consensus.a \
  245. src/test/fuzz/liboss-fuzz-descriptor.a \
  246. src/test/fuzz/liboss-fuzz-diff.a \
  247. src/test/fuzz/liboss-fuzz-diff-apply.a \
  248. src/test/fuzz/liboss-fuzz-extrainfo.a \
  249. src/test/fuzz/liboss-fuzz-hsdescv2.a \
  250. src/test/fuzz/liboss-fuzz-http.a \
  251. src/test/fuzz/liboss-fuzz-iptsv2.a \
  252. src/test/fuzz/liboss-fuzz-microdesc.a \
  253. src/test/fuzz/liboss-fuzz-vrs.a
  254. else
  255. OSS_FUZZ_FUZZERS =
  256. endif
  257. noinst_PROGRAMS += $(FUZZERS) $(LIBFUZZER_FUZZERS)
  258. noinst_LIBRARIES += $(OSS_FUZZ_FUZZERS)
  259. oss-fuzz-fuzzers: oss-fuzz-prereqs $(OSS_FUZZ_FUZZERS)
  260. fuzzers: $(FUZZERS) $(LIBFUZZER_FUZZERS)
  261. test-fuzz-corpora: $(FUZZERS)
  262. $(top_srcdir)/src/test/fuzz_static_testcases.sh