1 From 9085ce6f615d9d2e0182d3ce029b882835bd0a6b Mon Sep 17 00:00:00 2001
2 From: Matt Turner <mattst88@gmail.com>
3 Date: Tue, 26 Jul 2011 19:28:31 -0400
4 Subject: [PATCH 6/8] aperf: fix compilation on x86-32 with -fPIC
6 ebx is used to store the GOT pointer when compiled with -fPIC, so it's
7 not usable by inline assembly.
9 https://bugs.gentoo.org/375967
11 Signed-off-by: Matt Turner <mattst88@gmail.com>
12 Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
14 utils/cpuid.h | 14 +++++++++++++-
15 1 file changed, 13 insertions(+), 1 deletion(-)
17 diff --git a/utils/cpuid.h b/utils/cpuid.h
18 index 2bac69a..53da789 100644
21 @@ -5,9 +5,21 @@ static inline void __cpuid(unsigned int *eax, unsigned int *ebx,
22 unsigned int *ecx, unsigned int *edx)
24 /* ecx is often an input as well as an output. */
25 - asm volatile("cpuid"
27 +#if defined(__i386__) && defined(__PIC__)
36 +#if defined(__i386__) && defined(__PIC__)
43 : "0" (*eax), "2" (*ecx));