Skip to contentSkip to conversation

libkcapi: Fix build on riscv32

PATCH New Khem Raj 1 participant 1 message Nov 16, 2020

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 libkcapi: Fix build on riscv32

---
 ...f-__NR_io_getevents-when-not-defined.patch | 36 +++++++++++++++++++
 .../recipes-crypto/libkcapi/libkcapi_1.2.1.bb |  4 ++-
 2 files changed, 39 insertions(+), 1 deletion(-)
 create mode 100644 meta-oe/recipes-crypto/libkcapi/libkcapi/0001-Disable-use-of-__NR_io_getevents-when-not-defined.patch
meta-oe/recipes-crypto/libkcapi/libkcapi/0001-Disable-use-of-__NR_io_getevents-when-not-defined.patch new file +36 -0
new file mode 100644
index 0000000000..8dba3d3cf2
@@ -0,0 +1,36 @@
+From 771dd6aa45dd0bbbb7d7c7a7b116e1b5666fbd7a Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Sun, 15 Nov 2020 18:05:48 -0800
+Subject: [PATCH] Disable use of __NR_io_getevents when not defined
+
+Architectures like riscv32 do not define this syscall, therefore return
+ENOSYS on such architectures
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+ lib/internal.h | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+--- a/lib/internal.h
++++ b/lib/internal.h
+@@ -325,10 +325,17 @@ static inline int io_submit(aio_context_
+     return syscall(__NR_io_submit, ctx, n, iocb);
+ }
+ 
+-static inline int io_getevents(aio_context_t ctx, long min, long max,
+-            struct io_event *events, struct timespec *timeout)
++static inline int io_getevents(__attribute__((unused)) aio_context_t ctx,
++            __attribute__((unused)) long min,
++            __attribute__((unused)) long max,
++            __attribute__((unused)) struct io_event *events,
++            __attribute__((unused)) struct timespec *timeout)
+ {
++#ifdef __NR_io_getevents
+     return syscall(__NR_io_getevents, ctx, min, max, events, timeout);
++#else
++    return ENOSYS;
++#endif
+ }
+ 
+ /************************************************************
meta-oe/recipes-crypto/libkcapi/libkcapi_1.2.1.bb +3 -1
index 7de64fa0fe..e76fba09c3 100644
@@ -7,7 +7,9 @@ DEPENDS = "libtool"
 
 S = "${WORKDIR}/git"
 SRCREV = "d41284525ec8960e9a828979cfe269012b7df8db"
-SRC_URI = "git://github.com/smuellerDD/libkcapi.git"
+SRC_URI = "git://github.com/smuellerDD/libkcapi.git \
+           file://0001-Disable-use-of-__NR_io_getevents-when-not-defined.patch \
+           "
 
 inherit autotools
 
Signature · 1 line
2.29.2