linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* perf build failure on Linus's tree
@ 2012-05-03 21:57 Greg KH
  2012-05-04  1:37 ` Namhyung Kim
  0 siblings, 1 reply; 25+ messages in thread
From: Greg KH @ 2012-05-03 21:57 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Paul Mackerras, Ingo Molnar, Arnaldo Carvalho de Melo, Jiri Olsa,
	Arnaud Lacombe, linux-kernel

Linus's tree right now (3.4.rc5.67.gac001.dirty) gives me the following
build error when I try to build perf:
    CC util/parse-events-flex.o
<stdout>: In function ‘yy_get_next_buffer’:
<stdout>:1510:3: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
util/parse-events.l: In function ‘parse_events_lex’:
util/parse-events.l:122:1: error: ignoring return value of ‘fwrite’, declared with attribute warn_unused_result [-Werror=unused-result]
cc1: all warnings being treated as errors

Do you really want to ensure that flex's build warnings fail the build?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: perf build failure on Linus's tree
  2012-05-03 21:57 perf build failure on Linus's tree Greg KH
@ 2012-05-04  1:37 ` Namhyung Kim
  2012-05-04  1:41   ` Greg KH
  2012-05-04  1:50   ` David Miller
  0 siblings, 2 replies; 25+ messages in thread
From: Namhyung Kim @ 2012-05-04  1:37 UTC (permalink / raw)
  To: Greg KH
  Cc: Peter Zijlstra, Paul Mackerras, Ingo Molnar,
	Arnaldo Carvalho de Melo, Jiri Olsa, Arnaud Lacombe,
	linux-kernel

Hi,

On Thu, 3 May 2012 14:57:48 -0700, Greg KH wrote:
> Linus's tree right now (3.4.rc5.67.gac001.dirty) gives me the following
> build error when I try to build perf:
>     CC util/parse-events-flex.o
> <stdout>: In function ‘yy_get_next_buffer’:
> <stdout>:1510:3: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
> util/parse-events.l: In function ‘parse_events_lex’:
> util/parse-events.l:122:1: error: ignoring return value of ‘fwrite’, declared with attribute warn_unused_result [-Werror=unused-result]
> cc1: all warnings being treated as errors
>
> Do you really want to ensure that flex's build warnings fail the build?
>
> thanks,
>
> greg k-h

Can't reproduce it on my Fedora 17 box:

namhyung@sejong:perf$ make
PERF_VERSION = 3.4.rc5.67.gac001
    GEN common-cmds.h
    * new build flags or prefix
    CC perf.o
    CC builtin-annotate.o
    CC builtin-bench.o
    CC bench/sched-messaging.o
    CC bench/sched-pipe.o
[SNIP]
    CC util/trace-event-parse.o
    CC util/parse-events-flex.o
    CC util/parse-events-bison.o
    CC util/pmu-flex.o
    CC util/pmu-bison.o
[SNIP]
    CC util/scripting-engines/trace-event-python.o
    CC scripts/python/Perf-Trace-Util/Context.o
    AR libperf.a
    LINK perf
    GEN perf-archive
    GEN python/perf.so


What are versions of tools you are using?

Thanks,
Namhyung

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: perf build failure on Linus's tree
  2012-05-04  1:37 ` Namhyung Kim
@ 2012-05-04  1:41   ` Greg KH
  2012-05-04  1:45     ` Namhyung Kim
  2012-05-04  1:50   ` David Miller
  1 sibling, 1 reply; 25+ messages in thread
From: Greg KH @ 2012-05-04  1:41 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: Peter Zijlstra, Paul Mackerras, Ingo Molnar,
	Arnaldo Carvalho de Melo, Jiri Olsa, Arnaud Lacombe,
	linux-kernel

On Fri, May 04, 2012 at 10:37:24AM +0900, Namhyung Kim wrote:
> Hi,
> 
> On Thu, 3 May 2012 14:57:48 -0700, Greg KH wrote:
> > Linus's tree right now (3.4.rc5.67.gac001.dirty) gives me the following
> > build error when I try to build perf:
> >     CC util/parse-events-flex.o
> > <stdout>: In function ‘yy_get_next_buffer’:
> > <stdout>:1510:3: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
> > util/parse-events.l: In function ‘parse_events_lex’:
> > util/parse-events.l:122:1: error: ignoring return value of ‘fwrite’, declared with attribute warn_unused_result [-Werror=unused-result]
> > cc1: all warnings being treated as errors
> >
> > Do you really want to ensure that flex's build warnings fail the build?
> >
> > thanks,
> >
> > greg k-h
> 
> Can't reproduce it on my Fedora 17 box:
> 
> namhyung@sejong:perf$ make
> PERF_VERSION = 3.4.rc5.67.gac001
>     GEN common-cmds.h
>     * new build flags or prefix
>     CC perf.o
>     CC builtin-annotate.o
>     CC builtin-bench.o
>     CC bench/sched-messaging.o
>     CC bench/sched-pipe.o
> [SNIP]
>     CC util/trace-event-parse.o
>     CC util/parse-events-flex.o
>     CC util/parse-events-bison.o
>     CC util/pmu-flex.o
>     CC util/pmu-bison.o
> [SNIP]
>     CC util/scripting-engines/trace-event-python.o
>     CC scripts/python/Perf-Trace-Util/Context.o
>     AR libperf.a
>     LINK perf
>     GEN perf-archive
>     GEN python/perf.so
> 
> 
> What are versions of tools you are using?

gcc 4.6.2 from openSUSE 12.1.
Any other tools you want to know the version of?


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: perf build failure on Linus's tree
  2012-05-04  1:41   ` Greg KH
@ 2012-05-04  1:45     ` Namhyung Kim
  0 siblings, 0 replies; 25+ messages in thread
From: Namhyung Kim @ 2012-05-04  1:45 UTC (permalink / raw)
  To: Greg KH
  Cc: Peter Zijlstra, Paul Mackerras, Ingo Molnar,
	Arnaldo Carvalho de Melo, Jiri Olsa, Arnaud Lacombe,
	linux-kernel

Hi,

On Thu, 3 May 2012 18:41:20 -0700, Greg KH wrote:
> On Fri, May 04, 2012 at 10:37:24AM +0900, Namhyung Kim wrote:
>> What are versions of tools you are using?
>
> gcc 4.6.2 from openSUSE 12.1.
> Any other tools you want to know the version of?

flex and bison versions might be helpful.

Thanks,
Namhyung

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: perf build failure on Linus's tree
  2012-05-04  1:37 ` Namhyung Kim
  2012-05-04  1:41   ` Greg KH
@ 2012-05-04  1:50   ` David Miller
  2012-05-04  2:14     ` Arnaud Lacombe
  1 sibling, 1 reply; 25+ messages in thread
From: David Miller @ 2012-05-04  1:50 UTC (permalink / raw)
  To: namhyung.kim
  Cc: gregkh, a.p.zijlstra, paulus, mingo, acme, jolsa, lacombar, linux-kernel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: Text/Plain; charset=iso-8859-7, Size: 1136 bytes --]

From: Namhyung Kim <namhyung.kim@lge.com>
Date: Fri, 04 May 2012 10:37:24 +0900

> Hi,
> 
> On Thu, 3 May 2012 14:57:48 -0700, Greg KH wrote:
>> Linus's tree right now (3.4.rc5.67.gac001.dirty) gives me the following
>> build error when I try to build perf:
>>     CC util/parse-events-flex.o
>> <stdout>: In function ¡yy_get_next_buffer¢:
>> <stdout>:1510:3: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
>> util/parse-events.l: In function ¡parse_events_lex¢:
>> util/parse-events.l:122:1: error: ignoring return value of ¡fwrite¢, declared with attribute warn_unused_result [-Werror=unused-result]
>> cc1: all warnings being treated as errors
>>
>> Do you really want to ensure that flex's build warnings fail the build?
>>
>> thanks,
>>
>> greg k-h
> 
> Can't reproduce it on my Fedora 17 box:

