Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/liburing/, sys-libs/liburing/files/
Date: Wed, 20 Oct 2021 01:51:36
Message-Id: 1634694335.2ef2c4badbd29b3ae21c7f0615fb95af0068a74c.sam@gentoo
1 commit: 2ef2c4badbd29b3ae21c7f0615fb95af0068a74c
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Sat Oct 9 05:09:41 2021 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Wed Oct 20 01:45:35 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2ef2c4ba
7
8 sys-libs/liburing: fix build on arm
9
10 Closes: https://bugs.gentoo.org/816798
11 Signed-off-by: Sam James <sam <AT> gentoo.org>
12 Closes: https://github.com/gentoo/gentoo/pull/22523
13
14 .../liburing/files/liburing-2.1-arm-syscall.patch | 54 ++++++++++++++++++++++
15 sys-libs/liburing/liburing-2.1.ebuild | 5 ++
16 2 files changed, 59 insertions(+)
17
18 diff --git a/sys-libs/liburing/files/liburing-2.1-arm-syscall.patch b/sys-libs/liburing/files/liburing-2.1-arm-syscall.patch
19 new file mode 100644
20 index 00000000000..a652b052148
21 --- /dev/null
22 +++ b/sys-libs/liburing/files/liburing-2.1-arm-syscall.patch
23 @@ -0,0 +1,54 @@
24 +https://github.com/axboe/liburing/commit/cb350a8989adbd65db574325d9a86d5437d800da
25 +https://bugs.gentoo.org/816798
26 +
27 +From cb350a8989adbd65db574325d9a86d5437d800da Mon Sep 17 00:00:00 2001
28 +From: Guillem Jover <guillem@×××××××.org>
29 +Date: Mon, 13 Sep 2021 23:56:08 +0200
30 +Subject: [PATCH] test: Use syscall wrappers instead of using syscall(2)
31 + directly
32 +
33 +Some of these syscalls have different entry points depending on the
34 +architecture. Use the wrappers to avoid having to reimplement them
35 +portably.
36 +
37 +Fixes build failures on Debian armel and armhf builds.
38 +
39 +Signed-off-by: Guillem Jover <guillem@×××××××.org>
40 +--- a/test/sqpoll-cancel-hang.c
41 ++++ b/test/sqpoll-cancel-hang.c
42 +@@ -4,7 +4,6 @@
43 + #include <stdlib.h>
44 + #include <string.h>
45 + #include <sys/mman.h>
46 +-#include <sys/syscall.h>
47 + #include <sys/wait.h>
48 + #include <time.h>
49 + #include <unistd.h>
50 +@@ -29,8 +28,6 @@ static uint64_t current_time_ms(void)
51 +
52 + #define IORING_OFF_SQES 0x10000000ULL
53 +
54 +-#define sys_io_uring_setup 425
55 +-
56 + static void kill_and_wait(int pid, int* status)
57 + {
58 + kill(-pid, SIGKILL);
59 +@@ -53,7 +50,7 @@ a5)
60 + void* vma2 = (void*)a3;
61 + void** ring_ptr_out = (void**)a4;
62 + void** sqes_ptr_out = (void**)a5;
63 +- uint32_t fd_io_uring = syscall(sys_io_uring_setup, entries, setup_params);
64 ++ uint32_t fd_io_uring = __sys_io_uring_setup(entries, setup_params);
65 + uint32_t sq_ring_sz = setup_params->sq_off.array +
66 + setup_params->sq_entries * sizeof(uint32_t);
67 + uint32_t cq_ring_sz = setup_params->cq_off.cqes +
68 +@@ -135,7 +132,7 @@ void trigger_bug(void)
69 + }
70 + int main(void)
71 + {
72 +- syscall(__NR_mmap, 0x20000000ul, 0x1000000ul, 7ul, 0x32ul, -1, 0ul);
73 ++ mmap((void *)0x20000000ul, 0x1000000ul, 7ul, 0x32ul, -1, 0ul);
74 + int pid = fork();
75 + if (pid < 0)
76 + exit(1);
77 +
78
79 diff --git a/sys-libs/liburing/liburing-2.1.ebuild b/sys-libs/liburing/liburing-2.1.ebuild
80 index 6d65622e2a7..dd13ba0d9ab 100644
81 --- a/sys-libs/liburing/liburing-2.1.ebuild
82 +++ b/sys-libs/liburing/liburing-2.1.ebuild
83 @@ -21,6 +21,11 @@ IUSE="static-libs"
84 # fsync test hangs forever
85 RESTRICT="test"
86
87 +PATCHES=(
88 + # Upstream, bug #816798
89 + "${FILESDIR}"/${P}-arm-syscall.patch
90 +)
91 +
92 src_prepare() {
93 default
94 multilib_copy_sources