Source: libaio
Version: 0.3.109-3
Severity: wishlist
Tags: patch
User: debian-...@lists.debian.org
Tags: port-x32 ftbfs-x32

Please consider including the attached patch to add X32 support to the 
library.  (The patch is from 
http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=f5c071d93c9e6f57930bce56b1e4f009c160a826
 
with link posted on the X32 patches page,
https://sites.google.com/site/x32abi/x32-patches .)
-- 
Daniel Schepler
diff -Nru libaio-0.3.109/debian/changelog libaio-0.3.109/debian/changelog
--- libaio-0.3.109/debian/changelog	2012-06-21 00:22:01.000000000 -0700
+++ libaio-0.3.109/debian/changelog	2013-03-03 07:07:53.000000000 -0800
@@ -1,3 +1,9 @@
+libaio (0.3.109-3+x32) unreleased; urgency=low
+
+  * Apply patch from Yocto to add x32 support.
+
+ -- Daniel Schepler <schep...@debian.org>  Sat, 03 Mar 2013 07:07:39 -0800
+
 libaio (0.3.109-3) unstable; urgency=low
 
   * Escape backslash in man pages. (Closes: #651833)
diff -Nru libaio-0.3.109/debian/patches/00_arches_x32.patch libaio-0.3.109/debian/patches/00_arches_x32.patch
--- libaio-0.3.109/debian/patches/00_arches_x32.patch	1969-12-31 16:00:00.000000000 -0800
+++ libaio-0.3.109/debian/patches/00_arches_x32.patch	2013-03-03 07:23:55.000000000 -0800
@@ -0,0 +1,65 @@
+Index: libaio-0.3.109/src/syscall-x86_64.h
+===================================================================
+--- libaio-0.3.109.orig/src/syscall-x86_64.h	2009-10-09 11:17:02.000000000 -0700
++++ libaio-0.3.109/src/syscall-x86_64.h	2013-03-03 07:15:13.000000000 -0800
+@@ -1,8 +1,18 @@
++#ifndef __NR_io_setup
+ #define __NR_io_setup		206
++#endif
++#ifndef __NR_io_destroy
+ #define __NR_io_destroy		207
++#endif
++#ifndef __NR_io_getevents
+ #define __NR_io_getevents	208
++#endif
++#ifndef __NR_io_submit
+ #define __NR_io_submit		209
++#endif
++#ifndef __NR_io_cancel
+ #define __NR_io_cancel		210
++#endif
+ 
+ #define __syscall_clobber "r11","rcx","memory" 
+ #define __syscall "syscall"
+@@ -42,10 +52,11 @@
+ type fname (type1 arg1, type2 arg2, type3 arg3, type4 arg4)		\
+ {									\
+ long __res;								\
+-__asm__ volatile ("movq %5,%%r10 ;" __syscall				\
++register long __a4 asm ("r10") = (long) arg4;                           \
++__asm__ volatile (__syscall						\
+ 	: "=a" (__res)							\
+ 	: "0" (__NR_##sname),"D" ((long)(arg1)),"S" ((long)(arg2)),	\
+-	  "d" ((long)(arg3)),"g" ((long)(arg4)) : __syscall_clobber,"r10" ); \
++	  "d" ((long)(arg3)),"r" (__a4)); \
+ return __res;								\
+ } 
+ 
+@@ -54,10 +65,11 @@
+ type fname (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5)	\
+ {									\
+ long __res;								\
+-__asm__ volatile ("movq %5,%%r10 ; movq %6,%%r8 ; " __syscall		\
++register long __a4 asm ("r10") = (long) arg4;				\
++register long __a5 asm ("r8") = (long) arg5;                            \
++__asm__ volatile (__syscall						\
+ 	: "=a" (__res)							\
+ 	: "0" (__NR_##sname),"D" ((long)(arg1)),"S" ((long)(arg2)),	\
+-	  "d" ((long)(arg3)),"g" ((long)(arg4)),"g" ((long)(arg5)) :	\
+-	__syscall_clobber,"r8","r10" );					\
++	  "d" ((long)(arg3)),"r" (__a4),"r" (__a5)); \
+ return __res;								\
+ }
+Index: libaio-0.3.109/harness/main.c
+===================================================================
+--- libaio-0.3.109.orig/harness/main.c	2013-03-03 06:58:51.000000000 -0800
++++ libaio-0.3.109/harness/main.c	2013-03-03 07:23:40.000000000 -0800
+@@ -14,7 +14,7 @@
+ #if __LP64__ == 0
+ #if defined(__i386__) || defined(__powerpc__) || defined(__mips__)
+ #define KERNEL_RW_POINTER	((void *)0xc0010000)
+-#elif defined(__arm__) || defined(__m68k__) || defined(__s390__) || defined(__sh__)
++#elif defined(__arm__) || defined(__m68k__) || defined(__s390__) || defined(__sh__) || defined(__x86_64__)
+ #define KERNEL_RW_POINTER	((void *)0x00010000)
+ #elif defined(__hppa__)
+ #define KERNEL_RW_POINTER	((void *)0x10100000)
diff -Nru libaio-0.3.109/debian/patches/series libaio-0.3.109/debian/patches/series
--- libaio-0.3.109/debian/patches/series	2012-06-20 23:36:54.000000000 -0700
+++ libaio-0.3.109/debian/patches/series	2013-03-03 07:00:24.000000000 -0800
@@ -1,6 +1,7 @@
 00_arches.patch
 00_arches_sh.patch
 00_arches_sparc64.patch
+00_arches_x32.patch
 01_link_libgcc.patch
 02_libdevdir.patch
 03_man_errors.patch

Reply via email to