Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751708AbbGPQcI (ORCPT ); Thu, 16 Jul 2015 12:32:08 -0400 Received: from cantor2.suse.de ([195.135.220.15]:57075 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751205AbbGPQcH (ORCPT ); Thu, 16 Jul 2015 12:32:07 -0400 Date: Thu, 16 Jul 2015 18:32:02 +0200 From: Michal Marek To: Linus Torvalds Cc: Vineet Gupta , lkml , "arc-linux-dev@synopsys.com" , Alexey Brodkin , Joel Porquet Subject: Re: [GIT PULL] ARC fixes for 4.2-rc3 Message-ID: <20150716163202.GB20221@sepie.suse.cz> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2088 Lines: 61 On Wed, Jul 15, 2015 at 01:29:07PM -0700, Linus Torvalds wrote: > What happens if the environment has ARCH_CFLAGS set? The build will > start using them. Sure, we've had this before, and maybe the ARCH_ > prefix makes it unique enough, but generally I think we've tried to > either > > (a) make sure they get initialized in the makefiles (eg the usual > CFLAGS is set to empty by the arch things, so that we don't silently > take them from the environment) Good point. I'll add the below patch to my tree. > I don't think this is a big deal, and I suspect we may have other > cases where we do this, but I do not think that the *intention* was > that people could use this as another KCFLAGS replacement... It was definitely not intended to be set by the user. Michal >From f821bf39576444276917bd6737c526d361c69221 Mon Sep 17 00:00:00 2001 From: Michal Marek Date: Thu, 16 Jul 2015 18:23:53 +0200 Subject: [PATCH] kbuild: Do not pick up ARCH_{CPP,A,C}FLAGS from the environment Initialize the ARCH_* overrides before including the arch Makefile, to avoid picking up the values from the environment. The variables can still be overriden on the make command line, but this won't happen by accident. Signed-off-by: Michal Marek --- Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Makefile b/Makefile index 2f49d89..a99a14d 100644 --- a/Makefile +++ b/Makefile @@ -597,6 +597,11 @@ endif # $(dot-config) # Defaults to vmlinux, but the arch makefile usually adds further targets all: vmlinux +# The arch Makefile can set ARCH_{CPP,A,C}FLAGS to override the default +# values of the respective KBUILD_* variables +ARCH_CPPFLAGS := +ARCH_AFLAGS := +ARCH_CFLAGS := include arch/$(SRCARCH)/Makefile KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks,) -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/