Skip to content

Commit ecafda6

Browse files
k7k7acmel
authored andcommitted
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>
1 parent 033a273 commit ecafda6

2 files changed

Lines changed: 11 additions & 5 deletions

File tree

‎tools/perf/Makefile‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ endif
55
# The default target of this Makefile is...
66
all::
77

8+
ifneq ($(OUTPUT),)
9+
# check that the output directory actually exists
10+
OUTDIR := $(shell cd $(OUTPUT) && /bin/pwd)
11+
$(if $(OUTDIR),, $(error output directory "$(OUTPUT)" does not exist))
12+
endif
13+
814
# Define V=1 to have a more verbose compile.
915
# Define V=2 to have an even more verbose compile.
1016
#
@@ -931,15 +937,15 @@ $(OUTPUT)common-cmds.h: $(wildcard Documentation/perf-*.txt)
931937
$(QUIET_GEN). util/generate-cmdlist.sh > $@+ && mv $@+ $@
932938

933939
$(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh
934-
$(QUIET_GEN)$(RM) $@ $@+ && \
940+
$(QUIET_GEN)$(RM) $(OUTPUT)$@ $(OUTPUT)$@+ && \
935941
sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
936942
-e 's|@SHELL_PATH@|$(SHELL_PATH_SQ)|' \
937943
-e 's|@@PERL@@|$(PERL_PATH_SQ)|g' \
938944
-e 's/@@PERF_VERSION@@/$(PERF_VERSION)/g' \
939945
-e 's/@@NO_CURL@@/$(NO_CURL)/g' \
940-
$@.sh >$@+ && \
941-
chmod +x $@+ && \
942-
mv $@+ $(OUTPUT)$@
946+
$@.sh > $(OUTPUT)$@+ && \
947+
chmod +x $(OUTPUT)$@+ && \
948+
mv $(OUTPUT)$@+ $(OUTPUT)$@
943949

944950
configure: configure.ac
945951
$(QUIET_GEN)$(RM) $@ $<+ && \

‎tools/perf/feature-tests.mak‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ endef
113113
# try-cc
114114
# Usage: option = $(call try-cc, source-to-build, cc-options)
115115
try-cc = $(shell sh -c \
116-
'TMP="$(TMPOUT).$$$$"; \
116+
'TMP="$(OUTPUT)$(TMPOUT).$$$$"; \
117117
echo "$(1)" | \
118118
$(CC) -x c - $(2) -o "$$TMP" > /dev/null 2>&1 && echo y; \
119119
rm -f "$$TMP"')

0 commit comments

Comments
 (0)