summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorNitin A Kamble <nitin.a.kamble@intel.com>2011-12-02 12:20:08 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-12-05 22:47:07 +0000
commitf5c071d93c9e6f57930bce56b1e4f009c160a826 (patch)
tree2557660cb831eaf66826ebadab857331a7d6a7bb /meta
parenta3cd4f5ee490d50d0e1c28cdb2c23ef95361b1d1 (diff)
downloadpoky-f5c071d93c9e6f57930bce56b1e4f009c160a826.tar.gz
libaio: patch source code for x32
This Fixes bug: [YOCTO #1417] Properly load arguments 5 an 6 for x86-64 syscall Use asm ("r10") and asm ("r8") to load arguments 5 an 6 for x86-64 syscall so that it works with both x32 and x86-64. (From OE-Core rev: 207e86ba12c15937845ace66206566cd11dac994) Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com> Signed-Off-By: H.J. Lu <hjl.tools@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-extended/libaio/libaio/libaio_fix_for_x32.patch61
-rw-r--r--meta/recipes-extended/libaio/libaio_0.3.109.bb5
2 files changed, 64 insertions, 2 deletions
diff --git a/meta/recipes-extended/libaio/libaio/libaio_fix_for_x32.patch b/meta/recipes-extended/libaio/libaio/libaio_fix_for_x32.patch
new file mode 100644
index 0000000000..508f5a12f1
--- /dev/null
+++ b/meta/recipes-extended/libaio/libaio/libaio_fix_for_x32.patch
@@ -0,0 +1,61 @@
1Upstream-Status: Pending
2
3Properly load arguments 5 an 6 for x86-64 syscall
4Use asm ("r10") and asm ("r8") to load arguments 5 an 6 for x86-64
5syscall so that it works with both x32 and x86-64.
6
7Received this patch from H.J. Lu <hjl.tools@gmail.com>
8
9Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
102011/12/02
11
12--- libaio-0.3.109/src/syscall-x86_64.h.x32 2009-10-09 11:17:02.000000000 -0700
13+++ libaio-0.3.109/src/syscall-x86_64.h 2011-12-02 09:09:07.537603224 -0800
14@@ -1,8 +1,18 @@
15+#ifndef __NR_io_setup
16 #define __NR_io_setup 206
17+#endif
18+#ifndef __NR_io_destroy
19 #define __NR_io_destroy 207
20+#endif
21+#ifndef __NR_io_getevents
22 #define __NR_io_getevents 208
23+#endif
24+#ifndef __NR_io_submit
25 #define __NR_io_submit 209
26+#endif
27+#ifndef __NR_io_cancel
28 #define __NR_io_cancel 210
29+#endif
30
31 #define __syscall_clobber "r11","rcx","memory"
32 #define __syscall "syscall"
33@@ -42,10 +52,11 @@ return __res; \
34 type fname (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
35 { \
36 long __res; \
37-__asm__ volatile ("movq %5,%%r10 ;" __syscall \
38+register long __a4 asm ("r10") = (long) arg4; \
39+__asm__ volatile (__syscall \
40 : "=a" (__res) \
41 : "0" (__NR_##sname),"D" ((long)(arg1)),"S" ((long)(arg2)), \
42- "d" ((long)(arg3)),"g" ((long)(arg4)) : __syscall_clobber,"r10" ); \
43+ "d" ((long)(arg3)),"r" (__a4)); \
44 return __res; \
45 }
46
47@@ -54,10 +65,11 @@ return __res; \
48 type fname (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5) \
49 { \
50 long __res; \
51-__asm__ volatile ("movq %5,%%r10 ; movq %6,%%r8 ; " __syscall \
52+register long __a4 asm ("r10") = (long) arg4; \
53+register long __a5 asm ("r8") = (long) arg5; \
54+__asm__ volatile ( __syscall \
55 : "=a" (__res) \
56 : "0" (__NR_##sname),"D" ((long)(arg1)),"S" ((long)(arg2)), \
57- "d" ((long)(arg3)),"g" ((long)(arg4)),"g" ((long)(arg5)) : \
58- __syscall_clobber,"r8","r10" ); \
59+ "d" ((long)(arg3)),"r" (__a4),"r" (__a5)); \
60 return __res; \
61 }
diff --git a/meta/recipes-extended/libaio/libaio_0.3.109.bb b/meta/recipes-extended/libaio/libaio_0.3.109.bb
index 869b2da002..161b712a48 100644
--- a/meta/recipes-extended/libaio/libaio_0.3.109.bb
+++ b/meta/recipes-extended/libaio/libaio_0.3.109.bb
@@ -5,12 +5,13 @@ HOMEPAGE = "http://lse.sourceforge.net/io/aio.html"
5LICENSE = "LGPLv2.1+" 5LICENSE = "LGPLv2.1+"
6LIC_FILES_CHKSUM = "file://COPYING;md5=d8045f3b8f929c1cb29a1e3fd737b499" 6LIC_FILES_CHKSUM = "file://COPYING;md5=d8045f3b8f929c1cb29a1e3fd737b499"
7 7
8PR = "r0" 8PR = "r1"
9 9
10SRC_URI = "${DEBIAN_MIRROR}/main/liba/libaio/libaio_${PV}.orig.tar.gz \ 10SRC_URI = "${DEBIAN_MIRROR}/main/liba/libaio/libaio_${PV}.orig.tar.gz \
11 file://00_arches.patch \ 11 file://00_arches.patch \
12 file://toolchain.patch \ 12 file://toolchain.patch \
13 file://destdir.patch" 13 file://destdir.patch \
14 file://libaio_fix_for_x32.patch"
14 15
15SRC_URI[md5sum] = "435a5b16ca6198eaf01155263d855756" 16SRC_URI[md5sum] = "435a5b16ca6198eaf01155263d855756"
16SRC_URI[sha256sum] = "bf4a457253cbaab215aea75cb6e18dc8d95bbd507e9920661ff9bdd288c8778d" 17SRC_URI[sha256sum] = "bf4a457253cbaab215aea75cb6e18dc8d95bbd507e9920661ff9bdd288c8778d"