Accepting request 156938 from devel:libraries:c_c++

- Add libaio-aarch64-support.diff:
  * add support for aarch64
- Add libaio-generic-arch.diff:
  * support all archtes (also aarch64)

OBS-URL: https://build.opensuse.org/request/show/156938
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libaio?expand=0&rev=27
This commit is contained in:
Stephan Kulow 2013-03-01 10:32:36 +00:00 committed by Git OBS Bridge
commit ae5a4d28b2
4 changed files with 107 additions and 2 deletions

View File

@ -0,0 +1,34 @@
Index: harness/cases/16.t
===================================================================
--- harness/cases/16.t.orig
+++ harness/cases/16.t
@@ -18,6 +18,8 @@
#define SYS_eventfd 318
#elif defined(__alpha__)
#define SYS_eventfd 478
+#elif defined(__aarch64__)
+#define SYS_eventfd 1044
#else
#error define SYS_eventfd for your arch!
#endif
Index: src/libaio.h
===================================================================
--- src/libaio.h.orig
+++ src/libaio.h
@@ -117,6 +117,16 @@ typedef enum io_iocb_cmd {
#define PADDEDptr(x, y) x; unsigned y
#define PADDEDul(x, y) unsigned long x; unsigned y
# endif
+#elif defined(__aarch64__)
+# if defined (__AARCH64EB__) /* big endian, 64 bits */
+#define PADDED(x, y) unsigned y; x
+#define PADDEDptr(x,y) x
+#define PADDEDul(x, y) unsigned long x
+# elif defined(__AARCH64EL__) /* little endian, 64 bits */
+#define PADDED(x, y) x, y
+#define PADDEDptr(x, y) x
+#define PADDEDul(x, y) unsigned long x
+# endif
#else
#error endian?
#endif

58
libaio-generic-arch.diff Normal file
View File

@ -0,0 +1,58 @@
From 5e96c73d5dfbdea8d0be82b7f3fc8d6735e5dfa7 Mon Sep 17 00:00:00 2001
From: Mike Frysinger <vapier@gentoo.org>
Date: Sun, 17 Jan 2010 17:07:48 -0500
Subject: [PATCH] add a generic syscall() fallback
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
src/syscall-generic.h | 29 +++++++++++++++++++++++++++++
src/syscall.h | 3 ++-
2 files changed, 31 insertions(+), 1 deletions(-)
create mode 100644 src/syscall-generic.h
Index: src/syscall-generic.h
===================================================================
--- /dev/null
+++ src/syscall-generic.h
@@ -0,0 +1,29 @@
+#include <errno.h>
+#include <unistd.h>
+#include <sys/syscall.h>
+
+#define _body_io_syscall(sname, args...) \
+{ \
+ int ret = syscall(__NR_##sname, ## args); \
+ return ret < 0 ? -errno : ret; \
+}
+
+#define io_syscall1(type,fname,sname,type1,arg1) \
+type fname(type1 arg1) \
+_body_io_syscall(sname, (long)arg1)
+
+#define io_syscall2(type,fname,sname,type1,arg1,type2,arg2) \
+type fname(type1 arg1,type2 arg2) \
+_body_io_syscall(sname, (long)arg1, (long)arg2)
+
+#define io_syscall3(type,fname,sname,type1,arg1,type2,arg2,type3,arg3) \
+type fname(type1 arg1,type2 arg2,type3 arg3) \
+_body_io_syscall(sname, (long)arg1, (long)arg2, (long)arg3)
+
+#define io_syscall4(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
+type fname (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
+_body_io_syscall(sname, (long)arg1, (long)arg2, (long)arg3, (long)arg4)
+
+#define io_syscall5(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4, type5,arg5) \
+type fname (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5) \
+_body_io_syscall(sname, (long)arg1, (long)arg2, (long)arg3, (long)arg4, (long)arg5)
Index: src/syscall.h
===================================================================
--- src/syscall.h.orig
+++ src/syscall.h
@@ -35,5 +35,6 @@
#elif defined(__sh__)
#include "syscall-sh.h"
#else
-#error "add syscall-arch.h"
+#warning "using generic syscall method"
+#include "syscall-generic.h"
#endif

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Fri Mar 1 08:08:27 UTC 2013 - dmueller@suse.com
- Add libaio-aarch64-support.diff:
* add support for aarch64
- Add libaio-generic-arch.diff:
* support all archtes (also aarch64)
-------------------------------------------------------------------
Fri Feb 17 14:16:14 UTC 2012 - coolo@suse.com

View File

@ -1,7 +1,7 @@
#
# spec file for package libaio
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -37,6 +37,8 @@ Patch4: 00_arches_sh.patch
Patch5: 01_link_libgcc.patch
Patch6: 02_libdevdir.patch
Patch7: 03_man_errors.patch
Patch8: libaio-aarch64-support.diff
Patch9: libaio-generic-arch.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
@ -65,7 +67,8 @@ require the Linux-native async I/O API.
%package devel
Summary: Development Files for Linux-native Asynchronous I/O Access
Group: Development/Libraries/C and C++
Requires: %lname = %version, glibc-devel
Requires: %lname = %version
Requires: glibc-devel
# bug437293
%ifarch ppc64
Obsoletes: libaio-devel-64bit
@ -83,6 +86,8 @@ with, for the Linux-native asynchronous I/O facility ("async I/O", or
%setup -q
%patch2 -p1
%patch -p1 -P 3 -P 4 -P 5 -P 6 -P 7
%patch8
%patch9
%build
make %{?_smp_mflags} CC="%__cc" OPTFLAGS="$RPM_OPT_FLAGS"