From fad21b2af77a3fd60e37f7e0e5917aae2b6d6b2e Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Thu, 2 Oct 2008 02:48:29 +0000 Subject: [PATCH] add sparc support --- libaio-sparc.patch | 304 +++++++++++++++++++++++++++++++++++++++++++++ libaio.spec | 8 +- 2 files changed, 310 insertions(+), 2 deletions(-) create mode 100644 libaio-sparc.patch diff --git a/libaio-sparc.patch b/libaio-sparc.patch new file mode 100644 index 0000000..ee674a3 --- /dev/null +++ b/libaio-sparc.patch @@ -0,0 +1,304 @@ +diff -Nur libaio-0.3.107-orig/compat-libaio-0.3.107/src/libaio.h libaio-0.3.107/compat-libaio-0.3.107/src/libaio.h +--- libaio-0.3.107-orig/compat-libaio-0.3.107/src/libaio.h 2008-01-09 14:49:12.000000000 -0600 ++++ libaio-0.3.107/compat-libaio-0.3.107/src/libaio.h 2008-10-01 21:20:28.000000000 -0500 +@@ -73,6 +73,14 @@ + #define PADDED(x, y) unsigned y; x + #define PADDEDptr(x, y) unsigned y; x + #define PADDEDul(x, y) unsigned y; unsigned long x ++#elif defined(__sparc__) && defined(__arch64__) /* 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(__sparc__) /* big endian, 32 bits */ ++#define PADDED(x, y) unsigned y; x ++#define PADDEDptr(x, y) unsigned y; x ++#define PADDEDul(x, y) unsigned y; unsigned long x + #else + #error endian? + #endif +diff -Nur libaio-0.3.107-orig/compat-libaio-0.3.107/src/syscall.h libaio-0.3.107/compat-libaio-0.3.107/src/syscall.h +--- libaio-0.3.107-orig/compat-libaio-0.3.107/src/syscall.h 2005-04-01 14:31:32.000000000 -0600 ++++ libaio-0.3.107/compat-libaio-0.3.107/src/syscall.h 2008-10-01 21:20:28.000000000 -0500 +@@ -22,6 +22,8 @@ + #include "syscall-s390.h" + #elif defined(__alpha__) + #include "syscall-alpha.h" ++#elif defined(__sparc__) ++#include "syscall-sparc.h" + #else + #error "add syscall-arch.h" + #endif +diff -Nur libaio-0.3.107-orig/compat-libaio-0.3.107/src/syscall-sparc.h libaio-0.3.107/compat-libaio-0.3.107/src/syscall-sparc.h +--- libaio-0.3.107-orig/compat-libaio-0.3.107/src/syscall-sparc.h 1969-12-31 18:00:00.000000000 -0600 ++++ libaio-0.3.107/compat-libaio-0.3.107/src/syscall-sparc.h 2008-10-01 21:20:28.000000000 -0500 +@@ -0,0 +1,118 @@ ++#include ++ ++#define __NR_io_setup 268 ++#define __NR_io_destroy 269 ++#define __NR_io_submit 270 ++#define __NR_io_cancel 271 ++#define __NR_io_getevents 272 ++ ++#define io_syscall1(type,fname,sname,type1,arg1) \ ++type fname(type1 arg1) \ ++{ \ ++long __res; \ ++register long __g1 __asm__ ("g1") = __NR_##sname; \ ++register long __o0 __asm__ ("o0") = (long)(arg1); \ ++__asm__ __volatile__ ("t 0x10\n\t" \ ++ "bcc 1f\n\t" \ ++ "mov %%o0, %0\n\t" \ ++ "sub %%g0, %%o0, %0\n\t" \ ++ "1:\n\t" \ ++ : "=r" (__res), "=&r" (__o0) \ ++ : "1" (__o0), "r" (__g1) \ ++ : "cc"); \ ++if (__res < -255 || __res >= 0) \ ++ return (type) __res; \ ++errno = -__res; \ ++return -1; \ ++} ++ ++#define io_syscall2(type,fname,sname,type1,arg1,type2,arg2) \ ++type fname(type1 arg1,type2 arg2) \ ++{ \ ++long __res; \ ++register long __g1 __asm__ ("g1") = __NR_##sname; \ ++register long __o0 __asm__ ("o0") = (long)(arg1); \ ++register long __o1 __asm__ ("o1") = (long)(arg2); \ ++__asm__ __volatile__ ("t 0x10\n\t" \ ++ "bcc 1f\n\t" \ ++ "mov %%o0, %0\n\t" \ ++ "sub %%g0, %%o0, %0\n\t" \ ++ "1:\n\t" \ ++ : "=r" (__res), "=&r" (__o0) \ ++ : "1" (__o0), "r" (__o1), "r" (__g1) \ ++ : "cc"); \ ++if (__res < -255 || __res >= 0) \ ++ return (type) __res; \ ++errno = -__res; \ ++return -1; \ ++} ++ ++#define io_syscall3(type,fname,sname,type1,arg1,type2,arg2,type3,arg3) \ ++type fname(type1 arg1,type2 arg2,type3 arg3) \ ++{ \ ++long __res; \ ++register long __g1 __asm__ ("g1") = __NR_##sname; \ ++register long __o0 __asm__ ("o0") = (long)(arg1); \ ++register long __o1 __asm__ ("o1") = (long)(arg2); \ ++register long __o2 __asm__ ("o2") = (long)(arg3); \ ++__asm__ __volatile__ ("t 0x10\n\t" \ ++ "bcc 1f\n\t" \ ++ "mov %%o0, %0\n\t" \ ++ "sub %%g0, %%o0, %0\n\t" \ ++ "1:\n\t" \ ++ : "=r" (__res), "=&r" (__o0) \ ++ : "1" (__o0), "r" (__o1), "r" (__o2), "r" (__g1) \ ++ : "cc"); \ ++if (__res < -255 || __res>=0) \ ++ return (type) __res; \ ++errno = -__res; \ ++return -1; \ ++} ++ ++#define io_syscall4(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \ ++type fname (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \ ++{ \ ++long __res; \ ++register long __g1 __asm__ ("g1") = __NR_##sname; \ ++register long __o0 __asm__ ("o0") = (long)(arg1); \ ++register long __o1 __asm__ ("o1") = (long)(arg2); \ ++register long __o2 __asm__ ("o2") = (long)(arg3); \ ++register long __o3 __asm__ ("o3") = (long)(arg4); \ ++__asm__ __volatile__ ("t 0x10\n\t" \ ++ "bcc 1f\n\t" \ ++ "mov %%o0, %0\n\t" \ ++ "sub %%g0, %%o0, %0\n\t" \ ++ "1:\n\t" \ ++ : "=r" (__res), "=&r" (__o0) \ ++ : "1" (__o0), "r" (__o1), "r" (__o2), "r" (__o3), "r" (__g1) \ ++ : "cc"); \ ++if (__res < -255 || __res>=0) \ ++ return (type) __res; \ ++errno = -__res; \ ++return -1; \ ++} ++ ++#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) \ ++{ \ ++long __res; \ ++register long __g1 __asm__ ("g1") = __NR_##sname; \ ++register long __o0 __asm__ ("o0") = (long)(arg1); \ ++register long __o1 __asm__ ("o1") = (long)(arg2); \ ++register long __o2 __asm__ ("o2") = (long)(arg3); \ ++register long __o3 __asm__ ("o3") = (long)(arg4); \ ++register long __o4 __asm__ ("o4") = (long)(arg5); \ ++__asm__ __volatile__ ("t 0x10\n\t" \ ++ "bcc 1f\n\t" \ ++ "mov %%o0, %0\n\t" \ ++ "sub %%g0, %%o0, %0\n\t" \ ++ "1:\n\t" \ ++ : "=r" (__res), "=&r" (__o0) \ ++ : "1" (__o0), "r" (__o1), "r" (__o2), "r" (__o3), "r" (__o4), "r" (__g1) \ ++ : "cc"); \ ++if (__res < -255 || __res>=0) \ ++ return (type) __res; \ ++errno = -__res; \ ++return -1; \ ++} +diff -Nur libaio-0.3.107-orig/src/libaio.h libaio-0.3.107/src/libaio.h +--- libaio-0.3.107-orig/src/libaio.h 2008-01-09 14:49:12.000000000 -0600 ++++ libaio-0.3.107/src/libaio.h 2008-10-01 21:13:51.000000000 -0500 +@@ -73,6 +73,14 @@ + #define PADDED(x, y) unsigned y; x + #define PADDEDptr(x, y) unsigned y; x + #define PADDEDul(x, y) unsigned y; unsigned long x ++#elif defined(__sparc__) && defined(__arch64__) /* 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(__sparc__) /* big endian, 32 bits */ ++#define PADDED(x, y) unsigned y; x ++#define PADDEDptr(x, y) unsigned y; x ++#define PADDEDul(x, y) unsigned y; unsigned long x + #else + #error endian? + #endif +diff -Nur libaio-0.3.107-orig/src/syscall.h libaio-0.3.107/src/syscall.h +--- libaio-0.3.107-orig/src/syscall.h 2005-04-01 14:31:32.000000000 -0600 ++++ libaio-0.3.107/src/syscall.h 2008-10-01 21:03:16.000000000 -0500 +@@ -22,6 +22,8 @@ + #include "syscall-s390.h" + #elif defined(__alpha__) + #include "syscall-alpha.h" ++#elif defined(__sparc__) ++#include "syscall-sparc.h" + #else + #error "add syscall-arch.h" + #endif +diff -Nur libaio-0.3.107-orig/src/syscall-sparc.h libaio-0.3.107/src/syscall-sparc.h +--- libaio-0.3.107-orig/src/syscall-sparc.h 1969-12-31 18:00:00.000000000 -0600 ++++ libaio-0.3.107/src/syscall-sparc.h 2008-10-01 21:01:49.000000000 -0500 +@@ -0,0 +1,118 @@ ++#include ++ ++#define __NR_io_setup 268 ++#define __NR_io_destroy 269 ++#define __NR_io_submit 270 ++#define __NR_io_cancel 271 ++#define __NR_io_getevents 272 ++ ++#define io_syscall1(type,fname,sname,type1,arg1) \ ++type fname(type1 arg1) \ ++{ \ ++long __res; \ ++register long __g1 __asm__ ("g1") = __NR_##sname; \ ++register long __o0 __asm__ ("o0") = (long)(arg1); \ ++__asm__ __volatile__ ("t 0x10\n\t" \ ++ "bcc 1f\n\t" \ ++ "mov %%o0, %0\n\t" \ ++ "sub %%g0, %%o0, %0\n\t" \ ++ "1:\n\t" \ ++ : "=r" (__res), "=&r" (__o0) \ ++ : "1" (__o0), "r" (__g1) \ ++ : "cc"); \ ++if (__res < -255 || __res >= 0) \ ++ return (type) __res; \ ++errno = -__res; \ ++return -1; \ ++} ++ ++#define io_syscall2(type,fname,sname,type1,arg1,type2,arg2) \ ++type fname(type1 arg1,type2 arg2) \ ++{ \ ++long __res; \ ++register long __g1 __asm__ ("g1") = __NR_##sname; \ ++register long __o0 __asm__ ("o0") = (long)(arg1); \ ++register long __o1 __asm__ ("o1") = (long)(arg2); \ ++__asm__ __volatile__ ("t 0x10\n\t" \ ++ "bcc 1f\n\t" \ ++ "mov %%o0, %0\n\t" \ ++ "sub %%g0, %%o0, %0\n\t" \ ++ "1:\n\t" \ ++ : "=r" (__res), "=&r" (__o0) \ ++ : "1" (__o0), "r" (__o1), "r" (__g1) \ ++ : "cc"); \ ++if (__res < -255 || __res >= 0) \ ++ return (type) __res; \ ++errno = -__res; \ ++return -1; \ ++} ++ ++#define io_syscall3(type,fname,sname,type1,arg1,type2,arg2,type3,arg3) \ ++type fname(type1 arg1,type2 arg2,type3 arg3) \ ++{ \ ++long __res; \ ++register long __g1 __asm__ ("g1") = __NR_##sname; \ ++register long __o0 __asm__ ("o0") = (long)(arg1); \ ++register long __o1 __asm__ ("o1") = (long)(arg2); \ ++register long __o2 __asm__ ("o2") = (long)(arg3); \ ++__asm__ __volatile__ ("t 0x10\n\t" \ ++ "bcc 1f\n\t" \ ++ "mov %%o0, %0\n\t" \ ++ "sub %%g0, %%o0, %0\n\t" \ ++ "1:\n\t" \ ++ : "=r" (__res), "=&r" (__o0) \ ++ : "1" (__o0), "r" (__o1), "r" (__o2), "r" (__g1) \ ++ : "cc"); \ ++if (__res < -255 || __res>=0) \ ++ return (type) __res; \ ++errno = -__res; \ ++return -1; \ ++} ++ ++#define io_syscall4(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \ ++type fname (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \ ++{ \ ++long __res; \ ++register long __g1 __asm__ ("g1") = __NR_##sname; \ ++register long __o0 __asm__ ("o0") = (long)(arg1); \ ++register long __o1 __asm__ ("o1") = (long)(arg2); \ ++register long __o2 __asm__ ("o2") = (long)(arg3); \ ++register long __o3 __asm__ ("o3") = (long)(arg4); \ ++__asm__ __volatile__ ("t 0x10\n\t" \ ++ "bcc 1f\n\t" \ ++ "mov %%o0, %0\n\t" \ ++ "sub %%g0, %%o0, %0\n\t" \ ++ "1:\n\t" \ ++ : "=r" (__res), "=&r" (__o0) \ ++ : "1" (__o0), "r" (__o1), "r" (__o2), "r" (__o3), "r" (__g1) \ ++ : "cc"); \ ++if (__res < -255 || __res>=0) \ ++ return (type) __res; \ ++errno = -__res; \ ++return -1; \ ++} ++ ++#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) \ ++{ \ ++long __res; \ ++register long __g1 __asm__ ("g1") = __NR_##sname; \ ++register long __o0 __asm__ ("o0") = (long)(arg1); \ ++register long __o1 __asm__ ("o1") = (long)(arg2); \ ++register long __o2 __asm__ ("o2") = (long)(arg3); \ ++register long __o3 __asm__ ("o3") = (long)(arg4); \ ++register long __o4 __asm__ ("o4") = (long)(arg5); \ ++__asm__ __volatile__ ("t 0x10\n\t" \ ++ "bcc 1f\n\t" \ ++ "mov %%o0, %0\n\t" \ ++ "sub %%g0, %%o0, %0\n\t" \ ++ "1:\n\t" \ ++ : "=r" (__res), "=&r" (__o0) \ ++ : "1" (__o0), "r" (__o1), "r" (__o2), "r" (__o3), "r" (__o4), "r" (__g1) \ ++ : "cc"); \ ++if (__res < -255 || __res>=0) \ ++ return (type) __res; \ ++errno = -__res; \ ++return -1; \ ++} diff --git a/libaio.spec b/libaio.spec index 7cabdb1..6968467 100644 --- a/libaio.spec +++ b/libaio.spec @@ -1,13 +1,13 @@ Name: libaio Version: 0.3.107 -Release: 5%{?dist} +Release: 6%{?dist} Summary: Linux-native asynchronous I/O access library License: LGPLv2+ Group: System Environment/Libraries Source: %{name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-root Patch1: libaio-install-to-slash.patch - +Patch2: libaio-sparc.patch %description The Linux-native asynchronous I/O facility ("async I/O", or "aio") has a @@ -33,6 +33,7 @@ for the Linux-native asynchronous I/O facility ("async I/O", or "aio"). %setup -a 0 %patch1 -p1 mv %{name}-%{version} compat-%{name}-%{version} +%patch2 -p1 %build # A library with a soname of 1.0.0 was inadvertantly released. This @@ -72,6 +73,9 @@ make destdir=$RPM_BUILD_ROOT prefix=/ libdir=%{libdir} usrlibdir=%{usrlibdir} \ %attr(0644,root,root) %{_libdir}/libaio.a %changelog +* Wed Oct 01 2008 Dennis Gilmore - 0.3.107-6 +- add patch with sparc support + * Wed Oct 01 2008 Dennis Gilmore - 0.3.107-5 - remove ExclusiveArch line