Because your glibc headers probably don't have the warn_unused_result attribute
in the extern declaration of fwrite() like Greg's do.
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: perf build failure on Linus's tree
  2012-05-04  1:50   ` David Miller
@ 2012-05-04  2:14     ` Arnaud Lacombe
  2012-05-04  2:24       ` Namhyung Kim
  2012-05-04  2:29       ` Arnaud Lacombe
  0 siblings, 2 replies; 25+ messages in thread
From: Arnaud Lacombe @ 2012-05-04  2:14 UTC (permalink / raw)
  To: David Miller
  Cc: namhyung.kim, gregkh, a.p.zijlstra, paulus, mingo, acme, jolsa,
	linux-kernel

Hi,

On Thu, May 3, 2012 at 9:50 PM, David Miller <davem@davemloft.net> wrote:
> From: Namhyung Kim <namhyung.kim@lge.com>
> Date: Fri, 04 May 2012 10:37:24 +0900
>
>> Hi,
>>
>> On Thu, 3 May 2012 14:57:48 -0700, Greg KH wrote:
>>> Linus's tree right now (3.4.rc5.67.gac001.dirty) gives me the following
>>> build error when I try to build perf:
>>>     CC util/parse-events-flex.o
>>> <stdout>: In function ‘yy_get_next_buffer’:
>>> <stdout>:1510:3: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
>>> util/parse-events.l: In function ‘parse_events_lex’:
>>> util/parse-events.l:122:1: error: ignoring return value of ‘fwrite’, declared with attribute warn_unused_result [-Werror=unused-result]
>>> cc1: all warnings being treated as errors
>>>
>>> Do you really want to ensure that flex's build warnings fail the build?
>>>
>>> thanks,
>>>
>>> greg k-h
>>
>> Can't reproduce it on my Fedora 17 box:
>
> Because your glibc headers probably don't have the warn_unused_result attribute
> in the extern declaration of fwrite() like Greg's do.
>
`tools/perf/Makefile' adds -D_FORTIFY_SOURCE=2 on the compiler's
command line, which in turn adds `__attribute__
((__warn_unused_result__))' to fwrite(3)'s prototypes, via `__wur'. I
double checked by pre-processing `util/parse-events-flex.c' with the
same arguments used by perf. fwrite(3) ends up being declared as:

extern size_t fwrite (__const void *__restrict __ptr, size_t __size,
        size_t __n, FILE *__restrict __s) __attribute__
((__warn_unused_result__));

So it is definitively enabled, and used, on Fedora.

Above tests were done on Fedora 15/x86_64 and Fedora 16/x86_64, `perf'
build without any issue there too.

my 0.2c,
 - Arnaud

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: perf build failure on Linus's tree
  2012-05-04  2:14     ` Arnaud Lacombe
@ 2012-05-04  2:24       ` Namhyung Kim
  2012-05-04  2:29       ` Arnaud Lacombe
  1 sibling, 0 replies; 25+ messages in thread
From: Namhyung Kim @ 2012-05-04  2:24 UTC (permalink / raw)
  To: Arnaud Lacombe
  Cc: David Miller, gregkh, a.p.zijlstra, paulus, mingo, acme, jolsa,
	linux-kernel

Hi,

On Thu, 3 May 2012 22:14:03 -0400, Arnaud Lacombe wrote:
> Hi,
>
> On Thu, May 3, 2012 at 9:50 PM, David Miller <davem@davemloft.net> wrote:
>> From: Namhyung Kim <namhyung.kim@lge.com>
>> Date: Fri, 04 May 2012 10:37:24 +0900
>>
>>> Hi,
>>>
>>> On Thu, 3 May 2012 14:57:48 -0700, Greg KH wrote:
>>>> Linus's tree right now (3.4.rc5.67.gac001.dirty) gives me the following
>>>> build error when I try to build perf:
>>>>     CC util/parse-events-flex.o
>>>> <stdout>: In function ‘yy_get_next_buffer’:
>>>> <stdout>:1510:3: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
>>>> util/parse-events.l: In function ‘parse_events_lex’:
>>>> util/parse-events.l:122:1: error: ignoring return value of ‘fwrite’, declared with attribute warn_unused_result [-Werror=unused-result]
>>>> cc1: all warnings being treated as errors
>>>>
>>>> Do you really want to ensure that flex's build warnings fail the build?
>>>>
>>>> thanks,
>>>>
>>>> greg k-h
>>>
>>> Can't reproduce it on my Fedora 17 box:
>>
>> Because your glibc headers probably don't have the warn_unused_result attribute
>> in the extern declaration of fwrite() like Greg's do.
>>
> `tools/perf/Makefile' adds -D_FORTIFY_SOURCE=2 on the compiler's
> command line, which in turn adds `__attribute__
> ((__warn_unused_result__))' to fwrite(3)'s prototypes, via `__wur'. I
> double checked by pre-processing `util/parse-events-flex.c' with the
> same arguments used by perf. fwrite(3) ends up being declared as:
>
> extern size_t fwrite (__const void *__restrict __ptr, size_t __size,
>         size_t __n, FILE *__restrict __s) __attribute__
> ((__warn_unused_result__));
>
> So it is definitively enabled, and used, on Fedora.
>
> Above tests were done on Fedora 15/x86_64 and Fedora 16/x86_64, `perf'
> build without any issue there too.
>
> my 0.2c,
>  - Arnaud

On my desktop:

$ make util/parse-events-flex.i
    CC util/parse-events-flex.i

$ grep -A1 'size_t fwrite' util/parse-events-flex.i
extern size_t fwrite (__const void *__restrict __ptr, size_t __size,
        size_t __n, FILE *__restrict __s) __attribute__ ((__warn_unused_result__));
--
extern size_t fwrite_unlocked (__const void *__restrict __ptr, size_t __size,
          size_t __n, FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));


Thanks,
Namhyung

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: perf build failure on Linus's tree
  2012-05-04  2:14     ` Arnaud Lacombe
  2012-05-04  2:24       ` Namhyung Kim
@ 2012-05-04  2:29       ` Arnaud Lacombe
  2012-05-04  2:35         ` Arnaud Lacombe
  1 sibling, 1 reply; 25+ messages in thread
From: Arnaud Lacombe @ 2012-05-04  2:29 UTC (permalink / raw)
  To: David Miller
  Cc: namhyung.kim, gregkh, a.p.zijlstra, paulus, mingo, acme, jolsa,
	linux-kernel

Hi,

On Thu, May 3, 2012 at 10:14 PM, Arnaud Lacombe <lacombar@gmail.com> wrote:
> Hi,
>
> On Thu, May 3, 2012 at 9:50 PM, David Miller <davem@davemloft.net> wrote:
>> From: Namhyung Kim <namhyung.kim@lge.com>
>> Date: Fri, 04 May 2012 10:37:24 +0900
>>
>>> Hi,
>>>
>>> On Thu, 3 May 2012 14:57:48 -0700, Greg KH wrote:
>>>> Linus's tree right now (3.4.rc5.67.gac001.dirty) gives me the following
>>>> build error when I try to build perf:
>>>>     CC util/parse-events-flex.o
>>>> <stdout>: In function ‘yy_get_next_buffer’:
>>>> <stdout>:1510:3: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
>>>> util/parse-events.l: In function ‘parse_events_lex’:
>>>> util/parse-events.l:122:1: error: ignoring return value of ‘fwrite’, declared with attribute warn_unused_result [-Werror=unused-result]
>>>> cc1: all warnings being treated as errors
>>>>
>>>> Do you really want to ensure that flex's build warnings fail the build?
>>>>
>>>> thanks,
>>>>
>>>> greg k-h
>>>
>>> Can't reproduce it on my Fedora 17 box:
>>
>> Because your glibc headers probably don't have the warn_unused_result attribute
>> in the extern declaration of fwrite() like Greg's do.
>>
> `tools/perf/Makefile' adds -D_FORTIFY_SOURCE=2 on the compiler's
> command line, which in turn adds `__attribute__
> ((__warn_unused_result__))' to fwrite(3)'s prototypes, via `__wur'. I
> double checked by pre-processing `util/parse-events-flex.c' with the
> same arguments used by perf. fwrite(3) ends up being declared as:
>
> extern size_t fwrite (__const void *__restrict __ptr, size_t __size,
>        size_t __n, FILE *__restrict __s) __attribute__
> ((__warn_unused_result__));
>
> So it is definitively enabled, and used, on Fedora.
>
> Above tests were done on Fedora 15/x86_64 and Fedora 16/x86_64, `perf'
> build without any issue there too.
>
it would seem that OpenSuse 12.1 and Fedora ship the same `flex'
package, upstream version 2.5.35. However, Fedora specifically harden
flex(1) wrt. lacks of fwrite(3)'s return value check, see [0] for the
exact patch.

 - Arnaud

[0]: http://pkgs.fedoraproject.org/gitweb/?p=flex.git;a=blob;f=flex-2.5.35-hardening.patch;h=7d608ea2371fa3295bdb8eb97c15eeb03029c02b;hb=HEAD

> my 0.2c,
>  - Arnaud

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: perf build failure on Linus's tree
  2012-05-04  2:29       ` Arnaud Lacombe
