summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-apps/cpuid/files/cpuid-20110305-fPIC.patch')
-rw-r--r--sys-apps/cpuid/files/cpuid-20110305-fPIC.patch24
1 files changed, 24 insertions, 0 deletions
diff --git a/sys-apps/cpuid/files/cpuid-20110305-fPIC.patch b/sys-apps/cpuid/files/cpuid-20110305-fPIC.patch
new file mode 100644
index 000000000000..80cc6774a188
--- /dev/null
+++ b/sys-apps/cpuid/files/cpuid-20110305-fPIC.patch
@@ -0,0 +1,24 @@
+diff -u cpuid-20110305.orig//cpuid.c cpuid-20110305/cpuid.c
+--- cpuid-20110305.orig//cpuid.c 2011-03-04 13:25:16.000000000 -0500
++++ cpuid-20110305/cpuid.c 2011-07-31 01:53:39.647437813 -0400
+@@ -5319,9 +5319,20 @@
+ boolean quiet)
+ {
+ if (cpuid_fd == USE_INSTRUCTION) {
++#if defined(__i386__) && defined(__PIC__)
++ asm("push %%ebx\n"
++ "cpuid\n"
++ "movl %%ebx, %1\n"
++ "pop %%ebx\n"
++#else
+ asm("cpuid"
++#endif
+ : "=a" (words[WORD_EAX]),
++#if defined(__i386__) && defined(__PIC__)
++ "=r" (words[WORD_EBX]),
++#else
+ "=b" (words[WORD_EBX]),
++#endif
+ "=c" (words[WORD_ECX]),
+ "=d" (words[WORD_EDX])
+ : "a" (reg),