diff options
author | Khem Raj <raj.khem@gmail.com> | 2024-09-16 16:10:07 -0700 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2024-09-17 10:08:39 -0700 |
commit | a8c72984ae2e4d3a80cf4f562a79f2f08ff5fadc (patch) | |
tree | 563996fce06ea80ce20c2307e77ffe058338c118 | |
parent | a2010f12fd3a0d615c021417b0494447560742a0 (diff) | |
download | meta-openembedded-a8c72984ae2e4d3a80cf4f562a79f2f08ff5fadc.tar.gz |
liburing: Upgrade to 2.7 and fix build on riscv32
Fix build regression with musl
Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r-- | meta-oe/recipes-support/liburing/liburing/0001-test-Compile-nolibc.c-only-when-CONFIG_NOLIBC-is-set.patch | 43 | ||||
-rw-r--r-- | meta-oe/recipes-support/liburing/liburing/0001-test-Drop-including-error.h-header.patch | 27 | ||||
-rw-r--r-- | meta-oe/recipes-support/liburing/liburing/0002-ooo-file-unreg.c-Include-poll.h-instead-of-sys-poll..patch | 32 | ||||
-rw-r--r-- | meta-oe/recipes-support/liburing/liburing_2.7.bb (renamed from meta-oe/recipes-support/liburing/liburing_2.6.bb) | 10 |
4 files changed, 109 insertions, 3 deletions
diff --git a/meta-oe/recipes-support/liburing/liburing/0001-test-Compile-nolibc.c-only-when-CONFIG_NOLIBC-is-set.patch b/meta-oe/recipes-support/liburing/liburing/0001-test-Compile-nolibc.c-only-when-CONFIG_NOLIBC-is-set.patch new file mode 100644 index 000000000..90f028b85 --- /dev/null +++ b/meta-oe/recipes-support/liburing/liburing/0001-test-Compile-nolibc.c-only-when-CONFIG_NOLIBC-is-set.patch | |||
@@ -0,0 +1,43 @@ | |||
1 | From 7ea4e55a91e6d5564c6de762c2d1afc78ff9cfd3 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Mon, 16 Sep 2024 22:58:38 +0000 | ||
4 | Subject: [PATCH] test: Compile nolibc.c only when CONFIG_NOLIBC is set | ||
5 | |||
6 | building nolibc.c fails for non nolibc targets | ||
7 | |||
8 | Fixes | ||
9 | In file included from nolibc.c:33: | ||
10 | ./../src/lib.h:20:2: error: "This arch doesn't support building liburing without libc" | ||
11 | 20 | #error "This arch doesn't support building liburing without libc" | ||
12 | | ^ | ||
13 | 1 error generated. | ||
14 | |||
15 | Upstream-Status: Backport [https://github.com/axboe/liburing/commit/a182f62c01f981cd9dd508ec952fbc975b263e3d] | ||
16 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
17 | --- | ||
18 | test/Makefile | 5 ++++- | ||
19 | 1 file changed, 4 insertions(+), 1 deletion(-) | ||
20 | |||
21 | diff --git a/test/Makefile b/test/Makefile | ||
22 | index 0538a75..0dfecb8 100644 | ||
23 | --- a/test/Makefile | ||
24 | +++ b/test/Makefile | ||
25 | @@ -126,7 +126,6 @@ test_srcs := \ | ||
26 | msg-ring-overflow.c \ | ||
27 | multicqes_drain.c \ | ||
28 | no-mmap-inval.c \ | ||
29 | - nolibc.c \ | ||
30 | nop-all-sizes.c \ | ||
31 | nop.c \ | ||
32 | ooo-file-unreg.c \ | ||
33 | @@ -221,6 +220,10 @@ test_srcs := \ | ||
34 | all_targets := | ||
35 | include ../Makefile.quiet | ||
36 | |||
37 | +ifeq ($(CONFIG_NOLIBC),y) | ||
38 | + test_srcs += nolibc.c | ||
39 | +endif | ||
40 | + | ||
41 | ifdef CONFIG_HAVE_STATX | ||
42 | test_srcs += statx.c | ||
43 | else ifdef CONFIG_HAVE_GLIBC_STATX | ||
diff --git a/meta-oe/recipes-support/liburing/liburing/0001-test-Drop-including-error.h-header.patch b/meta-oe/recipes-support/liburing/liburing/0001-test-Drop-including-error.h-header.patch new file mode 100644 index 000000000..62ca78a1e --- /dev/null +++ b/meta-oe/recipes-support/liburing/liburing/0001-test-Drop-including-error.h-header.patch | |||
@@ -0,0 +1,27 @@ | |||
1 | From 684bcb2a8795fd399d6c164e51459a2785057b1c Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Tue, 17 Sep 2024 09:56:42 -0700 | ||
4 | Subject: [PATCH 1/2] test: Drop including error.h header | ||
5 | |||
6 | There is no error APIs being used in this test, therefore | ||
7 | drop including it, this also makes it portable to musl | ||
8 | systems which do not have error.h | ||
9 | |||
10 | Upstream-Status: Submitted [https://github.com/axboe/liburing/pull/1233] | ||
11 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
12 | --- | ||
13 | test/init-mem.c | 1 - | ||
14 | 1 file changed, 1 deletion(-) | ||
15 | |||
16 | diff --git a/test/init-mem.c b/test/init-mem.c | ||
17 | index 6f9a02a..f512190 100644 | ||
18 | --- a/test/init-mem.c | ||
19 | +++ b/test/init-mem.c | ||
20 | @@ -13,7 +13,6 @@ | ||
21 | #include <netinet/udp.h> | ||
22 | #include <arpa/inet.h> | ||
23 | #include <net/if.h> | ||
24 | -#include <error.h> | ||
25 | |||
26 | #include "liburing.h" | ||
27 | #include "helpers.h" | ||
diff --git a/meta-oe/recipes-support/liburing/liburing/0002-ooo-file-unreg.c-Include-poll.h-instead-of-sys-poll..patch b/meta-oe/recipes-support/liburing/liburing/0002-ooo-file-unreg.c-Include-poll.h-instead-of-sys-poll..patch new file mode 100644 index 000000000..8a1d54250 --- /dev/null +++ b/meta-oe/recipes-support/liburing/liburing/0002-ooo-file-unreg.c-Include-poll.h-instead-of-sys-poll..patch | |||
@@ -0,0 +1,32 @@ | |||
1 | From d06433ff1a1905436cfcde80e22ee51bd9591536 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Tue, 17 Sep 2024 09:59:31 -0700 | ||
4 | Subject: [PATCH 2/2] ooo-file-unreg.c: Include poll.h instead of sys/poll.h | ||
5 | |||
6 | This fixes a warning e.g. | ||
7 | |||
8 | In file included from ooo-file-unreg.c:12: | ||
9 | /mnt/b/yoe/master/build/tmp/work/riscv32-yoe-linux-musl/liburing/2.7/recipe-sysroot/usr/include/sys/poll.h:1:2: warning: redirecting incorrect #include <sys/poll.h> to <poll.h> [-W#warnings] | ||
10 | 1 | #warning redirecting incorrect #include <sys/poll.h> to <poll.h> | ||
11 | | ^ | ||
12 | 1 warning generated. | ||
13 | |||
14 | Upstream-Status: Submitted [https://github.com/axboe/liburing/pull/1233] | ||
15 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
16 | --- | ||
17 | test/ooo-file-unreg.c | 2 +- | ||
18 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
19 | |||
20 | diff --git a/test/ooo-file-unreg.c b/test/ooo-file-unreg.c | ||
21 | index d76e0fb..dd6ea55 100644 | ||
22 | --- a/test/ooo-file-unreg.c | ||
23 | +++ b/test/ooo-file-unreg.c | ||
24 | @@ -9,7 +9,7 @@ | ||
25 | #include <sys/socket.h> | ||
26 | #include <unistd.h> | ||
27 | #include <stdlib.h> | ||
28 | -#include <sys/poll.h> | ||
29 | +#include <poll.h> | ||
30 | |||
31 | #include "liburing.h" | ||
32 | #include "helpers.h" | ||
diff --git a/meta-oe/recipes-support/liburing/liburing_2.6.bb b/meta-oe/recipes-support/liburing/liburing_2.7.bb index fc3fe1cac..b10fe40ca 100644 --- a/meta-oe/recipes-support/liburing/liburing_2.6.bb +++ b/meta-oe/recipes-support/liburing/liburing_2.7.bb | |||
@@ -9,8 +9,11 @@ SECTION = "libs" | |||
9 | LICENSE = "LGPL-2.1-only | MIT" | 9 | LICENSE = "LGPL-2.1-only | MIT" |
10 | LIC_FILES_CHKSUM = "file://README;beginline=41;endline=44;md5=2b0e9926530c269f5ae95560370195af" | 10 | LIC_FILES_CHKSUM = "file://README;beginline=41;endline=44;md5=2b0e9926530c269f5ae95560370195af" |
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 | SRCREV = "f7dcc1ea60819475dffd3a45059e16f04381bee7" | 13 | file://0001-test-Compile-nolibc.c-only-when-CONFIG_NOLIBC-is-set.patch \ |
14 | file://0001-test-Drop-including-error.h-header.patch \ | ||
15 | file://0002-ooo-file-unreg.c-Include-poll.h-instead-of-sys-poll..patch" | ||
16 | SRCREV = "5227d48b28ad8671e61d444b72678da584d2e6c3" | ||
14 | 17 | ||
15 | S = "${WORKDIR}/git" | 18 | S = "${WORKDIR}/git" |
16 | 19 | ||
@@ -19,10 +22,11 @@ XCFLAGS = "-pthread" | |||
19 | XCFLAGS:append:libc-musl = " -lucontext" | 22 | XCFLAGS:append:libc-musl = " -lucontext" |
20 | 23 | ||
21 | USELIBC = "" | 24 | USELIBC = "" |
22 | # clang-18 on RV64 emits memset for arch/riscv64/syscall.h provided __do_syscall4 macro | 25 | # clang-18+ on RV64 emits memset for arch/riscv64/syscall.h provided __do_syscall4 macro |
23 | # this does not happen for gcc or older clang, so link with libc since we need memset API | 26 | # this does not happen for gcc or older clang, so link with libc since we need memset API |
24 | # -fno-builtin-memset does not help | 27 | # -fno-builtin-memset does not help |
25 | USELIBC:riscv64:toolchain-clang = "--use-libc" | 28 | USELIBC:riscv64:toolchain-clang = "--use-libc" |
29 | USELIBC:riscv32 = "--use-libc" | ||
26 | EXTRA_OEMAKE = "'CC=${CC}' 'RANLIB=${RANLIB}' 'AR=${AR}' 'CFLAGS=${CFLAGS} -I${S}/include -DWITHOUT_XATTR' 'LDFLAGS=${LDFLAGS}' 'XCFLAGS=${XCFLAGS}' 'BUILDDIR=${S}'" | 30 | EXTRA_OEMAKE = "'CC=${CC}' 'RANLIB=${RANLIB}' 'AR=${AR}' 'CFLAGS=${CFLAGS} -I${S}/include -DWITHOUT_XATTR' 'LDFLAGS=${LDFLAGS}' 'XCFLAGS=${XCFLAGS}' 'BUILDDIR=${S}'" |
27 | do_configure() { | 31 | do_configure() { |
28 | ${S}/configure --prefix=${prefix} --libdir=${libdir} --libdevdir=${libdir} --mandir=${mandir} --datadir=${datadir} --includedir=${includedir} ${USELIBC} | 32 | ${S}/configure --prefix=${prefix} --libdir=${libdir} --libdevdir=${libdir} --mandir=${mandir} --datadir=${datadir} --includedir=${includedir} ${USELIBC} |