@ 2012-05-04  2:35         ` Arnaud Lacombe
  2012-05-04  2:47           ` Greg KH
  0 siblings, 1 reply; 25+ messages in thread
From: Arnaud Lacombe @ 2012-05-04  2:35 UTC (permalink / raw)
  To: David Miller
  Cc: namhyung.kim, gregkh, a.p.zijlstra, paulus, mingo, acme, jolsa,
	linux-kernel

Hi,

On Thu, May 3, 2012 at 10:29 PM, Arnaud Lacombe <lacombar@gmail.com> wrote:
> [...]
> [0]: http://pkgs.fedoraproject.org/gitweb/?p=flex.git;a=blob;f=flex-2.5.35-hardening.patch;h=7d608ea2371fa3295bdb8eb97c15eeb03029c02b;hb=HEAD
>
as a side note, this patch sounds more being about "silencing" than
"hardening"...

 - Arnaud

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: perf build failure on Linus's tree
  2012-05-04  2:35         ` Arnaud Lacombe
@ 2012-05-04  2:47           ` Greg KH
  2012-05-04  3:01             ` Arnaud Lacombe
  0 siblings, 1 reply; 25+ messages in thread
From: Greg KH @ 2012-05-04  2:47 UTC (permalink / raw)
  To: Arnaud Lacombe
  Cc: David Miller, namhyung.kim, a.p.zijlstra, paulus, mingo, acme,
	jolsa, linux-kernel

On Thu, May 03, 2012 at 10:35:02PM -0400, Arnaud Lacombe wrote:
> Hi,
> 
> On Thu, May 3, 2012 at 10:29 PM, Arnaud Lacombe <lacombar@gmail.com> wrote:
> > [...]
> > [0]: http://pkgs.fedoraproject.org/gitweb/?p=flex.git;a=blob;f=flex-2.5.35-hardening.patch;h=7d608ea2371fa3295bdb8eb97c15eeb03029c02b;hb=HEAD
> >
> as a side note, this patch sounds more being about "silencing" than
> "hardening"...

That's nice, but I can build the perf version in 3.3 just fine, so
something broke here (hint, build regression.)  Do I have to bisect it
down to find the problem?

greg

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: perf build failure on Linus's tree
  2012-05-04  2:47           ` Greg KH
@ 2012-05-04  3:01             ` Arnaud Lacombe
  2012-05-04  3:16               ` Greg KH
  0 siblings, 1 reply; 25+ messages in thread
From: Arnaud Lacombe @ 2012-05-04  3:01 UTC (permalink / raw)
  To: Greg KH
  Cc: David Miller, namhyung.kim, a.p.zijlstra, paulus, mingo, acme,
	jolsa, linux-kernel

Hi,

On Thu, May 3, 2012 at 10:47 PM, Greg KH <gregkh@linuxfoundation.org> wrote:
> On Thu, May 03, 2012 at 10:35:02PM -0400, Arnaud Lacombe wrote:
>> Hi,
>>
>> On Thu, May 3, 2012 at 10:29 PM, Arnaud Lacombe <lacombar@gmail.com> wrote:
>> > [...]
>> > [0]: http://pkgs.fedoraproject.org/gitweb/?p=flex.git;a=blob;f=flex-2.5.35-hardening.patch;h=7d608ea2371fa3295bdb8eb97c15eeb03029c02b;hb=HEAD
>> >
>> as a side note, this patch sounds more being about "silencing" than
>> "hardening"...
>
> That's nice, but I can build the perf version in 3.3 just fine, so
> something broke here (hint, build regression.)  Do I have to bisect it
> down to find the problem?
>
there is most likely nothing to bisect, `perf' seems to have never
required any parser before 3.4. The way the rest of the tools
(especially `kconfig', `genksyms' and `dtc') manage parsers is via
pre-generated .[ch]_shipped version of the lexer/tokenizer. It's been
working well for a long time as such. `perf' will certainly have to
follow the same path.

 - Arnaud

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: perf build failure on Linus's tree
  2012-05-04  3:01             ` Arnaud Lacombe
@ 2012-05-04  3:16               ` Greg KH
  2012-05-04  4:01                 ` Arnaud Lacombe
  2012-05-04  7:09                 ` [patch] perf: Fix build failure on OpenSuse userspace Ingo Molnar
  0 siblings, 2 replies; 25+ messages in thread
From: Greg KH @ 2012-05-04  3:16 UTC (permalink / raw)
  To: Arnaud Lacombe
  Cc: David Miller, namhyung.kim, a.p.zijlstra, paulus, mingo, acme,
	jolsa, linux-kernel

On Thu, May 03, 2012 at 11:01:54PM -0400, Arnaud Lacombe wrote:
> Hi,
> 
> On Thu, May 3, 2012 at 10:47 PM, Greg KH <gregkh@linuxfoundation.org> wrote:
> > On Thu, May 03, 2012 at 10:35:02PM -0400, Arnaud Lacombe wrote:
> >> Hi,
> >>
> >> On Thu, May 3, 2012 at 10:29 PM, Arnaud Lacombe <lacombar@gmail.com> wrote:
> >> > [...]
> >> > [0]: http://pkgs.fedoraproject.org/gitweb/?p=flex.git;a=blob;f=flex-2.5.35-hardening.patch;h=7d608ea2371fa3295bdb8eb97c15eeb03029c02b;hb=HEAD
> >> >
> >> as a side note, this patch sounds more being about "silencing" than
> >> "hardening"...
> >
> > That's nice, but I can build the perf version in 3.3 just fine, so
> > something broke here (hint, build regression.)  Do I have to bisect it
> > down to find the problem?
> >
> there is most likely nothing to bisect, `perf' seems to have never
> required any parser before 3.4. The way the rest of the tools
> (especially `kconfig', `genksyms' and `dtc') manage parsers is via
> pre-generated .[ch]_shipped version of the lexer/tokenizer. It's been
> working well for a long time as such. `perf' will certainly have to
> follow the same path.

Well, it can allow bison to run, but just don't break the build if the
generated code it creates happens to contain warnings.

I'm using bison 2.5 and flex 2.5.35, and my phone number is...

Like this really matters?  This needs to work for everyone, if not, you
better put the specific version numbers you need to require in the
Documentation/Changes file.

