Skip to contentSkip to conversation

perf tools: Fix bison-related build failure on CentOS 6

PATCH In review Namhyung Kim 5 participants 10 messages Apr 29, 2015 – May 6, 2015 perf events

lore
Share & tools
lore

Namhyung Kim

author maintainer
#0 lore raw

PATCH 1/1 perf tools: Fix bison-related build failure on CentOS 6

The YYLTYPE_IS_TRIVIAL is defined in the Build file, but unlike pmu-bison.c, gcc complained about it for parse-events-bison.c:

CC util/parse-events-bison.o
In file included from util/parse-events.y:16:
util/parse-events-bison.h:101:1: error: "YYLTYPE_IS_TRIVIAL" redefined <command-line>: error: this is the location of the previous definition make[3]: *** [util/parse-events-bison.o] Error 1

---
 tools/perf/util/Build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/Build +1 -1
index b6c3f39f081a..28af8e2825b3 100644
@@ -118,7 +118,7 @@ $(OUTPUT)util/pmu-bison.c: util/pmu.y
 
 CFLAGS_parse-events-flex.o  += -w
 CFLAGS_pmu-flex.o           += -w
-CFLAGS_parse-events-bison.o += -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -w
+CFLAGS_parse-events-bison.o += -DYYENABLE_NLS=0 -w
 CFLAGS_pmu-bison.o          += -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -w
 
 $(OUTPUT)util/parse-events.o: $(OUTPUT)util/parse-events-flex.c $(OUTPUT)util/parse-events-bison.c
Signature · 1 line
2.3.5
#1 lore raw
Quoted 2 lines · Namhyung Kim

The YYLTYPE_IS_TRIVIAL is defined in the Build file, but unlike pmu-bison.c, gcc complained about it for parse-events-bison.c:

any clue why is that? cant see why Fedora is not complaining over the same sources and RHEL6 fails..

jirka

Quoted 28 lines

CC util/parse-events-bison.o
In file included from util/parse-events.y:16:
util/parse-events-bison.h:101:1: error: "YYLTYPE_IS_TRIVIAL" redefined <command-line>: error: this is the location of the previous definition make[3]: *** [util/parse-events-bison.o] Error 1

---
 tools/perf/util/Build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/Build +1 -1
index b6c3f39f081a..28af8e2825b3 100644
@@ -118,7 +118,7 @@ $(OUTPUT)util/pmu-bison.c: util/pmu.y
 
 CFLAGS_parse-events-flex.o  += -w
 CFLAGS_pmu-flex.o           += -w
-CFLAGS_parse-events-bison.o += -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -w
+CFLAGS_parse-events-bison.o += -DYYENABLE_NLS=0 -w
 CFLAGS_pmu-bison.o          += -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -w
 
 $(OUTPUT)util/parse-events.o: $(OUTPUT)util/parse-events-flex.c $(OUTPUT)util/parse-events-bison.c
Signature · 1 line
2.3.5
author maintainer
#2 lore raw
Quoted 6 lines · Jiri Olsa
Quoted 2 lines · Namhyung Kim

The YYLTYPE_IS_TRIVIAL is defined in the Build file, but unlike pmu-bison.c, gcc complained about it for parse-events-bison.c:

any clue why is that? cant see why Fedora is not complaining over the same sources and RHEL6 fails..

I have no idea. I just found it during build test using containers, and had no chance to look into the bison code..

Thanks,
Namhyung

Quoted 28 lines
Quoted 28 lines

CC util/parse-events-bison.o
In file included from util/parse-events.y:16:
util/parse-events-bison.h:101:1: error: "YYLTYPE_IS_TRIVIAL" redefined <command-line>: error: this is the location of the previous definition make[3]: *** [util/parse-events-bison.o] Error 1

---
 tools/perf/util/Build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/Build +1 -2
index b6c3f39f081a..28af8e2825b3 100644
@@ -118,7 +118,7 @@ $(OUTPUT)util/pmu-bison.c: util/pmu.y
 
 CFLAGS_parse-events-flex.o  += -w
 CFLAGS_pmu-flex.o           += -w
-CFLAGS_parse-events-bison.o += -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -w
+CFLAGS_parse-events-bison.o += -DYYENABLE_NLS=0 -w
 CFLAGS_pmu-bison.o          += -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -w
 
 $(OUTPUT)util/parse-events.o: $(OUTPUT)util/parse-events-flex.c $(OUTPUT)util/parse-events-bison.c
--

2.3.5

Signature · 2 lines
Thanks,
Namhyung
#3 lore raw
Quoted 10 lines · Namhyung Kim
Quoted 6 lines · Jiri Olsa
Quoted 2 lines · Namhyung Kim

The YYLTYPE_IS_TRIVIAL is defined in the Build file, but unlike pmu-bison.c, gcc complained about it for parse-events-bison.c:

any clue why is that? cant see why Fedora is not complaining over the same sources and RHEL6 fails..

I have no idea. I just found it during build test using containers, and had no chance to look into the bison code..

