Mercurial > hg-stable
annotate contrib/fuzz/Makefile @ 36708:624cbd1477a6
fuzz: add a fuzzer for xdiff
Based entirely on the fuzzer for bdiff.
Differential Revision: https://phab.mercurial-scm.org/D2632
author | Augie Fackler <augie@google.com> |
---|---|
date | Sat, 03 Mar 2018 18:58:13 -0500 |
parents | 2b9e2415f5b5 |
children | 04d64163039a |
rev | line source |
---|---|
35670
2b9e2415f5b5
contrib: add some basic scaffolding for some fuzz test targets
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
1 bdiff.o: ../../mercurial/bdiff.c |
2b9e2415f5b5
contrib: add some basic scaffolding for some fuzz test targets
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
2 clang -g -O1 -fsanitize=fuzzer-no-link,address -c -o bdiff.o \ |
2b9e2415f5b5
contrib: add some basic scaffolding for some fuzz test targets
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
3 ../../mercurial/bdiff.c |
2b9e2415f5b5
contrib: add some basic scaffolding for some fuzz test targets
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
4 |
2b9e2415f5b5
contrib: add some basic scaffolding for some fuzz test targets
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
5 bdiff: bdiff.cc bdiff.o |
2b9e2415f5b5
contrib: add some basic scaffolding for some fuzz test targets
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
6 clang -DHG_FUZZER_INCLUDE_MAIN=1 -g -O1 -fsanitize=fuzzer-no-link,address \ |
2b9e2415f5b5
contrib: add some basic scaffolding for some fuzz test targets
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
7 -I../../mercurial bdiff.cc bdiff.o -o bdiff |
2b9e2415f5b5
contrib: add some basic scaffolding for some fuzz test targets
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
8 |
2b9e2415f5b5
contrib: add some basic scaffolding for some fuzz test targets
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
9 bdiff-oss-fuzz.o: ../../mercurial/bdiff.c |
2b9e2415f5b5
contrib: add some basic scaffolding for some fuzz test targets
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
10 $$CC $$CFLAGS -c -o bdiff-oss-fuzz.o ../../mercurial/bdiff.c |
2b9e2415f5b5
contrib: add some basic scaffolding for some fuzz test targets
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
11 |
2b9e2415f5b5
contrib: add some basic scaffolding for some fuzz test targets
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
12 bdiff_fuzzer: bdiff.cc bdiff-oss-fuzz.o |
2b9e2415f5b5
contrib: add some basic scaffolding for some fuzz test targets
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
13 $$CXX $$CXXFLAGS -std=c++11 -I../../mercurial bdiff.cc \ |
2b9e2415f5b5
contrib: add some basic scaffolding for some fuzz test targets
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
14 bdiff-oss-fuzz.o -lFuzzingEngine -o $$OUT/bdiff_fuzzer |
2b9e2415f5b5
contrib: add some basic scaffolding for some fuzz test targets
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
15 |
36708
624cbd1477a6
fuzz: add a fuzzer for xdiff
Augie Fackler <augie@google.com>
parents:
35670
diff
changeset
|
16 x%.o: ../../mercurial/thirdparty/xdiff/x%.c ../../mercurial/thirdparty/xdiff/*.h |
624cbd1477a6
fuzz: add a fuzzer for xdiff
Augie Fackler <augie@google.com>
parents:
35670
diff
changeset
|
17 clang -g -O1 -fsanitize=fuzzer-no-link,address -c \ |
624cbd1477a6
fuzz: add a fuzzer for xdiff
Augie Fackler <augie@google.com>
parents:
35670
diff
changeset
|
18 -o $@ \ |
624cbd1477a6
fuzz: add a fuzzer for xdiff
Augie Fackler <augie@google.com>
parents:
35670
diff
changeset
|
19 $< |
624cbd1477a6
fuzz: add a fuzzer for xdiff
Augie Fackler <augie@google.com>
parents:
35670
diff
changeset
|
20 |
624cbd1477a6
fuzz: add a fuzzer for xdiff
Augie Fackler <augie@google.com>
parents:
35670
diff
changeset
|
21 xdiff: xdiff.cc xdiffi.o xemit.o xmerge.o xprepare.o xutils.o |
624cbd1477a6
fuzz: add a fuzzer for xdiff
Augie Fackler <augie@google.com>
parents:
35670
diff
changeset
|
22 clang -DHG_FUZZER_INCLUDE_MAIN=1 -g -O1 -fsanitize=fuzzer-no-link,address \ |
624cbd1477a6
fuzz: add a fuzzer for xdiff
Augie Fackler <augie@google.com>
parents:
35670
diff
changeset
|
23 -I../../mercurial xdiff.cc \ |
624cbd1477a6
fuzz: add a fuzzer for xdiff
Augie Fackler <augie@google.com>
parents:
35670
diff
changeset
|
24 xdiffi.o xemit.o xmerge.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
|
25 |
36708
624cbd1477a6
fuzz: add a fuzzer for xdiff
Augie Fackler <augie@google.com>
parents:
35670
diff
changeset
|
26 fuzz-x%.o: ../../mercurial/thirdparty/xdiff/x%.c ../../mercurial/thirdparty/xdiff/*.h |
624cbd1477a6
fuzz: add a fuzzer for xdiff
Augie Fackler <augie@google.com>
parents:
35670
diff
changeset
|
27 $$CC $$CFLAGS -c \ |
624cbd1477a6
fuzz: add a fuzzer for xdiff
Augie Fackler <augie@google.com>
parents:
35670
diff
changeset
|
28 -o $@ \ |
624cbd1477a6
fuzz: add a fuzzer for xdiff
Augie Fackler <augie@google.com>
parents:
35670
diff
changeset
|
29 $< |
624cbd1477a6
fuzz: add a fuzzer for xdiff
Augie Fackler <augie@google.com>
parents:
35670
diff
changeset
|
30 |
624cbd1477a6
fuzz: add a fuzzer for xdiff
Augie Fackler <augie@google.com>
parents:
35670
diff
changeset
|
31 xdiff_fuzzer: xdiff.cc fuzz-xdiffi.o fuzz-xemit.o fuzz-xmerge.o fuzz-xprepare.o fuzz-xutils.o |
624cbd1477a6
fuzz: add a fuzzer for xdiff
Augie Fackler <augie@google.com>
parents:
35670
diff
changeset
|
32 $$CXX $$CXXFLAGS -std=c++11 -I../../mercurial xdiff.cc \ |
624cbd1477a6
fuzz: add a fuzzer for xdiff
Augie Fackler <augie@google.com>
parents:
35670
diff
changeset
|
33 fuzz-xdiffi.o fuzz-xemit.o fuzz-xmerge.o fuzz-xprepare.o fuzz-xutils.o \ |
624cbd1477a6
fuzz: add a fuzzer for xdiff
Augie Fackler <augie@google.com>
parents:
35670
diff
changeset
|
34 -lFuzzingEngine -o $$OUT/xdiff_fuzzer |
624cbd1477a6
fuzz: add a fuzzer for xdiff
Augie Fackler <augie@google.com>
parents:
35670
diff
changeset
|
35 |
624cbd1477a6
fuzz: add a fuzzer for xdiff
Augie Fackler <augie@google.com>
parents:
35670
diff
changeset
|
36 all: bdiff xdiff |
624cbd1477a6
fuzz: add a fuzzer for xdiff
Augie Fackler <augie@google.com>
parents:
35670
diff
changeset
|
37 |
624cbd1477a6
fuzz: add a fuzzer for xdiff
Augie Fackler <augie@google.com>
parents:
35670
diff
changeset
|
38 oss-fuzz: bdiff_fuzzer xdiff_fuzzer |
35670
2b9e2415f5b5
contrib: add some basic scaffolding for some fuzz test targets
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
39 |
2b9e2415f5b5
contrib: add some basic scaffolding for some fuzz test targets
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
40 .PHONY: all oss-fuzz |