git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Josh Steadmon <steadmon@google.com>
To: git@vger.kernel.org
Cc: sbeller@google.com, gitster@pobox.com
Subject: [PATCH v2] Makefile: use FUZZ_CXXFLAGS for linking fuzzers
Date: Wed, 14 Nov 2018 11:41:47 -0800	[thread overview]
Message-ID: <6b3d6dd7f0ab9324fcdf1b9322ef7e35d8355964.1542224326.git.steadmon@google.com> (raw)
In-Reply-To: <1630a93f8270ca090459be8cc7213221cc6250cf.1542060094.git.steadmon@google.com>

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 <steadmon@google.com>
---
Since there's nothing else using CXXFLAGS, let's just make it explicit
that these apply to the fuzzers.


Range-diff against v1:
1:  1630a93f82 < -:  ---------- Makefile: use CXXFLAGS for linking fuzzers
-:  ---------- > 1:  6b3d6dd7f0 Makefile: use FUZZ_CXXFLAGS for linking fuzzers

 Makefile | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index bbfbb4292d..0c05896797 100644
--- a/Makefile
+++ b/Makefile
@@ -3098,14 +3098,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)
-- 
2.19.1.930.g4563a0d9d0-goog


      parent reply	other threads:[~2018-11-14 19:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Josh Steadmon [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6b3d6dd7f0ab9324fcdf1b9322ef7e35d8355964.1542224326.git.steadmon@google.com \
    --to=steadmon@google.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=sbeller@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).