* [PATCH] perf tools: Fix build error on read only source.
@ 2010-08-16 12:40 Kusanagi Kouichi
2010-08-16 15:24 ` Arnaldo Carvalho de Melo
0 siblings, 1 reply; 6+ messages in thread
From: Kusanagi Kouichi @ 2010-08-16 12:40 UTC (permalink / raw)
To: Peter Zijlstra, Paul Mackerras, Ingo Molnar,
Arnaldo Carvalho de Melo
Cc: linux-kernel
Signed-off-by: Kusanagi Kouichi <slash@ac.auone-net.jp>
---
tools/perf/Makefile | 8 ++++----
tools/perf/feature-tests.mak | 6 ++----
2 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 41abb90..31b528f 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -935,15 +935,15 @@ $(OUTPUT)common-cmds.h: $(wildcard Documentation/perf-*.txt)
$(QUIET_GEN). util/generate-cmdlist.sh > $@+ && mv $@+ $@
$(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh
- $(QUIET_GEN)$(RM) $@ $@+ && \
+ $(QUIET_GEN)$(RM) $(OUTPUT)$@ $(OUTPUT)$@+ && \
sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
-e 's|@SHELL_PATH@|$(SHELL_PATH_SQ)|' \
-e 's|@@PERL@@|$(PERL_PATH_SQ)|g' \
-e 's/@@PERF_VERSION@@/$(PERF_VERSION)/g' \
-e 's/@@NO_CURL@@/$(NO_CURL)/g' \
- $@.sh >$@+ && \
- chmod +x $@+ && \
- mv $@+ $(OUTPUT)$@
+ $@.sh > $(OUTPUT)$@+ && \
+ chmod +x $(OUTPUT)$@+ && \
+ mv $(OUTPUT)$@+ $(OUTPUT)$@
configure: configure.ac
$(QUIET_GEN)$(RM) $@ $<+ && \
diff --git a/tools/perf/feature-tests.mak b/tools/perf/feature-tests.mak
index ddb68e6..cd75798 100644
--- a/tools/perf/feature-tests.mak
+++ b/tools/perf/feature-tests.mak
@@ -113,7 +113,5 @@ endef
# try-cc
# Usage: option = $(call try-cc, source-to-build, cc-options)
try-cc = $(shell sh -c \
- 'TMP="$(TMPOUT).$$$$"; \
- echo "$(1)" | \
- $(CC) -x c - $(2) -o "$$TMP" > /dev/null 2>&1 && echo y; \
- rm -f "$$TMP"')
+ 'echo "$(1)" | \
+ $(CC) -x c - $(2) -o /dev/null > /dev/null 2>&1 && echo y')
--
1.7.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] perf tools: Fix build error on read only source.
2010-08-16 12:40 [PATCH] perf tools: Fix build error on read only source Kusanagi Kouichi
@ 2010-08-16 15:24 ` Arnaldo Carvalho de Melo
2010-08-17 12:57 ` Kusanagi Kouichi
2010-08-17 14:08 ` Kusanagi Kouichi
0 siblings, 2 replies; 6+ messages in thread
From: Arnaldo Carvalho de Melo @ 2010-08-16 15:24 UTC (permalink / raw)
To: Kusanagi Kouichi
Cc: Peter Zijlstra, Paul Mackerras, Ingo Molnar, linux-kernel
Em Mon, Aug 16, 2010 at 09:40:13PM +0900, Kusanagi Kouichi escreveu:
...
> diff --git a/tools/perf/feature-tests.mak b/tools/perf/feature-tests.mak
> @@ -113,7 +113,5 @@ endef
> # try-cc
> # Usage: option = $(call try-cc, source-to-build, cc-options)
> try-cc = $(shell sh -c \
> - 'TMP="$(TMPOUT).$$$$"; \
> - echo "$(1)" | \
> - $(CC) -x c - $(2) -o "$$TMP" > /dev/null 2>&1 && echo y; \
> - rm -f "$$TMP"')
> + 'echo "$(1)" | \
> + $(CC) -x c - $(2) -o /dev/null > /dev/null 2>&1 && echo y')
Please read:
f9af3a4c1f59753bdd5a49e3a34263005f96972e
8b2c551f9635bf1c5c2d38de300137998915478f
1703f2c321a8a531c393e137a82602e16c6061cb
To see why we can't use '-o /dev/null' like that.
- Arnaldo
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] perf tools: Fix build error on read only source.
2010-08-16 15:24 ` Arnaldo Carvalho de Melo
@ 2010-08-17 12:57 ` Kusanagi Kouichi
2010-08-17 14:08 ` Kusanagi Kouichi
1 sibling, 0 replies; 6+ messages in thread
From: Kusanagi Kouichi @ 2010-08-17 12:57 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: Peter Zijlstra, Paul Mackerras, Ingo Molnar, linux-kernel
On 2010-08-16 12:24:10 -0300, Arnaldo Carvalho de Melo wrote:
> Em Mon, Aug 16, 2010 at 09:40:13PM +0900, Kusanagi Kouichi escreveu:
> ...
> > diff --git a/tools/perf/feature-tests.mak b/tools/perf/feature-tests.mak
> > @@ -113,7 +113,5 @@ endef
> > # try-cc
> > # Usage: option = $(call try-cc, source-to-build, cc-options)
> > try-cc = $(shell sh -c \
> > - 'TMP="$(TMPOUT).$$$$"; \
> > - echo "$(1)" | \
> > - $(CC) -x c - $(2) -o "$$TMP" > /dev/null 2>&1 && echo y; \
> > - rm -f "$$TMP"')
> > + 'echo "$(1)" | \
> > + $(CC) -x c - $(2) -o /dev/null > /dev/null 2>&1 && echo y')
>
> Please read:
>
> f9af3a4c1f59753bdd5a49e3a34263005f96972e
> 8b2c551f9635bf1c5c2d38de300137998915478f
> 1703f2c321a8a531c393e137a82602e16c6061cb
>
> To see why we can't use '-o /dev/null' like that.
>
> - Arnaldo
I see. I will try another way.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] perf tools: Fix build error on read only source.
2010-08-16 15:24 ` Arnaldo Carvalho de Melo
2010-08-17 12:57 ` Kusanagi Kouichi
@ 2010-08-17 14:08 ` Kusanagi Kouichi
2010-08-17 14:17 ` Arnaldo Carvalho de Melo
2010-08-19 11:22 ` [tip:perf/urgent] " tip-bot for Kusanagi Kouichi
1 sibling, 2 replies; 6+ messages in thread
From: Kusanagi Kouichi @ 2010-08-17 14:08 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: Peter Zijlstra, Paul Mackerras, Ingo Molnar, linux-kernel
Signed-off-by: Kusanagi Kouichi <slash@ac.auone-net.jp>
---
tools/perf/Makefile | 8 ++++----
tools/perf/feature-tests.mak | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 41abb90..31b528f 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -935,15 +935,15 @@ $(OUTPUT)common-cmds.h: $(wildcard Documentation/perf-*.txt)
$(QUIET_GEN). util/generate-cmdlist.sh > $@+ && mv $@+ $@
$(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh
- $(QUIET_GEN)$(RM) $@ $@+ && \
+ $(QUIET_GEN)$(RM) $(OUTPUT)$@ $(OUTPUT)$@+ && \
sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
-e 's|@SHELL_PATH@|$(SHELL_PATH_SQ)|' \
-e 's|@@PERL@@|$(PERL_PATH_SQ)|g' \
-e 's/@@PERF_VERSION@@/$(PERF_VERSION)/g' \
-e 's/@@NO_CURL@@/$(NO_CURL)/g' \
- $@.sh >$@+ && \
- chmod +x $@+ && \
- mv $@+ $(OUTPUT)$@
+ $@.sh > $(OUTPUT)$@+ && \
+ chmod +x $(OUTPUT)$@+ && \
+ mv $(OUTPUT)$@+ $(OUTPUT)$@
configure: configure.ac
$(QUIET_GEN)$(RM) $@ $<+ && \
diff --git a/tools/perf/feature-tests.mak b/tools/perf/feature-tests.mak
index ddb68e6..7a7b608 100644
--- a/tools/perf/feature-tests.mak
+++ b/tools/perf/feature-tests.mak
@@ -113,7 +113,7 @@ endef
# try-cc
# Usage: option = $(call try-cc, source-to-build, cc-options)
try-cc = $(shell sh -c \
- 'TMP="$(TMPOUT).$$$$"; \
+ 'TMP="$(OUTPUT)$(TMPOUT).$$$$"; \
echo "$(1)" | \
$(CC) -x c - $(2) -o "$$TMP" > /dev/null 2>&1 && echo y; \
rm -f "$$TMP"')
--
1.7.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] perf tools: Fix build error on read only source.
2010-08-17 14:08 ` Kusanagi Kouichi
@ 2010-08-17 14:17 ` Arnaldo Carvalho de Melo
2010-08-19 11:22 ` [tip:perf/urgent] " tip-bot for Kusanagi Kouichi
1 sibling, 0 replies; 6+ messages in thread
From: Arnaldo Carvalho de Melo @ 2010-08-17 14:17 UTC (permalink / raw)
To: Kusanagi Kouichi
Cc: Peter Zijlstra, Paul Mackerras, Ingo Molnar, linux-kernel
Em Tue, Aug 17, 2010 at 11:08:40PM +0900, Kusanagi Kouichi escreveu:
> --- a/tools/perf/feature-tests.mak
> +++ b/tools/perf/feature-tests.mak
> @@ -113,7 +113,7 @@ endef
> # try-cc
> # Usage: option = $(call try-cc, source-to-build, cc-options)
> try-cc = $(shell sh -c \
> - 'TMP="$(TMPOUT).$$$$"; \
> + 'TMP="$(OUTPUT)$(TMPOUT).$$$$"; \
> echo "$(1)" | \
> $(CC) -x c - $(2) -o "$$TMP" > /dev/null 2>&1 && echo y; \
> rm -f "$$TMP"')
Much better! Will test and merge, thanks!
- Arnaldo
^ permalink raw reply [flat|nested] 6+ messages in thread
* [tip:perf/urgent] perf tools: Fix build error on read only source.
2010-08-17 14:08 ` Kusanagi Kouichi
2010-08-17 14:17 ` Arnaldo Carvalho de Melo
@ 2010-08-19 11:22 ` tip-bot for Kusanagi Kouichi
1 sibling, 0 replies; 6+ messages in thread
From: tip-bot for Kusanagi Kouichi @ 2010-08-19 11:22 UTC (permalink / raw)
To: linux-tip-commits
Cc: acme, linux-kernel, paulus, hpa, mingo, a.p.zijlstra, slash, tglx,
mingo
Commit-ID: ecafda60e88031bcc4271c446f984ee883d69ea8
Gitweb: http://git.kernel.org/tip/ecafda60e88031bcc4271c446f984ee883d69ea8
Author: Kusanagi Kouichi <slash@ac.auone-net.jp>
AuthorDate: Wed, 18 Aug 2010 13:32:37 -0300
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Wed, 18 Aug 2010 13:32:37 -0300
perf tools: Fix build error on read only source.
Parts of the build process were generating files outside the specified
O= directory, causing the build to fail on systems where the sources are
in a read only file system.
Fix it by using $(OUTPUT) on these locations.
Also check that $(OUTPUT) actually exists, just like the top level
kernel Makefile does. Otherwise the failure message emitted is
completely misleading.
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
LKML-Reference: <20100817140841.0859362C03A@msa106.auone-net.jp>
Signed-off-by: Kusanagi Kouichi <slash@ac.auone-net.jp>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/Makefile | 14 ++++++++++----
tools/perf/feature-tests.mak | 2 +-
2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index dcb9700..4f1fa77 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -5,6 +5,12 @@ endif
# The default target of this Makefile is...
all::
+ifneq ($(OUTPUT),)
+# check that the output directory actually exists
+OUTDIR := $(shell cd $(OUTPUT) && /bin/pwd)
+$(if $(OUTDIR),, $(error output directory "$(OUTPUT)" does not exist))
+endif
+
# Define V=1 to have a more verbose compile.
# Define V=2 to have an even more verbose compile.
#
@@ -931,15 +937,15 @@ $(OUTPUT)common-cmds.h: $(wildcard Documentation/perf-*.txt)
$(QUIET_GEN). util/generate-cmdlist.sh > $@+ && mv $@+ $@
$(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh
- $(QUIET_GEN)$(RM) $@ $@+ && \
+ $(QUIET_GEN)$(RM) $(OUTPUT)$@ $(OUTPUT)$@+ && \
sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
-e 's|@SHELL_PATH@|$(SHELL_PATH_SQ)|' \
-e 's|@@PERL@@|$(PERL_PATH_SQ)|g' \
-e 's/@@PERF_VERSION@@/$(PERF_VERSION)/g' \
-e 's/@@NO_CURL@@/$(NO_CURL)/g' \
- $@.sh >$@+ && \
- chmod +x $@+ && \
- mv $@+ $(OUTPUT)$@
+ $@.sh > $(OUTPUT)$@+ && \
+ chmod +x $(OUTPUT)$@+ && \
+ mv $(OUTPUT)$@+ $(OUTPUT)$@
configure: configure.ac
$(QUIET_GEN)$(RM) $@ $<+ && \
diff --git a/tools/perf/feature-tests.mak b/tools/perf/feature-tests.mak
index ddb68e6..7a7b608 100644
--- a/tools/perf/feature-tests.mak
+++ b/tools/perf/feature-tests.mak
@@ -113,7 +113,7 @@ endef
# try-cc
# Usage: option = $(call try-cc, source-to-build, cc-options)
try-cc = $(shell sh -c \
- 'TMP="$(TMPOUT).$$$$"; \
+ 'TMP="$(OUTPUT)$(TMPOUT).$$$$"; \
echo "$(1)" | \
$(CC) -x c - $(2) -o "$$TMP" > /dev/null 2>&1 && echo y; \
rm -f "$$TMP"')
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-08-19 11:23 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-16 12:40 [PATCH] perf tools: Fix build error on read only source Kusanagi Kouichi
2010-08-16 15:24 ` Arnaldo Carvalho de Melo
2010-08-17 12:57 ` Kusanagi Kouichi
2010-08-17 14:08 ` Kusanagi Kouichi
2010-08-17 14:17 ` Arnaldo Carvalho de Melo
2010-08-19 11:22 ` [tip:perf/urgent] " tip-bot for Kusanagi Kouichi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox