diff options
-rw-r--r-- | meta-oe/recipes-support/liburing/liburing/0001-do-not-build-examples.patch | 10 | ||||
-rw-r--r-- | meta-oe/recipes-support/liburing/liburing/0001-examples-ucontext-cp.c-Do-not-use-SIGSTKSZ.patch | 37 | ||||
-rw-r--r-- | meta-oe/recipes-support/liburing/liburing/0001-test-Fix-build-on-32bit-architectures-with-6bit-time.patch | 35 | ||||
-rw-r--r-- | meta-oe/recipes-support/liburing/liburing/0001-tests-fix-portability-issue-when-using-__NR_mmap-sys.patch | 53 | ||||
-rw-r--r-- | meta-oe/recipes-support/liburing/liburing_2.0.bb (renamed from meta-oe/recipes-support/liburing/liburing_0.7.bb) | 5 |
5 files changed, 98 insertions, 42 deletions
diff --git a/meta-oe/recipes-support/liburing/liburing/0001-do-not-build-examples.patch b/meta-oe/recipes-support/liburing/liburing/0001-do-not-build-examples.patch index 19bf14708..03ab07531 100644 --- a/meta-oe/recipes-support/liburing/liburing/0001-do-not-build-examples.patch +++ b/meta-oe/recipes-support/liburing/liburing/0001-do-not-build-examples.patch | |||
@@ -1,4 +1,4 @@ | |||
1 | From 3ee2f1e231bde18a99f86da747a9b8feca3c179d Mon Sep 17 00:00:00 2001 | 1 | From 653c39b0b30b2a329db5041e558cfc97c03d6bfb Mon Sep 17 00:00:00 2001 |
2 | From: Khem Raj <raj.khem@gmail.com> | 2 | From: Khem Raj <raj.khem@gmail.com> |
3 | Date: Wed, 17 Feb 2021 19:18:16 -0800 | 3 | Date: Wed, 17 Feb 2021 19:18:16 -0800 |
4 | Subject: [PATCH] do not build examples | 4 | Subject: [PATCH] do not build examples |
@@ -14,7 +14,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com> | |||
14 | 1 file changed, 1 deletion(-) | 14 | 1 file changed, 1 deletion(-) |
15 | 15 | ||
16 | diff --git a/Makefile b/Makefile | 16 | diff --git a/Makefile b/Makefile |
17 | index 948e004..8b63024 100644 | 17 | index 5d9c4dc..53e1615 100644 |
18 | --- a/Makefile | 18 | --- a/Makefile |
19 | +++ b/Makefile | 19 | +++ b/Makefile |
20 | @@ -11,7 +11,6 @@ default: all | 20 | @@ -11,7 +11,6 @@ default: all |
@@ -23,8 +23,8 @@ index 948e004..8b63024 100644 | |||
23 | @$(MAKE) -C test | 23 | @$(MAKE) -C test |
24 | - @$(MAKE) -C examples | 24 | - @$(MAKE) -C examples |
25 | 25 | ||
26 | partcheck: all | 26 | .PHONY: all install default clean test |
27 | @echo "make partcheck => TODO add tests with out kernel support" | 27 | .PHONY: FORCE cscope |
28 | -- | 28 | -- |
29 | 2.30.1 | 29 | 2.31.1 |
30 | 30 | ||
diff --git a/meta-oe/recipes-support/liburing/liburing/0001-examples-ucontext-cp.c-Do-not-use-SIGSTKSZ.patch b/meta-oe/recipes-support/liburing/liburing/0001-examples-ucontext-cp.c-Do-not-use-SIGSTKSZ.patch new file mode 100644 index 000000000..a2ba66c3a --- /dev/null +++ b/meta-oe/recipes-support/liburing/liburing/0001-examples-ucontext-cp.c-Do-not-use-SIGSTKSZ.patch | |||
@@ -0,0 +1,37 @@ | |||
1 | From a30d62dfb9ea30af58ef331fae1e6f727d0558c0 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Tue, 4 May 2021 10:32:08 -0700 | ||
4 | Subject: [PATCH] examples/ucontext-cp.c: Do not use SIGSTKSZ | ||
5 | |||
6 | glibc 2.34 has removed SIGSTKSZ therefore we replace it | ||
7 | |||
8 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
9 | --- | ||
10 | examples/ucontext-cp.c | 6 +----- | ||
11 | 1 file changed, 1 insertion(+), 5 deletions(-) | ||
12 | |||
13 | --- a/examples/ucontext-cp.c | ||
14 | +++ b/examples/ucontext-cp.c | ||
15 | @@ -3,6 +3,7 @@ | ||
16 | * gcc -Wall -O2 -D_GNU_SOURCE -o ucontext-cp ucontext-cp.c -luring | ||
17 | */ | ||
18 | #define _POSIX_C_SOURCE 199309L | ||
19 | +#include <stddef.h> | ||
20 | #include <stdio.h> | ||
21 | #include <fcntl.h> | ||
22 | #include <string.h> | ||
23 | @@ -22,13 +23,9 @@ | ||
24 | #define QD 64 | ||
25 | #define BS 1024 | ||
26 | |||
27 | -#ifndef SIGSTKSZ | ||
28 | -#define SIGSTKSZ 8192 | ||
29 | -#endif | ||
30 | - | ||
31 | typedef struct { | ||
32 | struct io_uring *ring; | ||
33 | - unsigned char stack_buf[SIGSTKSZ]; | ||
34 | + max_align_t stack_buf[(8 * 1024 + sizeof (max_align_t) - 1) / sizeof (max_align_t)]; | ||
35 | ucontext_t ctx_main, ctx_fnew; | ||
36 | } async_context; | ||
37 | |||
diff --git a/meta-oe/recipes-support/liburing/liburing/0001-test-Fix-build-on-32bit-architectures-with-6bit-time.patch b/meta-oe/recipes-support/liburing/liburing/0001-test-Fix-build-on-32bit-architectures-with-6bit-time.patch deleted file mode 100644 index 01c5ccd53..000000000 --- a/meta-oe/recipes-support/liburing/liburing/0001-test-Fix-build-on-32bit-architectures-with-6bit-time.patch +++ /dev/null | |||
@@ -1,35 +0,0 @@ | |||
1 | From 0a9b12eda0f6e487398dad004121bdd1be792428 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Sat, 14 Nov 2020 16:18:44 -0800 | ||
4 | Subject: [PATCH] test: Fix build on 32bit architectures with 6bit time_t | ||
5 | |||
6 | It uses SYS_futex, which it expects from system C library. | ||
7 | in glibc (/usr/include/bits/syscall.h defines it in terms of of NR_futex) | ||
8 | rv32 is using 64bit time_t from get go unlike other 32bit architectures | ||
9 | in glibc, therefore it wont have NR_futex defined but just NR_futex_time64 | ||
10 | this aliases it to NR_futex so that SYS_futex is then defined for rv32 | ||
11 | |||
12 | Upstream-Status: Submitted [https://github.com/axboe/liburing/pull/237] | ||
13 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
14 | --- | ||
15 | test/35fa71a030ca-test.c | 4 ++++ | ||
16 | 1 file changed, 4 insertions(+) | ||
17 | |||
18 | diff --git a/test/35fa71a030ca-test.c b/test/35fa71a030ca-test.c | ||
19 | index 4ecf211..7f2124b 100644 | ||
20 | --- a/test/35fa71a030ca-test.c | ||
21 | +++ b/test/35fa71a030ca-test.c | ||
22 | @@ -24,6 +24,10 @@ | ||
23 | |||
24 | #include <linux/futex.h> | ||
25 | |||
26 | +#if !defined(SYS_futex) && defined(SYS_futex_time64) | ||
27 | +# define SYS_futex SYS_futex_time64 | ||
28 | +#endif | ||
29 | + | ||
30 | static void sleep_ms(uint64_t ms) | ||
31 | { | ||
32 | usleep(ms * 1000); | ||
33 | -- | ||
34 | 2.29.2 | ||
35 | |||
diff --git a/meta-oe/recipes-support/liburing/liburing/0001-tests-fix-portability-issue-when-using-__NR_mmap-sys.patch b/meta-oe/recipes-support/liburing/liburing/0001-tests-fix-portability-issue-when-using-__NR_mmap-sys.patch new file mode 100644 index 000000000..f2f03c18b --- /dev/null +++ b/meta-oe/recipes-support/liburing/liburing/0001-tests-fix-portability-issue-when-using-__NR_mmap-sys.patch | |||
@@ -0,0 +1,53 @@ | |||
1 | From 2d3940163e14d183fddc4d8b24cc1d3865bba0b3 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Wed, 5 May 2021 09:36:36 -0700 | ||
4 | Subject: [PATCH] tests: fix portability issue when using __NR_mmap syscall | ||
5 | |||
6 | On some architectures e.g. ARM and RISCV32, __NR_mmap does not exist and | ||
7 | libc will then use NR_mmap2 to implement mmap() API, therefore use | ||
8 | system C library mmap() API instead of calling the syscall directly | ||
9 | |||
10 | Upstream-Status: Partial Backport [https://github.com/axboe/liburing/commit/808b6c72ab753bda0c300b5683cfd31750d1d49b] | ||
11 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
12 | --- | ||
13 | test/double-poll-crash.c | 6 +++--- | ||
14 | test/sqpoll-disable-exit.c | 6 +++--- | ||
15 | 2 files changed, 6 insertions(+), 6 deletions(-) | ||
16 | |||
17 | diff --git a/test/double-poll-crash.c b/test/double-poll-crash.c | ||
18 | index 1a219c7..6e08285 100644 | ||
19 | --- a/test/double-poll-crash.c | ||
20 | +++ b/test/double-poll-crash.c | ||
21 | @@ -150,9 +150,9 @@ int main(int argc, char *argv[]) | ||
22 | if (argc > 1) | ||
23 | return 0; | ||
24 | |||
25 | - syscall(__NR_mmap, 0x1ffff000ul, 0x1000ul, 0ul, 0x32ul, -1, 0ul); | ||
26 | - syscall(__NR_mmap, 0x20000000ul, 0x1000000ul, 7ul, 0x32ul, -1, 0ul); | ||
27 | - syscall(__NR_mmap, 0x21000000ul, 0x1000ul, 0ul, 0x32ul, -1, 0ul); | ||
28 | + mmap((void *) 0x1ffff000, (size_t) 0x1000, PROT_NONE, MAP_FIXED | MAP_ANONYMOUS, -1, 0); | ||
29 | + mmap((void *) 0x20000000, (size_t) 0x1000000, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_FIXED | MAP_ANONYMOUS, -1, 0); | ||
30 | + mmap((void *) 0x21000000, (size_t) 0x1000, PROT_NONE, MAP_FIXED | MAP_ANONYMOUS, -1, 0); | ||
31 | intptr_t res = 0; | ||
32 | *(uint32_t*)0x20000484 = 0; | ||
33 | *(uint32_t*)0x20000488 = 0; | ||
34 | diff --git a/test/sqpoll-disable-exit.c b/test/sqpoll-disable-exit.c | ||
35 | index d4e17f8..a0d00cc 100644 | ||
36 | --- a/test/sqpoll-disable-exit.c | ||
37 | +++ b/test/sqpoll-disable-exit.c | ||
38 | @@ -223,9 +223,9 @@ void execute_one(void) | ||
39 | } | ||
40 | int main(void) | ||
41 | { | ||
42 | - syscall(__NR_mmap, 0x1ffff000ul, 0x1000ul, 0ul, 0x32ul, -1, 0ul); | ||
43 | - syscall(__NR_mmap, 0x20000000ul, 0x1000000ul, 7ul, 0x32ul, -1, 0ul); | ||
44 | - syscall(__NR_mmap, 0x21000000ul, 0x1000ul, 0ul, 0x32ul, -1, 0ul); | ||
45 | + mmap((void *) 0x1ffff000, (size_t) 0x1000, PROT_NONE, MAP_FIXED | MAP_ANONYMOUS, -1, 0); | ||
46 | + mmap((void *) 0x20000000, (size_t) 0x1000000, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_FIXED | MAP_ANONYMOUS, -1, 0); | ||
47 | + mmap((void *) 0x21000000, (size_t) 0x1000, PROT_NONE, MAP_FIXED | MAP_ANONYMOUS, -1, 0); | ||
48 | loop(); | ||
49 | return 0; | ||
50 | } | ||
51 | -- | ||
52 | 2.31.1 | ||
53 | |||
diff --git a/meta-oe/recipes-support/liburing/liburing_0.7.bb b/meta-oe/recipes-support/liburing/liburing_2.0.bb index d79389a69..9eddf2e2a 100644 --- a/meta-oe/recipes-support/liburing/liburing_0.7.bb +++ b/meta-oe/recipes-support/liburing/liburing_2.0.bb | |||
@@ -10,12 +10,13 @@ LICENSE = "LGPLv2.1 | MIT" | |||
10 | LIC_FILES_CHKSUM = "file://README;beginline=41;endline=44;md5=d51b5805e2a675685e6a66ca50904cf9" | 10 | LIC_FILES_CHKSUM = "file://README;beginline=41;endline=44;md5=d51b5805e2a675685e6a66ca50904cf9" |
11 | 11 | ||
12 | SRC_URI = "git://github.com/axboe/liburing.git;branch=master;protocol=https \ | 12 | SRC_URI = "git://github.com/axboe/liburing.git;branch=master;protocol=https \ |
13 | file://0001-test-Fix-build-on-32bit-architectures-with-6bit-time.patch \ | 13 | file://0001-examples-ucontext-cp.c-Do-not-use-SIGSTKSZ.patch \ |
14 | file://0001-tests-fix-portability-issue-when-using-__NR_mmap-sys.patch \ | ||
14 | " | 15 | " |
15 | SRC_URI_append_libc-musl_riscv64 = " file://0001-do-not-build-examples.patch " | 16 | SRC_URI_append_libc-musl_riscv64 = " file://0001-do-not-build-examples.patch " |
16 | SRC_URI_append_libc-musl_riscv32 = " file://0001-do-not-build-examples.patch " | 17 | SRC_URI_append_libc-musl_riscv32 = " file://0001-do-not-build-examples.patch " |
17 | 18 | ||
18 | SRCREV = "45f0735219a615ae848033c47c7e2d85d101d43e" | 19 | SRCREV = "b013dfd5a5f65116373d5e0f0bdfb73db9d8816e" |
19 | S = "${WORKDIR}/git" | 20 | S = "${WORKDIR}/git" |
20 | 21 | ||
21 | DEPENDS_append_libc-musl = " libucontext" | 22 | DEPENDS_append_libc-musl = " libucontext" |