Well, applied tested it on both rhel7, fedora21 and rhel6.6, seems to work, have it in my perf/core branch at git.kernel.org, that branch now builds on rhel6.6, after fixing issues with several patches that were making it shadow some functions (util.h's error(), etc).

If we can get a better message for that, figuring out what that _IS_TRIVIAL thingy does....

- Arnaldo

#4 lore raw
In reply to Namhyung Kim
Quoted 10 lines

The YYLTYPE_IS_TRIVIAL is defined in the Build file, but unlike pmu-bison.c, gcc complained about it for parse-events-bison.c:

CC util/parse-events-bison.o
In file included from util/parse-events.y:16:
util/parse-events-bison.h:101:1: error: "YYLTYPE_IS_TRIVIAL" redefined <command-line>: error: this is the location of the previous definition make[3]: *** [util/parse-events-bison.o] Error 1

Ok, so this helps, it builds now on RHEL6.6, which was something I and Jiri were chasing, but why has it complained for one and not the other? Ideas?

- Arnaldo

Quoted 20 lines
---
 tools/perf/util/Build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/Build +1 -1
index b6c3f39f081a..28af8e2825b3 100644
@@ -118,7 +118,7 @@ $(OUTPUT)util/pmu-bison.c: util/pmu.y
 
 CFLAGS_parse-events-flex.o  += -w
 CFLAGS_pmu-flex.o           += -w
-CFLAGS_parse-events-bison.o += -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -w
+CFLAGS_parse-events-bison.o += -DYYENABLE_NLS=0 -w
 CFLAGS_pmu-bison.o          += -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -w
 
 $(OUTPUT)util/parse-events.o: $(OUTPUT)util/parse-events-flex.c

$(OUTPUT)util/parse-events-bison.c
--
2.3.5

#5 lore raw
Quoted 9 lines · Arnaldo Carvalho de Melo
Quoted 9 lines

The YYLTYPE_IS_TRIVIAL is defined in the Build file, but unlike pmu-bison.c, gcc complained about it for parse-events-bison.c:

CC util/parse-events-bison.o
In file included from util/parse-events.y:16:
util/parse-events-bison.h:101:1: error: "YYLTYPE_IS_TRIVIAL" redefined <command-line>: error: this is the location of the previous definition make[3]: *** [util/parse-events-bison.o] Error 1

Quoted 5 lines
Quoted 1 line

Ok, so this helps, it builds now on RHEL6.6, which was something I and Jiri were chasing, but why has it complained for one and not the other? Ideas?

looks like the RHEL6 gcc/cpp treats this as an error which is not maskable by '-w' option

anyway I checked the git log history and I'm not sure why we event have this define, it was added by Ingo and carried by ever since:

65f3e56e0c81 perf tools: Remove auto-generated bison/flex files

probably because of the fail I see if I remove it from pmu-bison.o build:

util/pmu-bison.c:613:6: error: "YYLTYPE_IS_TRIVIAL" is not defined

jirka

#6 lore raw
Quoted 23 lines · Jiri Olsa
Quoted 9 lines · Arnaldo Carvalho de Melo
Quoted 9 lines

The YYLTYPE_IS_TRIVIAL is defined in the Build file, but unlike pmu-bison.c, gcc complained about it for parse-events-bison.c:

CC util/parse-events-bison.o
In file included from util/parse-events.y:16:
util/parse-events-bison.h:101:1: error: "YYLTYPE_IS_TRIVIAL" redefined <command-line>: error: this is the location of the previous definition make[3]: *** [util/parse-events-bison.o] Error 1

Quoted 5 lines
Quoted 1 line

Ok, so this helps, it builds now on RHEL6.6, which was something I and Jiri were chasing, but why has it complained for one and not the other? Ideas?

looks like the RHEL6 gcc/cpp treats this as an error which is not maskable by '-w' option

anyway I checked the git log history and I'm not sure why we event have this define, it was added by Ingo and carried by ever since:

Quoted 5 lines

65f3e56e0c81 perf tools: Remove auto-generated bison/flex files

probably because of the fail I see if I remove it from pmu-bison.o build:

util/pmu-bison.c:613:6: error: "YYLTYPE_IS_TRIVIAL" is not defined

ok, seem's the patch is right and the reason is the parse error handling that was added just recently

it adds YYLTYPE type (which is not present in pmu-bison.h), so YYLTYPE_IS_TRIVIAL gets redefined, which is ok in F20 that handle the error via '-w' option, but it's not ok for RHEL6 where the '-w' does not work for this kind of error

jirka

#7 lore raw

Em Wed, Apr 29, 2015 at 08:14:14PM +0200, Jiri Olsa escreveu:

Quoted 30 lines · Jiri Olsa
Quoted 23 lines · Arnaldo Carvalho de Melo
Quoted 9 lines
Quoted 9 lines

The YYLTYPE_IS_TRIVIAL is defined in the Build file, but unlike pmu-bison.c, gcc complained about it for parse-events-bison.c:

CC util/parse-events-bison.o
In file included from util/parse-events.y:16:
util/parse-events-bison.h:101:1: error: "YYLTYPE_IS_TRIVIAL" redefined <command-line>: error: this is the location of the previous definition make[3]: *** [util/parse-events-bison.o] Error 1

Quoted 5 lines
Quoted 1 line

Ok, so this helps, it builds now on RHEL6.6, which was something I and Jiri were chasing, but why has it complained for one and not the other? Ideas?

looks like the RHEL6 gcc/cpp treats this as an error which is not maskable by '-w' option

anyway I checked the git log history and I'm not sure why we event have this define, it was added by Ingo and carried by ever since:

Quoted 5 lines

65f3e56e0c81 perf tools: Remove auto-generated bison/flex files

probably because of the fail I see if I remove it from pmu-bison.o build:

util/pmu-bison.c:613:6: error: "YYLTYPE_IS_TRIVIAL" is not defined

Quoted 7 lines

ok, seem's the patch is right and the reason is the parse error handling that was added just recently

it adds YYLTYPE type (which is not present in pmu-bison.h), so YYLTYPE_IS_TRIVIAL gets redefined, which is ok in F20 that handle the error via '-w' option, but it's not ok for RHEL6 where the '-w' does not work for this kind of error

Ok, adding this comment to the changelog, together with your Acked-by, ok?

- Arnaldo

#8 lore raw
Quoted 34 lines · Arnaldo Carvalho de Melo

Em Wed, Apr 29, 2015 at 08:14:14PM +0200, Jiri Olsa escreveu:

Quoted 33 lines · Jiri Olsa
Quoted 23 lines · Arnaldo Carvalho de Melo
Quoted 9 lines
Quoted 9 lines

The YYLTYPE_IS_TRIVIAL is defined in the Build file, but unlike pmu-bison.c, gcc complained about it for parse-events-bison.c:

CC util/parse-events-bison.o
In file included from util/parse-events.y:16:
util/parse-events-bison.h:101:1: error: "YYLTYPE_IS_TRIVIAL" redefined <command-line>: error: this is the location of the previous definition make[3]: *** [util/parse-events-bison.o] Error 1

Quoted 5 lines
Quoted 1 line

Ok, so this helps, it builds now on RHEL6.6, which was something I and Jiri were chasing, but why has it complained for one and not the other? Ideas?

looks like the RHEL6 gcc/cpp treats this as an error which is not maskable by '-w' option

anyway I checked the git log history and I'm not sure why we event have this define, it was added by Ingo and carried by ever since:

Quoted 5 lines

65f3e56e0c81 perf tools: Remove auto-generated bison/flex files

probably because of the fail I see if I remove it from pmu-bison.o build:

util/pmu-bison.c:613:6: error: "YYLTYPE_IS_TRIVIAL" is not defined

ok, seem's the patch is right and the reason is the parse error handling that was added just recently

Quoted 7 lines
Quoted 4 lines

it adds YYLTYPE type (which is not present in pmu-bison.h), so YYLTYPE_IS_TRIVIAL gets redefined, which is ok in F20 that handle the error via '-w' option, but it's not ok for RHEL6 where the '-w' does not work for this kind of error

Ok, adding this comment to the changelog, together with your Acked-by, ok?

ook

jirka

Quoted 2 lines

- Arnaldo

#9 lore raw
In reply to Namhyung Kim
perf tools: Fix bison-related build failure on CentOS 6
Commit-ID:  539f3aa2ebb42a409bc9028e38af091a86087165
Gitweb:     http://git.kernel.org/tip/539f3aa2ebb42a409bc9028e38af091a86087165
Author:     Namhyung Kim <[email protected]>
AuthorDate: Wed, 29 Apr 2015 12:55:00 -0300
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Mon, 4 May 2015 12:43:52 -0300

perf tools: Fix bison-related build failure on CentOS 6

The YYLTYPE_IS_TRIVIAL is defined in the Build file, but unlike pmu-bison.c, gcc complained about it for parse-events-bison.c:

CC util/parse-events-bison.o
In file included from util/parse-events.y:16:
util/parse-events-bison.h:101:1: error: "YYLTYPE_IS_TRIVIAL" redefined <command-line>: error: this is the location of the previous definition make[3]: *** [util/parse-events-bison.o] Error 1

Comments from Jiri Olsa:

"Reason is the parse error handling that was added just recently: it adds YYLTYPE type (which is not present in pmu-bison.h), so YYLTYPE_IS_TRIVIAL gets redefined, which is ok in F20 that handle the error via '-w' option, but it's not ok for RHEL6 where the '-w' does not work for this kind of error."

---
 tools/perf/util/Build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/Build +1 -1
index b6c3f39..28af8e2 100644
@@ -118,7 +118,7 @@ $(OUTPUT)util/pmu-bison.c: util/pmu.y
 
 CFLAGS_parse-events-flex.o  += -w
 CFLAGS_pmu-flex.o           += -w
-CFLAGS_parse-events-bison.o += -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -w
+CFLAGS_parse-events-bison.o += -DYYENABLE_NLS=0 -w
 CFLAGS_pmu-bison.o          += -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -w
 
 $(OUTPUT)util/parse-events.o: $(OUTPUT)util/parse-events-flex.c $(OUTPUT)util/parse-events-bison.c