From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf0-f66.google.com ([209.85.215.66]:43826 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750722AbdKBL0X (ORCPT ); Thu, 2 Nov 2017 07:26:23 -0400 Received: by mail-lf0-f66.google.com with SMTP id a16so6070146lfk.0 for ; Thu, 02 Nov 2017 04:26:22 -0700 (PDT) Date: Thu, 2 Nov 2017 13:26:14 +0200 From: Tuomas Tynkkynen To: Sasha Levin Cc: stable@vger.kernel.org Subject: 4.1 backport request: Two perf build fixes Message-ID: <20171102132614.5949b70e@thinkpad> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: stable-owner@vger.kernel.org List-ID: Hi Sasha, First, the following commit: commit b5bf1733d6a391c4e90ea8f8468d83023be74a2a Author: Arnaldo Carvalho de Melo Date: Wed Feb 8 17:01:46 2017 -0300 tools include: Add a __fallthrough statement For cases where implicit fall through case labels are intended, to let us inform that to gcc >= 7: CC /tmp/build/perf/util/string.o util/string.c: In function 'perf_atoll': util/string.c:22:7: error: this statement may fall through [-Werror=implicit-fallthrough=] if (*p) ^ util/string.c:24:3: note: here case '\0': ^~~~ So we introduce: #define __fallthrough __attribute__ ((fallthrough)) And use it in such cases. Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Cc: William Cohen Link: http://lkml.kernel.org/n/tip-qnpig0xfop4hwv6k4mv1wts5@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo That is required because there already some commits picked to 4.1 that use __fallthrough without the declaration, namely: ed83069083743b perf top: Use __fallthrough 9de93e56698fe2 tools string: Use __fallthrough in perf_atoll() Next, the following commit is required to make perf build in distributions with new Perl: commit b581c01fff646b5075d65359c8667de9c667da9e Author: Namhyung Kim Date: Tue Aug 2 11:43:17 2016 +0900 perf tools: Fix build failure on perl script context On my Archlinux machine, perf faild to build like below: CC scripts/perl/Perf-Trace-Util/Context.o In file included from /usr/lib/perl5/core/perl/CORE/perl.h:3905:0, from Context.xs:23: /usr/lib/perl5/core/perl/CORE/inline.h: In function : /usr/lib/perl5/core/perl/CORE/cop.h:612:13: warning: declaration of 'av' shadows a previous local [-Werror-shadow] AV *av =3D GvAV(PL_defgv); ^ /usr/lib/perl5/core/perl/CORE/inline.h:526:5: note: in expansion of macro 'CX_POP_SAVEARRAY' CX_POP_SAVEARRAY(cx); ^~~~~~~~~~~~~~~~ In file included from /usr/lib/perl5/core/perl/CORE/perl.h:5853:0, from Context.xs:23: /usr/lib/perl5/core/perl/CORE/inline.h:518:9: note: shadowed declaration is here AV *av; ^~ What I did to fix is adding '-Wno-shadow' as the error message said it's the cause of the failure. Since it's from the perl (not perf) code base, we don't have the control so I just wanted to ignore the warning when compiling perl scripting code. Committer note: This also fixes the build on Fedora Rawhide. Signed-off-by: Namhyung Kim Tested-by: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20160802024317.31725-1-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo Thanks.