linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] perf: Fix include order for bison/flex-generated C files
@ 2012-08-19 23:47 Ben Hutchings
  2012-08-20 12:37 ` Arnaldo Carvalho de Melo
  2012-08-21 16:33 ` [tip:perf/core] perf tools: Fix include order for bison/ flex-generated " tip-bot for Ben Hutchings
  0 siblings, 2 replies; 3+ messages in thread
From: Ben Hutchings @ 2012-08-19 23:47 UTC (permalink / raw)
  To: Peter Zijlstra, Paul Mackerras, Ingo Molnar, Arnaldo Carvalho de Melo
  Cc: linux-kernel, Sedat Dilek

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

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.

Reported-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 tools/perf/Makefile |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 0eee64c..434175c 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -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) $<


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

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

* Re: [PATCH] perf: Fix include order for bison/flex-generated C files
  2012-08-19 23:47 [PATCH] perf: Fix include order for bison/flex-generated C files Ben Hutchings
@ 2012-08-20 12:37 ` Arnaldo Carvalho de Melo
  2012-08-21 16:33 ` [tip:perf/core] perf tools: Fix include order for bison/ flex-generated " tip-bot for Ben Hutchings
  1 sibling, 0 replies; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2012-08-20 12:37 UTC (permalink / raw)
  To: Ben Hutchings
  Cc: Peter Zijlstra, Paul Mackerras, Ingo Molnar, linux-kernel, Sedat Dilek

Em Mon, Aug 20, 2012 at 12:47:19AM +0100, Ben Hutchings escreveu:
> 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.

Thanks, applied

> Reported-by: Sedat Dilek <sedat.dilek@gmail.com>
> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
> ---
>  tools/perf/Makefile |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/perf/Makefile b/tools/perf/Makefile
> index 0eee64c..434175c 100644
> --- a/tools/perf/Makefile
> +++ b/tools/perf/Makefile
> @@ -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) $<
> 



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

* [tip:perf/core] perf tools: Fix include order for bison/ flex-generated C files
  2012-08-19 23:47 [PATCH] perf: Fix include order for bison/flex-generated C files Ben Hutchings
  2012-08-20 12:37 ` Arnaldo Carvalho de Melo
@ 2012-08-21 16:33 ` tip-bot for Ben Hutchings
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Ben Hutchings @ 2012-08-21 16:33 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: acme, linux-kernel, paulus, mingo, hpa, mingo, a.p.zijlstra, ben,
	tglx, sedat.dilek

Commit-ID:  ed7e2c2ec59422b68b643c479a5816197620016e
Gitweb:     http://git.kernel.org/tip/ed7e2c2ec59422b68b643c479a5816197620016e
Author:     Ben Hutchings <ben@decadent.org.uk>
AuthorDate: Mon, 20 Aug 2012 00:47:19 +0100
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
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.

Reported-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Sedat Dilek <sedat.dilek@gmail.com>
Link: http://lkml.kernel.org/r/1345420039.22400.80.camel@deadeye.wl.decadent.org.uk
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Makefile |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 90cfecf..77e7ae3e 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -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) $<

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

end of thread, other threads:[~2012-08-21 16:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-19 23:47 [PATCH] perf: Fix include order for bison/flex-generated C files Ben Hutchings
2012-08-20 12:37 ` Arnaldo Carvalho de Melo
2012-08-21 16:33 ` [tip:perf/core] perf tools: Fix include order for bison/ flex-generated " tip-bot for Ben Hutchings

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