* [PATCH] perf: Let O= makes handle relative paths
@ 2012-08-13 13:20 Steven Rostedt
2012-08-13 13:24 ` Borislav Petkov
0 siblings, 1 reply; 15+ messages in thread
From: Steven Rostedt @ 2012-08-13 13:20 UTC (permalink / raw)
To: LKML; +Cc: Arnaldo Carvalho de Melo, borislav.petkov, Ingo Molnar,
Namhyung Kim
When I did a compile of perf using a relative path for the output
directory, the build failed when it tried to compile libtraceevent. This
is because it continues to use the same relative path when the new
working directory is in a different path.
SUBDIR ../lib/traceevent/
/bin/sh: line 0: cd: ../../../nobackup/perf/: No such file or directory
Makefile:74: *** output directory "../../../nobackup/perf/" does not exist. Stop.
make: *** [../../../nobackup/perf///libtraceevent.a] Error 2
Make the path used an absolute path when building perf with O=.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
diff --git a/tools/scripts/Makefile.include b/tools/scripts/Makefile.include
index bde8521..9e3e31e 100644
--- a/tools/scripts/Makefile.include
+++ b/tools/scripts/Makefile.include
@@ -1,6 +1,7 @@
ifeq ("$(origin O)", "command line")
- OUTPUT := $(O)/
- COMMAND_O := O=$(O)
+ RAW_O := $(shell cd $(O) ; pwd)
+ OUTPUT := $(RAW_O)/
+ COMMAND_O := O=$(RAW_O)
endif
ifneq ($(OUTPUT),)
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [PATCH] perf: Let O= makes handle relative paths 2012-08-13 13:20 [PATCH] perf: Let O= makes handle relative paths Steven Rostedt @ 2012-08-13 13:24 ` Borislav Petkov 2012-08-13 14:23 ` Steven Rostedt 0 siblings, 1 reply; 15+ messages in thread From: Borislav Petkov @ 2012-08-13 13:24 UTC (permalink / raw) To: Steven Rostedt Cc: LKML, Arnaldo Carvalho de Melo, borislav.petkov, Ingo Molnar, Namhyung Kim On Mon, Aug 13, 2012 at 09:20:55AM -0400, Steven Rostedt wrote: > When I did a compile of perf using a relative path for the output > directory, the build failed when it tried to compile libtraceevent. This > is because it continues to use the same relative path when the new > working directory is in a different path. > > SUBDIR ../lib/traceevent/ > /bin/sh: line 0: cd: ../../../nobackup/perf/: No such file or directory > Makefile:74: *** output directory "../../../nobackup/perf/" does not exist. Stop. > make: *** [../../../nobackup/perf///libtraceevent.a] Error 2 > > > Make the path used an absolute path when building perf with O=. > > Signed-off-by: Steven Rostedt <rostedt@goodmis.org> > > diff --git a/tools/scripts/Makefile.include b/tools/scripts/Makefile.include > index bde8521..9e3e31e 100644 > --- a/tools/scripts/Makefile.include > +++ b/tools/scripts/Makefile.include > @@ -1,6 +1,7 @@ > ifeq ("$(origin O)", "command line") > - OUTPUT := $(O)/ > - COMMAND_O := O=$(O) > + RAW_O := $(shell cd $(O) ; pwd) > + OUTPUT := $(RAW_O)/ > + COMMAND_O := O=$(RAW_O) So wouldn't it make sense to call this ABSOLUTE_O or so then? Thanks. -- Regards/Gruss, Boris. Advanced Micro Devices GmbH Einsteinring 24, 85609 Dornach GM: Alberto Bozzo Reg: Dornach, Landkreis Muenchen HRB Nr. 43632 WEEE Registernr: 129 19551 ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] perf: Let O= makes handle relative paths 2012-08-13 13:24 ` Borislav Petkov @ 2012-08-13 14:23 ` Steven Rostedt 2012-08-13 14:29 ` Borislav Petkov 0 siblings, 1 reply; 15+ messages in thread From: Steven Rostedt @ 2012-08-13 14:23 UTC (permalink / raw) To: Borislav Petkov Cc: LKML, Arnaldo Carvalho de Melo, borislav.petkov, Ingo Molnar, Namhyung Kim On Mon, 2012-08-13 at 15:24 +0200, Borislav Petkov wrote: > So wouldn't it make sense to call this ABSOLUTE_O or so then? That's just because you're russian, and are promoting Vodka! ;-) Done... ---------- When I did a compile of perf using a relative path for the output directory, the build failed when it tried to compile libtraceevent. This is because it continues to use the same relative path when the new working directory is in a different path. SUBDIR ../lib/traceevent/ /bin/sh: line 0: cd: ../../../nobackup/perf/: No such file or directory Makefile:74: *** output directory "../../../nobackup/perf/" does not exist. Stop. make: *** [../../../nobackup/perf///libtraceevent.a] Error 2 Make the path used an absolute path when building perf with O=. Signed-off-by: Steven Rostedt <rostedt@goodmis.org> diff --git a/tools/scripts/Makefile.include b/tools/scripts/Makefile.include index bde8521..e90e1b4 100644 --- a/tools/scripts/Makefile.include +++ b/tools/scripts/Makefile.include @@ -1,6 +1,7 @@ ifeq ("$(origin O)", "command line") - OUTPUT := $(O)/ - COMMAND_O := O=$(O) + ABSOLUTE_O := $(shell cd $(O) ; pwd) + OUTPUT := $(ABSOLUTE_O)/ + COMMAND_O := O=$(ABSOLUTE_O) endif ifneq ($(OUTPUT),) ^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH] perf: Let O= makes handle relative paths 2012-08-13 14:23 ` Steven Rostedt @ 2012-08-13 14:29 ` Borislav Petkov 2012-08-13 18:02 ` Arnaldo Carvalho de Melo 0 siblings, 1 reply; 15+ messages in thread From: Borislav Petkov @ 2012-08-13 14:29 UTC (permalink / raw) To: Steven Rostedt; +Cc: LKML, Arnaldo Carvalho de Melo, Ingo Molnar, Namhyung Kim On Mon, Aug 13, 2012 at 10:23:02AM -0400, Steven Rostedt wrote: > On Mon, 2012-08-13 at 15:24 +0200, Borislav Petkov wrote: > > > So wouldn't it make sense to call this ABSOLUTE_O or so then? > > That's just because you're russian, and are promoting Vodka! ;-) > > > Done... > > ---------- > > When I did a compile of perf using a relative path for the output > directory, the build failed when it tried to compile libtraceevent. This > is because it continues to use the same relative path when the new > working directory is in a different path. > > SUBDIR ../lib/traceevent/ > /bin/sh: line 0: cd: ../../../nobackup/perf/: No such file or directory > Makefile:74: *** output directory "../../../nobackup/perf/" does not exist. Stop. > make: *** [../../../nobackup/perf///libtraceevent.a] Error 2 > > > Make the path used an absolute path when building perf with O=. > > Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Acked-by: The Russian Vodka Promoter. 8-). Thanks and Na Zdorovia! -- Regards/Gruss, Boris. Advanced Micro Devices GmbH Einsteinring 24, 85609 Dornach GM: Alberto Bozzo Reg: Dornach, Landkreis Muenchen HRB Nr. 43632 WEEE Registernr: 129 19551 ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] perf: Let O= makes handle relative paths 2012-08-13 14:29 ` Borislav Petkov @ 2012-08-13 18:02 ` Arnaldo Carvalho de Melo 2012-08-15 10:27 ` Borislav Petkov 0 siblings, 1 reply; 15+ messages in thread From: Arnaldo Carvalho de Melo @ 2012-08-13 18:02 UTC (permalink / raw) To: Borislav Petkov; +Cc: Steven Rostedt, LKML, Ingo Molnar, Namhyung Kim Em Mon, Aug 13, 2012 at 04:29:09PM +0200, Borislav Petkov escreveu: > On Mon, Aug 13, 2012 at 10:23:02AM -0400, Steven Rostedt wrote: > > On Mon, 2012-08-13 at 15:24 +0200, Borislav Petkov wrote: > > > > > So wouldn't it make sense to call this ABSOLUTE_O or so then? > > > > That's just because you're russian, and are promoting Vodka! ;-) Before: [acme@sandy linux]$ rm -rf ../build/perf [acme@sandy linux]$ make -j8 -C tools/perf/ LIBUNWIND_DIR=/opt/libunwind O=/home/acme/git/build/perf install /bin/sh: line 0: cd: /home/acme/git/build/perf/: No such file or directory make: Entering directory `/home/git/linux/tools/perf' ../scripts/Makefile.include:9: *** output directory "/home/acme/git/build/perf/" does not exist. Stop. make: Leaving directory `/home/git/linux/tools/perf' [acme@sandy linux]$ Now: [acme@sandy linux]$ rm -rf ../build/perf [acme@sandy linux]$ make -j8 -C tools/perf/ LIBUNWIND_DIR=/opt/libunwind O=/home/acme/git/build/perf install /bin/sh: line 0: cd: /home/acme/git/build/perf: No such file or directory make: Entering directory `/home/git/linux/tools/perf' GEN perf-archive GEN /home/git/linux/tools/perf/python/perf.so make[1]: Entering directory `/home/git/linux/tools/lib/traceevent' make[2]: warning: jobserver unavailable: using -j1. Add `+' to parent make rule. * new build flags or cross compiler CC /home/git/linux/tools/perf/perf.o CC /home/git/linux/tools/perf/builtin-annotate.o CC /home/git/linux/tools/perf/builtin-bench.o CC /home/git/linux/tools/perf/bench/sched-messaging.o CC /home/git/linux/tools/perf/bench/sched-pipe.o I.e. it should stop if the O= provided directory is not there. Can you fix this? Avoid vodka while doing it :-P - Arnaldo ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] perf: Let O= makes handle relative paths 2012-08-13 18:02 ` Arnaldo Carvalho de Melo @ 2012-08-15 10:27 ` Borislav Petkov 2012-08-15 13:06 ` Arnaldo Carvalho de Melo 0 siblings, 1 reply; 15+ messages in thread From: Borislav Petkov @ 2012-08-15 10:27 UTC (permalink / raw) To: Arnaldo Carvalho de Melo; +Cc: Steven Rostedt, LKML, Ingo Molnar, Namhyung Kim On Mon, Aug 13, 2012 at 03:02:49PM -0300, Arnaldo Carvalho de Melo wrote: > [acme@sandy linux]$ rm -rf ../build/perf > [acme@sandy linux]$ make -j8 -C tools/perf/ LIBUNWIND_DIR=/opt/libunwind O=/home/acme/git/build/perf install > /bin/sh: line 0: cd: /home/acme/git/build/perf: No such file or directory > make: Entering directory `/home/git/linux/tools/perf' > GEN perf-archive > GEN /home/git/linux/tools/perf/python/perf.so > make[1]: Entering directory `/home/git/linux/tools/lib/traceevent' > make[2]: warning: jobserver unavailable: using -j1. Add `+' to parent make rule. > * new build flags or cross compiler > CC /home/git/linux/tools/perf/perf.o > CC /home/git/linux/tools/perf/builtin-annotate.o > CC /home/git/linux/tools/perf/builtin-bench.o > CC /home/git/linux/tools/perf/bench/sched-messaging.o > CC /home/git/linux/tools/perf/bench/sched-pipe.o > > I.e. it should stop if the O= provided directory is not there. Why stop? Don't we want to make the directory instead and continue building in there? -- Regards/Gruss, Boris. Advanced Micro Devices GmbH Einsteinring 24, 85609 Dornach GM: Alberto Bozzo Reg: Dornach, Landkreis Muenchen HRB Nr. 43632 WEEE Registernr: 129 19551 ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] perf: Let O= makes handle relative paths 2012-08-15 10:27 ` Borislav Petkov @ 2012-08-15 13:06 ` Arnaldo Carvalho de Melo 2012-08-15 13:18 ` Borislav Petkov 0 siblings, 1 reply; 15+ messages in thread From: Arnaldo Carvalho de Melo @ 2012-08-15 13:06 UTC (permalink / raw) To: Borislav Petkov Cc: Steven Rostedt, Peter Zijlstra, LKML, Ingo Molnar, Namhyung Kim Em Wed, Aug 15, 2012 at 12:27:22PM +0200, Borislav Petkov escreveu: > On Mon, Aug 13, 2012 at 03:02:49PM -0300, Arnaldo Carvalho de Melo wrote: > > [acme@sandy linux]$ rm -rf ../build/perf > > [acme@sandy linux]$ make -j8 -C tools/perf/ LIBUNWIND_DIR=/opt/libunwind O=/home/acme/git/build/perf install > > /bin/sh: line 0: cd: /home/acme/git/build/perf: No such file or directory > > make: Entering directory `/home/git/linux/tools/perf' > > GEN perf-archive > > GEN /home/git/linux/tools/perf/python/perf.so > > make[1]: Entering directory `/home/git/linux/tools/lib/traceevent' > > * new build flags or cross compiler > > CC /home/git/linux/tools/perf/perf.o > > I.e. it should stop if the O= provided directory is not there. > Why stop? Don't we want to make the directory instead and continue > building in there? That was the case in the past, but IIRC PeterZ advocated not to and I agreed. - Arnaldo ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] perf: Let O= makes handle relative paths 2012-08-15 13:06 ` Arnaldo Carvalho de Melo @ 2012-08-15 13:18 ` Borislav Petkov 2012-08-15 14:38 ` Peter Zijlstra 0 siblings, 1 reply; 15+ messages in thread From: Borislav Petkov @ 2012-08-15 13:18 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: Steven Rostedt, Peter Zijlstra, LKML, Ingo Molnar, Namhyung Kim On Wed, Aug 15, 2012 at 10:06:34AM -0300, Arnaldo Carvalho de Melo wrote: > That was the case in the past, but IIRC PeterZ advocated not to and I > agreed. Maybe you guys need to explain yourselves :) I mean, the dir is not present so we're not overwriting anything. And since we say "O=..." on the command line, it is actually expected that we really mean it... why type it, otherwise? Hmmm. -- Regards/Gruss, Boris. Advanced Micro Devices GmbH Einsteinring 24, 85609 Dornach GM: Alberto Bozzo Reg: Dornach, Landkreis Muenchen HRB Nr. 43632 WEEE Registernr: 129 19551 ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] perf: Let O= makes handle relative paths 2012-08-15 13:18 ` Borislav Petkov @ 2012-08-15 14:38 ` Peter Zijlstra 2012-08-15 14:42 ` Borislav Petkov 0 siblings, 1 reply; 15+ messages in thread From: Peter Zijlstra @ 2012-08-15 14:38 UTC (permalink / raw) To: Borislav Petkov Cc: Arnaldo Carvalho de Melo, Steven Rostedt, LKML, Ingo Molnar, Namhyung Kim On Wed, 2012-08-15 at 15:18 +0200, Borislav Petkov wrote: > On Wed, Aug 15, 2012 at 10:06:34AM -0300, Arnaldo Carvalho de Melo wrote: > > That was the case in the past, but IIRC PeterZ advocated not to and I > > agreed. > > Maybe you guys need to explain yourselves :) I mean, the dir is not > present so we're not overwriting anything. And since we say "O=..." on > the command line, it is actually expected that we really mean it... why > type it, otherwise? Because you're an idiot and made a typo ;-) Happens to me all the time. The regular kernel build doesn't create non-existent O= targets either iirc. ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] perf: Let O= makes handle relative paths 2012-08-15 14:38 ` Peter Zijlstra @ 2012-08-15 14:42 ` Borislav Petkov 2012-08-15 14:59 ` Arnaldo Carvalho de Melo 0 siblings, 1 reply; 15+ messages in thread From: Borislav Petkov @ 2012-08-15 14:42 UTC (permalink / raw) To: Peter Zijlstra Cc: Arnaldo Carvalho de Melo, Steven Rostedt, LKML, Ingo Molnar, Namhyung Kim On Wed, Aug 15, 2012 at 04:38:05PM +0200, Peter Zijlstra wrote: > Because you're an idiot and made a typo ;-) Happens to me all the time. I'm not an idiot - I'm perfection at its purest! :-) > The regular kernel build doesn't create non-existent O= targets either > iirc. Ok, I see. The kernel needs to protect itself against the people who wrote it :-). -- Regards/Gruss, Boris. Advanced Micro Devices GmbH Einsteinring 24, 85609 Dornach GM: Alberto Bozzo Reg: Dornach, Landkreis Muenchen HRB Nr. 43632 WEEE Registernr: 129 19551 ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] perf: Let O= makes handle relative paths 2012-08-15 14:42 ` Borislav Petkov @ 2012-08-15 14:59 ` Arnaldo Carvalho de Melo 2012-08-15 16:39 ` Borislav Petkov 0 siblings, 1 reply; 15+ messages in thread From: Arnaldo Carvalho de Melo @ 2012-08-15 14:59 UTC (permalink / raw) To: Borislav Petkov Cc: Peter Zijlstra, Steven Rostedt, LKML, Ingo Molnar, Namhyung Kim Em Wed, Aug 15, 2012 at 04:42:55PM +0200, Borislav Petkov escreveu: > On Wed, Aug 15, 2012 at 04:38:05PM +0200, Peter Zijlstra wrote: > > Because you're an idiot and made a typo ;-) Happens to me all the time. > > I'm not an idiot - I'm perfection at its purest! :-) > > > The regular kernel build doesn't create non-existent O= targets either > > iirc. > > Ok, I see. The kernel needs to protect itself against the people who > wrote it :-). Of course! Those are the ultimate kernel killers! - Arnaldo ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] perf: Let O= makes handle relative paths 2012-08-15 14:59 ` Arnaldo Carvalho de Melo @ 2012-08-15 16:39 ` Borislav Petkov 2012-08-16 16:07 ` Steven Rostedt 2012-08-21 16:20 ` [tip:perf/core] perf tools: " tip-bot for Steven Rostedt 0 siblings, 2 replies; 15+ messages in thread From: Borislav Petkov @ 2012-08-15 16:39 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: Peter Zijlstra, Steven Rostedt, LKML, Ingo Molnar, Namhyung Kim On Wed, Aug 15, 2012 at 11:59:35AM -0300, Arnaldo Carvalho de Melo wrote: > Of course! Those are the ultimate kernel killers! Haha, this is what I'm answering next time I'm asked about what I do for a living :-). How about this? -- From: Steven Rostedt <rostedt@goodmis.org> Date: Mon, 13 Aug 2012 10:23:02 -0400 Subject: [PATCH] perf: Let O= makes handle relative paths When I did a compile of perf using a relative path for the output directory, the build failed when it tried to compile libtraceevent. This is because it continues to use the same relative path when the new working directory is in a different path. SUBDIR ../lib/traceevent/ /bin/sh: line 0: cd: ../../../nobackup/perf/: No such file or directory Makefile:74: *** output directory "../../../nobackup/perf/" does not exist. Stop. make: *** [../../../nobackup/perf///libtraceevent.a] Error 2 Make the path used an absolute path when building perf with O=. Boris: Teach Makefile to check whether the supplied O= directory exists and bail out if not. Reportedly, kernel dudes are idiots and need to be guarded so as not to shoot themselves in the foot when playing in the sandbox. Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Borislav Petkov <borislav.petkov@amd.com> --- tools/scripts/Makefile.include | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/scripts/Makefile.include b/tools/scripts/Makefile.include index bde8521d56bb..96ce80a3743b 100644 --- a/tools/scripts/Makefile.include +++ b/tools/scripts/Makefile.include @@ -1,6 +1,8 @@ ifeq ("$(origin O)", "command line") - OUTPUT := $(O)/ - COMMAND_O := O=$(O) + dummy := $(if $(shell test -d $(O) || echo $(O)),$(error O=$(O) does not exist),) + ABSOLUTE_O := $(shell cd $(O) ; pwd) + OUTPUT := $(ABSOLUTE_O)/ + COMMAND_O := O=$(ABSOLUTE_O) endif ifneq ($(OUTPUT),) -- 1.7.11.rc1 -- Regards/Gruss, Boris. Advanced Micro Devices GmbH Einsteinring 24, 85609 Dornach GM: Alberto Bozzo Reg: Dornach, Landkreis Muenchen HRB Nr. 43632 WEEE Registernr: 129 19551 ^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH] perf: Let O= makes handle relative paths 2012-08-15 16:39 ` Borislav Petkov @ 2012-08-16 16:07 ` Steven Rostedt 2012-08-16 17:12 ` Arnaldo Carvalho de Melo 2012-08-21 16:20 ` [tip:perf/core] perf tools: " tip-bot for Steven Rostedt 1 sibling, 1 reply; 15+ messages in thread From: Steven Rostedt @ 2012-08-16 16:07 UTC (permalink / raw) To: Borislav Petkov Cc: Arnaldo Carvalho de Melo, Peter Zijlstra, LKML, Ingo Molnar, Namhyung Kim On Wed, 2012-08-15 at 18:39 +0200, Borislav Petkov wrote: > diff --git a/tools/scripts/Makefile.include b/tools/scripts/Makefile.include > index bde8521d56bb..96ce80a3743b 100644 > --- a/tools/scripts/Makefile.include > +++ b/tools/scripts/Makefile.include > @@ -1,6 +1,8 @@ > ifeq ("$(origin O)", "command line") > - OUTPUT := $(O)/ > - COMMAND_O := O=$(O) > + dummy := $(if $(shell test -d $(O) || echo $(O)),$(error O=$(O) does not exist),) > + ABSOLUTE_O := $(shell cd $(O) ; pwd) > + OUTPUT := $(ABSOLUTE_O)/ > + COMMAND_O := O=$(ABSOLUTE_O) > endif > Acked-by: Steven Rostedt <rostedt@goodmis.org> Arnaldo, can you pick this patch? Keep both the Signed-off-bys that Boris placed. Thanks! -- Steve ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] perf: Let O= makes handle relative paths 2012-08-16 16:07 ` Steven Rostedt @ 2012-08-16 17:12 ` Arnaldo Carvalho de Melo 0 siblings, 0 replies; 15+ messages in thread From: Arnaldo Carvalho de Melo @ 2012-08-16 17:12 UTC (permalink / raw) To: Steven Rostedt Cc: Borislav Petkov, Peter Zijlstra, LKML, Ingo Molnar, Namhyung Kim Em Thu, Aug 16, 2012 at 12:07:54PM -0400, Steven Rostedt escreveu: > Acked-by: Steven Rostedt <rostedt@goodmis.org> > > Arnaldo, can you pick this patch? Keep both the Signed-off-bys that > Boris placed. ack, done, - Arnaldo ^ permalink raw reply [flat|nested] 15+ messages in thread
* [tip:perf/core] perf tools: Let O= makes handle relative paths 2012-08-15 16:39 ` Borislav Petkov 2012-08-16 16:07 ` Steven Rostedt @ 2012-08-21 16:20 ` tip-bot for Steven Rostedt 1 sibling, 0 replies; 15+ messages in thread From: tip-bot for Steven Rostedt @ 2012-08-21 16:20 UTC (permalink / raw) To: linux-tip-commits Cc: acme, linux-kernel, hpa, mingo, peterz, namhyung.kim, rostedt, tglx, borislav.petkov Commit-ID: c883122acc0d97648d8b8f4726709017674e4420 Gitweb: http://git.kernel.org/tip/c883122acc0d97648d8b8f4726709017674e4420 Author: Steven Rostedt <rostedt@goodmis.org> AuthorDate: Mon, 13 Aug 2012 10:23:02 -0400 Committer: Arnaldo Carvalho de Melo <acme@redhat.com> CommitDate: Thu, 16 Aug 2012 14:11:11 -0300 perf tools: Let O= makes handle relative paths When I did a compile of perf using a relative path for the output directory, the build failed when it tried to compile libtraceevent. This is because it continues to use the same relative path when the new working directory is in a different path. SUBDIR ../lib/traceevent/ /bin/sh: line 0: cd: ../../../nobackup/perf/: No such file or directory Makefile:74: *** output directory "../../../nobackup/perf/" does not exist. Stop. make: *** [../../../nobackup/perf///libtraceevent.a] Error 2 Make the path used an absolute path when building perf with O=. Boris: Teach Makefile to check whether the supplied O= directory exists and bail out if not. Reportedly, kernel dudes are idiots and need to be guarded so as not to shoot themselves in the foot when playing in the sandbox. Signed-off-by: Borislav Petkov <borislav.petkov@amd.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Acked-by: Steven Rostedt <rostedt@goodmis.org> Cc: Ingo Molnar <mingo@kernel.org> Cc: Namhyung Kim <namhyung.kim@lge.com> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/20120815163923.GD15989@aftab.osrc.amd.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/scripts/Makefile.include | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/scripts/Makefile.include b/tools/scripts/Makefile.include index bde8521..96ce80a 100644 --- a/tools/scripts/Makefile.include +++ b/tools/scripts/Makefile.include @@ -1,6 +1,8 @@ ifeq ("$(origin O)", "command line") - OUTPUT := $(O)/ - COMMAND_O := O=$(O) + dummy := $(if $(shell test -d $(O) || echo $(O)),$(error O=$(O) does not exist),) + ABSOLUTE_O := $(shell cd $(O) ; pwd) + OUTPUT := $(ABSOLUTE_O)/ + COMMAND_O := O=$(ABSOLUTE_O) endif ifneq ($(OUTPUT),) ^ permalink raw reply related [flat|nested] 15+ messages in thread
end of thread, other threads:[~2012-08-21 16:20 UTC | newest] Thread overview: 15+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2012-08-13 13:20 [PATCH] perf: Let O= makes handle relative paths Steven Rostedt 2012-08-13 13:24 ` Borislav Petkov 2012-08-13 14:23 ` Steven Rostedt 2012-08-13 14:29 ` Borislav Petkov 2012-08-13 18:02 ` Arnaldo Carvalho de Melo 2012-08-15 10:27 ` Borislav Petkov 2012-08-15 13:06 ` Arnaldo Carvalho de Melo 2012-08-15 13:18 ` Borislav Petkov 2012-08-15 14:38 ` Peter Zijlstra 2012-08-15 14:42 ` Borislav Petkov 2012-08-15 14:59 ` Arnaldo Carvalho de Melo 2012-08-15 16:39 ` Borislav Petkov 2012-08-16 16:07 ` Steven Rostedt 2012-08-16 17:12 ` Arnaldo Carvalho de Melo 2012-08-21 16:20 ` [tip:perf/core] perf tools: " tip-bot for Steven Rostedt
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox