##// END OF EJS Templates
fuzz: suppress deprecated-register warnings in our compile...
Augie Fackler -
r44250:28be1932 default draft
parent child Browse files
Show More
@@ -1,177 +1,179
1 CC = clang
1 CC = clang
2 CXX = clang++
2 CXX = clang++
3
3
4 LIB_FUZZING_ENGINE ?= -lFuzzingEngine
4 LIB_FUZZING_ENGINE ?= -lFuzzingEngine
5
5
6 CXXFLAGS += -Wno-deprecated-register
7
6 all: bdiff mpatch xdiff
8 all: bdiff mpatch xdiff
7
9
8 pyutil.o: pyutil.cc pyutil.h
10 pyutil.o: pyutil.cc pyutil.h
9 $(CXX) $(CXXFLAGS) -g -O1 \
11 $(CXX) $(CXXFLAGS) -g -O1 \
10 `$$OUT/sanpy/bin/python-config --cflags` \
12 `$$OUT/sanpy/bin/python-config --cflags` \
11 -I../../mercurial -c -o pyutil.o pyutil.cc
13 -I../../mercurial -c -o pyutil.o pyutil.cc
12
14
13 bdiff.o: ../../mercurial/bdiff.c
15 bdiff.o: ../../mercurial/bdiff.c
14 $(CC) $(CFLAGS) -fsanitize=fuzzer-no-link,address -c -o bdiff.o \
16 $(CC) $(CFLAGS) -fsanitize=fuzzer-no-link,address -c -o bdiff.o \
15 ../../mercurial/bdiff.c
17 ../../mercurial/bdiff.c
16
18
17 bdiff: bdiff.cc bdiff.o
19 bdiff: bdiff.cc bdiff.o
18 $(CXX) $(CXXFLAGS) -DHG_FUZZER_INCLUDE_MAIN=1 -g -O1 -fsanitize=fuzzer-no-link,address \
20 $(CXX) $(CXXFLAGS) -DHG_FUZZER_INCLUDE_MAIN=1 -g -O1 -fsanitize=fuzzer-no-link,address \
19 -std=c++17 \
21 -std=c++17 \
20 -I../../mercurial bdiff.cc bdiff.o -o bdiff
22 -I../../mercurial bdiff.cc bdiff.o -o bdiff
21
23
22 bdiff-oss-fuzz.o: ../../mercurial/bdiff.c
24 bdiff-oss-fuzz.o: ../../mercurial/bdiff.c
23 $(CC) $(CFLAGS) -c -o bdiff-oss-fuzz.o ../../mercurial/bdiff.c
25 $(CC) $(CFLAGS) -c -o bdiff-oss-fuzz.o ../../mercurial/bdiff.c
24
26
25 bdiff_fuzzer: bdiff.cc bdiff-oss-fuzz.o
27 bdiff_fuzzer: bdiff.cc bdiff-oss-fuzz.o
26 $(CXX) $(CXXFLAGS) -std=c++17 -I../../mercurial bdiff.cc \
28 $(CXX) $(CXXFLAGS) -std=c++17 -I../../mercurial bdiff.cc \
27 bdiff-oss-fuzz.o $(LIB_FUZZING_ENGINE) -o \
29 bdiff-oss-fuzz.o $(LIB_FUZZING_ENGINE) -o \
28 $$OUT/bdiff_fuzzer
30 $$OUT/bdiff_fuzzer
29
31
30 mpatch.o: ../../mercurial/mpatch.c
32 mpatch.o: ../../mercurial/mpatch.c
31 $(CC) -g -O1 -fsanitize=fuzzer-no-link,address -c -o mpatch.o \
33 $(CC) -g -O1 -fsanitize=fuzzer-no-link,address -c -o mpatch.o \
32 ../../mercurial/mpatch.c
34 ../../mercurial/mpatch.c
33
35
34 mpatch: CXXFLAGS += -std=c++17
36 mpatch: CXXFLAGS += -std=c++17
35 mpatch: mpatch.cc mpatch.o
37 mpatch: mpatch.cc mpatch.o
36 $(CXX) $(CXXFLAGS) -DHG_FUZZER_INCLUDE_MAIN=1 -g -O1 -fsanitize=fuzzer-no-link,address \
38 $(CXX) $(CXXFLAGS) -DHG_FUZZER_INCLUDE_MAIN=1 -g -O1 -fsanitize=fuzzer-no-link,address \
37 -I../../mercurial mpatch.cc mpatch.o -o mpatch
39 -I../../mercurial mpatch.cc mpatch.o -o mpatch
38
40
39 mpatch-oss-fuzz.o: ../../mercurial/mpatch.c
41 mpatch-oss-fuzz.o: ../../mercurial/mpatch.c
40 $(CC) $(CFLAGS) -c -o mpatch-oss-fuzz.o ../../mercurial/mpatch.c
42 $(CC) $(CFLAGS) -c -o mpatch-oss-fuzz.o ../../mercurial/mpatch.c
41
43
42 mpatch_fuzzer: mpatch.cc mpatch-oss-fuzz.o
44 mpatch_fuzzer: mpatch.cc mpatch-oss-fuzz.o
43 $(CXX) $(CXXFLAGS) -std=c++17 -I../../mercurial mpatch.cc \
45 $(CXX) $(CXXFLAGS) -std=c++17 -I../../mercurial mpatch.cc \
44 mpatch-oss-fuzz.o $(LIB_FUZZING_ENGINE) -o \
46 mpatch-oss-fuzz.o $(LIB_FUZZING_ENGINE) -o \
45 $$OUT/mpatch_fuzzer
47 $$OUT/mpatch_fuzzer
46
48
47 mpatch_corpus.zip:
49 mpatch_corpus.zip:
48 python mpatch_corpus.py $$OUT/mpatch_fuzzer_seed_corpus.zip
50 python mpatch_corpus.py $$OUT/mpatch_fuzzer_seed_corpus.zip
49
51
50 x%.o: ../../mercurial/thirdparty/xdiff/x%.c ../../mercurial/thirdparty/xdiff/*.h
52 x%.o: ../../mercurial/thirdparty/xdiff/x%.c ../../mercurial/thirdparty/xdiff/*.h
51 $(CC) -g -O1 -fsanitize=fuzzer-no-link,address -c \
53 $(CC) -g -O1 -fsanitize=fuzzer-no-link,address -c \
52 -o $@ \
54 -o $@ \
53 $<
55 $<
54
56
55 xdiff: CXXFLAGS += -std=c++17
57 xdiff: CXXFLAGS += -std=c++17
56 xdiff: xdiff.cc xdiffi.o xprepare.o xutils.o
58 xdiff: xdiff.cc xdiffi.o xprepare.o xutils.o
57 $(CXX) $(CXXFLAGS) -DHG_FUZZER_INCLUDE_MAIN=1 -g -O1 -fsanitize=fuzzer-no-link,address \
59 $(CXX) $(CXXFLAGS) -DHG_FUZZER_INCLUDE_MAIN=1 -g -O1 -fsanitize=fuzzer-no-link,address \
58 -I../../mercurial xdiff.cc \
60 -I../../mercurial xdiff.cc \
59 xdiffi.o xprepare.o xutils.o -o xdiff
61 xdiffi.o xprepare.o xutils.o -o xdiff
60
62
61 fuzz-x%.o: ../../mercurial/thirdparty/xdiff/x%.c ../../mercurial/thirdparty/xdiff/*.h
63 fuzz-x%.o: ../../mercurial/thirdparty/xdiff/x%.c ../../mercurial/thirdparty/xdiff/*.h
62 $(CC) $(CFLAGS) -c \
64 $(CC) $(CFLAGS) -c \
63 -o $@ \
65 -o $@ \
64 $<
66 $<
65
67
66 xdiff_fuzzer: xdiff.cc fuzz-xdiffi.o fuzz-xprepare.o fuzz-xutils.o
68 xdiff_fuzzer: xdiff.cc fuzz-xdiffi.o fuzz-xprepare.o fuzz-xutils.o
67 $(CXX) $(CXXFLAGS) -std=c++17 -I../../mercurial xdiff.cc \
69 $(CXX) $(CXXFLAGS) -std=c++17 -I../../mercurial xdiff.cc \
68 fuzz-xdiffi.o fuzz-xprepare.o fuzz-xutils.o \
70 fuzz-xdiffi.o fuzz-xprepare.o fuzz-xutils.o \
69 $(LIB_FUZZING_ENGINE) -o $$OUT/xdiff_fuzzer
71 $(LIB_FUZZING_ENGINE) -o $$OUT/xdiff_fuzzer
70
72
71 manifest.o: ../../mercurial/cext/manifest.c
73 manifest.o: ../../mercurial/cext/manifest.c
72 $(CC) $(CFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \
74 $(CC) $(CFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \
73 -I../../mercurial \
75 -I../../mercurial \
74 -c -o manifest.o ../../mercurial/cext/manifest.c
76 -c -o manifest.o ../../mercurial/cext/manifest.c
75
77
76 charencode.o: ../../mercurial/cext/charencode.c
78 charencode.o: ../../mercurial/cext/charencode.c
77 $(CC) $(CFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \
79 $(CC) $(CFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \
78 -I../../mercurial \
80 -I../../mercurial \
79 -c -o charencode.o ../../mercurial/cext/charencode.c
81 -c -o charencode.o ../../mercurial/cext/charencode.c
80
82
81 parsers.o: ../../mercurial/cext/parsers.c
83 parsers.o: ../../mercurial/cext/parsers.c
82 $(CC) $(CFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \
84 $(CC) $(CFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \
83 -I../../mercurial \
85 -I../../mercurial \
84 -c -o parsers.o ../../mercurial/cext/parsers.c
86 -c -o parsers.o ../../mercurial/cext/parsers.c
85
87
86 dirs.o: ../../mercurial/cext/dirs.c
88 dirs.o: ../../mercurial/cext/dirs.c
87 $(CC) $(CFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \
89 $(CC) $(CFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \
88 -I../../mercurial \
90 -I../../mercurial \
89 -c -o dirs.o ../../mercurial/cext/dirs.c
91 -c -o dirs.o ../../mercurial/cext/dirs.c
90
92
91 pathencode.o: ../../mercurial/cext/pathencode.c
93 pathencode.o: ../../mercurial/cext/pathencode.c
92 $(CC) $(CFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \
94 $(CC) $(CFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \
93 -I../../mercurial \
95 -I../../mercurial \
94 -c -o pathencode.o ../../mercurial/cext/pathencode.c
96 -c -o pathencode.o ../../mercurial/cext/pathencode.c
95
97
96 revlog.o: ../../mercurial/cext/revlog.c
98 revlog.o: ../../mercurial/cext/revlog.c
97 $(CC) $(CFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \
99 $(CC) $(CFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \
98 -I../../mercurial \
100 -I../../mercurial \
99 -c -o revlog.o ../../mercurial/cext/revlog.c
101 -c -o revlog.o ../../mercurial/cext/revlog.c
100
102
101 dirs_fuzzer: dirs.cc manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o
103 dirs_fuzzer: dirs.cc manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o
102 $(CXX) $(CXXFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \
104 $(CXX) $(CXXFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \
103 -Wno-register -Wno-macro-redefined \
105 -Wno-register -Wno-macro-redefined \
104 -I../../mercurial dirs.cc \
106 -I../../mercurial dirs.cc \
105 manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o \
107 manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o \
106 $(LIB_FUZZING_ENGINE) `$$OUT/sanpy/bin/python-config --ldflags` \
108 $(LIB_FUZZING_ENGINE) `$$OUT/sanpy/bin/python-config --ldflags` \
107 -o $$OUT/dirs_fuzzer
109 -o $$OUT/dirs_fuzzer
108
110
109 fncache_fuzzer: fncache.cc manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o
111 fncache_fuzzer: fncache.cc manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o
110 $(CXX) $(CXXFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \
112 $(CXX) $(CXXFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \
111 -Wno-register -Wno-macro-redefined \
113 -Wno-register -Wno-macro-redefined \
112 -I../../mercurial fncache.cc \
114 -I../../mercurial fncache.cc \
113 manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o \
115 manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o \
114 $(LIB_FUZZING_ENGINE) `$$OUT/sanpy/bin/python-config --ldflags` \
116 $(LIB_FUZZING_ENGINE) `$$OUT/sanpy/bin/python-config --ldflags` \
115 -o $$OUT/fncache_fuzzer
117 -o $$OUT/fncache_fuzzer
116
118
117 jsonescapeu8fast_fuzzer: jsonescapeu8fast.cc manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o
119 jsonescapeu8fast_fuzzer: jsonescapeu8fast.cc manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o
118 $(CXX) $(CXXFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \
120 $(CXX) $(CXXFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \
119 -Wno-register -Wno-macro-redefined \
121 -Wno-register -Wno-macro-redefined \
120 -I../../mercurial jsonescapeu8fast.cc \
122 -I../../mercurial jsonescapeu8fast.cc \
121 manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o \
123 manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o \
122 $(LIB_FUZZING_ENGINE) `$$OUT/sanpy/bin/python-config --ldflags` \
124 $(LIB_FUZZING_ENGINE) `$$OUT/sanpy/bin/python-config --ldflags` \
123 -o $$OUT/jsonescapeu8fast_fuzzer
125 -o $$OUT/jsonescapeu8fast_fuzzer
124
126
125 manifest_corpus.zip:
127 manifest_corpus.zip:
126 python manifest_corpus.py $$OUT/manifest_fuzzer_seed_corpus.zip
128 python manifest_corpus.py $$OUT/manifest_fuzzer_seed_corpus.zip
127
129
128 manifest_fuzzer: manifest.cc manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o
130 manifest_fuzzer: manifest.cc manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o
129 $(CXX) $(CXXFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \
131 $(CXX) $(CXXFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \
130 -Wno-register -Wno-macro-redefined \
132 -Wno-register -Wno-macro-redefined \
131 -I../../mercurial manifest.cc \
133 -I../../mercurial manifest.cc \
132 manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o \
134 manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o \
133 $(LIB_FUZZING_ENGINE) `$$OUT/sanpy/bin/python-config --ldflags` \
135 $(LIB_FUZZING_ENGINE) `$$OUT/sanpy/bin/python-config --ldflags` \
134 -o $$OUT/manifest_fuzzer
136 -o $$OUT/manifest_fuzzer
135
137
136 revlog_fuzzer: revlog.cc manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o
138 revlog_fuzzer: revlog.cc manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o
137 $(CXX) $(CXXFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \
139 $(CXX) $(CXXFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \
138 -Wno-register -Wno-macro-redefined \
140 -Wno-register -Wno-macro-redefined \
139 -I../../mercurial revlog.cc \
141 -I../../mercurial revlog.cc \
140 manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o \
142 manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o \
141 $(LIB_FUZZING_ENGINE) `$$OUT/sanpy/bin/python-config --ldflags` \
143 $(LIB_FUZZING_ENGINE) `$$OUT/sanpy/bin/python-config --ldflags` \
142 -o $$OUT/revlog_fuzzer
144 -o $$OUT/revlog_fuzzer
143
145
144 revlog_corpus.zip:
146 revlog_corpus.zip:
145 python revlog_corpus.py $$OUT/revlog_fuzzer_seed_corpus.zip
147 python revlog_corpus.py $$OUT/revlog_fuzzer_seed_corpus.zip
146
148
147 dirstate_fuzzer: dirstate.cc manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o
149 dirstate_fuzzer: dirstate.cc manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o
148 $(CXX) $(CXXFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \
150 $(CXX) $(CXXFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \
149 -Wno-register -Wno-macro-redefined \
151 -Wno-register -Wno-macro-redefined \
150 -I../../mercurial dirstate.cc \
152 -I../../mercurial dirstate.cc \
151 manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o \
153 manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o \
152 $(LIB_FUZZING_ENGINE) `$$OUT/sanpy/bin/python-config --ldflags` \
154 $(LIB_FUZZING_ENGINE) `$$OUT/sanpy/bin/python-config --ldflags` \
153 -o $$OUT/dirstate_fuzzer
155 -o $$OUT/dirstate_fuzzer
154
156
155 dirstate_corpus.zip:
157 dirstate_corpus.zip:
156 python dirstate_corpus.py $$OUT/dirstate_fuzzer_seed_corpus.zip
158 python dirstate_corpus.py $$OUT/dirstate_fuzzer_seed_corpus.zip
157
159
158 fm1readmarkers_fuzzer: fm1readmarkers.cc manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o
160 fm1readmarkers_fuzzer: fm1readmarkers.cc manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o
159 $(CXX) $(CXXFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \
161 $(CXX) $(CXXFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \
160 -Wno-register -Wno-macro-redefined \
162 -Wno-register -Wno-macro-redefined \
161 -I../../mercurial fm1readmarkers.cc \
163 -I../../mercurial fm1readmarkers.cc \
162 manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o \
164 manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o \
163 $(LIB_FUZZING_ENGINE) `$$OUT/sanpy/bin/python-config --ldflags` \
165 $(LIB_FUZZING_ENGINE) `$$OUT/sanpy/bin/python-config --ldflags` \
164 -o $$OUT/fm1readmarkers_fuzzer
166 -o $$OUT/fm1readmarkers_fuzzer
165
167
166 fm1readmarkers_corpus.zip:
168 fm1readmarkers_corpus.zip:
167 python fm1readmarkers_corpus.py $$OUT/fm1readmarkers_fuzzer_seed_corpus.zip
169 python fm1readmarkers_corpus.py $$OUT/fm1readmarkers_fuzzer_seed_corpus.zip
168
170
169 clean:
171 clean:
170 $(RM) *.o *_fuzzer \
172 $(RM) *.o *_fuzzer \
171 bdiff \
173 bdiff \
172 mpatch \
174 mpatch \
173 xdiff
175 xdiff
174
176
175 oss-fuzz: bdiff_fuzzer mpatch_fuzzer mpatch_corpus.zip xdiff_fuzzer dirs_fuzzer fncache_fuzzer jsonescapeu8fast_fuzzer manifest_fuzzer manifest_corpus.zip revlog_fuzzer revlog_corpus.zip dirstate_fuzzer dirstate_corpus.zip fm1readmarkers_fuzzer fm1readmarkers_corpus.zip
177 oss-fuzz: bdiff_fuzzer mpatch_fuzzer mpatch_corpus.zip xdiff_fuzzer dirs_fuzzer fncache_fuzzer jsonescapeu8fast_fuzzer manifest_fuzzer manifest_corpus.zip revlog_fuzzer revlog_corpus.zip dirstate_fuzzer dirstate_corpus.zip fm1readmarkers_fuzzer fm1readmarkers_corpus.zip
176
178
177 .PHONY: all clean oss-fuzz
179 .PHONY: all clean oss-fuzz
General Comments 0
You need to be logged in to leave comments. Login now