From 0f2c58c4e582268c2414f1788734e4fa0290cf215d3b340fc858868e9f0b53e7 Mon Sep 17 00:00:00 2001 From: Adam Majer Date: Tue, 5 Mar 2019 16:31:16 +0000 Subject: [PATCH] Accepting request 681828 from openSUSE:Factory:RISCV - riscv-support.patch: Add support for RISC-V OBS-URL: https://build.opensuse.org/request/show/681828 OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/libaio?expand=0&rev=34 --- libaio.changes | 5 +++++ libaio.spec | 8 +++++--- riscv-support.patch | 40 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 riscv-support.patch diff --git a/libaio.changes b/libaio.changes index 6adef7d..9d264d4 100644 --- a/libaio.changes +++ b/libaio.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Jan 31 16:03:40 UTC 2019 - schwab@suse.de + +- riscv-support.patch: Add support for RISC-V + ------------------------------------------------------------------- Thu May 24 16:33:59 CEST 2018 - kukuk@suse.de diff --git a/libaio.spec b/libaio.spec index fad4267..368bedc 100644 --- a/libaio.spec +++ b/libaio.spec @@ -1,7 +1,7 @@ # # spec file for package libaio # -# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -12,7 +12,7 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # @@ -39,6 +39,7 @@ Patch6: 02_libdevdir.patch Patch7: 03_man_errors.patch Patch8: libaio-aarch64-support.diff Patch9: libaio-generic-arch.diff +Patch10: riscv-support.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -51,8 +52,8 @@ require the Linux-native async I/O API. %package -n %lname Summary: Linux-Native Asynchronous I/O Access Library -# O/P added 2011-11-27 Group: System/Libraries +# O/P added 2011-11-27 Obsoletes: libaio < %version-%release Provides: libaio = %version-%release @@ -88,6 +89,7 @@ with, for the Linux-native asynchronous I/O facility ("async I/O", or %patch -p1 -P 3 -P 4 -P 5 -P 6 -P 7 %patch8 %patch9 +%patch10 -p1 %build make %{?_smp_mflags} CC="%__cc" OPTFLAGS="$RPM_OPT_FLAGS" diff --git a/riscv-support.patch b/riscv-support.patch new file mode 100644 index 0000000..fdf9bf0 --- /dev/null +++ b/riscv-support.patch @@ -0,0 +1,40 @@ +Index: libaio-0.3.109/harness/cases/16.t +=================================================================== +--- libaio-0.3.109.orig/harness/cases/16.t ++++ libaio-0.3.109/harness/cases/16.t +@@ -20,7 +20,7 @@ + #define SYS_eventfd 478 + #elif defined(__aarch64__) + #define SYS_eventfd 1044 +-#else ++#elif !defined(SYS_eventfd2) + #error define SYS_eventfd for your arch! + #endif + #endif +@@ -41,7 +41,11 @@ int test_main(void) + struct timespec notime = { .tv_sec = 0, .tv_nsec = 0 }; + + buf = malloc(SIZE); assert(buf); ++#ifndef SYS_eventfd ++ efd = syscall(SYS_eventfd2, 0, 0); ++#else + efd = syscall(SYS_eventfd, 0); ++#endif + if (efd < 0) { + if (errno == ENOSYS) { + printf("No eventfd support. [SKIPPING]\n"); +Index: libaio-0.3.109/src/libaio.h +=================================================================== +--- libaio-0.3.109.orig/src/libaio.h ++++ libaio-0.3.109/src/libaio.h +@@ -127,6 +127,10 @@ typedef enum io_iocb_cmd { + #define PADDEDptr(x, y) x + #define PADDEDul(x, y) unsigned long x + # endif ++#elif defined(__riscv) ++#define PADDED(x, y) x, y ++#define PADDEDptr(x, y) x ++#define PADDEDul(x, y) unsigned long x + #else + #error endian? + #endif