So, how do I fix this?

greg k-h

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: perf build failure on Linus's tree
  2012-05-04  3:16               ` Greg KH
@ 2012-05-04  4:01                 ` Arnaud Lacombe
  2012-05-04  7:09                 ` [patch] perf: Fix build failure on OpenSuse userspace Ingo Molnar
  1 sibling, 0 replies; 25+ messages in thread
From: Arnaud Lacombe @ 2012-05-04  4:01 UTC (permalink / raw)
  To: Greg KH
  Cc: David Miller, namhyung.kim, a.p.zijlstra, paulus, mingo, acme,
	jolsa, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2341 bytes --]

Hi,

On Thu, May 3, 2012 at 11:16 PM, Greg KH <gregkh@linuxfoundation.org> wrote:
> On Thu, May 03, 2012 at 11:01:54PM -0400, Arnaud Lacombe wrote:
>> Hi,
>>
>> On Thu, May 3, 2012 at 10:47 PM, Greg KH <gregkh@linuxfoundation.org> wrote:
>> > On Thu, May 03, 2012 at 10:35:02PM -0400, Arnaud Lacombe wrote:
>> >> Hi,
>> >>
>> >> On Thu, May 3, 2012 at 10:29 PM, Arnaud Lacombe <lacombar@gmail.com> wrote:
>> >> > [...]
>> >> > [0]: http://pkgs.fedoraproject.org/gitweb/?p=flex.git;a=blob;f=flex-2.5.35-hardening.patch;h=7d608ea2371fa3295bdb8eb97c15eeb03029c02b;hb=HEAD
>> >> >
>> >> as a side note, this patch sounds more being about "silencing" than
>> >> "hardening"...
>> >
>> > That's nice, but I can build the perf version in 3.3 just fine, so
>> > something broke here (hint, build regression.)  Do I have to bisect it
>> > down to find the problem?
>> >
>> there is most likely nothing to bisect, `perf' seems to have never
>> required any parser before 3.4. The way the rest of the tools
>> (especially `kconfig', `genksyms' and `dtc') manage parsers is via
>> pre-generated .[ch]_shipped version of the lexer/tokenizer. It's been
>> working well for a long time as such. `perf' will certainly have to
>> follow the same path.
>
> Well, it can allow bison to run, but just don't break the build if the
> generated code it creates happens to contain warnings.
>
> I'm using bison 2.5 and flex 2.5.35, and my phone number is...
>
> Like this really matters?  This needs to work for everyone, if not, you
> better put the specific version numbers you need to require in the
> Documentation/Changes file.
>
This will not really help. Fedora and OpenSuse both ship flex 2.5.35,
which happens to both produce different output. It will be a real mess
to track which patch is applied by such or such distro which results
in such behavior.

Now, I agree with you. This does not *need* to work, it *must*.
Removing the dependency on bison/flex for normal users would make it
more manageable, from my point of view.

> So, how do I fix this?
>
you may either want to try the attached patch, or wait for `perf's
folks to look at this issue.

 - Arnaud

ps: btw, please do not shoot at the messenger, I had nothing to do
with `util/perf' before you Cc'ed me. I'm just proposing solutions...

[-- Attachment #2: 0001-perf-pre-generate-events-and-pmu-parsers.patch.gz --]
[-- Type: application/x-gzip, Size: 63237 bytes --]

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [patch] perf: Fix build failure on OpenSuse userspace
  2012-05-04  3:16               ` Greg KH
  2012-05-04  4:01                 ` Arnaud Lacombe
@ 2012-05-04  7:09                 ` Ingo Molnar
  2012-05-04 14:44                   ` Arnaud Lacombe
                                     ` (2 more replies)
  1 sibling, 3 replies; 25+ messages in thread
From: Ingo Molnar @ 2012-05-04  7:09 UTC (permalink / raw)
  To: Greg KH
  Cc: Arnaud Lacombe, David Miller, namhyung.kim, a.p.zijlstra, paulus,
	mingo, acme, jolsa, linux-kernel


* Greg KH <gregkh@linuxfoundation.org> wrote:

> On Thu, May 03, 2012 at 11:01:54PM -0400, Arnaud Lacombe wrote:
> > Hi,
> > 
> > On Thu, May 3, 2012 at 10:47 PM, Greg KH <gregkh@linuxfoundation.org> wrote:
> > > On Thu, May 03, 2012 at 10:35:02PM -0400, Arnaud Lacombe wrote:
> > >> Hi,
> > >>
> > >> On Thu, May 3, 2012 at 10:29 PM, Arnaud Lacombe <lacombar@gmail.com> wrote:
> > >> > [...]
> > >> > [0]: http://pkgs.fedoraproject.org/gitweb/?p=flex.git;a=blob;f=flex-2.5.35-hardening.patch;h=7d608ea2371fa3295bdb8eb97c15eeb03029c02b;hb=HEAD
> > >> >
> > >> as a side note, this patch sounds more being about "silencing" than
> > >> "hardening"...
> > >
> > > That's nice, but I can build the perf version in 3.3 just fine, so
> > > something broke here (hint, build regression.)  Do I have to bisect it
> > > down to find the problem?
> > >
> > there is most likely nothing to bisect, `perf' seems to have never
> > required any parser before 3.4. The way the rest of the tools
> > (especially `kconfig', `genksyms' and `dtc') manage parsers is via
> > pre-generated .[ch]_shipped version of the lexer/tokenizer. It's been
> > working well for a long time as such. `perf' will certainly have to
> > follow the same path.
> 
> Well, it can allow bison to run, but just don't break the build if the
> generated code it creates happens to contain warnings.
> 
> I'm using bison 2.5 and flex 2.5.35, and my phone number is...
> 
> Like this really matters?  This needs to work for everyone, if not, you
> better put the specific version numbers you need to require in the
> Documentation/Changes file.
> 
> So, how do I fix this?

Does the (untested) patch below help?

If not then please paste me the build failure output (it will 
most likely change due to the patch), and until we fix this 
build regression on OpenSuse userspace you can work it around 
via:

  make WERROR=0

Thanks,

	Ingo

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 7055a00..3174e9b 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -729,10 +729,10 @@ $(OUTPUT)perf.o perf.spec \
 # over the general rule for .o
 
 $(OUTPUT)util/%-flex.o: $(OUTPUT)util/%-flex.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -Iutil/ -Wno-redundant-decls -Wno-switch-default -Wno-unused-function $<
+	$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -Iutil/ -Wno-redundant-decls -Wno-switch-default -Wno-unused-function -Wno-unused-parameter $<
 
 $(OUTPUT)util/%-bison.o: $(OUTPUT)util/%-bison.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -Iutil/ -Wno-redundant-decls -Wno-switch-default -Wno-unused-function $<
+	$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -Iutil/ -Wno-redundant-decls -Wno-switch-default -Wno-unused-function -Wno-unused-parameter $<
 
 $(OUTPUT)%.o: %.c $(OUTPUT)PERF-CFLAGS
 	$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $<

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* Re: [patch] perf: Fix build failure on OpenSuse userspace
  2012-05-04  7:09                 ` [patch] perf: Fix build failure on OpenSuse userspace Ingo Molnar
@ 2012-05-04 14:44                   ` Arnaud Lacombe
  2012-05-04 14:55                     ` Namhyung Kim
                                       ` (2 more replies)
  2012-05-04 14:52                   ` Greg KH
  2012-05-04 15:10                   ` Lucas De Marchi
  2 siblings, 3 replies; 25+ messages in thread
From: Arnaud Lacombe @ 2012-05-04 14:44 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Greg KH, David Miller, namhyung.kim, a.p.zijlstra, paulus, mingo,
	acme, jolsa, linux-kernel

Hi,

