aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Ahern <dsahern@gmail.com>2012-08-27 15:05:54 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2012-09-05 16:23:30 -0400
commit09a2f16a916178489fc4bf439de668d81fda7616 (patch)
tree3e4ef06a1a295327f524b1ad5219c5348fbdbff0
parent8d3eca20b9f31cf10088e283d704f6a71b9a4ee2 (diff)
perf tools: Fix x86 builds with ARCH specified on the command line
e.g., compiling i386 on x86_64 using: $ make -C tools/perf ARCH=i386 fails with: CC /tmp/pbuild/util/evsel.o In file included from util/evsel.c:21:0: util/perf_regs.h:5:23: fatal error: perf_regs.h: No such file or directory compilation terminated. Adding V=1 you see that the include argument for the arch is '-Iarch/i386/include' is wrong. It is supposed to be -Iarch/x86/include per the redefinition of ARCH in the Makefile. According to the make manual, http://www.gnu.org/software/make/manual/make.html#Override-Directive: "If a variable has been set with a command argument (see Overriding Variables), then ordinary assignments in the makefile are ignored. If you want to set the variable in the makefile even though it was set with a command argument, you can use an override directive ..." Make it so. Signed-off-by: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/1346094354-74356-1-git-send-email-dsahern@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r--tools/perf/Makefile4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 722ddee61f9f..939cf6d898a5 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -64,12 +64,12 @@ AR = $(CROSS_COMPILE)ar
64 64
65# Additional ARCH settings for x86 65# Additional ARCH settings for x86
66ifeq ($(ARCH),i386) 66ifeq ($(ARCH),i386)
67 ARCH := x86 67 override ARCH := x86
68 NO_PERF_REGS := 0 68 NO_PERF_REGS := 0
69 LIBUNWIND_LIBS = -lunwind -lunwind-x86 69 LIBUNWIND_LIBS = -lunwind -lunwind-x86
70endif 70endif
71ifeq ($(ARCH),x86_64) 71ifeq ($(ARCH),x86_64)
72 ARCH := x86 72 override ARCH := x86
73 IS_X86_64 := 0 73 IS_X86_64 := 0
74 ifeq (, $(findstring m32,$(EXTRA_CFLAGS))) 74 ifeq (, $(findstring m32,$(EXTRA_CFLAGS)))
75 IS_X86_64 := $(shell echo __x86_64__ | ${CC} -E -xc - | tail -n 1) 75 IS_X86_64 := $(shell echo __x86_64__ | ${CC} -E -xc - | tail -n 1)