All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Makefile: use CXXFLAGS for linking fuzzers
@ 2018-11-12 22:02 steadmon
  2018-11-12 22:47 ` Stefan Beller
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: steadmon @ 2018-11-12 22:02 UTC (permalink / raw)
  To: git

OSS-Fuzz requires C++-specific flags to link fuzzers. Passing these in
CFLAGS causes lots of build warnings. Using separate CXXFLAGS avoids
this.

Signed-off-by: Josh Steadmon <steadmon@google.com>
---
 Makefile | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index bbfbb4292d..5462bc4b6b 100644
--- a/Makefile
+++ b/Makefile
@@ -497,6 +497,7 @@ GIT-VERSION-FILE: FORCE
 # CFLAGS and LDFLAGS are for the users to override from the command line.
 
 CFLAGS = -g -O2 -Wall
+CXXFLAGS ?= $(CFLAGS)
 LDFLAGS =
 ALL_CFLAGS = $(CPPFLAGS) $(CFLAGS)
 ALL_LDFLAGS = $(LDFLAGS)
@@ -3098,14 +3099,14 @@ 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" \
+#      CXXFLAGS="-fsanitize-coverage=trace-pc-guard -fsanitize=address" \
 #      LIB_FUZZING_ENGINE=/usr/lib/llvm-4.0/lib/libFuzzer.a \
 #      fuzz-all
 #
 .PHONY: fuzz-all
 
 $(FUZZ_PROGRAMS): all
-	$(QUIET_LINK)$(CXX) $(CFLAGS) $(LIB_OBJS) $(BUILTIN_OBJS) \
+	$(QUIET_LINK)$(CXX) $(CXXFLAGS) $(LIB_OBJS) $(BUILTIN_OBJS) \
 		$(XDIFF_OBJS) $(EXTLIBS) git.o $@.o $(LIB_FUZZING_ENGINE) -o $@
 
 fuzz-all: $(FUZZ_PROGRAMS)
-- 
2.19.1.930.g4563a0d9d0-goog


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-11-14 19:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-12 22:02 [PATCH] Makefile: use CXXFLAGS for linking fuzzers steadmon
2018-11-12 22:47 ` Stefan Beller
2018-11-13  3:12 ` Junio C Hamano
2018-11-13 18:50   ` Josh Steadmon
2018-11-14  2:56     ` Junio C Hamano
2018-11-14 19:41 ` [PATCH v2] Makefile: use FUZZ_CXXFLAGS " Josh Steadmon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.