On Fri, May 4, 2012 at 3:09 AM, Ingo Molnar <mingo@kernel.org> wrote:
>
> * Greg KH <gregkh@linuxfoundation.org> wrote:
>
>> On Thu, May 03, 2012 at 11:01:54PM -0400, Arnaud Lacombe wrote:
>> > Hi,
>> >
>> > On Thu, May 3, 2012 at 10:47 PM, Greg KH <gregkh@linuxfoundation.org> wrote:
>> > > On Thu, May 03, 2012 at 10:35:02PM -0400, Arnaud Lacombe wrote:
>> > >> Hi,
>> > >>
>> > >> On Thu, May 3, 2012 at 10:29 PM, Arnaud Lacombe <lacombar@gmail.com> wrote:
>> > >> > [...]
>> > >> > [0]: http://pkgs.fedoraproject.org/gitweb/?p=flex.git;a=blob;f=flex-2.5.35-hardening.patch;h=7d608ea2371fa3295bdb8eb97c15eeb03029c02b;hb=HEAD
>> > >> >
>> > >> as a side note, this patch sounds more being about "silencing" than
>> > >> "hardening"...
>> > >
>> > > That's nice, but I can build the perf version in 3.3 just fine, so
>> > > something broke here (hint, build regression.)  Do I have to bisect it
>> > > down to find the problem?
>> > >
>> > there is most likely nothing to bisect, `perf' seems to have never
>> > required any parser before 3.4. The way the rest of the tools
>> > (especially `kconfig', `genksyms' and `dtc') manage parsers is via
>> > pre-generated .[ch]_shipped version of the lexer/tokenizer. It's been
>> > working well for a long time as such. `perf' will certainly have to
>> > follow the same path.
>>
>> Well, it can allow bison to run, but just don't break the build if the
>> generated code it creates happens to contain warnings.
>>
>> I'm using bison 2.5 and flex 2.5.35, and my phone number is...
>>
>> Like this really matters?  This needs to work for everyone, if not, you
>> better put the specific version numbers you need to require in the
>> Documentation/Changes file.
>>
>> So, how do I fix this?
>
> Does the (untested) patch below help?
>
> If not then please paste me the build failure output (it will
> most likely change due to the patch), and until we fix this
> build regression on OpenSuse userspace you can work it around
> via:
>
>  make WERROR=0
>
> Thanks,
>
>        Ingo
>
> diff --git a/tools/perf/Makefile b/tools/perf/Makefile
> index 7055a00..3174e9b 100644
> --- a/tools/perf/Makefile
> +++ b/tools/perf/Makefile
> @@ -729,10 +729,10 @@ $(OUTPUT)perf.o perf.spec \
>  # over the general rule for .o
>
>  $(OUTPUT)util/%-flex.o: $(OUTPUT)util/%-flex.c $(OUTPUT)PERF-CFLAGS
> -       $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -Iutil/ -Wno-redundant-decls -Wno-switch-default -Wno-unused-function $<
> +       $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -Iutil/ -Wno-redundant-decls -Wno-switch-default -Wno-unused-function -Wno-unused-parameter $<
>
>  $(OUTPUT)util/%-bison.o: $(OUTPUT)util/%-bison.c $(OUTPUT)PERF-CFLAGS
> -       $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -Iutil/ -Wno-redundant-decls -Wno-switch-default -Wno-unused-function $<
> +       $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -Iutil/ -Wno-redundant-decls -Wno-switch-default -Wno-unused-function -Wno-unused-parameter $<
>
>  $(OUTPUT)%.o: %.c $(OUTPUT)PERF-CFLAGS
>        $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $<
>
You can find the build failure log in
<20120503215748.GA18995@kroah.com>, pasted here for reference:

    CC util/parse-events-flex.o
<stdout>: In function ‘yy_get_next_buffer’:
<stdout>:1510:3: error: comparison between signed and unsigned integer
expressions [-Werror=sign-compare]
util/parse-events.l: In function ‘parse_events_lex’:
util/parse-events.l:122:1: error: ignoring return value of
‘fwrite’, declared with attribute warn_unused_result
[-Werror=unused-result]
cc1: all warnings being treated as errors

So I doubt -Wno-unused-parameter will do any good here.

How about my solution, pre-generating the lexer/tokenizer ? It has
been used without trouble in other place of the tree for years. I
don't really see the point of micro-managing flex/bison issue here.

 - Arnaud

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [patch] perf: Fix build failure on OpenSuse userspace
  2012-05-04  7:09                 ` [patch] perf: Fix build failure on OpenSuse userspace Ingo Molnar
  2012-05-04 14:44                   ` Arnaud Lacombe
@ 2012-05-04 14:52                   ` Greg KH
  2012-05-04 15:10                   ` Lucas De Marchi
  2 siblings, 0 replies; 25+ messages in thread
From: Greg KH @ 2012-05-04 14:52 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Arnaud Lacombe, David Miller, namhyung.kim, a.p.zijlstra, paulus,
	mingo, acme, jolsa, linux-kernel

On Fri, May 04, 2012 at 09:09:28AM +0200, Ingo Molnar wrote:
> Does the (untested) patch below help?

No :(

> If not then please paste me the build failure output (it will 
> most likely change due to the patch), and until we fix this 
> build regression on OpenSuse userspace you can work it around 
> via:

Here's the error, it looks identical to what I previously had:

    CC perf.o
    CC util/parse-events-flex.o
<stdout>: In function ‘yy_get_next_buffer’:
<stdout>:1510:3: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
util/parse-events.l: In function ‘parse_events_lex’:
util/parse-events.l:122:1: error: ignoring return value of ‘fwrite’, declared with attribute warn_unused_result [-Werror=unused-result]
cc1: all warnings being treated as errors

>   make WERROR=0

Thanks, that works for me for now, but obviously, not a real solution :)

greg k-h

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [patch] perf: Fix build failure on OpenSuse userspace
  2012-05-04 14:44                   ` Arnaud Lacombe
@ 2012-05-04 14:55                     ` Namhyung Kim
  2012-05-04 15:09                       ` Greg KH
  2012-05-04 15:02                     ` Jiri Olsa
  2012-05-04 15:03                     ` Arnaldo Carvalho de Melo
  2 siblings, 1 reply; 25+ messages in thread
From: Namhyung Kim @ 2012-05-04 14:55 UTC (permalink / raw)
  To: Arnaud Lacombe
  Cc: Ingo Molnar, Greg KH, David Miller, namhyung.kim, a.p.zijlstra,
	paulus, mingo, acme, jolsa, linux-kernel

Hi,

On Fri, 4 May 2012 10:44:28 -0400, Arnaud Lacombe wrote:
> How about my solution, pre-generating the lexer/tokenizer ? It has
> been used without trouble in other place of the tree for years. I
> don't really see the point of micro-managing flex/bison issue here.
>

There was a discussion:

  https://lkml.org/lkml/2012/3/27/263


Thanks,
Namhyung

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [patch] perf: Fix build failure on OpenSuse userspace
  2012-05-04 14:44                   ` Arnaud Lacombe
  2012-05-04 14:55                     ` Namhyung Kim
@ 2012-05-04 15:02                     ` Jiri Olsa
  2012-05-04 15:26                       ` Namhyung Kim
  2012-05-04 15:03                     ` Arnaldo Carvalho de Melo
  2 siblings, 1 reply; 25+ messages in thread
From: Jiri Olsa @ 2012-05-04 15:02 UTC (permalink / raw)
  To: Arnaud Lacombe
  Cc: Ingo Molnar, Greg KH, David Miller, namhyung.kim, a.p.zijlstra,
	paulus, mingo, acme, linux-kernel

On Fri, May 04, 2012 at 10:44:28AM -0400, Arnaud Lacombe wrote:
> Hi,
> 
> On Fri, May 4, 2012 at 3:09 AM, Ingo Molnar <mingo@kernel.org> wrote:
> >
> > * Greg KH <gregkh@linuxfoundation.org> wrote:
> >

