Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932910AbcDENgr (ORCPT ); Tue, 5 Apr 2016 09:36:47 -0400 Received: from mail.kernel.org ([198.145.29.136]:46408 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932787AbcDENgp (ORCPT ); Tue, 5 Apr 2016 09:36:45 -0400 Date: Tue, 5 Apr 2016 10:36:39 -0300 From: Arnaldo Carvalho de Melo To: Vinson Lee Cc: Peter Zijlstra , Ingo Molnar , Alexander Shishkin , Taeung Song , Jiri Olsa , Josh Poimboeuf , Alexei Starovoitov , Wang Nan , linux-kernel@vger.kernel.org Subject: Re: [PATCH] perf config: Fix build with older toolchain. Message-ID: <20160405133639.GA5945@kernel.org> References: <1459807659-9020-1-git-send-email-vlee@freedesktop.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1459807659-9020-1-git-send-email-vlee@freedesktop.org> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2794 Lines: 80 Em Mon, Apr 04, 2016 at 10:07:39PM +0000, Vinson Lee escreveu: > Fix build error on Ubuntu 12.04.5 with GCC 4.6.3. > CC util/config.o > util/config.c: In function ‘perf_buildid_config’: > util/config.c:384:15: error: declaration of ‘dirname’ shadows a global declaration [-Werror=shadow] Argh, I was catching these by building on rhel6, but I stopped doing so since switching to using docker images to do test builds... but I had none set up for ubuntu 12.04 or any other distro with such breakage in the headers, not anymore: [root@jouet ~]# docker run -v /home/acme/git:/git --privileged=true --rm=true -t -i ubuntu:12.04 /bin/bash Unable to find image 'ubuntu:12.04' locally Trying to pull repository docker.io/library/ubuntu ... 12.04: Pulling from library/ubuntu e37bb777fc4e: Pull complete which is indeed: root@7d7625f390d3:/# cat /etc/os-release NAME="Ubuntu" VERSION="12.04.5 LTS, Precise Pangolin" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu precise (12.04.5 LTS)" VERSION_ID="12.04" root@7d7625f390d3:/# And where I indeed can reproduce this error: root@7d7625f390d3:/# make JOBS=1 -C /git/linux/tools/perf O=/tmp/build/perf install-bin 2>&1 | tail CC /tmp/build/perf/util/config.o util/config.c: In function 'perf_buildid_config': util/config.c:384:15: error: declaration of 'dirname' shadows a global declaration [-Werror=shadow] cc1: all warnings being treated as errors mv: cannot stat `/tmp/build/perf/util/.config.o.tmp': No such file or directory make[3]: *** [/tmp/build/perf/util/config.o] Error 1 make[2]: *** [util] Error 2 make[1]: *** [/tmp/build/perf/libperf-in.o] Error 2 make: *** [install-bin] Error 2 make: Leaving directory `/git/linux/tools/perf' root@7d7625f390d3:/# Applying the patch, hopefully with this new distro in the set of build test images we won't see such problems for a while :-) - Arnaldo > Fixes: 9cb5987c8227 ("perf config: Rework buildid_dir_command_config to perf_buildid_config") > Signed-off-by: Vinson Lee > --- > tools/perf/util/config.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/tools/perf/util/config.c b/tools/perf/util/config.c > index 5c20d783423b..a3d80a05e7a2 100644 > --- a/tools/perf/util/config.c > +++ b/tools/perf/util/config.c > @@ -381,11 +381,11 @@ static int perf_buildid_config(const char *var, const char *value) > { > /* same dir for all commands */ > if (!strcmp(var, "buildid.dir")) { > - const char *dirname = perf_config_dirname(var, value); > + const char *v = perf_config_dirname(var, value); > > - if (!dirname) > + if (!v) > return -1; > - strncpy(buildid_dir, dirname, MAXPATHLEN-1); > + strncpy(buildid_dir, v, MAXPATHLEN-1); > buildid_dir[MAXPATHLEN-1] = '\0'; > } > > -- > 1.7.9.5