From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org, Jiri Olsa <jolsa@kernel.org>,
Andi Kleen <andi@firstfloor.org>, David Ahern <dsahern@gmail.com>,
Namhyung Kim <namhyung@kernel.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
William Cohen <wcohen@redhat.com>,
Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 03/15] tools build: Add CFLAGS_REMOVE_* support
Date: Mon, 14 Nov 2016 22:38:35 -0300 [thread overview]
Message-ID: <1479173927-24613-4-git-send-email-acme@kernel.org> (raw)
In-Reply-To: <1479173927-24613-1-git-send-email-acme@kernel.org>
From: Jiri Olsa <jolsa@kernel.org>
Adding support to remove options from final CFLAGS for both object file
and build target. It's now possible to remove CFLAGS options like:
CFLAGS_REMOVE_krava.o += -Wstrict-prototypes
Committer notes:
This comes from the kernel's kbuild infrastructure, the subset that is
supported in tools/ is being documented at tools/build/Documentation/Build.txt.
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Tested-by: Stephane Eranian <eranian@google.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: William Cohen <wcohen@redhat.com>
Link: http://lkml.kernel.org/r/1478093749-5602-2-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/build/Build.include | 4 +++-
tools/build/Documentation/Build.txt | 6 ++++--
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/tools/build/Build.include b/tools/build/Build.include
index 1dcb95e76f70..c4ae12a5d0a5 100644
--- a/tools/build/Build.include
+++ b/tools/build/Build.include
@@ -89,7 +89,9 @@ if_changed = $(if $(strip $(any-prereq) $(arg-check)), \
# - per target C flags
# - per object C flags
# - BUILD_STR macro to allow '-D"$(variable)"' constructs
-c_flags = -Wp,-MD,$(depfile),-MT,$@ $(CFLAGS) -D"BUILD_STR(s)=\#s" $(CFLAGS_$(basetarget).o) $(CFLAGS_$(obj))
+c_flags_1 = -Wp,-MD,$(depfile),-MT,$@ $(CFLAGS) -D"BUILD_STR(s)=\#s" $(CFLAGS_$(basetarget).o) $(CFLAGS_$(obj))
+c_flags_2 = $(filter-out $(CFLAGS_REMOVE_$(basetarget).o), $(c_flags_1))
+c_flags = $(filter-out $(CFLAGS_REMOVE_$(obj)), $(c_flags_2))
cxx_flags = -Wp,-MD,$(depfile),-MT,$@ $(CXXFLAGS) -D"BUILD_STR(s)=\#s" $(CXXFLAGS_$(basetarget).o) $(CXXFLAGS_$(obj))
###
diff --git a/tools/build/Documentation/Build.txt b/tools/build/Documentation/Build.txt
index a47bffbae159..a22587475dbe 100644
--- a/tools/build/Documentation/Build.txt
+++ b/tools/build/Documentation/Build.txt
@@ -135,8 +135,10 @@ CFLAGS
It's possible to alter the standard object C flags in the following way:
- CFLAGS_perf.o += '...' - alters CFLAGS for perf.o object
- CFLAGS_gtk += '...' - alters CFLAGS for gtk build object
+ CFLAGS_perf.o += '...' - adds CFLAGS for perf.o object
+ CFLAGS_gtk += '...' - adds CFLAGS for gtk build object
+ CFLAGS_REMOVE_perf.o += '...' - removes CFLAGS for perf.o object
+ CFLAGS_REMOVE_gtk += '...' - removes CFLAGS for gtk build object
This C flags changes has the scope of the Build makefile they are defined in.
--
2.7.4
next prev parent reply other threads:[~2016-11-15 1:39 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-15 1:38 [GIT PULL 00/15] perf/core improvements and fixes Arnaldo Carvalho de Melo
2016-11-15 1:38 ` [PATCH 01/15] perf callchain: Fixup help/config for no-unwinding Arnaldo Carvalho de Melo
2016-11-15 1:38 ` [PATCH 02/15] perf intel-pt: Update documentation about context switch events Arnaldo Carvalho de Melo
2016-11-15 1:38 ` Arnaldo Carvalho de Melo [this message]
2016-11-15 1:38 ` [PATCH 04/15] tools build: Add jvmti feature detection support Arnaldo Carvalho de Melo
2016-11-15 1:38 ` [PATCH 05/15] perf jvmti: Plug compilation into perf build Arnaldo Carvalho de Melo
2016-11-15 1:38 ` [PATCH 06/15] perf kvmti: Remove unused Makefile file Arnaldo Carvalho de Melo
2016-11-15 1:38 ` [PATCH 07/15] perf config: Add support for getting config key-value pairs Arnaldo Carvalho de Melo
2016-11-15 1:38 ` [PATCH 08/15] perf config: Validate config variable arguments before trying use them Arnaldo Carvalho de Melo
2016-11-15 1:38 ` [PATCH 09/15] perf config: Add support setting variables in a config file Arnaldo Carvalho de Melo
2016-11-15 2:20 ` Taeung Song
2016-11-15 1:38 ` [PATCH 10/15] perf config: Mark where are config items from (user or system) Arnaldo Carvalho de Melo
2016-11-15 1:38 ` [PATCH 11/15] perf report: Add branch flag to callchain cursor node Arnaldo Carvalho de Melo
2016-11-15 1:38 ` [PATCH 12/15] perf report: Create a symbol_conf flag for showing branch flag counting Arnaldo Carvalho de Melo
2016-11-15 1:38 ` [PATCH 13/15] perf report: Calculate and return the " Arnaldo Carvalho de Melo
2016-11-15 1:38 ` [PATCH 14/15] perf report: Show branch info in callchain entry for stdio mode Arnaldo Carvalho de Melo
2016-11-15 1:38 ` [PATCH 15/15] perf report: Show branch info in callchain entry for browser mode Arnaldo Carvalho de Melo
2016-11-15 8:47 ` [GIT PULL 00/15] perf/core improvements and fixes Ingo Molnar
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=1479173927-24613-4-git-send-email-acme@kernel.org \
--to=acme@kernel.org \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@redhat.com \
--cc=andi@firstfloor.org \
--cc=dsahern@gmail.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=wcohen@redhat.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.