D7567: fuzz: remove legacy setup for running fuzzers outside oss-fuzz

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Fri Dec 6 20:52:00 UTC 2019


durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  We don't need this anymore.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D7567

AFFECTED FILES
  contrib/fuzz/Makefile
  contrib/fuzz/bdiff.cc
  contrib/fuzz/mpatch.cc
  contrib/fuzz/xdiff.cc

CHANGE DETAILS

diff --git a/contrib/fuzz/xdiff.cc b/contrib/fuzz/xdiff.cc
--- a/contrib/fuzz/xdiff.cc
+++ b/contrib/fuzz/xdiff.cc
@@ -55,12 +55,4 @@
 	return 0; // Non-zero return values are reserved for future use.
 }
 
-#ifdef HG_FUZZER_INCLUDE_MAIN
-int main(int argc, char **argv)
-{
-	const char data[] = "asdf";
-	return LLVMFuzzerTestOneInput((const uint8_t *)data, 4);
-}
-#endif
-
 } // extern "C"
diff --git a/contrib/fuzz/mpatch.cc b/contrib/fuzz/mpatch.cc
--- a/contrib/fuzz/mpatch.cc
+++ b/contrib/fuzz/mpatch.cc
@@ -111,17 +111,4 @@
 	return 0;
 }
 
-#ifdef HG_FUZZER_INCLUDE_MAIN
-int main(int argc, char **argv)
-{
-	// One text, one patch.
-	const char data[] = "\x02\x00\0x1\x00\x0d"
-	                    // base text
-	                    "a"
-	                    // binary delta that will append a single b
-	                    "\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01b";
-	return LLVMFuzzerTestOneInput((const uint8_t *)data, 19);
-}
-#endif
-
 } // extern "C"
diff --git a/contrib/fuzz/bdiff.cc b/contrib/fuzz/bdiff.cc
--- a/contrib/fuzz/bdiff.cc
+++ b/contrib/fuzz/bdiff.cc
@@ -36,12 +36,4 @@
 	return 0; // Non-zero return values are reserved for future use.
 }
 
-#ifdef HG_FUZZER_INCLUDE_MAIN
-int main(int argc, char **argv)
-{
-	const char data[] = "asdf";
-	return LLVMFuzzerTestOneInput((const uint8_t *)data, 4);
-}
-#endif
-
 } // extern "C"
diff --git a/contrib/fuzz/Makefile b/contrib/fuzz/Makefile
--- a/contrib/fuzz/Makefile
+++ b/contrib/fuzz/Makefile
@@ -23,15 +23,6 @@
 	  `$(PYTHON_CONFIG) --cflags` \
 	  -I../../mercurial -c -o pyutil.o pyutil.cc
 
-bdiff.o: ../../mercurial/bdiff.c
-	$(CC) $(CFLAGS) -fsanitize=fuzzer-no-link,address -c -o bdiff.o \
-	  ../../mercurial/bdiff.c
-
-bdiff: bdiff.cc bdiff.o 
-	$(CXX) $(CXXFLAGS) -DHG_FUZZER_INCLUDE_MAIN=1 -g -O1 -fsanitize=fuzzer-no-link,address \
-	  -std=c++17 \
-	  -I../../mercurial bdiff.cc bdiff.o -o bdiff
-
 bdiff-oss-fuzz.o: ../../mercurial/bdiff.c
 	$(CC) $(CFLAGS) -c -o bdiff-oss-fuzz.o ../../mercurial/bdiff.c
 
@@ -44,11 +35,6 @@
 	$(CC) -g -O1 -fsanitize=fuzzer-no-link,address -c -o mpatch.o \
 	  ../../mercurial/mpatch.c
 
-mpatch: CXXFLAGS += -std=c++17
-mpatch: mpatch.cc mpatch.o
-	$(CXX) $(CXXFLAGS) -DHG_FUZZER_INCLUDE_MAIN=1 -g -O1 -fsanitize=fuzzer-no-link,address \
-	  -I../../mercurial mpatch.cc mpatch.o -o mpatch
-
 mpatch-oss-fuzz.o: ../../mercurial/mpatch.c
 	$(CC) $(CFLAGS) -c -o mpatch-oss-fuzz.o ../../mercurial/mpatch.c
 
@@ -60,17 +46,6 @@
 mpatch_corpus.zip:
 	python mpatch_corpus.py $$OUT/mpatch_fuzzer_seed_corpus.zip
 
-x%.o: ../../mercurial/thirdparty/xdiff/x%.c ../../mercurial/thirdparty/xdiff/*.h
-	$(CC) -g -O1 -fsanitize=fuzzer-no-link,address -c \
-	  -o $@ \
-	  $<
-
-xdiff: CXXFLAGS += -std=c++17
-xdiff: xdiff.cc xdiffi.o xprepare.o xutils.o 
-	$(CXX) $(CXXFLAGS) -DHG_FUZZER_INCLUDE_MAIN=1 -g -O1 -fsanitize=fuzzer-no-link,address \
-	  -I../../mercurial xdiff.cc \
-	  xdiffi.o xprepare.o xutils.o -o xdiff
-
 fuzz-x%.o: ../../mercurial/thirdparty/xdiff/x%.c ../../mercurial/thirdparty/xdiff/*.h
 	$(CC) $(CFLAGS) -c \
 	  -o $@ \



To: durin42, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list