stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* 4.1 backport request: Two perf build fixes
@ 2017-11-02 11:26 Tuomas Tynkkynen
  0 siblings, 0 replies; only message in thread
From: Tuomas Tynkkynen @ 2017-11-02 11:26 UTC (permalink / raw)
  To: Sasha Levin; +Cc: stable

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.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-11-02 11:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-02 11:26 4.1 backport request: Two perf build fixes Tuomas Tynkkynen

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).