Skip to content

Commit 08a4a43

Browse files
dsahernIngo Molnar
authored andcommitted
perf tools, x86: Fix 32-bit compile on 64-bit system
Builds for 32-bit perf binaries on a 64-bit host currently fail with this error: [...] bench/../../../arch/x86/lib/memcpy_64.S: Assembler messages: bench/../../../arch/x86/lib/memcpy_64.S:29: Error: bad register name `%rdi' bench/../../../arch/x86/lib/memcpy_64.S:34: Error: invalid instruction suffix for `movs' bench/../../../arch/x86/lib/memcpy_64.S:50: Error: bad register name `%rdi' bench/../../../arch/x86/lib/memcpy_64.S:61: Error: bad register name `%rdi' ... The problem is the detection of the host arch without considering passed in flags. This change fixes 32-bit builds via: make EXTRA_CFLAGS=-m32 and 64-bit builds still reference the memcpy_64.S. Signed-off-by: David Ahern <dsahern@gmail.com> Acked-by: Frederic Weisbecker <fweisbec@gmail.com> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: <stable@kernel.org> Link: http://lkml.kernel.org/r/1310420304-21452-1-git-send-email-dsahern@gmail.com Signed-off-by: Ingo Molnar <mingo@elte.hu>
1 parent cf6ace1 commit 08a4a43

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎tools/perf/Makefile‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ ifeq ($(ARCH),i386)
5252
endif
5353
ifeq ($(ARCH),x86_64)
5454
ARCH := x86
55-
IS_X86_64 := $(shell echo __x86_64__ | ${CC} -E -xc - | tail -n 1)
55+
IS_X86_64 := 0
56+
ifeq (, $(findstring m32,$(EXTRA_CFLAGS)))
57+
IS_X86_64 := $(shell echo __x86_64__ | ${CC} -E -xc - | tail -n 1)
58+
endif
5659
ifeq (${IS_X86_64}, 1)
5760
RAW_ARCH := x86_64
5861
ARCH_CFLAGS := -DARCH_X86_64

0 commit comments

Comments
 (0)