Mercurial > hg
annotate contrib/fuzz/Makefile @ 43812:bf0453866c80
fuzz: use a variable to allow specifying python-config to use
Eventually we should probably default this to just `python-config` and have
the oss-fuzz build.sh script specify the sanpy python-config, but for now this
lets us make progress.
Differential Revision: https://phab.mercurial-scm.org/D7563
author | Augie Fackler <augie@google.com> |
---|---|
date | Fri, 06 Dec 2019 15:15:05 -0500 |
parents | d1587fadff06 |
children | 5a9e2ae9899b |
rev | line source |
---|---|
38230
bf901559e647
fuzz: expand variables by make
Yuya Nishihara <yuya@tcha.org>
parents:
38175
diff
changeset
|
1 CC = clang |
bf901559e647
fuzz: expand variables by make
Yuya Nishihara <yuya@tcha.org>
parents:
38175
diff
changeset
|
2 CXX = clang++ |
bf901559e647
fuzz: expand variables by make
Yuya Nishihara <yuya@tcha.org>
parents:
38175
diff
changeset
|
3 |
43810
53f582bee3d1
fuzz: follow modern guidelines and use LIB_FUZZING_ENGINE
Augie Fackler <augie@google.com>
parents:
43615
diff
changeset
|
4 LIB_FUZZING_ENGINE ?= -lFuzzingEngine |
53f582bee3d1
fuzz: follow modern guidelines and use LIB_FUZZING_ENGINE
Augie Fackler <augie@google.com>
parents:
43615
diff
changeset
|
5 |
43812
bf0453866c80
fuzz: use a variable to allow specifying python-config to use
Augie Fackler <augie@google.com>
parents:
43811
diff
changeset
|
6 PYTHON_CONFIG ?= $$OUT/sanpy/bin/python-config |
bf0453866c80
fuzz: use a variable to allow specifying python-config to use
Augie Fackler <augie@google.com>
parents:
43811
diff
changeset
|
7 |
43811
d1587fadff06
fuzz: suppress deprecated-register warnings in our compile
Augie Fackler <augie@google.com>
parents:
43810
diff
changeset
|
8 CXXFLAGS += -Wno-deprecated-register |
d1587fadff06
fuzz: suppress deprecated-register warnings in our compile
Augie Fackler <augie@google.com>
parents:
43810
diff
changeset
|
9 |
38246
46dcb9f14900
fuzz: new fuzzer for the mpatch code
Augie Fackler <augie@google.com>
parents:
38234
diff
changeset
|
10 all: bdiff mpatch xdiff |
38231
4dd3b6c68f96
fuzz: fix the default make target
Yuya Nishihara <yuya@tcha.org>
parents:
38230
diff
changeset
|
11 |
41013
ef103c96ed33
fuzz: extract Python initialization to utility package
Augie Fackler <augie@google.com>
parents:
41012
diff
changeset
|
12 pyutil.o: pyutil.cc pyutil.h |
ef103c96ed33
fuzz: extract Python initialization to utility package
Augie Fackler <augie@google.com>
parents:
41012
diff
changeset
|
13 $(CXX) $(CXXFLAGS) -g -O1 \ |
43812
bf0453866c80
fuzz: use a variable to allow specifying python-config to use
Augie Fackler <augie@google.com>
parents:
43811
diff
changeset
|
14 `$(PYTHON_CONFIG) --cflags` \ |
41013
ef103c96ed33
fuzz: extract Python initialization to utility package
Augie Fackler <augie@google.com>
parents:
41012
diff
changeset
|
15 -I../../mercurial -c -o pyutil.o pyutil.cc |
ef103c96ed33
fuzz: extract Python initialization to utility package
Augie Fackler <augie@google.com>
parents:
41012
diff
changeset
|
16 |
35670
2b9e2415f5b5
contrib: add some basic scaffolding for some fuzz test targets
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
17 bdiff.o: ../../mercurial/bdiff.c |
38230
bf901559e647
fuzz: expand variables by make
Yuya Nishihara <yuya@tcha.org>
parents:
38175
diff
changeset
|
18 $(CC) $(CFLAGS) -fsanitize=fuzzer-no-link,address -c -o bdiff.o \ |
35670
2b9e2415f5b5
contrib: add some basic scaffolding for some fuzz test targets
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
19 ../../mercurial/bdiff.c |
2b9e2415f5b5
contrib: add some basic scaffolding for some fuzz test targets
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
20 |
43615
6f5c352f41b6
fuzz: clean out most of fuzzutil
Augie Fackler <augie@google.com>
parents:
43153
diff
changeset
|
21 bdiff: bdiff.cc bdiff.o |
38230
bf901559e647
fuzz: expand variables by make
Yuya Nishihara <yuya@tcha.org>
parents:
38175
diff
changeset
|
22 $(CXX) $(CXXFLAGS) -DHG_FUZZER_INCLUDE_MAIN=1 -g -O1 -fsanitize=fuzzer-no-link,address \ |
38173
fa0ddd5e8fff
fuzz: extract some common utilities and use modern C++ idioms
Augie Fackler <augie@google.com>
parents:
36765
diff
changeset
|
23 -std=c++17 \ |
43615
6f5c352f41b6
fuzz: clean out most of fuzzutil
Augie Fackler <augie@google.com>
parents:
43153
diff
changeset
|
24 -I../../mercurial bdiff.cc bdiff.o -o bdiff |
35670
2b9e2415f5b5
contrib: add some basic scaffolding for some fuzz test targets
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
25 |
2b9e2415f5b5
contrib: add some basic scaffolding for some fuzz test targets
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
26 bdiff-oss-fuzz.o: ../../mercurial/bdiff.c |
38230
bf901559e647
fuzz: expand variables by make
Yuya Nishihara <yuya@tcha.org>
parents:
38175
diff
changeset
|
27 $(CC) $(CFLAGS) -c -o bdiff-oss-fuzz.o ../../mercurial/bdiff.c |
35670
2b9e2415f5b5
contrib: add some basic scaffolding for some fuzz test targets
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
28 |
43615
6f5c352f41b6
fuzz: clean out most of fuzzutil
Augie Fackler <augie@google.com>
parents:
43153
diff
changeset
|
29 bdiff_fuzzer: bdiff.cc bdiff-oss-fuzz.o |
38230
bf901559e647
fuzz: expand variables by make
Yuya Nishihara <yuya@tcha.org>
parents:
38175
diff
changeset
|
30 $(CXX) $(CXXFLAGS) -std=c++17 -I../../mercurial bdiff.cc \ |
43810
53f582bee3d1
fuzz: follow modern guidelines and use LIB_FUZZING_ENGINE
Augie Fackler <augie@google.com>
parents:
43615
diff
changeset
|
31 bdiff-oss-fuzz.o $(LIB_FUZZING_ENGINE) -o \ |
38174
36d55f90e2a3
fuzzutil: make it possible to use absl when C++17 isn't supported
Augie Fackler <augie@google.com>
parents:
38173
diff
changeset
|
32 $$OUT/bdiff_fuzzer |
35670
2b9e2415f5b5
contrib: add some basic scaffolding for some fuzz test targets
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
33 |
38246
46dcb9f14900
fuzz: new fuzzer for the mpatch code
Augie Fackler <augie@google.com>
parents:
38234
diff
changeset
|
34 mpatch.o: ../../mercurial/mpatch.c |
46dcb9f14900
fuzz: new fuzzer for the mpatch code
Augie Fackler <augie@google.com>
parents:
38234
diff
changeset
|
35 $(CC) -g -O1 -fsanitize=fuzzer-no-link,address -c -o mpatch.o \ |
46dcb9f14900
fuzz: new fuzzer for the mpatch code
Augie Fackler <augie@google.com>
parents:
38234
diff
changeset
|
36 ../../mercurial/mpatch.c |
46dcb9f14900
fuzz: new fuzzer for the mpatch code
Augie Fackler <augie@google.com>
parents:
38234
diff
changeset
|
37 |
46dcb9f14900
fuzz: new fuzzer for the mpatch code
Augie Fackler <augie@google.com>
parents:
38234
diff
changeset
|
38 mpatch: CXXFLAGS += -std=c++17 |
43615
6f5c352f41b6
fuzz: clean out most of fuzzutil
Augie Fackler <augie@google.com>
parents:
43153
diff
changeset
|
39 mpatch: mpatch.cc mpatch.o |
38246
46dcb9f14900
fuzz: new fuzzer for the mpatch code
Augie Fackler <augie@google.com>
parents:
38234
diff
changeset
|
40 $(CXX) $(CXXFLAGS) -DHG_FUZZER_INCLUDE_MAIN=1 -g -O1 -fsanitize=fuzzer-no-link,address \ |
43615
6f5c352f41b6
fuzz: clean out most of fuzzutil
Augie Fackler <augie@google.com>
parents:
43153
diff
changeset
|
41 -I../../mercurial mpatch.cc mpatch.o -o mpatch |
38246
46dcb9f14900
fuzz: new fuzzer for the mpatch code
Augie Fackler <augie@google.com>
parents:
38234
diff
changeset
|
42 |
46dcb9f14900
fuzz: new fuzzer for the mpatch code
Augie Fackler <augie@google.com>
parents:
38234
diff
changeset
|
43 mpatch-oss-fuzz.o: ../../mercurial/mpatch.c |
46dcb9f14900
fuzz: new fuzzer for the mpatch code
Augie Fackler <augie@google.com>
parents:
38234
diff
changeset
|
44 $(CC) $(CFLAGS) -c -o mpatch-oss-fuzz.o ../../mercurial/mpatch.c |
46dcb9f14900
fuzz: new fuzzer for the mpatch code
Augie Fackler <augie@google.com>
parents:
38234
diff
changeset
|
45 |
43615
6f5c352f41b6
fuzz: clean out most of fuzzutil
Augie Fackler <augie@google.com>
parents:
43153
diff
changeset
|
46 mpatch_fuzzer: mpatch.cc mpatch-oss-fuzz.o |
38246
46dcb9f14900
fuzz: new fuzzer for the mpatch code
Augie Fackler <augie@google.com>
parents:
38234
diff
changeset
|
47 $(CXX) $(CXXFLAGS) -std=c++17 -I../../mercurial mpatch.cc \ |
43810
53f582bee3d1
fuzz: follow modern guidelines and use LIB_FUZZING_ENGINE
Augie Fackler <augie@google.com>
parents:
43615
diff
changeset
|
48 mpatch-oss-fuzz.o $(LIB_FUZZING_ENGINE) -o \ |
38246
46dcb9f14900
fuzz: new fuzzer for the mpatch code
Augie Fackler <augie@google.com>
parents:
38234
diff
changeset
|
49 $$OUT/mpatch_fuzzer |
46dcb9f14900
fuzz: new fuzzer for the mpatch code
Augie Fackler <augie@google.com>
parents:
38234
diff
changeset
|
50 |
46dcb9f14900
fuzz: new fuzzer for the mpatch code
Augie Fackler <augie@google.com>
parents:
38234
diff
changeset
|
51 mpatch_corpus.zip: |
46dcb9f14900
fuzz: new fuzzer for the mpatch code
Augie Fackler <augie@google.com>
parents:
38234
diff
changeset
|
52 python mpatch_corpus.py $$OUT/mpatch_fuzzer_seed_corpus.zip |
46dcb9f14900
fuzz: new fuzzer for the mpatch code
Augie Fackler <augie@google.com>
parents:
38234
diff
changeset
|
53 |
36679
624cbd1477a6
fuzz: add a fuzzer for xdiff
Augie Fackler <augie@google.com>
parents:
35670
diff
changeset
|
54 x%.o: ../../mercurial/thirdparty/xdiff/x%.c ../../mercurial/thirdparty/xdiff/*.h |
38230
bf901559e647
fuzz: expand variables by make
Yuya Nishihara <yuya@tcha.org>
parents:
38175
diff
changeset
|
55 $(CC) -g -O1 -fsanitize=fuzzer-no-link,address -c \ |
36679
624cbd1477a6
fuzz: add a fuzzer for xdiff
Augie Fackler <augie@google.com>
parents:
35670
diff
changeset
|
56 -o $@ \ |
624cbd1477a6
fuzz: add a fuzzer for xdiff
Augie Fackler <augie@google.com>
parents:
35670
diff
changeset
|
57 $< |
624cbd1477a6
fuzz: add a fuzzer for xdiff
Augie Fackler <augie@google.com>
parents:
35670
diff
changeset
|
58 |
38233
74f89b7a4268
fuzz: compile xdiff.cc with -std=c++17
Yuya Nishihara <yuya@tcha.org>
parents:
38231
diff
changeset
|
59 xdiff: CXXFLAGS += -std=c++17 |
43615
6f5c352f41b6
fuzz: clean out most of fuzzutil
Augie Fackler <augie@google.com>
parents:
43153
diff
changeset
|
60 xdiff: xdiff.cc xdiffi.o xprepare.o xutils.o |
38230
bf901559e647
fuzz: expand variables by make
Yuya Nishihara <yuya@tcha.org>
parents:
38175
diff
changeset
|
61 $(CXX) $(CXXFLAGS) -DHG_FUZZER_INCLUDE_MAIN=1 -g -O1 -fsanitize=fuzzer-no-link,address \ |
36679
624cbd1477a6
fuzz: add a fuzzer for xdiff
Augie Fackler <augie@google.com>
parents:
35670
diff
changeset
|
62 -I../../mercurial xdiff.cc \ |
43615
6f5c352f41b6
fuzz: clean out most of fuzzutil
Augie Fackler <augie@google.com>
parents:
43153
diff
changeset
|
63 xdiffi.o xprepare.o xutils.o -o xdiff |
35670
2b9e2415f5b5
contrib: add some basic scaffolding for some fuzz test targets
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
64 |
36679
624cbd1477a6
fuzz: add a fuzzer for xdiff
Augie Fackler <augie@google.com>
parents:
35670
diff
changeset
|
65 fuzz-x%.o: ../../mercurial/thirdparty/xdiff/x%.c ../../mercurial/thirdparty/xdiff/*.h |
38230
bf901559e647
fuzz: expand variables by make
Yuya Nishihara <yuya@tcha.org>
parents:
38175
diff
changeset
|
66 $(CC) $(CFLAGS) -c \ |
36679
624cbd1477a6
fuzz: add a fuzzer for xdiff
Augie Fackler <augie@google.com>
parents:
35670
diff
changeset
|
67 -o $@ \ |
624cbd1477a6
fuzz: add a fuzzer for xdiff
Augie Fackler <augie@google.com>
parents:
35670
diff
changeset
|
68 $< |
624cbd1477a6
fuzz: add a fuzzer for xdiff
Augie Fackler <augie@google.com>
parents:
35670
diff
changeset
|
69 |
43615
6f5c352f41b6
fuzz: clean out most of fuzzutil
Augie Fackler <augie@google.com>
parents:
43153
diff
changeset
|
70 xdiff_fuzzer: xdiff.cc fuzz-xdiffi.o fuzz-xprepare.o fuzz-xutils.o |
38230
bf901559e647
fuzz: expand variables by make
Yuya Nishihara <yuya@tcha.org>
parents:
38175
diff
changeset
|
71 $(CXX) $(CXXFLAGS) -std=c++17 -I../../mercurial xdiff.cc \ |
43615
6f5c352f41b6
fuzz: clean out most of fuzzutil
Augie Fackler <augie@google.com>
parents:
43153
diff
changeset
|
72 fuzz-xdiffi.o fuzz-xprepare.o fuzz-xutils.o \ |
43810
53f582bee3d1
fuzz: follow modern guidelines and use LIB_FUZZING_ENGINE
Augie Fackler <augie@google.com>
parents:
43615
diff
changeset
|
73 $(LIB_FUZZING_ENGINE) -o $$OUT/xdiff_fuzzer |
36679
624cbd1477a6
fuzz: add a fuzzer for xdiff
Augie Fackler <augie@google.com>
parents:
35670
diff
changeset
|
74 |
41183
c01fac6749e5
fuzz: stop building Python in the Makefile
Augie Fackler <augie@google.com>
parents:
41024
diff
changeset
|
75 manifest.o: ../../mercurial/cext/manifest.c |
43812
bf0453866c80
fuzz: use a variable to allow specifying python-config to use
Augie Fackler <augie@google.com>
parents:
43811
diff
changeset
|
76 $(CC) $(CFLAGS) `$(PYTHON_CONFIG) --cflags` \ |
40053
8c692a6b5ad1
fuzz: new fuzzer for cext/manifest.c
Augie Fackler <augie@google.com>
parents:
38246
diff
changeset
|
77 -I../../mercurial \ |
8c692a6b5ad1
fuzz: new fuzzer for cext/manifest.c
Augie Fackler <augie@google.com>
parents:
38246
diff
changeset
|
78 -c -o manifest.o ../../mercurial/cext/manifest.c |
8c692a6b5ad1
fuzz: new fuzzer for cext/manifest.c
Augie Fackler <augie@google.com>
parents:
38246
diff
changeset
|
79 |
41183
c01fac6749e5
fuzz: stop building Python in the Makefile
Augie Fackler <augie@google.com>
parents:
41024
diff
changeset
|
80 charencode.o: ../../mercurial/cext/charencode.c |
43812
bf0453866c80
fuzz: use a variable to allow specifying python-config to use
Augie Fackler <augie@google.com>
parents:
43811
diff
changeset
|
81 $(CC) $(CFLAGS) `$(PYTHON_CONFIG) --cflags` \ |
40053
8c692a6b5ad1
fuzz: new fuzzer for cext/manifest.c
Augie Fackler <augie@google.com>
parents:
38246
diff
changeset
|
82 -I../../mercurial \ |
8c692a6b5ad1
fuzz: new fuzzer for cext/manifest.c
Augie Fackler <augie@google.com>
parents:
38246
diff
changeset
|
83 -c -o charencode.o ../../mercurial/cext/charencode.c |
8c692a6b5ad1
fuzz: new fuzzer for cext/manifest.c
Augie Fackler <augie@google.com>
parents:
38246
diff
changeset
|
84 |
41183
c01fac6749e5
fuzz: stop building Python in the Makefile
Augie Fackler <augie@google.com>
parents:
41024
diff
changeset
|
85 parsers.o: ../../mercurial/cext/parsers.c |
43812
bf0453866c80
fuzz: use a variable to allow specifying python-config to use
Augie Fackler <augie@google.com>
parents:
43811
diff
changeset
|
86 $(CC) $(CFLAGS) `$(PYTHON_CONFIG) --cflags` \ |
40053
8c692a6b5ad1
fuzz: new fuzzer for cext/manifest.c
Augie Fackler <augie@google.com>
parents:
38246
diff
changeset
|
87 -I../../mercurial \ |
8c692a6b5ad1
fuzz: new fuzzer for cext/manifest.c
Augie Fackler <augie@google.com>
parents:
38246
diff
changeset
|
88 -c -o parsers.o ../../mercurial/cext/parsers.c |
8c692a6b5ad1
fuzz: new fuzzer for cext/manifest.c
Augie Fackler <augie@google.com>
parents:
38246
diff
changeset
|
89 |
41183
c01fac6749e5
fuzz: stop building Python in the Makefile
Augie Fackler <augie@google.com>
parents:
41024
diff
changeset
|
90 dirs.o: ../../mercurial/cext/dirs.c |
43812
bf0453866c80
fuzz: use a variable to allow specifying python-config to use
Augie Fackler <augie@google.com>
parents:
43811
diff
changeset
|
91 $(CC) $(CFLAGS) `$(PYTHON_CONFIG) --cflags` \ |
40053
8c692a6b5ad1
fuzz: new fuzzer for cext/manifest.c
Augie Fackler <augie@google.com>
parents:
38246
diff
changeset
|
92 -I../../mercurial \ |
8c692a6b5ad1
fuzz: new fuzzer for cext/manifest.c
Augie Fackler <augie@google.com>
parents:
38246
diff
changeset
|
93 -c -o dirs.o ../../mercurial/cext/dirs.c |
8c692a6b5ad1
fuzz: new fuzzer for cext/manifest.c
Augie Fackler <augie@google.com>
parents:
38246
diff
changeset
|
94 |
41183
c01fac6749e5
fuzz: stop building Python in the Makefile
Augie Fackler <augie@google.com>
parents:
41024
diff
changeset
|
95 pathencode.o: ../../mercurial/cext/pathencode.c |
43812
bf0453866c80
fuzz: use a variable to allow specifying python-config to use
Augie Fackler <augie@google.com>
parents:
43811
diff
changeset
|
96 $(CC) $(CFLAGS) `$(PYTHON_CONFIG) --cflags` \ |
40053
8c692a6b5ad1
fuzz: new fuzzer for cext/manifest.c
Augie Fackler <augie@google.com>
parents:
38246
diff
changeset
|
97 -I../../mercurial \ |
8c692a6b5ad1
fuzz: new fuzzer for cext/manifest.c
Augie Fackler <augie@google.com>
parents:
38246
diff
changeset
|
98 -c -o pathencode.o ../../mercurial/cext/pathencode.c |
8c692a6b5ad1
fuzz: new fuzzer for cext/manifest.c
Augie Fackler <augie@google.com>
parents:
38246
diff
changeset
|
99 |
41183
c01fac6749e5
fuzz: stop building Python in the Makefile
Augie Fackler <augie@google.com>
parents:
41024
diff
changeset
|
100 revlog.o: ../../mercurial/cext/revlog.c |
43812
bf0453866c80
fuzz: use a variable to allow specifying python-config to use
Augie Fackler <augie@google.com>
parents:
43811
diff
changeset
|
101 $(CC) $(CFLAGS) `$(PYTHON_CONFIG) --cflags` \ |
40053
8c692a6b5ad1
fuzz: new fuzzer for cext/manifest.c
Augie Fackler <augie@google.com>
parents:
38246
diff
changeset
|
102 -I../../mercurial \ |
8c692a6b5ad1
fuzz: new fuzzer for cext/manifest.c
Augie Fackler <augie@google.com>
parents:
38246
diff
changeset
|
103 -c -o revlog.o ../../mercurial/cext/revlog.c |
8c692a6b5ad1
fuzz: new fuzzer for cext/manifest.c
Augie Fackler <augie@google.com>
parents:
38246
diff
changeset
|
104 |
43150
7ff40418c6bf
fuzz: new fuzzer for dirs.c
Augie Fackler <augie@google.com>
parents:
41183
diff
changeset
|
105 dirs_fuzzer: dirs.cc manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o |
43812
bf0453866c80
fuzz: use a variable to allow specifying python-config to use
Augie Fackler <augie@google.com>
parents:
43811
diff
changeset
|
106 $(CXX) $(CXXFLAGS) `$(PYTHON_CONFIG) --cflags` \ |
43150
7ff40418c6bf
fuzz: new fuzzer for dirs.c
Augie Fackler <augie@google.com>
parents:
41183
diff
changeset
|
107 -Wno-register -Wno-macro-redefined \ |
7ff40418c6bf
fuzz: new fuzzer for dirs.c
Augie Fackler <augie@google.com>
parents:
41183
diff
changeset
|
108 -I../../mercurial dirs.cc \ |
7ff40418c6bf
fuzz: new fuzzer for dirs.c
Augie Fackler <augie@google.com>
parents:
41183
diff
changeset
|
109 manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o \ |
43812
bf0453866c80
fuzz: use a variable to allow specifying python-config to use
Augie Fackler <augie@google.com>
parents:
43811
diff
changeset
|
110 $(LIB_FUZZING_ENGINE) `$(PYTHON_CONFIG) --ldflags` \ |
43150
7ff40418c6bf
fuzz: new fuzzer for dirs.c
Augie Fackler <augie@google.com>
parents:
41183
diff
changeset
|
111 -o $$OUT/dirs_fuzzer |
7ff40418c6bf
fuzz: new fuzzer for dirs.c
Augie Fackler <augie@google.com>
parents:
41183
diff
changeset
|
112 |
43152
b37dd26935ee
fuzz: new fuzzer for fncache-related functions
Augie Fackler <augie@google.com>
parents:
43150
diff
changeset
|
113 fncache_fuzzer: fncache.cc manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o |
43812
bf0453866c80
fuzz: use a variable to allow specifying python-config to use
Augie Fackler <augie@google.com>
parents:
43811
diff
changeset
|
114 $(CXX) $(CXXFLAGS) `$(PYTHON_CONFIG) --cflags` \ |
43152
b37dd26935ee
fuzz: new fuzzer for fncache-related functions
Augie Fackler <augie@google.com>
parents:
43150
diff
changeset
|
115 -Wno-register -Wno-macro-redefined \ |
b37dd26935ee
fuzz: new fuzzer for fncache-related functions
Augie Fackler <augie@google.com>
parents:
43150
diff
changeset
|
116 -I../../mercurial fncache.cc \ |
b37dd26935ee
fuzz: new fuzzer for fncache-related functions
Augie Fackler <augie@google.com>
parents:
43150
diff
changeset
|
117 manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o \ |
43812
bf0453866c80
fuzz: use a variable to allow specifying python-config to use
Augie Fackler <augie@google.com>
parents:
43811
diff
changeset
|
118 $(LIB_FUZZING_ENGINE) `$(PYTHON_CONFIG) --ldflags` \ |
43152
b37dd26935ee
fuzz: new fuzzer for fncache-related functions
Augie Fackler <augie@google.com>
parents:
43150
diff
changeset
|
119 -o $$OUT/fncache_fuzzer |
b37dd26935ee
fuzz: new fuzzer for fncache-related functions
Augie Fackler <augie@google.com>
parents:
43150
diff
changeset
|
120 |
43153
741fb1a95da2
fuzz: new target to fuzz jsonescapeu8fast
Augie Fackler <augie@google.com>
parents:
43152
diff
changeset
|
121 jsonescapeu8fast_fuzzer: jsonescapeu8fast.cc manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o |
43812
bf0453866c80
fuzz: use a variable to allow specifying python-config to use
Augie Fackler <augie@google.com>
parents:
43811
diff
changeset
|
122 $(CXX) $(CXXFLAGS) `$(PYTHON_CONFIG) --cflags` \ |
43153
741fb1a95da2
fuzz: new target to fuzz jsonescapeu8fast
Augie Fackler <augie@google.com>
parents:
43152
diff
changeset
|
123 -Wno-register -Wno-macro-redefined \ |
741fb1a95da2
fuzz: new target to fuzz jsonescapeu8fast
Augie Fackler <augie@google.com>
parents:
43152
diff
changeset
|
124 -I../../mercurial jsonescapeu8fast.cc \ |
741fb1a95da2
fuzz: new target to fuzz jsonescapeu8fast
Augie Fackler <augie@google.com>
parents:
43152
diff
changeset
|
125 manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o \ |
43812
bf0453866c80
fuzz: use a variable to allow specifying python-config to use
Augie Fackler <augie@google.com>
parents:
43811
diff
changeset
|
126 $(LIB_FUZZING_ENGINE) `$(PYTHON_CONFIG) --ldflags` \ |
43153
741fb1a95da2
fuzz: new target to fuzz jsonescapeu8fast
Augie Fackler <augie@google.com>
parents:
43152
diff
changeset
|
127 -o $$OUT/jsonescapeu8fast_fuzzer |
741fb1a95da2
fuzz: new target to fuzz jsonescapeu8fast
Augie Fackler <augie@google.com>
parents:
43152
diff
changeset
|
128 |
43150
7ff40418c6bf
fuzz: new fuzzer for dirs.c
Augie Fackler <augie@google.com>
parents:
41183
diff
changeset
|
129 manifest_corpus.zip: |
7ff40418c6bf
fuzz: new fuzzer for dirs.c
Augie Fackler <augie@google.com>
parents:
41183
diff
changeset
|
130 python manifest_corpus.py $$OUT/manifest_fuzzer_seed_corpus.zip |
7ff40418c6bf
fuzz: new fuzzer for dirs.c
Augie Fackler <augie@google.com>
parents:
41183
diff
changeset
|
131 |
41183
c01fac6749e5
fuzz: stop building Python in the Makefile
Augie Fackler <augie@google.com>
parents:
41024
diff
changeset
|
132 manifest_fuzzer: manifest.cc manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o |
43812
bf0453866c80
fuzz: use a variable to allow specifying python-config to use
Augie Fackler <augie@google.com>
parents:
43811
diff
changeset
|
133 $(CXX) $(CXXFLAGS) `$(PYTHON_CONFIG) --cflags` \ |
40053
8c692a6b5ad1
fuzz: new fuzzer for cext/manifest.c
Augie Fackler <augie@google.com>
parents:
38246
diff
changeset
|
134 -Wno-register -Wno-macro-redefined \ |
8c692a6b5ad1
fuzz: new fuzzer for cext/manifest.c
Augie Fackler <augie@google.com>
parents:
38246
diff
changeset
|
135 -I../../mercurial manifest.cc \ |
41013
ef103c96ed33
fuzz: extract Python initialization to utility package
Augie Fackler <augie@google.com>
parents:
41012
diff
changeset
|
136 manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o \ |
43812
bf0453866c80
fuzz: use a variable to allow specifying python-config to use
Augie Fackler <augie@google.com>
parents:
43811
diff
changeset
|
137 $(LIB_FUZZING_ENGINE) `$(PYTHON_CONFIG) --ldflags` \ |
40053
8c692a6b5ad1
fuzz: new fuzzer for cext/manifest.c
Augie Fackler <augie@google.com>
parents:
38246
diff
changeset
|
138 -o $$OUT/manifest_fuzzer |
8c692a6b5ad1
fuzz: new fuzzer for cext/manifest.c
Augie Fackler <augie@google.com>
parents:
38246
diff
changeset
|
139 |
41183
c01fac6749e5
fuzz: stop building Python in the Makefile
Augie Fackler <augie@google.com>
parents:
41024
diff
changeset
|
140 revlog_fuzzer: revlog.cc manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o |
43812
bf0453866c80
fuzz: use a variable to allow specifying python-config to use
Augie Fackler <augie@google.com>
parents:
43811
diff
changeset
|
141 $(CXX) $(CXXFLAGS) `$(PYTHON_CONFIG) --cflags` \ |
41014
c06f0ef9a5ba
fuzz: new fuzzer for revlog's parse_index2 method
Augie Fackler <augie@google.com>
parents:
41013
diff
changeset
|
142 -Wno-register -Wno-macro-redefined \ |
c06f0ef9a5ba
fuzz: new fuzzer for revlog's parse_index2 method
Augie Fackler <augie@google.com>
parents:
41013
diff
changeset
|
143 -I../../mercurial revlog.cc \ |
c06f0ef9a5ba
fuzz: new fuzzer for revlog's parse_index2 method
Augie Fackler <augie@google.com>
parents:
41013
diff
changeset
|
144 manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o \ |
43812
bf0453866c80
fuzz: use a variable to allow specifying python-config to use
Augie Fackler <augie@google.com>
parents:
43811
diff
changeset
|
145 $(LIB_FUZZING_ENGINE) `$(PYTHON_CONFIG) --ldflags` \ |
41014
c06f0ef9a5ba
fuzz: new fuzzer for revlog's parse_index2 method
Augie Fackler <augie@google.com>
parents:
41013
diff
changeset
|
146 -o $$OUT/revlog_fuzzer |
c06f0ef9a5ba
fuzz: new fuzzer for revlog's parse_index2 method
Augie Fackler <augie@google.com>
parents:
41013
diff
changeset
|
147 |
c06f0ef9a5ba
fuzz: new fuzzer for revlog's parse_index2 method
Augie Fackler <augie@google.com>
parents:
41013
diff
changeset
|
148 revlog_corpus.zip: |
c06f0ef9a5ba
fuzz: new fuzzer for revlog's parse_index2 method
Augie Fackler <augie@google.com>
parents:
41013
diff
changeset
|
149 python revlog_corpus.py $$OUT/revlog_fuzzer_seed_corpus.zip |
c06f0ef9a5ba
fuzz: new fuzzer for revlog's parse_index2 method
Augie Fackler <augie@google.com>
parents:
41013
diff
changeset
|
150 |
41183
c01fac6749e5
fuzz: stop building Python in the Makefile
Augie Fackler <augie@google.com>
parents:
41024
diff
changeset
|
151 dirstate_fuzzer: dirstate.cc manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o |
43812
bf0453866c80
fuzz: use a variable to allow specifying python-config to use
Augie Fackler <augie@google.com>
parents:
43811
diff
changeset
|
152 $(CXX) $(CXXFLAGS) `$(PYTHON_CONFIG) --cflags` \ |
41015
b444407f635b
fuzz: new fuzzer for dirstate parser
Augie Fackler <augie@google.com>
parents:
41014
diff
changeset
|
153 -Wno-register -Wno-macro-redefined \ |
b444407f635b
fuzz: new fuzzer for dirstate parser
Augie Fackler <augie@google.com>
parents:
41014
diff
changeset
|
154 -I../../mercurial dirstate.cc \ |
b444407f635b
fuzz: new fuzzer for dirstate parser
Augie Fackler <augie@google.com>
parents:
41014
diff
changeset
|
155 manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o \ |
43812
bf0453866c80
fuzz: use a variable to allow specifying python-config to use
Augie Fackler <augie@google.com>
parents:
43811
diff
changeset
|
156 $(LIB_FUZZING_ENGINE) `$(PYTHON_CONFIG) --ldflags` \ |
41015
b444407f635b
fuzz: new fuzzer for dirstate parser
Augie Fackler <augie@google.com>
parents:
41014
diff
changeset
|
157 -o $$OUT/dirstate_fuzzer |
b444407f635b
fuzz: new fuzzer for dirstate parser
Augie Fackler <augie@google.com>
parents:
41014
diff
changeset
|
158 |
b444407f635b
fuzz: new fuzzer for dirstate parser
Augie Fackler <augie@google.com>
parents:
41014
diff
changeset
|
159 dirstate_corpus.zip: |
b444407f635b
fuzz: new fuzzer for dirstate parser
Augie Fackler <augie@google.com>
parents:
41014
diff
changeset
|
160 python dirstate_corpus.py $$OUT/dirstate_fuzzer_seed_corpus.zip |
b444407f635b
fuzz: new fuzzer for dirstate parser
Augie Fackler <augie@google.com>
parents:
41014
diff
changeset
|
161 |
41183
c01fac6749e5
fuzz: stop building Python in the Makefile
Augie Fackler <augie@google.com>
parents:
41024
diff
changeset
|
162 fm1readmarkers_fuzzer: fm1readmarkers.cc manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o |
43812
bf0453866c80
fuzz: use a variable to allow specifying python-config to use
Augie Fackler <augie@google.com>
parents:
43811
diff
changeset
|
163 $(CXX) $(CXXFLAGS) `$(PYTHON_CONFIG) --cflags` \ |
41024
6a951f535fee
fuzz: new fuzzer for parsers.fm1readmarkers
Augie Fackler <augie@google.com>
parents:
41015
diff
changeset
|
164 -Wno-register -Wno-macro-redefined \ |
6a951f535fee
fuzz: new fuzzer for parsers.fm1readmarkers
Augie Fackler <augie@google.com>
parents:
41015
diff
changeset
|
165 -I../../mercurial fm1readmarkers.cc \ |
6a951f535fee
fuzz: new fuzzer for parsers.fm1readmarkers
Augie Fackler <augie@google.com>
parents:
41015
diff
changeset
|
166 manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o \ |
43812
bf0453866c80
fuzz: use a variable to allow specifying python-config to use
Augie Fackler <augie@google.com>
parents:
43811
diff
changeset
|
167 $(LIB_FUZZING_ENGINE) `$(PYTHON_CONFIG) --ldflags` \ |
41024
6a951f535fee
fuzz: new fuzzer for parsers.fm1readmarkers
Augie Fackler <augie@google.com>
parents:
41015
diff
changeset
|
168 -o $$OUT/fm1readmarkers_fuzzer |
6a951f535fee
fuzz: new fuzzer for parsers.fm1readmarkers
Augie Fackler <augie@google.com>
parents:
41015
diff
changeset
|
169 |
6a951f535fee
fuzz: new fuzzer for parsers.fm1readmarkers
Augie Fackler <augie@google.com>
parents:
41015
diff
changeset
|
170 fm1readmarkers_corpus.zip: |
6a951f535fee
fuzz: new fuzzer for parsers.fm1readmarkers
Augie Fackler <augie@google.com>
parents:
41015
diff
changeset
|
171 python fm1readmarkers_corpus.py $$OUT/fm1readmarkers_fuzzer_seed_corpus.zip |
6a951f535fee
fuzz: new fuzzer for parsers.fm1readmarkers
Augie Fackler <augie@google.com>
parents:
41015
diff
changeset
|
172 |
38175 | 173 clean: |
38234
9db30f438ddd
fuzz: fix "make clean" to pass even if no binaries built yet
Yuya Nishihara <yuya@tcha.org>
parents:
38233
diff
changeset
|
174 $(RM) *.o *_fuzzer \ |
38175 | 175 bdiff \ |
38246
46dcb9f14900
fuzz: new fuzzer for the mpatch code
Augie Fackler <augie@google.com>
parents:
38234
diff
changeset
|
176 mpatch \ |
38175 | 177 xdiff |
178 | |
43153
741fb1a95da2
fuzz: new target to fuzz jsonescapeu8fast
Augie Fackler <augie@google.com>
parents:
43152
diff
changeset
|
179 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 |
35670
2b9e2415f5b5
contrib: add some basic scaffolding for some fuzz test targets
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
180 |
41183
c01fac6749e5
fuzz: stop building Python in the Makefile
Augie Fackler <augie@google.com>
parents:
41024
diff
changeset
|
181 .PHONY: all clean oss-fuzz |