Re: [patch] perf: Fix build failure on OpenSuse userspace

From: Jiri Olsa
Date: Fri May 04 2012 - 11:21:03 EST


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@xxxxxxxxxx> wrote:
> >
> > * Greg KH <gregkh@xxxxxxxxxxxxxxxxxxx> 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@xxxxxxxxx>, 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) $<
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/