All of lore.kernel.org
 help / color / mirror / Atom feed
From: Masami Hiramatsu <mhiramat@kernel.org>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Anders Roxell <anders.roxell@linaro.org>,
	Leo Yan <leo.yan@linaro.org>,
	linux-kernel@vger.kernel.org,
	Nathan Chancellor <nathan@kernel.org>,
	Nick Desaulniers <ndesaulniers@google.com>
Subject: [PATCH 1/2] perf build: Move EXTRA_CFLAGS and EXTRA_WARNINGS at the end of CFLAGS
Date: Wed, 12 May 2021 00:02:34 +0900	[thread overview]
Message-ID: <162074535428.289757.16452586688199107510.stgit@devnote2> (raw)
In-Reply-To: <162074534493.289757.1243545574686276554.stgit@devnote2>

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@kernel.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)


  reply	other threads:[~2021-05-11 15:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-11 15:02 [PATCH 0/2] tools/perf: tools: Fix perf build issues Masami Hiramatsu
2021-05-11 15:02 ` Masami Hiramatsu [this message]
2021-05-11 15:02 ` [PATCH 2/2] tools: Add -Wno-missing-field-initializers to for clang Masami Hiramatsu
2021-05-11 18:23   ` Nick Desaulniers

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

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

  git send-email \
    --in-reply-to=162074535428.289757.16452586688199107510.stgit@devnote2 \
    --to=mhiramat@kernel.org \
    --cc=acme@kernel.org \
    --cc=anders.roxell@linaro.org \
    --cc=leo.yan@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@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.
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.