##// END OF EJS Templates
fuzz: clean out most of fuzzutil...
Augie Fackler -
r44013:6f5c352f default
parent child Browse files
Show More
@@ -3,15 +3,6 b' CXX = clang++'
3
3
4 all: bdiff mpatch xdiff
4 all: bdiff mpatch xdiff
5
5
6 fuzzutil.o: fuzzutil.cc fuzzutil.h
7 $(CXX) $(CXXFLAGS) -g -O1 \
8 -std=c++17 \
9 -I../../mercurial -c -o fuzzutil.o fuzzutil.cc
10
11 fuzzutil-oss-fuzz.o: fuzzutil.cc fuzzutil.h
12 $(CXX) $(CXXFLAGS) -std=c++17 \
13 -I../../mercurial -c -o fuzzutil-oss-fuzz.o fuzzutil.cc
14
15 pyutil.o: pyutil.cc pyutil.h
6 pyutil.o: pyutil.cc pyutil.h
16 $(CXX) $(CXXFLAGS) -g -O1 \
7 $(CXX) $(CXXFLAGS) -g -O1 \
17 `$$OUT/sanpy/bin/python-config --cflags` \
8 `$$OUT/sanpy/bin/python-config --cflags` \
@@ -21,17 +12,17 b' bdiff.o: ../../mercurial/bdiff.c'
21 $(CC) $(CFLAGS) -fsanitize=fuzzer-no-link,address -c -o bdiff.o \
12 $(CC) $(CFLAGS) -fsanitize=fuzzer-no-link,address -c -o bdiff.o \
22 ../../mercurial/bdiff.c
13 ../../mercurial/bdiff.c
23
14
24 bdiff: bdiff.cc bdiff.o fuzzutil.o
15 bdiff: bdiff.cc bdiff.o
25 $(CXX) $(CXXFLAGS) -DHG_FUZZER_INCLUDE_MAIN=1 -g -O1 -fsanitize=fuzzer-no-link,address \
16 $(CXX) $(CXXFLAGS) -DHG_FUZZER_INCLUDE_MAIN=1 -g -O1 -fsanitize=fuzzer-no-link,address \
26 -std=c++17 \
17 -std=c++17 \
27 -I../../mercurial bdiff.cc bdiff.o fuzzutil.o -o bdiff
18 -I../../mercurial bdiff.cc bdiff.o -o bdiff
28
19
29 bdiff-oss-fuzz.o: ../../mercurial/bdiff.c
20 bdiff-oss-fuzz.o: ../../mercurial/bdiff.c
30 $(CC) $(CFLAGS) -c -o bdiff-oss-fuzz.o ../../mercurial/bdiff.c
21 $(CC) $(CFLAGS) -c -o bdiff-oss-fuzz.o ../../mercurial/bdiff.c
31
22
32 bdiff_fuzzer: bdiff.cc bdiff-oss-fuzz.o fuzzutil-oss-fuzz.o
23 bdiff_fuzzer: bdiff.cc bdiff-oss-fuzz.o
33 $(CXX) $(CXXFLAGS) -std=c++17 -I../../mercurial bdiff.cc \
24 $(CXX) $(CXXFLAGS) -std=c++17 -I../../mercurial bdiff.cc \
34 bdiff-oss-fuzz.o fuzzutil-oss-fuzz.o -lFuzzingEngine -o \
25 bdiff-oss-fuzz.o -lFuzzingEngine -o \
35 $$OUT/bdiff_fuzzer
26 $$OUT/bdiff_fuzzer
36
27
37 mpatch.o: ../../mercurial/mpatch.c
28 mpatch.o: ../../mercurial/mpatch.c
@@ -39,16 +30,16 b' mpatch.o: ../../mercurial/mpatch.c'
39 ../../mercurial/mpatch.c
30 ../../mercurial/mpatch.c
40
31
41 mpatch: CXXFLAGS += -std=c++17
32 mpatch: CXXFLAGS += -std=c++17
42 mpatch: mpatch.cc mpatch.o fuzzutil.o
33 mpatch: mpatch.cc mpatch.o
43 $(CXX) $(CXXFLAGS) -DHG_FUZZER_INCLUDE_MAIN=1 -g -O1 -fsanitize=fuzzer-no-link,address \
34 $(CXX) $(CXXFLAGS) -DHG_FUZZER_INCLUDE_MAIN=1 -g -O1 -fsanitize=fuzzer-no-link,address \
44 -I../../mercurial mpatch.cc mpatch.o fuzzutil.o -o mpatch
35 -I../../mercurial mpatch.cc mpatch.o -o mpatch
45
36
46 mpatch-oss-fuzz.o: ../../mercurial/mpatch.c
37 mpatch-oss-fuzz.o: ../../mercurial/mpatch.c
47 $(CC) $(CFLAGS) -c -o mpatch-oss-fuzz.o ../../mercurial/mpatch.c
38 $(CC) $(CFLAGS) -c -o mpatch-oss-fuzz.o ../../mercurial/mpatch.c
48
39
49 mpatch_fuzzer: mpatch.cc mpatch-oss-fuzz.o fuzzutil-oss-fuzz.o
40 mpatch_fuzzer: mpatch.cc mpatch-oss-fuzz.o
50 $(CXX) $(CXXFLAGS) -std=c++17 -I../../mercurial mpatch.cc \
41 $(CXX) $(CXXFLAGS) -std=c++17 -I../../mercurial mpatch.cc \
51 mpatch-oss-fuzz.o fuzzutil-oss-fuzz.o -lFuzzingEngine -o \
42 mpatch-oss-fuzz.o -lFuzzingEngine -o \
52 $$OUT/mpatch_fuzzer
43 $$OUT/mpatch_fuzzer
53
44
54 mpatch_corpus.zip:
45 mpatch_corpus.zip:
@@ -60,19 +51,19 b' x%.o: ../../mercurial/thirdparty/xdiff/x'
60 $<
51 $<
61
52
62 xdiff: CXXFLAGS += -std=c++17
53 xdiff: CXXFLAGS += -std=c++17
63 xdiff: xdiff.cc xdiffi.o xprepare.o xutils.o fuzzutil.o
54 xdiff: xdiff.cc xdiffi.o xprepare.o xutils.o
64 $(CXX) $(CXXFLAGS) -DHG_FUZZER_INCLUDE_MAIN=1 -g -O1 -fsanitize=fuzzer-no-link,address \
55 $(CXX) $(CXXFLAGS) -DHG_FUZZER_INCLUDE_MAIN=1 -g -O1 -fsanitize=fuzzer-no-link,address \
65 -I../../mercurial xdiff.cc \
56 -I../../mercurial xdiff.cc \
66 xdiffi.o xprepare.o xutils.o fuzzutil.o -o xdiff
57 xdiffi.o xprepare.o xutils.o -o xdiff
67
58
68 fuzz-x%.o: ../../mercurial/thirdparty/xdiff/x%.c ../../mercurial/thirdparty/xdiff/*.h
59 fuzz-x%.o: ../../mercurial/thirdparty/xdiff/x%.c ../../mercurial/thirdparty/xdiff/*.h
69 $(CC) $(CFLAGS) -c \
60 $(CC) $(CFLAGS) -c \
70 -o $@ \
61 -o $@ \
71 $<
62 $<
72
63
73 xdiff_fuzzer: xdiff.cc fuzz-xdiffi.o fuzz-xprepare.o fuzz-xutils.o fuzzutil-oss-fuzz.o
64 xdiff_fuzzer: xdiff.cc fuzz-xdiffi.o fuzz-xprepare.o fuzz-xutils.o
74 $(CXX) $(CXXFLAGS) -std=c++17 -I../../mercurial xdiff.cc \
65 $(CXX) $(CXXFLAGS) -std=c++17 -I../../mercurial xdiff.cc \
75 fuzz-xdiffi.o fuzz-xprepare.o fuzz-xutils.o fuzzutil-oss-fuzz.o \
66 fuzz-xdiffi.o fuzz-xprepare.o fuzz-xutils.o \
76 -lFuzzingEngine -o $$OUT/xdiff_fuzzer
67 -lFuzzingEngine -o $$OUT/xdiff_fuzzer
77
68
78 manifest.o: ../../mercurial/cext/manifest.c
69 manifest.o: ../../mercurial/cext/manifest.c
@@ -34,14 +34,4 b' using absl::optional;'
34 if (level <= DEBUG) \
34 if (level <= DEBUG) \
35 std::cout
35 std::cout
36
36
37 struct two_inputs {
38 std::unique_ptr<char[]> right;
39 size_t right_size;
40 std::unique_ptr<char[]> left;
41 size_t left_size;
42 };
43
44 /* Split a non-zero-length input into two inputs. */
45 contrib::optional<two_inputs> SplitInputs(const uint8_t *Data, size_t Size);
46
47 #endif /* CONTRIB_FUZZ_FUZZUTIL_H */
37 #endif /* CONTRIB_FUZZ_FUZZUTIL_H */
1 NO CONTENT: file was removed
NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now