aboutsummaryrefslogtreecommitdiffstats
path: root/main/cpufrequtils/0006-aperf-fix-compilation-on-x86-32-with-fPIC.patch
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2014-12-02 09:52:11 +0000
committerTimo Teräs <timo.teras@iki.fi>2014-12-02 09:53:48 +0000
commit862c741a3ccc0936ce80840bad3937dec6a52c4d (patch)
tree17c50031bdf772cd550ec3600fb4c2ba439a73f7 /main/cpufrequtils/0006-aperf-fix-compilation-on-x86-32-with-fPIC.patch
parentfc0e71c84b2f87957a39905d17240097e8cb475f (diff)
downloadaports-862c741a3ccc0936ce80840bad3937dec6a52c4d.tar.bz2
aports-862c741a3ccc0936ce80840bad3937dec6a52c4d.tar.xz
main/cpufrequtils: apply upstream commits to fix arm build
and also the other issues we were already patching for.
Diffstat (limited to 'main/cpufrequtils/0006-aperf-fix-compilation-on-x86-32-with-fPIC.patch')
-rw-r--r--main/cpufrequtils/0006-aperf-fix-compilation-on-x86-32-with-fPIC.patch46
1 files changed, 46 insertions, 0 deletions
diff --git a/main/cpufrequtils/0006-aperf-fix-compilation-on-x86-32-with-fPIC.patch b/main/cpufrequtils/0006-aperf-fix-compilation-on-x86-32-with-fPIC.patch
new file mode 100644
index 0000000000..ee3adff75a
--- /dev/null
+++ b/main/cpufrequtils/0006-aperf-fix-compilation-on-x86-32-with-fPIC.patch
@@ -0,0 +1,46 @@
+From 9085ce6f615d9d2e0182d3ce029b882835bd0a6b Mon Sep 17 00:00:00 2001
+From: Matt Turner <mattst88@gmail.com>
+Date: Tue, 26 Jul 2011 19:28:31 -0400
+Subject: [PATCH 6/8] aperf: fix compilation on x86-32 with -fPIC
+
+ebx is used to store the GOT pointer when compiled with -fPIC, so it's
+not usable by inline assembly.
+
+https://bugs.gentoo.org/375967
+
+Signed-off-by: Matt Turner <mattst88@gmail.com>
+Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
+---
+ utils/cpuid.h | 14 +++++++++++++-
+ 1 file changed, 13 insertions(+), 1 deletion(-)
+
+diff --git a/utils/cpuid.h b/utils/cpuid.h
+index 2bac69a..53da789 100644
+--- a/utils/cpuid.h
++++ b/utils/cpuid.h
+@@ -5,9 +5,21 @@ static inline void __cpuid(unsigned int *eax, unsigned int *ebx,
+ unsigned int *ecx, unsigned int *edx)
+ {
+ /* ecx is often an input as well as an output. */
+- asm volatile("cpuid"
++ asm volatile(
++#if defined(__i386__) && defined(__PIC__)
++ "push %%ebx\n"
++ "cpuid\n"
++ "movl %%ebx, %1\n"
++ "pop %%ebx\n"
++#else
++ "cpuid\n"
++#endif
+ : "=a" (*eax),
++#if defined(__i386__) && defined(__PIC__)
++ "=r" (*ebx),
++#else
+ "=b" (*ebx),
++#endif
+ "=c" (*ecx),
+ "=d" (*edx)
+ : "0" (*eax), "2" (*ecx));
+--
+1.7.10
+