summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2013-03-27 01:59:26 +0000
committerRobin H. Johnson <robbat2@gentoo.org>2013-03-27 01:59:26 +0000
commitfcb6c6a573a97fde16bb7016e1a0f346519af4d5 (patch)
treeb6fb4da51e0ed562c346c07aed4dfbd936135a1b /sys-block/fio/files
parentvanilla-3.8.4 + genpatches-3.8-5 + grsecurity-2.9.1-3.8.4-201303252035 (diff)
downloadgentoo-2-fcb6c6a573a97fde16bb7016e1a0f346519af4d5.tar.gz
gentoo-2-fcb6c6a573a97fde16bb7016e1a0f346519af4d5.tar.bz2
gentoo-2-fcb6c6a573a97fde16bb7016e1a0f346519af4d5.zip
PIC compile fixes for 32-bit.
(Portage version: 2.2.0_alpha169/cvs/Linux x86_64, unsigned Manifest commit)
Diffstat (limited to 'sys-block/fio/files')
-rw-r--r--sys-block/fio/files/fio-2.0.14-pic-clobber-fix.patch29
1 files changed, 29 insertions, 0 deletions
diff --git a/sys-block/fio/files/fio-2.0.14-pic-clobber-fix.patch b/sys-block/fio/files/fio-2.0.14-pic-clobber-fix.patch
new file mode 100644
index 000000000000..fa35e27c754e
--- /dev/null
+++ b/sys-block/fio/files/fio-2.0.14-pic-clobber-fix.patch
@@ -0,0 +1,29 @@
+diff -Nuar fio-2.0.14.orig/arch/arch-x86-common.h fio-2.0.14/arch/arch-x86-common.h
+--- fio-2.0.14.orig/arch/arch-x86-common.h 2013-02-21 18:12:32.000000000 +0000
++++ fio-2.0.14/arch/arch-x86-common.h 2013-03-27 01:48:04.000000000 +0000
+@@ -6,10 +6,24 @@
+ static inline void do_cpuid(unsigned int *eax, unsigned int *ebx,
+ unsigned int *ecx, unsigned int *edx)
+ {
++#ifdef __PIC__
++ /* 32-bit Hardened GCC (PIC) uses register EBX, so it must be preserved
++ * Fix ported from Gentoo's x86info-1.24-pic patch
++ * http://tuxion.com/2010/07/02/clobber-registers.html */
++ asm volatile(
++ "movl %%ebx,%%edi\n"
++ "cpuid\n"
++ "movl %%ebx,%1\n"
++ "movl %%edi,%%ebx\n"
++ : "=a" (*eax), "=m" (*ebx), "=c" (*ecx), "=d" (*edx)
++ : "0" (*eax), "2" (*ecx)
++ : "memory", "%edi");
++#else
+ asm volatile("cpuid"
+ : "=a" (*eax), "=b" (*ebx), "=c" (*ecx), "=d" (*edx)
+ : "0" (*eax), "2" (*ecx)
+ : "memory");
++#endif
+ }
+
+ static inline void cpuid(unsigned int op,
+