From: Josh Steadmon Date: Wed, 14 Nov 2018 19:41:47 +0000 (-0800) Subject: Makefile: use FUZZ_CXXFLAGS for linking fuzzers X-Git-Tag: v2.20.0-rc0~6^2 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/927c77e7d4d1e42c1e523d4651a7fe2c9122fe32 Makefile: use FUZZ_CXXFLAGS for linking fuzzers OSS-Fuzz requires C++-specific flags to link fuzzers. Passing these in CFLAGS causes lots of build warnings. Using separate FUZZ_CXXFLAGS avoids this. Signed-off-by: Josh Steadmon Signed-off-by: Junio C Hamano --- diff --git a/Makefile b/Makefile index 1b3d893090..507968416d 100644 --- a/Makefile +++ b/Makefile @@ -3083,14 +3083,16 @@ cover_db_html: cover_db # An example command to build against libFuzzer from LLVM 4.0.0: # # make CC=clang CXX=clang++ \ -# CFLAGS="-fsanitize-coverage=trace-pc-guard -fsanitize=address" \ +# FUZZ_CXXFLAGS="-fsanitize-coverage=trace-pc-guard -fsanitize=address" \ # LIB_FUZZING_ENGINE=/usr/lib/llvm-4.0/lib/libFuzzer.a \ # fuzz-all # +FUZZ_CXXFLAGS ?= $(CFLAGS) + .PHONY: fuzz-all $(FUZZ_PROGRAMS): all - $(QUIET_LINK)$(CXX) $(CFLAGS) $(LIB_OBJS) $(BUILTIN_OBJS) \ + $(QUIET_LINK)$(CXX) $(FUZZ_CXXFLAGS) $(LIB_OBJS) $(BUILTIN_OBJS) \ $(XDIFF_OBJS) $(EXTLIBS) git.o $@.o $(LIB_FUZZING_ENGINE) -o $@ fuzz-all: $(FUZZ_PROGRAMS)