Skip to content

Commit 927c77e

Browse files
steadmongitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 1127a98 commit 927c77e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3083,14 +3083,16 @@ cover_db_html: cover_db
30833083
# An example command to build against libFuzzer from LLVM 4.0.0:
30843084
#
30853085
# make CC=clang CXX=clang++ \
3086-
# CFLAGS="-fsanitize-coverage=trace-pc-guard -fsanitize=address" \
3086+
# FUZZ_CXXFLAGS="-fsanitize-coverage=trace-pc-guard -fsanitize=address" \
30873087
# LIB_FUZZING_ENGINE=/usr/lib/llvm-4.0/lib/libFuzzer.a \
30883088
# fuzz-all
30893089
#
3090+
FUZZ_CXXFLAGS ?= $(CFLAGS)
3091+
30903092
.PHONY: fuzz-all
30913093

30923094
$(FUZZ_PROGRAMS): all
3093-
$(QUIET_LINK)$(CXX) $(CFLAGS) $(LIB_OBJS) $(BUILTIN_OBJS) \
3095+
$(QUIET_LINK)$(CXX) $(FUZZ_CXXFLAGS) $(LIB_OBJS) $(BUILTIN_OBJS) \
30943096
$(XDIFF_OBJS) $(EXTLIBS) git.o $@.o $(LIB_FUZZING_ENGINE) -o $@
30953097

30963098
fuzz-all: $(FUZZ_PROGRAMS)

0 commit comments

Comments
 (0)