perf: Fix include order for bison/flex-generated C files
PATCH 1/1 perf: Fix include order for bison/flex-generated C files
When we use a separate output directory, we add util/ to the include path for the generated C files. However, this is currently added to the end of the path, behind /usr/include/slang and /usr/include/gtk-2.0 if use of the respective libraries is enabled. Thus the '#include "../perf.h"' in util/parse-events.l can actually include /usr/include/perf.h if it exists.
Move '-Iutil/' ahead of all the other preprocessor options.
--- tools/perf/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tools/perf/Makefile +2 -2
@@ -756,10 +756,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/ -w $< + $(QUIET_CC)$(CC) -o $@ -c -Iutil/ $(ALL_CFLAGS) -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/ -w $< + $(QUIET_CC)$(CC) -o $@ -c -Iutil/ $(ALL_CFLAGS) -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -w $< $(OUTPUT)%.o: %.c $(OUTPUT)PERF-CFLAGS $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $<
Arnaldo Carvalho de Melo
AppliedEm Mon, Aug 20, 2012 at 12:47:19AM +0100, Ben Hutchings escreveu:
Quoted 8 lines
When we use a separate output directory, we add util/ to the include path for the generated C files. However, this is currently added to the end of the path, behind
/usr/include/slangand/usr/include/gtk-2.0if use of the respective libraries is enabled. Thus the '#include "../perf.h"' in util/parse-events.l can actually include/usr/include/perf.hif it exists.Move '-Iutil/' ahead of all the other preprocessor options.
Thanks, applied
Quoted 24 lines
Reported-by Sedat Dilek <[email protected]>Signed-off-by Ben Hutchings <[email protected]>--- tools/perf/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)tools/perf/Makefile +2
-2@@ -756,10 +756,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/ -w $< + $(QUIET_CC)$(CC) -o $@ -c -Iutil/ $(ALL_CFLAGS) -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/ -w $< + $(QUIET_CC)$(CC) -o $@ -c -Iutil/ $(ALL_CFLAGS) -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -w $< $(OUTPUT)%.o: %.c $(OUTPUT)PERF-CFLAGS $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $<
[tip:perf/core] perf tools: Fix include order for bison/ flex-generated C files
In reply to Ben HutchingsCommit-ID: ed7e2c2ec59422b68b643c479a5816197620016e Gitweb: http://git.kernel.org/tip/ed7e2c2ec59422b68b643c479a5816197620016e Author: Ben Hutchings <[email protected]> AuthorDate: Mon, 20 Aug 2012 00:47:19 +0100 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Mon, 20 Aug 2012 09:36:41 -0300
perf tools: Fix include order for bison/flex-generated C files
When we use a separate output directory, we add util/ to the include path for the generated C files. However, this is currently added to the end of the path, behind /usr/include/slang and /usr/include/gtk-2.0 if use of the respective libraries is enabled. Thus the '#include "../perf.h"' in util/parse-events.l can actually include /usr/include/perf.h if it exists.
Move '-Iutil/' ahead of all the other preprocessor options.
--- tools/perf/Makefile | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
tools/perf/Makefile +2 -2
@@ -841,10 +841,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/ -w $< + $(QUIET_CC)$(CC) -o $@ -c -Iutil/ $(ALL_CFLAGS) -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/ -w $< + $(QUIET_CC)$(CC) -o $@ -c -Iutil/ $(ALL_CFLAGS) -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -w $< $(OUTPUT)%.o: %.c $(OUTPUT)PERF-CFLAGS $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $<