Patchwork D7561: fuzz: follow modern guidelines and use LIB_FUZZING_ENGINE

login
register
mail settings
Submitter phabricator
Date Dec. 7, 2019, 3:59 a.m.
Message ID <b02cfeca8bb3ad6a3f7ec1ac0d6ab2f7@localhost.localdomain>
Download mbox | patch
Permalink /patch/43621/
State Not Applicable
Headers show

Comments

phabricator - Dec. 7, 2019, 3:59 a.m.
Closed by commit rHG7cb99887bcc3: fuzz: follow modern guidelines and use LIB_FUZZING_ENGINE (authored by durin42).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7561?vs=18499&id=18512

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7561/new/

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

AFFECTED FILES
  contrib/fuzz/Makefile

CHANGE DETAILS




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

Patch

diff --git a/contrib/fuzz/Makefile b/contrib/fuzz/Makefile
--- a/contrib/fuzz/Makefile
+++ b/contrib/fuzz/Makefile
@@ -1,6 +1,8 @@ 
 CC = clang
 CXX = clang++
 
+LIB_FUZZING_ENGINE ?= -lFuzzingEngine
+
 all: bdiff mpatch xdiff
 
 pyutil.o: pyutil.cc pyutil.h
@@ -22,7 +24,7 @@ 
 
 bdiff_fuzzer: bdiff.cc bdiff-oss-fuzz.o
 	$(CXX) $(CXXFLAGS) -std=c++17 -I../../mercurial bdiff.cc \
-	  bdiff-oss-fuzz.o -lFuzzingEngine -o \
+	  bdiff-oss-fuzz.o $(LIB_FUZZING_ENGINE) -o \
 	  $$OUT/bdiff_fuzzer
 
 mpatch.o: ../../mercurial/mpatch.c
@@ -39,7 +41,7 @@ 
 
 mpatch_fuzzer: mpatch.cc mpatch-oss-fuzz.o 
 	$(CXX) $(CXXFLAGS) -std=c++17 -I../../mercurial mpatch.cc \
-	  mpatch-oss-fuzz.o -lFuzzingEngine -o \
+	  mpatch-oss-fuzz.o $(LIB_FUZZING_ENGINE) -o \
 	  $$OUT/mpatch_fuzzer
 
 mpatch_corpus.zip:
@@ -64,7 +66,7 @@ 
 xdiff_fuzzer: xdiff.cc fuzz-xdiffi.o fuzz-xprepare.o fuzz-xutils.o 
 	$(CXX) $(CXXFLAGS) -std=c++17 -I../../mercurial xdiff.cc \
 	  fuzz-xdiffi.o fuzz-xprepare.o fuzz-xutils.o \
-	  -lFuzzingEngine -o $$OUT/xdiff_fuzzer
+	  $(LIB_FUZZING_ENGINE) -o $$OUT/xdiff_fuzzer
 
 manifest.o: ../../mercurial/cext/manifest.c
 	$(CC) $(CFLAGS) `$$OUT/sanpy/bin/python-config --cflags` \
@@ -101,7 +103,7 @@ 
 	  -Wno-register -Wno-macro-redefined \
 	  -I../../mercurial dirs.cc \
 	  manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o \
-	  -lFuzzingEngine `$$OUT/sanpy/bin/python-config --ldflags` \
+	  $(LIB_FUZZING_ENGINE) `$$OUT/sanpy/bin/python-config --ldflags` \
 	  -o $$OUT/dirs_fuzzer
 
 fncache_fuzzer: fncache.cc manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o
@@ -109,7 +111,7 @@ 
 	  -Wno-register -Wno-macro-redefined \
 	  -I../../mercurial fncache.cc \
 	  manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o \
-	  -lFuzzingEngine `$$OUT/sanpy/bin/python-config --ldflags` \
+	  $(LIB_FUZZING_ENGINE) `$$OUT/sanpy/bin/python-config --ldflags` \
 	  -o $$OUT/fncache_fuzzer
 
 jsonescapeu8fast_fuzzer: jsonescapeu8fast.cc manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o
@@ -117,7 +119,7 @@ 
 	  -Wno-register -Wno-macro-redefined \
 	  -I../../mercurial jsonescapeu8fast.cc \
 	  manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o \
-	  -lFuzzingEngine `$$OUT/sanpy/bin/python-config --ldflags` \
+	  $(LIB_FUZZING_ENGINE) `$$OUT/sanpy/bin/python-config --ldflags` \
 	  -o $$OUT/jsonescapeu8fast_fuzzer
 
 manifest_corpus.zip:
@@ -128,7 +130,7 @@ 
 	  -Wno-register -Wno-macro-redefined \
 	  -I../../mercurial manifest.cc \
 	  manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o \
-	  -lFuzzingEngine `$$OUT/sanpy/bin/python-config --ldflags` \
+	  $(LIB_FUZZING_ENGINE) `$$OUT/sanpy/bin/python-config --ldflags` \
 	  -o $$OUT/manifest_fuzzer
 
 revlog_fuzzer: revlog.cc manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o
@@ -136,7 +138,7 @@ 
 	  -Wno-register -Wno-macro-redefined \
 	  -I../../mercurial revlog.cc \
 	  manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o \
-	  -lFuzzingEngine `$$OUT/sanpy/bin/python-config --ldflags` \
+	  $(LIB_FUZZING_ENGINE) `$$OUT/sanpy/bin/python-config --ldflags` \
 	  -o $$OUT/revlog_fuzzer
 
 revlog_corpus.zip:
@@ -147,7 +149,7 @@ 
 	  -Wno-register -Wno-macro-redefined \
 	  -I../../mercurial dirstate.cc \
 	  manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o \
-	  -lFuzzingEngine `$$OUT/sanpy/bin/python-config --ldflags` \
+	  $(LIB_FUZZING_ENGINE) `$$OUT/sanpy/bin/python-config --ldflags` \
 	  -o $$OUT/dirstate_fuzzer
 
 dirstate_corpus.zip:
@@ -158,7 +160,7 @@ 
 	  -Wno-register -Wno-macro-redefined \
 	  -I../../mercurial fm1readmarkers.cc \
 	  manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o \
-	  -lFuzzingEngine `$$OUT/sanpy/bin/python-config --ldflags` \
+	  $(LIB_FUZZING_ENGINE) `$$OUT/sanpy/bin/python-config --ldflags` \
 	  -o $$OUT/fm1readmarkers_fuzzer
 
 fm1readmarkers_corpus.zip: