From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754206AbdBFPmT (ORCPT ); Mon, 6 Feb 2017 10:42:19 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37634 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752337AbdBFPmR (ORCPT ); Mon, 6 Feb 2017 10:42:17 -0500 Date: Mon, 6 Feb 2017 16:42:13 +0100 From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: David Carrillo-Cisneros , Mark Rutland , linux-kernel@vger.kernel.org, Ingo Molnar , Peter Zijlstra , Jiri Olsa , Alexander Shishkin , Wang Nan , He Kuang , Michal Marek , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , Stephane Eranian , Paul Turner Subject: Re: [PATCH 3/4] tools lib feature: Do not redefine compiler configuration Message-ID: <20170206154213.GA13416@krava> References: <20170202063804.94027-1-davidcc@google.com> <20170202063804.94027-4-davidcc@google.com> <20170206133859.GB11283@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170206133859.GB11283@kernel.org> User-Agent: Mutt/1.7.1 (2016-10-04) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 06 Feb 2017 15:42:18 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 06, 2017 at 10:38:59AM -0300, Arnaldo Carvalho de Melo wrote: > Em Wed, Feb 01, 2017 at 10:38:03PM -0800, David Carrillo-Cisneros escreveu: > > Feature detection redefines CC, CCX and PKG_CONFIG, making the > > output of feature detection inconsistent with the actual features > > available during compilation when the above variables are used. > > > > Fix it by using conditional assignment. > > This one is tricky, the real meaning of that line got lost somewhere, > its original intent, in commit 8b6eb56a9570 ("tools/perf/build: Add > 'autodep' functionality, generate feature test dependencies > automatically") was to just add that "-MD" to whatever definition CC > had, be it the default one or a value set by the user in the make > command line. > > At some point someone added that CROSS_COMPILE there, which it should > have gotten from the default CC definition > > It was here: a8a5cd8b472c ("perf: tools: Fix cross building") > > perf: tools: Fix cross building > > Currently the feature-checks Makefile does not inherit $(CC), and calls > cc rather than $(CROSS_COMPILE)gcc. Thus the feature checks invoke the > native toolchain rather than the cross toolchain, and can identify > features as available when they are not. This can break the build > > ---------------------------------- > > Mark, do you recall why can't we make tools/perf/Makefile.perf pass the > definitions of CC, AR and PKG_CONFIG to tools/perf/config/Makefile (now > tools/build/feature/Makefile) so that the original intent (adding -MD to > whatever was in CC) can be kept? > > Jiri? I guess we could remove -MD from the gcc like and add it to the CFLAGS if we want to keep the CC/CXX lines alone.. jirka