Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1453559 > unrolled thread

[PATCH] perf tools: Fix build failture on perl script context

Started byNamhyung Kim <namhyung@kernel.org>
First post2016-08-02 04:50 +0200
Last post2016-08-04 11:20 +0200
Articles 7 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] perf tools: Fix build failture on perl script context Namhyung Kim <namhyung@kernel.org> - 2016-08-02 04:50 +0200
    Re: [PATCH] perf tools: Fix build failture on perl script context Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-08-02 15:30 +0200
    Re: [PATCH] perf tools: Fix build failture on perl script context Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-08-02 15:50 +0200
      Re: [PATCH] perf tools: Fix build failture on perl script context Namhyung Kim <namhyung@kernel.org> - 2016-08-02 16:10 +0200
        Re: [PATCH] perf tools: Fix build failture on perl script context Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-08-02 16:30 +0200
          Re: [PATCH] perf tools: Fix build failture on perl script context Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-08-02 17:20 +0200
    [tip:perf/urgent] perf tools: Fix build failure on perl script  context tip-bot for Namhyung Kim <tipbot@zytor.com> - 2016-08-04 11:20 +0200

#1453559 — [PATCH] perf tools: Fix build failture on perl script context

FromNamhyung Kim <namhyung@kernel.org>
Date2016-08-02 04:50 +0200
Subject[PATCH] perf tools: Fix build failture on perl script context
Message-ID<s1xWi-6Jw-11@gated-at.bofh.it>
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;
             ^~

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/perf/scripts/perl/Perf-Trace-Util/Build | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/perf/scripts/perl/Perf-Trace-Util/Build b/tools/perf/scripts/perl/Perf-Trace-Util/Build
index 928e110179cb..34faecf774ae 100644
--- a/tools/perf/scripts/perl/Perf-Trace-Util/Build
+++ b/tools/perf/scripts/perl/Perf-Trace-Util/Build
@@ -1,3 +1,5 @@
 libperf-y += Context.o
 
-CFLAGS_Context.o += $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-nested-externs -Wno-undef -Wno-switch-default
+CFLAGS_Context.o += $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes
+CFLAGS_Context.o += -Wno-unused-parameter -Wno-nested-externs -Wno-undef
+CFLAGS_Context.o += -Wno-switch-default -Wno-shadow
-- 
2.9.2

[toc] | [next] | [standalone]


#1454344

FromArnaldo Carvalho de Melo <acme@kernel.org>
Date2016-08-02 15:30 +0200
Message-ID<s1HVE-50V-33@gated-at.bofh.it>
In reply to#1453559
Em Tue, Aug 02, 2016 at 11:43:17AM +0900, Namhyung Kim escreveu:
> 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;
>              ^~

Ok, reproduced here with yet another container image for regularly
building perf:

  CC       /tmp/build/perf/util/usage.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 'S_cx_popsub_args':
/usr/lib/perl5/core_perl/CORE/cop.h:612:13: error: declaration of 'av'
shadows a previous local [-Werror=shadow]
         AV *av = 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;
         ^~
  CC       /tmp/build/perf/util/dso.o
cc1: all warnings being treated as errors
mv: cannot stat
'/tmp/build/perf/scripts/perl/Perf-Trace-Util/.Context.o.tmp': No such
file or directory
make[4]: *** [/git/linux/tools/build/Makefile.build:78:
/tmp/build/perf/scripts/perl/Perf-Trace-Util/Context.o] Error 1
make[3]: *** [/git/linux/tools/build/Makefile.build:116:
perl/Perf-Trace-Util] Error 2
make[2]: *** [/git/linux/tools/build/Makefile.build:116: scripts] Error
2
make[2]: *** Waiting for unfinished jobs....
  CC       /tmp/build/perf/util/symbol.o

---------------------------------------------------

this time based on:

docker run -v /home/acme/git:/git:Z --rm -ti docker.io/base/archlinux:2015.06.01 /bin/bash
pacman -Syu --noconfirm && pacman -Sy --noconfirm make gcc flex bison

----

thanks for the patch, will test and push out.

- Arnaldo