SNIP

> > diff --git a/tools/perf/Makefile b/tools/perf/Makefile
> > index 7055a00..3174e9b 100644
> > --- a/tools/perf/Makefile
> > +++ b/tools/perf/Makefile
> > @@ -729,10 +729,10 @@ $(OUTPUT)perf.o perf.spec \
> >  # over the general rule for .o
> >
> >  $(OUTPUT)util/%-flex.o: $(OUTPUT)util/%-flex.c $(OUTPUT)PERF-CFLAGS
> > -       $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -Iutil/ -Wno-redundant-decls -Wno-switch-default -Wno-unused-function $<
> > +       $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -Iutil/ -Wno-redundant-decls -Wno-switch-default -Wno-unused-function -Wno-unused-parameter $<
> >
> >  $(OUTPUT)util/%-bison.o: $(OUTPUT)util/%-bison.c $(OUTPUT)PERF-CFLAGS
> > -       $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -Iutil/ -Wno-redundant-decls -Wno-switch-default -Wno-unused-function $<
> > +       $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -Iutil/ -Wno-redundant-decls -Wno-switch-default -Wno-unused-function -Wno-unused-parameter $<
> >
> >  $(OUTPUT)%.o: %.c $(OUTPUT)PERF-CFLAGS
> >        $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $<
> >
> You can find the build failure log in
> <20120503215748.GA18995@kroah.com>, pasted here for reference:
> 
>     CC util/parse-events-flex.o
> <stdout>: In function ‘yy_get_next_buffer’:
> <stdout>:1510:3: error: comparison between signed and unsigned integer
> expressions [-Werror=sign-compare]
> util/parse-events.l: In function ‘parse_events_lex’:
> util/parse-events.l:122:1: error: ignoring return value of
> ‘fwrite’, declared with attribute warn_unused_result
> [-Werror=unused-result]
> cc1: all warnings being treated as errors
> 
> So I doubt -Wno-unused-parameter will do any good here.
I think we need also -Wno-sign-compare, please check the attached patch

jirka


---
diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 7055a00..8f7b6cf 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -729,10 +729,10 @@ $(OUTPUT)perf.o perf.spec \
 # over the general rule for .o
 
 $(OUTPUT)util/%-flex.o: $(OUTPUT)util/%-flex.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -Iutil/ -Wno-redundant-decls -Wno-switch-default -Wno-unused-function $<
+	$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -Iutil/ -Wno-redundant-decls -Wno-switch-default -Wno-unused-function -Wno-unused-parameter -Wno-sign-compare $<
 
 $(OUTPUT)util/%-bison.o: $(OUTPUT)util/%-bison.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -Iutil/ -Wno-redundant-decls -Wno-switch-default -Wno-unused-function $<
+	$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -Iutil/ -Wno-redundant-decls -Wno-switch-default -Wno-unused-function -Wno-unused-parameter -Wno-sign-compare $<
 
 $(OUTPUT)%.o: %.c $(OUTPUT)PERF-CFLAGS
 	$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $<

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* Re: [patch] perf: Fix build failure on OpenSuse userspace
  2012-05-04 14:44                   ` Arnaud Lacombe
  2012-05-04 14:55                     ` Namhyung Kim
  2012-05-04 15:02                     ` Jiri Olsa
@ 2012-05-04 15:03                     ` Arnaldo Carvalho de Melo
  2 siblings, 0 replies; 25+ messages in thread
From: Arnaldo Carvalho de Melo @ 2012-05-04 15:03 UTC (permalink / raw)
  To: Arnaud Lacombe
  Cc: Ingo Molnar, Greg KH, David Miller, namhyung.kim, a.p.zijlstra,
	paulus, mingo, jolsa, linux-kernel

Em Fri, May 04, 2012 at 10:44:28AM -0400, Arnaud Lacombe escreveu:
>     CC util/parse-events-flex.o
> <stdout>: In function ‘yy_get_next_buffer’:
> <stdout>:1510:3: error: comparison between signed and unsigned integer
> expressions [-Werror=sign-compare]
> util/parse-events.l: In function ‘parse_events_lex’:
> util/parse-events.l:122:1: error: ignoring return value of
> ‘fwrite’, declared with attribute warn_unused_result
> [-Werror=unused-result]
> cc1: all warnings being treated as errors
> 
> So I doubt -Wno-unused-parameter will do any good here.
> 
> How about my solution, pre-generating the lexer/tokenizer ? It has
> been used without trouble in other place of the tree for years. I
> don't really see the point of micro-managing flex/bison issue here.

This was what we did in the first place:

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commitdiff;h=89812fc81f8d62d70433a8ff63d26819f372e8ec

Then we asked Linus about it and he said:

https://lkml.org/lkml/2012/3/28/417

So we:

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commitdiff;h=65f3e56e0c81d1f581c4bdef7646ae5a8d51f494

- Arnaldo

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [patch] perf: Fix build failure on OpenSuse userspace
  2012-05-04 14:55                     ` Namhyung Kim
@ 2012-05-04 15:09                       ` Greg KH
  0 siblings, 0 replies; 25+ messages in thread
From: Greg KH @ 2012-05-04 15:09 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: Arnaud Lacombe, Ingo Molnar, David Miller, namhyung.kim,
	a.p.zijlstra, paulus, mingo, acme, jolsa, linux-kernel

On Fri, May 04, 2012 at 11:55:44PM +0900, Namhyung Kim wrote:
> Hi,
> 
> On Fri, 4 May 2012 10:44:28 -0400, Arnaud Lacombe wrote:
> > How about my solution, pre-generating the lexer/tokenizer ? It has
> > been used without trouble in other place of the tree for years. I
> > don't really see the point of micro-managing flex/bison issue here.
> >
> 
> There was a discussion:
> 
>   https://lkml.org/lkml/2012/3/27/263

Yes, and I agree with Ingo on this, you can require flex and bison to
build this code, I have no problem with that.

It's the "you must build with this specific version that is not possible
for your distro otherwise the build will break" side affect of this that
I do have a problem with :)

