All of lore.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Jiri Olsa <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: andi@firstfloor.org, namhyung@kernel.org, dsahern@gmail.com,
	tglx@linutronix.de, hpa@zytor.com, acme@redhat.com,
	mingo@kernel.org, eranian@google.com, a.p.zijlstra@chello.nl,
	jolsa@kernel.org, wcohen@redhat.com,
	linux-kernel@vger.kernel.org
Subject: [tip:perf/core] tools build: Add CFLAGS_REMOVE_* support
Date: Tue, 15 Nov 2016 02:41:58 -0800	[thread overview]
Message-ID: <tip-2ec8107d8e0d1d285b2bbf1999e7f4e46b6b535b@git.kernel.org> (raw)
In-Reply-To: <1478093749-5602-2-git-send-email-jolsa@kernel.org>

Commit-ID:  2ec8107d8e0d1d285b2bbf1999e7f4e46b6b535b
Gitweb:     http://git.kernel.org/tip/2ec8107d8e0d1d285b2bbf1999e7f4e46b6b535b
Author:     Jiri Olsa <jolsa@kernel.org>
AuthorDate: Wed, 2 Nov 2016 14:35:47 +0100
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 14 Nov 2016 11:37:25 -0300

tools build: Add CFLAGS_REMOVE_* support

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 1dcb95e..c4ae12a 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 a47bffb..a225874 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.
 

  parent reply	other threads:[~2016-11-15 10:42 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-02 13:35 [PATCH 0/3] perf tools: Plug jvmti compilation into perf build Jiri Olsa
2016-11-02 13:35 ` [PATCH 1/3] tools build: Add CFLAGS_REMOVE_* support Jiri Olsa
2016-11-14 14:36   ` Arnaldo Carvalho de Melo
2016-11-14 14:37     ` Arnaldo Carvalho de Melo
2016-11-15 10:41   ` tip-bot for Jiri Olsa [this message]
2016-11-02 13:35 ` [PATCH 2/3] tools build: Add jvmti feature detection support Jiri Olsa
2016-11-15 10:42   ` [tip:perf/core] " tip-bot for Jiri Olsa
2016-11-02 13:35 ` [PATCH 3/3] perf tools: Plug jvmti compilation into perf build Jiri Olsa
2016-11-15 10:43   ` [tip:perf/core] perf jvmti: Plug " tip-bot for Jiri Olsa
2016-11-11  9:51 ` [PATCH 0/3] perf tools: Plug jvmti " Jiri Olsa
2016-11-11 15:13   ` Stephane Eranian
2016-11-11 23:18 ` Stephane Eranian
2016-11-12 12:10   ` [PATCH] perf tools: Remove jvmti/Makefile file Jiri Olsa
2016-11-15 10:43     ` [tip:perf/core] perf kvmti: Remove unused Makefile file tip-bot for Jiri Olsa

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=tip-2ec8107d8e0d1d285b2bbf1999e7f4e46b6b535b@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@redhat.com \
    --cc=andi@firstfloor.org \
    --cc=dsahern@gmail.com \
    --cc=eranian@google.com \
    --cc=hpa@zytor.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=tglx@linutronix.de \
    --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.