> 
> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
> ---
>  tools/perf/scripts/perl/Perf-Trace-Util/Build | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/perf/scripts/perl/Perf-Trace-Util/Build b/tools/perf/scripts/perl/Perf-Trace-Util/Build
> index 928e110179cb..34faecf774ae 100644
> --- a/tools/perf/scripts/perl/Perf-Trace-Util/Build
> +++ b/tools/perf/scripts/perl/Perf-Trace-Util/Build
> @@ -1,3 +1,5 @@
>  libperf-y += Context.o
>  
> -CFLAGS_Context.o += $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-nested-externs -Wno-undef -Wno-switch-default
> +CFLAGS_Context.o += $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes
> +CFLAGS_Context.o += -Wno-unused-parameter -Wno-nested-externs -Wno-undef
> +CFLAGS_Context.o += -Wno-switch-default -Wno-shadow
> -- 
> 2.9.2

[toc] | [prev] | [next] | [standalone]


#1454438

FromArnaldo Carvalho de Melo <acme@kernel.org>
Date2016-08-02 15:50 +0200
Message-ID<s1If1-589-59@gated-at.bofh.it>
In reply to#1453559
Em Tue, Aug 02, 2016 at 11:43:17AM +0900, Namhyung Kim escreveu:
> 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;
>              ^~

But you forgot to describe _what_ you did to "fix" the problem besides
breaking down a long line, i.e. adding -Wno-shadow, is that what we
want? To ignore such warnings?

Some explanation in the changelog as to why that is the wise solution
would help a lot :-\

- Arnaldo

> 
> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
> ---
>  tools/perf/scripts/perl/Perf-Trace-Util/Build | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/perf/scripts/perl/Perf-Trace-Util/Build b/tools/perf/scripts/perl/Perf-Trace-Util/Build
> index 928e110179cb..34faecf774ae 100644
> --- a/tools/perf/scripts/perl/Perf-Trace-Util/Build
> +++ b/tools/perf/scripts/perl/Perf-Trace-Util/Build
> @@ -1,3 +1,5 @@
>  libperf-y += Context.o
>  
> -CFLAGS_Context.o += $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-nested-externs -Wno-undef -Wno-switch-default
> +CFLAGS_Context.o += $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes
> +CFLAGS_Context.o += -Wno-unused-parameter -Wno-nested-externs -Wno-undef
> +CFLAGS_Context.o += -Wno-switch-default -Wno-shadow
> -- 
> 2.9.2

[toc] | [prev] | [next] | [standalone]


#1454496

FromNamhyung Kim <namhyung@kernel.org>
Date2016-08-02 16:10 +0200
Message-ID<s1Iyn-5ut-61@gated-at.bofh.it>
In reply to#1454438
Hi Arnaldo,

On Tue, Aug 02, 2016 at 10:29:22AM -0300, Arnaldo Carvalho de Melo wrote:
> Em Tue, Aug 02, 2016 at 11:43:17AM +0900, Namhyung Kim escreveu:
> > 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;
> >              ^~
> 
> But you forgot to describe _what_ you did to "fix" the problem besides
> breaking down a long line, i.e. adding -Wno-shadow, is that what we
> want? To ignore such warnings?
> 
> Some explanation in the changelog as to why that is the wise solution
> would help a lot :-\

Oops, sorry.

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.

Is it ok for you?

Thanks,
Namhyung


> > 
> > Signed-off-by: Namhyung Kim <namhyung@kernel.org>
> > ---
> >  tools/perf/scripts/perl/Perf-Trace-Util/Build | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> > 
> > diff --git a/tools/perf/scripts/perl/Perf-Trace-Util/Build b/tools/perf/scripts/perl/Perf-Trace-Util/Build
> > index 928e110179cb..34faecf774ae 100644
> > --- a/tools/perf/scripts/perl/Perf-Trace-Util/Build
> > +++ b/tools/perf/scripts/perl/Perf-Trace-Util/Build
> > @@ -1,3 +1,5 @@
> >  libperf-y += Context.o
> >  
> > -CFLAGS_Context.o += $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-nested-externs -Wno-undef -Wno-switch-default
> > +CFLAGS_Context.o += $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes
> > +CFLAGS_Context.o += -Wno-unused-parameter -Wno-nested-externs -Wno-undef
> > +CFLAGS_Context.o += -Wno-switch-default -Wno-shadow
> > -- 
> > 2.9.2

[toc] | [prev] | [next] | [standalone]


#1454555