Why can't we turn off "build error on warning" for just these generated
files?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [patch] perf: Fix build failure on OpenSuse userspace
  2012-05-04  7:09                 ` [patch] perf: Fix build failure on OpenSuse userspace Ingo Molnar
  2012-05-04 14:44                   ` Arnaud Lacombe
  2012-05-04 14:52                   ` Greg KH
@ 2012-05-04 15:10                   ` Lucas De Marchi
  2012-05-04 15:26                     ` Jiri Olsa
  2 siblings, 1 reply; 25+ messages in thread
From: Lucas De Marchi @ 2012-05-04 15:10 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Greg KH, Arnaud Lacombe, David Miller, namhyung.kim,
	a.p.zijlstra, paulus, mingo, acme, jolsa, linux-kernel

On Fri, May 4, 2012 at 4:09 AM, Ingo Molnar <mingo@kernel.org> wrote:
>
> * Greg KH <gregkh@linuxfoundation.org> wrote:
>
>> On Thu, May 03, 2012 at 11:01:54PM -0400, Arnaud Lacombe wrote:
>> > Hi,
>> >
>> > On Thu, May 3, 2012 at 10:47 PM, Greg KH <gregkh@linuxfoundation.org> wrote:
>> > > On Thu, May 03, 2012 at 10:35:02PM -0400, Arnaud Lacombe wrote:
>> > >> Hi,
>> > >>
>> > >> On Thu, May 3, 2012 at 10:29 PM, Arnaud Lacombe <lacombar@gmail.com> wrote:
>> > >> > [...]
>> > >> > [0]: http://pkgs.fedoraproject.org/gitweb/?p=flex.git;a=blob;f=flex-2.5.35-hardening.patch;h=7d608ea2371fa3295bdb8eb97c15eeb03029c02b;hb=HEAD
>> > >> >
>> > >> as a side note, this patch sounds more being about "silencing" than
>> > >> "hardening"...
>> > >
>> > > That's nice, but I can build the perf version in 3.3 just fine, so
>> > > something broke here (hint, build regression.)  Do I have to bisect it
>> > > down to find the problem?
>> > >
>> > there is most likely nothing to bisect, `perf' seems to have never
>> > required any parser before 3.4. The way the rest of the tools
>> > (especially `kconfig', `genksyms' and `dtc') manage parsers is via
>> > pre-generated .[ch]_shipped version of the lexer/tokenizer. It's been
>> > working well for a long time as such. `perf' will certainly have to
>> > follow the same path.
>>
>> Well, it can allow bison to run, but just don't break the build if the
>> generated code it creates happens to contain warnings.
>>
>> I'm using bison 2.5 and flex 2.5.35, and my phone number is...
>>
>> Like this really matters?  This needs to work for everyone, if not, you
>> better put the specific version numbers you need to require in the
>> Documentation/Changes file.
>>
>> So, how do I fix this?
>
> Does the (untested) patch below help?
>
> If not then please paste me the build failure output (it will
> most likely change due to the patch), and until we fix this
> build regression on OpenSuse userspace you can work it around
> via:
>
>  make WERROR=0
>
> Thanks,
>
>        Ingo
>
> diff --git a/tools/perf/Makefile b/tools/perf/Makefile
> index 7055a00..3174e9b 100644
> --- a/tools/perf/Makefile
> +++ b/tools/perf/Makefile
> @@ -729,10 +729,10 @@ $(OUTPUT)perf.o perf.spec \
>  # over the general rule for .o
>
>  $(OUTPUT)util/%-flex.o: $(OUTPUT)util/%-flex.c $(OUTPUT)PERF-CFLAGS
> -       $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -Iutil/ -Wno-redundant-decls -Wno-switch-default -Wno-unused-function $<
> +       $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -Iutil/ -Wno-redundant-decls -Wno-switch-default -Wno-unused-function -Wno-unused-parameter $<

Nah. What you need is -Wno-sign-compare.

But you are better off overriding the CFLAGS for these generated
files. Just put -Wno-error as the last one (untested, but should work)



Lucas De Marchi

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [patch] perf: Fix build failure on OpenSuse userspace
  2012-05-04 15:10                   ` Lucas De Marchi
@ 2012-05-04 15:26                     ` Jiri Olsa
  2012-05-04 15:38                       ` Namhyung Kim
  0 siblings, 1 reply; 25+ messages in thread
From: Jiri Olsa @ 2012-05-04 15:26 UTC (permalink / raw)
  To: Lucas De Marchi
  Cc: Ingo Molnar, Greg KH, Arnaud Lacombe, David Miller, namhyung.kim,
	a.p.zijlstra, paulus, mingo, acme, linux-kernel

On Fri, May 04, 2012 at 12:10:55PM -0300, Lucas De Marchi wrote:
> On Fri, May 4, 2012 at 4:09 AM, Ingo Molnar <mingo@kernel.org> wrote:
> >
> > * Greg KH <gregkh@linuxfoundation.org> wrote:
> >
> >> On Thu, May 03, 2012 at 11:01:54PM -0400, Arnaud Lacombe wrote:
> >> > Hi,
> >> >
> >> > On Thu, May 3, 2012 at 10:47 PM, Greg KH <gregkh@linuxfoundation.org> wrote:
> >> > > On Thu, May 03, 2012 at 10:35:02PM -0400, Arnaud Lacombe wrote:
> >> > >> Hi,
> >> > >>
> >> > >> On Thu, May 3, 2012 at 10:29 PM, Arnaud Lacombe <lacombar@gmail.com> wrote:
> >> > >> > [...]
> >> > >> > [0]: http://pkgs.fedoraproject.org/gitweb/?p=flex.git;a=blob;f=flex-2.5.35-hardening.patch;h=7d608ea2371fa3295bdb8eb97c15eeb03029c02b;hb=HEAD
> >> > >> >
> >> > >> as a side note, this patch sounds more being about "silencing" than
> >> > >> "hardening"...
> >> > >
> >> > > That's nice, but I can build the perf version in 3.3 just fine, so
> >> > > something broke here (hint, build regression.)  Do I have to bisect it
> >> > > down to find the problem?
> >> > >
> >> > there is most likely nothing to bisect, `perf' seems to have never
> >> > required any parser before 3.4. The way the rest of the tools
> >> > (especially `kconfig', `genksyms' and `dtc') manage parsers is via
> >> > pre-generated .[ch]_shipped version of the lexer/tokenizer. It's been
> >> > working well for a long time as such. `perf' will certainly have to
> >> > follow the same path.
> >>
> >> Well, it can allow bison to run, but just don't break the build if the
> >> generated code it creates happens to contain warnings.
> >>
> >> I'm using bison 2.5 and flex 2.5.35, and my phone number is...
> >>
> >> Like this really matters?  This needs to work for everyone, if not, you
> >> better put the specific version numbers you need to require in the
> >> Documentation/Changes file.
> >>
> >> So, how do I fix this?
> >
> > Does the (untested) patch below help?
> >
> > If not then please paste me the build failure output (it will
> > most likely change due to the patch), and until we fix this
> > build regression on OpenSuse userspace you can work it around
> > via:
> >
> >  make WERROR=0
> >
> > Thanks,
> >
> >        Ingo
> >
> > diff --git a/tools/perf/Makefile b/tools/perf/Makefile
> > index 7055a00..3174e9b 100644
> > --- a/tools/perf/Makefile
> > +++ b/tools/perf/Makefile
> > @@ -729,10 +729,10 @@ $(OUTPUT)perf.o perf.spec \
> >  # over the general rule for .o
> >
> >  $(OUTPUT)util/%-flex.o: $(OUTPUT)util/%-flex.c $(OUTPUT)PERF-CFLAGS
> > -       $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -Iutil/ -Wno-redundant-decls -Wno-switch-default -Wno-unused-function $<
> > +       $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -Iutil/ -Wno-redundant-decls -Wno-switch-default -Wno-unused-function -Wno-unused-parameter $<
> 
> Nah. What you need is -Wno-sign-compare.
> 
> But you are better off overriding the CFLAGS for these generated
> files. Just put -Wno-error as the last one (untested, but should work)

yep, I think it's good idea..  and plus '-w' to suppres warnings not to
polute the build log

jirka


---
diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 7055a00..9c734a2 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -729,10 +729,10 @@ $(OUTPUT)perf.o perf.spec \
 # over the general rule for .o
 
 $(OUTPUT)util/%-flex.o: $(OUTPUT)util/%-flex.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -Iutil/ -Wno-redundant-decls -Wno-switch-default -Wno-unused-function $<
+	$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -Iutil/ -Wno-error -w $<
 
 $(OUTPUT)util/%-bison.o: $(OUTPUT)util/%-bison.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -Iutil/ -Wno-redundant-decls -Wno-switch-default -Wno-unused-function $<
+	$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -Iutil/ -Wno-error -w $<
 
 $(OUTPUT)%.o: %.c $(OUTPUT)PERF-CFLAGS
 	$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $<

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* Re: [patch] perf: Fix build failure on OpenSuse userspace
  2012-05-04 15:02                     ` Jiri Olsa
@ 2012-05-04 15:26                       ` Namhyung Kim
  0 siblings, 0 replies; 25+ messages in thread
From: Namhyung Kim @ 2012-05-04 15:26 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: Arnaud Lacombe, Ingo Molnar, Greg KH, David Miller, namhyung.kim,
	a.p.zijlstra, paulus, mingo, acme, linux-kernel

Hi,

