stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
To: Sasha Levin <alexander.levin@verizon.com>
Cc: stable@vger.kernel.org
Subject: 4.1 backport request: Two perf build fixes
Date: Thu, 2 Nov 2017 13:26:14 +0200	[thread overview]
Message-ID: <20171102132614.5949b70e@thinkpad> (raw)

Hi Sasha,

First, the following commit:

commit b5bf1733d6a391c4e90ea8f8468d83023be74a2a
Author: Arnaldo Carvalho de Melo <acme@redhat.com>
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 <adrian.hunter@intel.com>
    Cc: David Ahern <dsahern@gmail.com>
    Cc: Jiri Olsa <jolsa@kernel.org>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Cc: Wang Nan <wangnan0@huawei.com>
    Cc: William Cohen <wcohen@redhat.com>
    Link: http://lkml.kernel.org/n/tip-qnpig0xfop4hwv6k4mv1wts5@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

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 <namhyung@kernel.org>
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 <namhyung@kernel.org>
    Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
    Cc: Jiri Olsa <jolsa@kernel.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Link: http://lkml.kernel.org/r/20160802024317.31725-1-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

Thanks.

                 reply	other threads:[~2017-11-02 11:26 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171102132614.5949b70e@thinkpad \
    --to=tuomas.tynkkynen@iki.fi \
    --cc=alexander.levin@verizon.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).