[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <162074535428.289757.16452586688199107510.stgit@devnote2>
Date: Wed, 12 May 2021 00:02:34 +0900
From: Masami Hiramatsu <mhiramat@...nel.org>
To: Arnaldo Carvalho de Melo <acme@...nel.org>
Cc: Anders Roxell <anders.roxell@...aro.org>,
Leo Yan <leo.yan@...aro.org>, linux-kernel@...r.kernel.org,
Nathan Chancellor <nathan@...nel.org>,
Nick Desaulniers <ndesaulniers@...gle.com>
Subject: [PATCH 1/2] perf build: Move EXTRA_CFLAGS and EXTRA_WARNINGS at the end of CFLAGS
Move EXTRA_CFLAGS and EXTRA_WARNINGS at the end of CFLAGS so that
additional flags will be passed to the compiler correctly.
CFLAGS is composed by CORE_CFLAGS, INC_FLAGS, EXTRA_CFLAGS, and
EXTRA_WARNINGS in the following order;
CFLAGS = $EXTRA_CFLAGS $EXTRA_WARNINGS $CORE_CFLAGS $INC_FLAGS
But since CORE_CFLAGS includes "-Wall" and "-Wextra", the other -Wno-*
flags in EXTRA_CFLAGS and EXTRA_WARNINGS are overridden and ignored.
To fix this issue, move those EXTRA_* at the end of CFLAGS definition
as below.
CFLAGS = $CORE_CFLAGS $INC_FLAGS $EXTRA_CFLAGS $EXTRA_WARNINGS
Signed-off-by: Masami Hiramatsu <mhiramat@...nel.org>
---
tools/perf/Makefile.config | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
index 406a9519145e..2ad46c66bc7b 100644
--- a/tools/perf/Makefile.config
+++ b/tools/perf/Makefile.config
@@ -16,7 +16,7 @@ $(shell printf "" > $(OUTPUT).config-detected)
detected = $(shell echo "$(1)=y" >> $(OUTPUT).config-detected)
detected_var = $(shell echo "$(1)=$($(1))" >> $(OUTPUT).config-detected)
-CFLAGS := $(EXTRA_CFLAGS) $(filter-out -Wnested-externs,$(EXTRA_WARNINGS))
+CFLAGS :=
include $(srctree)/tools/scripts/Makefile.arch
@@ -340,6 +340,7 @@ INC_FLAGS += -I$(srctree)/tools/lib/
CORE_CFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
CFLAGS += $(CORE_CFLAGS) $(INC_FLAGS)
+CFLAGS += $(EXTRA_CFLAGS) $(filter-out -Wnested-externs,$(EXTRA_WARNINGS))
CXXFLAGS += $(INC_FLAGS)
LIBPERF_CFLAGS := $(CORE_CFLAGS) $(EXTRA_CFLAGS)
Powered by blists - more mailing lists