On Fri, 4 May 2012 17:02:11 +0200, Jiri Olsa wrote:
>> So I doubt -Wno-unused-parameter will do any good here.
> I think we need also -Wno-sign-compare, please check the attached patch
>
>
> ---
> diff --git a/tools/perf/Makefile b/tools/perf/Makefile
> index 7055a00..8f7b6cf 100644
> --- a/tools/perf/Makefile
> +++ b/tools/perf/Makefile
> @@ -729,10 +729,10 @@ $(OUTPUT)perf.o perf.spec \
>  # over the general rule for .o
>  
>  $(OUTPUT)util/%-flex.o: $(OUTPUT)util/%-flex.c $(OUTPUT)PERF-CFLAGS
> -	$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -Iutil/ -Wno-redundant-decls -Wno-switch-default -Wno-unused-function $<
> +	$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -Iutil/ -Wno-redundant-decls -Wno-switch-default -Wno-unused-function -Wno-unused-parameter -Wno-sign-compare $<
>  

s/unused-parameter/unused-result/ ?

Thanks,
Namhyung


>  $(OUTPUT)util/%-bison.o: $(OUTPUT)util/%-bison.c $(OUTPUT)PERF-CFLAGS
> -	$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -Iutil/ -Wno-redundant-decls -Wno-switch-default -Wno-unused-function $<
> +	$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -Iutil/ -Wno-redundant-decls -Wno-switch-default -Wno-unused-function -Wno-unused-parameter -Wno-sign-compare $<
>  
>  $(OUTPUT)%.o: %.c $(OUTPUT)PERF-CFLAGS
>  	$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $<

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [patch] perf: Fix build failure on OpenSuse userspace
  2012-05-04 15:26                     ` Jiri Olsa
@ 2012-05-04 15:38                       ` Namhyung Kim
  2012-05-04 16:41                         ` Jiri Olsa
  0 siblings, 1 reply; 25+ messages in thread
From: Namhyung Kim @ 2012-05-04 15:38 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: Lucas De Marchi, Ingo Molnar, Greg KH, Arnaud Lacombe,
	David Miller, namhyung.kim, a.p.zijlstra, paulus, mingo, acme,
	linux-kernel

Hi,

On Fri, 4 May 2012 17:26:13 +0200, Jiri Olsa wrote:
> On Fri, May 04, 2012 at 12:10:55PM -0300, Lucas De Marchi wrote:
>> Nah. What you need is -Wno-sign-compare.
>> 
>> But you are better off overriding the CFLAGS for these generated
>> files. Just put -Wno-error as the last one (untested, but should work)
>
> yep, I think it's good idea..  and plus '-w' to suppres warnings not to
> polute the build log
>
> jirka

Works well for me. But I guess -Wno-error turns into a nop if we use
'-w', right?


Thank,
Namhyung


>
>
> ---
> diff --git a/tools/perf/Makefile b/tools/perf/Makefile
> index 7055a00..9c734a2 100644
> --- a/tools/perf/Makefile
> +++ b/tools/perf/Makefile
> @@ -729,10 +729,10 @@ $(OUTPUT)perf.o perf.spec \
>  # over the general rule for .o
>  
>  $(OUTPUT)util/%-flex.o: $(OUTPUT)util/%-flex.c $(OUTPUT)PERF-CFLAGS
> -	$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -Iutil/ -Wno-redundant-decls -Wno-switch-default -Wno-unused-function $<
> +	$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -Iutil/ -Wno-error -w $<
>  
>  $(OUTPUT)util/%-bison.o: $(OUTPUT)util/%-bison.c $(OUTPUT)PERF-CFLAGS
> -	$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -Iutil/ -Wno-redundant-decls -Wno-switch-default -Wno-unused-function $<
> +	$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -Iutil/ -Wno-error -w $<
>  
>  $(OUTPUT)%.o: %.c $(OUTPUT)PERF-CFLAGS
>  	$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $<

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [patch] perf: Fix build failure on OpenSuse userspace
  2012-05-04 15:38                       ` Namhyung Kim
@ 2012-05-04 16:41                         ` Jiri Olsa
  0 siblings, 0 replies; 25+ messages in thread
From: Jiri Olsa @ 2012-05-04 16:41 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: Lucas De Marchi, Ingo Molnar, Greg KH, Arnaud Lacombe,
	David Miller, namhyung.kim, a.p.zijlstra, paulus, mingo, acme,
	linux-kernel

On Sat, May 05, 2012 at 12:38:48AM +0900, Namhyung Kim wrote:
> Hi,
> 
> On Fri, 4 May 2012 17:26:13 +0200, Jiri Olsa wrote:
> > On Fri, May 04, 2012 at 12:10:55PM -0300, Lucas De Marchi wrote:
> >> Nah. What you need is -Wno-sign-compare.
> >> 
> >> But you are better off overriding the CFLAGS for these generated
> >> files. Just put -Wno-error as the last one (untested, but should work)
> >
> > yep, I think it's good idea..  and plus '-w' to suppres warnings not to
> > polute the build log
> >
> > jirka
> 
> Works well for me. But I guess -Wno-error turns into a nop if we use
> '-w', right?

argghh.. right ;) misread the man page.. I tested -w is enough

thanks,
jirka

> 
> 
> Thank,
> Namhyung
> 
> 
> >
> >
> > ---
> > diff --git a/tools/perf/Makefile b/tools/perf/Makefile
> > index 7055a00..9c734a2 100644
> > --- a/tools/perf/Makefile
> > +++ b/tools/perf/Makefile
> > @@ -729,10 +729,10 @@ $(OUTPUT)perf.o perf.spec \
> >  # over the general rule for .o
> >  
> >  $(OUTPUT)util/%-flex.o: $(OUTPUT)util/%-flex.c $(OUTPUT)PERF-CFLAGS
> > -	$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -Iutil/ -Wno-redundant-decls -Wno-switch-default -Wno-unused-function $<
> > +	$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -Iutil/ -Wno-error -w $<
> >  
> >  $(OUTPUT)util/%-bison.o: $(OUTPUT)util/%-bison.c $(OUTPUT)PERF-CFLAGS
> > -	$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -Iutil/ -Wno-redundant-decls -Wno-switch-default -Wno-unused-function $<
> > +	$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -Iutil/ -Wno-error -w $<
> >  
> >  $(OUTPUT)%.o: %.c $(OUTPUT)PERF-CFLAGS
> >  	$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $<

^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2012-05-04 16:41 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-03 21:57 perf build failure on Linus's tree Greg KH
2012-05-04  1:37 ` Namhyung Kim
2012-05-04  1:41   ` Greg KH
2012-05-04  1:45     ` Namhyung Kim
2012-05-04  1:50   ` David Miller
2012-05-04  2:14     ` Arnaud Lacombe
2012-05-04  2:24       ` Namhyung Kim
2012-05-04  2:29       ` Arnaud Lacombe
2012-05-04  2:35         ` Arnaud Lacombe
2012-05-04  2:47           ` Greg KH
2012-05-04  3:01             ` Arnaud Lacombe
2012-05-04  3:16               ` Greg KH
2012-05-04  4:01                 ` Arnaud Lacombe
2012-05-04  7:09                 ` [patch] perf: Fix build failure on OpenSuse userspace Ingo Molnar
2012-05-04 14:44                   ` Arnaud Lacombe
2012-05-04 14:55                     ` Namhyung Kim
2012-05-04 15:09                       ` Greg KH
2012-05-04 15:02                     ` Jiri Olsa
2012-05-04 15:26                       ` Namhyung Kim
2012-05-04 15:03                     ` Arnaldo Carvalho de Melo
2012-05-04 14:52                   ` Greg KH
2012-05-04 15:10                   ` Lucas De Marchi
2012-05-04 15:26                     ` Jiri Olsa
2012-05-04 15:38                       ` Namhyung Kim
2012-05-04 16:41                         ` Jiri Olsa

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