FromArnaldo Carvalho de Melo <acme@kernel.org>
Date2016-08-02 16:30 +0200
Message-ID<s1IRJ-5C1-31@gated-at.bofh.it>
In reply to#1454496
Em Tue, Aug 02, 2016 at 11:03:02PM +0900, Namhyung Kim escreveu:
> Hi Arnaldo,
> 
> On Tue, Aug 02, 2016 at 10:29:22AM -0300, Arnaldo Carvalho de Melo wrote:
> > Em Tue, Aug 02, 2016 at 11:43:17AM +0900, Namhyung Kim escreveu:
> > > 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;
> > >              ^~
> > 
> > But you forgot to describe _what_ you did to "fix" the problem besides
> > breaking down a long line, i.e. adding -Wno-shadow, is that what we
> > want? To ignore such warnings?
> > 
> > Some explanation in the changelog as to why that is the wise solution
> > would help a lot :-\
> 
> Oops, sorry.
> 
> 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.
> 
> Is it ok for you?

Now it is :-)

I'll stick this to the changeset log as the reason for adding
-wno-shadow just for building the perl code.

Sometimes we'll get to this conclusion after some thinking, if you add
these explanations to the changelog then it speeds up reviewing.

Thanks,

- Arnaldo
 
> Thanks,
> Namhyung
> 
> 
> > > 
> > > Signed-off-by: Namhyung Kim <namhyung@kernel.org>
> > > ---
> > >  tools/perf/scripts/perl/Perf-Trace-Util/Build | 4 +++-
> > >  1 file changed, 3 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/tools/perf/scripts/perl/Perf-Trace-Util/Build b/tools/perf/scripts/perl/Perf-Trace-Util/Build
> > > index 928e110179cb..34faecf774ae 100644
> > > --- a/tools/perf/scripts/perl/Perf-Trace-Util/Build
> > > +++ b/tools/perf/scripts/perl/Perf-Trace-Util/Build
> > > @@ -1,3 +1,5 @@
> > >  libperf-y += Context.o
> > >  
> > > -CFLAGS_Context.o += $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-nested-externs -Wno-undef -Wno-switch-default
> > > +CFLAGS_Context.o += $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes
> > > +CFLAGS_Context.o += -Wno-unused-parameter -Wno-nested-externs -Wno-undef
> > > +CFLAGS_Context.o += -Wno-switch-default -Wno-shadow
> > > -- 
> > > 2.9.2

[toc] | [prev] | [next] | [standalone]


#1454724

FromArnaldo Carvalho de Melo <acme@kernel.org>
Date2016-08-02 17:20 +0200
Message-ID<s1JE6-6cg-37@gated-at.bofh.it>
In reply to#1454555
Em Tue, Aug 02, 2016 at 11:12:32AM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Tue, Aug 02, 2016 at 11:03:02PM +0900, Namhyung Kim escreveu:
> > 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.
> > 
> > Is it ok for you?
> 
> Now it is :-)
> 
> I'll stick this to the changeset log as the reason for adding
> -wno-shadow just for building the perl code.
> 
> Sometimes we'll get to this conclusion after some thinking, if you add
> these explanations to the changelog then it speeds up reviewing.

Cool, this fixed the build as well for fedora rawhide.

- Arnaldo

[toc] | [prev] | [next] | [standalone]


#1456245 — [tip:perf/urgent] perf tools: Fix build failure on perl script context

Fromtip-bot for Namhyung Kim <tipbot@zytor.com>
Date2016-08-04 11:20 +0200
Subject[tip:perf/urgent] perf tools: Fix build failure on perl script context
Message-ID<s2mYO-6W6-39@gated-at.bofh.it>
In reply to#1453559
Commit-ID:  b581c01fff646b5075d65359c8667de9c667da9e
Gitweb:     http://git.kernel.org/tip/b581c01fff646b5075d65359c8667de9c667da9e
Author:     Namhyung Kim <namhyung@kernel.org>
AuthorDate: Tue, 2 Aug 2016 11:43:17 +0900
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Tue, 2 Aug 2016 12:11:06 -0300

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>
---
 tools/perf/scripts/perl/Perf-Trace-Util/Build | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/perf/scripts/perl/Perf-Trace-Util/Build b/tools/perf/scripts/perl/Perf-Trace-Util/Build
index 928e110..34faecf 100644
--- a/tools/perf/scripts/perl/Perf-Trace-Util/Build
+++ b/tools/perf/scripts/perl/Perf-Trace-Util/Build
@@ -1,3 +1,5 @@
 libperf-y += Context.o
 
-CFLAGS_Context.o += $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-nested-externs -Wno-undef -Wno-switch-default
+CFLAGS_Context.o += $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes
+CFLAGS_Context.o += -Wno-unused-parameter -Wno-nested-externs -Wno-undef
+CFLAGS_Context.o += -Wno-switch-default -Wno-shadow

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web