linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] perf: add support for disabling -Werror via WERROR=0
@ 2011-06-03 16:10 Darren Hart
  0 siblings, 0 replies; 3+ messages in thread
From: Darren Hart @ 2011-06-03 16:10 UTC (permalink / raw)
  To: Linux Kernel Mailing List
  Cc: Darren Hart, Ingo Molnar, Arnaldo Carvalho de Melo

GCC often introduces new warnings with lots of false positives - breaking
-Werror builds. WERROR=0 allows one to build perf without much fuss - while
still encouraging people to send patches to avoid the fuss of having to type
WERROR=0.

Bisecting back to commits that produce a (mostly harmless) warning on some
compilers is more difficult. With WERROR=0 one could bisect without worrying
about harmless warnings.

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Makefile |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 032ba63..e76dfbb 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -30,6 +30,8 @@ endif
 # Define EXTRA_CFLAGS=-m64 or EXTRA_CFLAGS=-m32 as appropriate for cross-builds.
 #
 # Define NO_DWARF if you do not want debug-info analysis feature at all.
+#
+# Define WERROR=0 to disable treating any warnings as errors.
 
 $(OUTPUT)PERF-VERSION-FILE: .FORCE-PERF-VERSION-FILE
 	@$(SHELL_PATH) util/PERF-VERSION-GEN $(OUTPUT)
@@ -60,6 +62,11 @@ ifeq ($(ARCH),x86_64)
 	endif
 endif
 
+# Treat warnings as errors unless directed not to
+ifneq ($(WERROR),0)
+	CFLAGS_WERROR := -Werror
+endif
+
 #
 # Include saner warnings here, which can catch bugs:
 #
@@ -92,7 +99,7 @@ ifndef PERF_DEBUG
   CFLAGS_OPTIMIZE = -O6
 endif
 
-CFLAGS = -fno-omit-frame-pointer -ggdb3 -Wall -Wextra -std=gnu99 -Werror $(CFLAGS_OPTIMIZE) -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS) $(EXTRA_CFLAGS)
+CFLAGS = -fno-omit-frame-pointer -ggdb3 -Wall -Wextra -std=gnu99 $(CFLAGS_WERROR) $(CFLAGS_OPTIMIZE) -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS) $(EXTRA_CFLAGS)
 EXTLIBS = -lpthread -lrt -lelf -lm
 ALL_CFLAGS = $(CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
 ALL_LDFLAGS = $(LDFLAGS)
-- 
1.7.1


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

* Re: [PATCH] perf: add support for disabling -Werror via WERROR=0
  2011-09-08 20:42 Darren Hart
@ 2011-09-15 14:53 ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2011-09-15 14:53 UTC (permalink / raw)
  To: Darren Hart; +Cc: Linux Kernel Mailing List, Ingo Molnar

Em Thu, Sep 08, 2011 at 01:42:39PM -0700, Darren Hart escreveu:
> GCC often introduces new warnings with lots of false positives - breaking
> -Werror builds. WERROR=0 allows one to build perf without much fuss - while
> still encouraging people to send patches to avoid the fuss of having to type
> WERROR=0.
> 
> Bisecting back to commits that produce a (mostly harmless) warning on some
> compilers is more difficult. With WERROR=0 one could bisect without worrying
> about harmless warnings.

Thanks, I put it in my perf/urgent branch in:

https://github.com/acmel/linux/commit/d8075f711858fce568e37453c1dd5e2b6f18504c

- Arnaldo

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

* [PATCH] perf: add support for disabling -Werror via WERROR=0
@ 2011-09-08 20:42 Darren Hart
  2011-09-15 14:53 ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 3+ messages in thread
From: Darren Hart @ 2011-09-08 20:42 UTC (permalink / raw)
  To: Linux Kernel Mailing List
  Cc: Darren Hart, Ingo Molnar, Arnaldo Carvalho de Melo

GCC often introduces new warnings with lots of false positives - breaking
-Werror builds. WERROR=0 allows one to build perf without much fuss - while
still encouraging people to send patches to avoid the fuss of having to type
WERROR=0.

Bisecting back to commits that produce a (mostly harmless) warning on some
compilers is more difficult. With WERROR=0 one could bisect without worrying
about harmless warnings.

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Makefile |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 3b8f7b8..e9d5c27 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -30,6 +30,8 @@ endif
 # Define EXTRA_CFLAGS=-m64 or EXTRA_CFLAGS=-m32 as appropriate for cross-builds.
 #
 # Define NO_DWARF if you do not want debug-info analysis feature at all.
+#
+# Define WERROR=0 to disable treating any warnings as errors.
 
 $(OUTPUT)PERF-VERSION-FILE: .FORCE-PERF-VERSION-FILE
 	@$(SHELL_PATH) util/PERF-VERSION-GEN $(OUTPUT)
@@ -63,6 +65,11 @@ ifeq ($(ARCH),x86_64)
 	endif
 endif
 
+# Treat warnings as errors unless directed not to
+ifneq ($(WERROR),0)
+	CFLAGS_WERROR := -Werror
+endif
+
 #
 # Include saner warnings here, which can catch bugs:
 #
@@ -95,7 +102,7 @@ ifndef PERF_DEBUG
   CFLAGS_OPTIMIZE = -O6
 endif
 
-CFLAGS = -fno-omit-frame-pointer -ggdb3 -Wall -Wextra -std=gnu99 -Werror $(CFLAGS_OPTIMIZE) -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS) $(EXTRA_CFLAGS)
+CFLAGS = -fno-omit-frame-pointer -ggdb3 -Wall -Wextra -std=gnu99 $(CFLAGS_WERROR) $(CFLAGS_OPTIMIZE) -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS) $(EXTRA_CFLAGS)
 EXTLIBS = -lpthread -lrt -lelf -lm
 ALL_CFLAGS = $(CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
 ALL_LDFLAGS = $(LDFLAGS)
-- 
1.7.6


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

end of thread, other threads:[~2011-09-15 14:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-03 16:10 [PATCH] perf: add support for disabling -Werror via WERROR=0 Darren Hart
2011-09-08 20:42 Darren Hart
2011-09-15 14:53 ` Arnaldo Carvalho de Melo

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 NNTP newsgroup(s).