diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2019-07-19 14:34:30 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2019-07-23 08:04:54 -0400 |
commit | 39e7317e37f7f0be366d1201c283f968c17268da (patch) | |
tree | 4e70178c670cd978ba970d620d6eaf64023fca70 | |
parent | d95daf5accf4a72005daa13fbb1d1bd8709f2861 (diff) |
perf build: Do not use -Wshadow on gcc < 4.8
As it is too strict, see https://lkml.org/lkml/2006/11/28/253 and
https://gcc.gnu.org/gcc-4.8/changes.html, that takes into account
Linus's comments (search for Wshadow) for the reasoning about -Wshadow
not being interesting before gcc 4.8.
Acked-by: Andrii Nakryiko <andrii.nakryiko@gmail.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lkml.kernel.org/r/20190719183417.GQ3624@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | tools/scripts/Makefile.include | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tools/scripts/Makefile.include b/tools/scripts/Makefile.include index 495066bafbe3..ded7a950dc40 100644 --- a/tools/scripts/Makefile.include +++ b/tools/scripts/Makefile.include | |||
@@ -32,7 +32,6 @@ EXTRA_WARNINGS += -Wno-system-headers | |||
32 | EXTRA_WARNINGS += -Wold-style-definition | 32 | EXTRA_WARNINGS += -Wold-style-definition |
33 | EXTRA_WARNINGS += -Wpacked | 33 | EXTRA_WARNINGS += -Wpacked |
34 | EXTRA_WARNINGS += -Wredundant-decls | 34 | EXTRA_WARNINGS += -Wredundant-decls |
35 | EXTRA_WARNINGS += -Wshadow | ||
36 | EXTRA_WARNINGS += -Wstrict-prototypes | 35 | EXTRA_WARNINGS += -Wstrict-prototypes |
37 | EXTRA_WARNINGS += -Wswitch-default | 36 | EXTRA_WARNINGS += -Wswitch-default |
38 | EXTRA_WARNINGS += -Wswitch-enum | 37 | EXTRA_WARNINGS += -Wswitch-enum |
@@ -69,8 +68,16 @@ endif | |||
69 | # will do for now and keep the above -Wstrict-aliasing=3 in place | 68 | # will do for now and keep the above -Wstrict-aliasing=3 in place |
70 | # in newer systems. | 69 | # in newer systems. |
71 | # Needed for the __raw_cmpxchg in tools/arch/x86/include/asm/cmpxchg.h | 70 | # Needed for the __raw_cmpxchg in tools/arch/x86/include/asm/cmpxchg.h |
71 | # | ||
72 | # See https://lkml.org/lkml/2006/11/28/253 and https://gcc.gnu.org/gcc-4.8/changes.html, | ||
73 | # that takes into account Linus's comments (search for Wshadow) for the reasoning about | ||
74 | # -Wshadow not being interesting before gcc 4.8. | ||
75 | |||
72 | ifneq ($(filter 3.%,$(MAKE_VERSION)),) # make-3 | 76 | ifneq ($(filter 3.%,$(MAKE_VERSION)),) # make-3 |
73 | EXTRA_WARNINGS += -fno-strict-aliasing | 77 | EXTRA_WARNINGS += -fno-strict-aliasing |
78 | EXTRA_WARNINGS += -Wno-shadow | ||
79 | else | ||
80 | EXTRA_WARNINGS += -Wshadow | ||
74 | endif | 81 | endif |
75 | 82 | ||
76 | ifneq ($(findstring $(MAKEFLAGS), w),w) | 83 | ifneq ($(findstring $(MAKEFLAGS), w),w) |