1 From 08a4a43fc407d780bdde36d98f89c0dbb2a6be6b Mon Sep 17 00:00:00 2001
2 From: David Ahern <dsahern@gmail.com>
3 Date: Mon, 11 Jul 2011 15:38:24 -0600
4 Subject: perf tools, x86: Fix 32-bit compile on 64-bit system
6 From: David Ahern <dsahern@gmail.com>
8 commit 08a4a43fc407d780bdde36d98f89c0dbb2a6be6b upstream.
10 Builds for 32-bit perf binaries on a 64-bit host currently fail
14 bench/../../../arch/x86/lib/memcpy_64.S: Assembler messages:
15 bench/../../../arch/x86/lib/memcpy_64.S:29: Error: bad register name `%rdi'
16 bench/../../../arch/x86/lib/memcpy_64.S:34: Error: invalid instruction suffix for `movs'
17 bench/../../../arch/x86/lib/memcpy_64.S:50: Error: bad register name `%rdi'
18 bench/../../../arch/x86/lib/memcpy_64.S:61: Error: bad register name `%rdi'
21 The problem is the detection of the host arch without considering passed in
22 flags. This change fixes 32-bit builds via:
24 make EXTRA_CFLAGS=-m32
26 and 64-bit builds still reference the memcpy_64.S.
28 Signed-off-by: David Ahern <dsahern@gmail.com>
29 Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
30 Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
31 Link: http://lkml.kernel.org/r/1310420304-21452-1-git-send-email-dsahern@gmail.com
32 Signed-off-by: Ingo Molnar <mingo@elte.hu>
33 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
36 tools/perf/Makefile | 5 ++++-
37 1 file changed, 4 insertions(+), 1 deletion(-)
39 --- a/tools/perf/Makefile
40 +++ b/tools/perf/Makefile
41 @@ -52,7 +52,10 @@ ifeq ($(ARCH),i386)
45 - IS_X86_64 := $(shell echo __x86_64__ | ${CC} -E -xc - | tail -n 1)
47 + ifeq (, $(findstring m32,$(EXTRA_CFLAGS)))
48 + IS_X86_64 := $(shell echo __x86_64__ | ${CC} -E -xc - | tail -n 1)
50 ifeq (${IS_X86_64}, 1)
52 ARCH_CFLAGS := -DARCH_X86_64