]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/3.0.1/perf-tools-x86-fix-32-bit-compile-on-64-bit-system.patch
fixes for 4.19
[thirdparty/kernel/stable-queue.git] / releases / 3.0.1 / perf-tools-x86-fix-32-bit-compile-on-64-bit-system.patch
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
5
6 From: David Ahern <dsahern@gmail.com>
7
8 commit 08a4a43fc407d780bdde36d98f89c0dbb2a6be6b upstream.
9
10 Builds for 32-bit perf binaries on a 64-bit host currently fail
11 with this error:
12
13 [...]
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'
19 ...
20
21 The problem is the detection of the host arch without considering passed in
22 flags. This change fixes 32-bit builds via:
23
24 make EXTRA_CFLAGS=-m32
25
26 and 64-bit builds still reference the memcpy_64.S.
27
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>
34
35 ---
36 tools/perf/Makefile | 5 ++++-
37 1 file changed, 4 insertions(+), 1 deletion(-)
38
39 --- a/tools/perf/Makefile
40 +++ b/tools/perf/Makefile
41 @@ -52,7 +52,10 @@ ifeq ($(ARCH),i386)
42 endif
43 ifeq ($(ARCH),x86_64)
44 ARCH := x86
45 - IS_X86_64 := $(shell echo __x86_64__ | ${CC} -E -xc - | tail -n 1)
46 + IS_X86_64 := 0
47 + ifeq (, $(findstring m32,$(EXTRA_CFLAGS)))
48 + IS_X86_64 := $(shell echo __x86_64__ | ${CC} -E -xc - | tail -n 1)
49 + endif
50 ifeq (${IS_X86_64}, 1)
51 RAW_ARCH := x86_64
52 ARCH_CFLAGS := -DARCH_X86_64