diff options
| -rw-r--r-- | meta/recipes-extended/libaio/libaio/libaio_fix_for_x32.patch | 61 | ||||
| -rw-r--r-- | meta/recipes-extended/libaio/libaio_0.3.109.bb | 5 |
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 @@ | |||
| 1 | Upstream-Status: Pending | ||
| 2 | |||
| 3 | Properly load arguments 5 an 6 for x86-64 syscall | ||
| 4 | Use asm ("r10") and asm ("r8") to load arguments 5 an 6 for x86-64 | ||
| 5 | syscall so that it works with both x32 and x86-64. | ||
| 6 | |||
| 7 | Received this patch from H.J. Lu <hjl.tools@gmail.com> | ||
| 8 | |||
| 9 | Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com> | ||
| 10 | 2011/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" | |||
| 5 | LICENSE = "LGPLv2.1+" | 5 | LICENSE = "LGPLv2.1+" |
| 6 | LIC_FILES_CHKSUM = "file://COPYING;md5=d8045f3b8f929c1cb29a1e3fd737b499" | 6 | LIC_FILES_CHKSUM = "file://COPYING;md5=d8045f3b8f929c1cb29a1e3fd737b499" |
| 7 | 7 | ||
| 8 | PR = "r0" | 8 | PR = "r1" |
| 9 | 9 | ||
| 10 | SRC_URI = "${DEBIAN_MIRROR}/main/liba/libaio/libaio_${PV}.orig.tar.gz \ | 10 | SRC_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 | ||
| 15 | SRC_URI[md5sum] = "435a5b16ca6198eaf01155263d855756" | 16 | SRC_URI[md5sum] = "435a5b16ca6198eaf01155263d855756" |
| 16 | SRC_URI[sha256sum] = "bf4a457253cbaab215aea75cb6e18dc8d95bbd507e9920661ff9bdd288c8778d" | 17 | SRC_URI[sha256sum] = "bf4a457253cbaab215aea75cb6e18dc8d95bbd507e9920661ff9bdd288c8778d" |
