All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/libkcapi: fix build on riscv32
@ 2021-05-27 20:49 Fabrice Fontaine
  2021-06-01 20:36 ` Arnout Vandecappelle
  2021-06-10  8:44 ` Peter Korsgaard
  0 siblings, 2 replies; 3+ messages in thread
From: Fabrice Fontaine @ 2021-05-27 20:49 UTC (permalink / raw)
  To: buildroot

Fix the following build failure on riscv32:

lib/internal.h:331:20: error: '__NR_io_getevents' undeclared (first use in this function); did you mean 'io_getevents'?
  331 |     return syscall(__NR_io_getevents, ctx, min, max, events, timeout);
      |                    ^~~~~~~~~~~~~~

Fixes:
 - http://autobuild.buildroot.org/results/c828d4330a8888fe8db4299dc2f20759947f329f

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 ...f-__NR_io_getevents-when-not-defined.patch | 42 +++++++++++++++++++
 1 file changed, 42 insertions(+)
 create mode 100644 package/libkcapi/0001-Disable-use-of-__NR_io_getevents-when-not-defined.patch

diff --git a/package/libkcapi/0001-Disable-use-of-__NR_io_getevents-when-not-defined.patch b/package/libkcapi/0001-Disable-use-of-__NR_io_getevents-when-not-defined.patch
new file mode 100644
index 0000000000..20aa75b741
--- /dev/null
+++ b/package/libkcapi/0001-Disable-use-of-__NR_io_getevents-when-not-defined.patch
@@ -0,0 +1,42 @@
+From 455c4938f5822c017c7ff79dd2dca638b6410923 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+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 <raj.khem@gmail.com>
+Signed-off-by: Stephan Mueller <smueller@chronox.de>
+[Retrieved from:
+https://github.com/smuellerDD/libkcapi/commit/455c4938f5822c017c7ff79dd2dca638b6410923]
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+---
+ lib/internal.h | 11 +++++++++--
+ 1 file changed, 9 insertions(+), 2 deletions(-)
+
+diff --git a/lib/internal.h b/lib/internal.h
+index 1237827..f765461 100644
+--- a/lib/internal.h
++++ b/lib/internal.h
+@@ -325,10 +325,17 @@ static inline int io_submit(aio_context_t ctx, long n,  struct iocb **iocb)
+     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
+ }
+ 
+ /************************************************************
-- 
2.30.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCH 1/1] package/libkcapi: fix build on riscv32
  2021-05-27 20:49 [Buildroot] [PATCH 1/1] package/libkcapi: fix build on riscv32 Fabrice Fontaine
@ 2021-06-01 20:36 ` Arnout Vandecappelle
  2021-06-10  8:44 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Arnout Vandecappelle @ 2021-06-01 20:36 UTC (permalink / raw)
  To: buildroot



On 27/05/2021 22:49, Fabrice Fontaine wrote:
> Fix the following build failure on riscv32:
> 
> lib/internal.h:331:20: error: '__NR_io_getevents' undeclared (first use in this function); did you mean 'io_getevents'?
>   331 |     return syscall(__NR_io_getevents, ctx, min, max, events, timeout);
>       |                    ^~~~~~~~~~~~~~
> 
> Fixes:
>  - http://autobuild.buildroot.org/results/c828d4330a8888fe8db4299dc2f20759947f329f
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
>  ...f-__NR_io_getevents-when-not-defined.patch | 42 +++++++++++++++++++
>  1 file changed, 42 insertions(+)
>  create mode 100644 package/libkcapi/0001-Disable-use-of-__NR_io_getevents-when-not-defined.patch
> 
> diff --git a/package/libkcapi/0001-Disable-use-of-__NR_io_getevents-when-not-defined.patch b/package/libkcapi/0001-Disable-use-of-__NR_io_getevents-when-not-defined.patch
> new file mode 100644
> index 0000000000..20aa75b741
> --- /dev/null
> +++ b/package/libkcapi/0001-Disable-use-of-__NR_io_getevents-when-not-defined.patch
> @@ -0,0 +1,42 @@
> +From 455c4938f5822c017c7ff79dd2dca638b6410923 Mon Sep 17 00:00:00 2001
> +From: Khem Raj <raj.khem@gmail.com>
> +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

 I don't really like those vague OpenEmbedded patches :-)

 Applied to master, thanks.

 Regards,
 Arnout

> +Signed-off-by: Khem Raj <raj.khem@gmail.com>
> +Signed-off-by: Stephan Mueller <smueller@chronox.de>
> +[Retrieved from:
> +https://github.com/smuellerDD/libkcapi/commit/455c4938f5822c017c7ff79dd2dca638b6410923]
> +Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> +---
> + lib/internal.h | 11 +++++++++--
> + 1 file changed, 9 insertions(+), 2 deletions(-)
> +
> +diff --git a/lib/internal.h b/lib/internal.h
> +index 1237827..f765461 100644
> +--- a/lib/internal.h
> ++++ b/lib/internal.h
> +@@ -325,10 +325,17 @@ static inline int io_submit(aio_context_t ctx, long n,  struct iocb **iocb)
> +     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
> + }
> + 
> + /************************************************************
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCH 1/1] package/libkcapi: fix build on riscv32
  2021-05-27 20:49 [Buildroot] [PATCH 1/1] package/libkcapi: fix build on riscv32 Fabrice Fontaine
  2021-06-01 20:36 ` Arnout Vandecappelle
@ 2021-06-10  8:44 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2021-06-10  8:44 UTC (permalink / raw)
  To: buildroot

>>>>> "Fabrice" == Fabrice Fontaine <fontaine.fabrice@gmail.com> writes:

 > Fix the following build failure on riscv32:
 > lib/internal.h:331:20: error: '__NR_io_getevents' undeclared (first use in this function); did you mean 'io_getevents'?
 >   331 |     return syscall(__NR_io_getevents, ctx, min, max, events, timeout);
 >       |                    ^~~~~~~~~~~~~~

 > Fixes:
 >  - http://autobuild.buildroot.org/results/c828d4330a8888fe8db4299dc2f20759947f329f

 > Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>

Committed to 2021.02.x, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-06-10  8:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-27 20:49 [Buildroot] [PATCH 1/1] package/libkcapi: fix build on riscv32 Fabrice Fontaine
2021-06-01 20:36 ` Arnout Vandecappelle
2021-06-10  8:44 ` Peter Korsgaard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.