Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933593AbcKOKmb (ORCPT ); Tue, 15 Nov 2016 05:42:31 -0500 Received: from terminus.zytor.com ([198.137.202.10]:50720 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753580AbcKOKm2 (ORCPT ); Tue, 15 Nov 2016 05:42:28 -0500 Date: Tue, 15 Nov 2016 02:41:58 -0800 From: tip-bot for Jiri Olsa Message-ID: 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 Reply-To: andi@firstfloor.org, namhyung@kernel.org, tglx@linutronix.de, hpa@zytor.com, dsahern@gmail.com, acme@redhat.com, eranian@google.com, mingo@kernel.org, a.p.zijlstra@chello.nl, jolsa@kernel.org, wcohen@redhat.com, linux-kernel@vger.kernel.org In-Reply-To: <1478093749-5602-2-git-send-email-jolsa@kernel.org> References: <1478093749-5602-2-git-send-email-jolsa@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] tools build: Add CFLAGS_REMOVE_* support Git-Commit-ID: 2ec8107d8e0d1d285b2bbf1999e7f4e46b6b535b X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2924 Lines: 65 Commit-ID: 2ec8107d8e0d1d285b2bbf1999e7f4e46b6b535b Gitweb: http://git.kernel.org/tip/2ec8107d8e0d1d285b2bbf1999e7f4e46b6b535b Author: Jiri Olsa AuthorDate: Wed, 2 Nov 2016 14:35:47 +0100 Committer: Arnaldo Carvalho de Melo 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 Tested-by: Stephane Eranian Cc: Andi Kleen Cc: David Ahern Cc: Namhyung Kim Cc: Peter Zijlstra Cc: William Cohen Link: http://lkml.kernel.org/r/1478093749-5602-2-git-send-email-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- 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.