diff mbox series

[meta-oe,03/12] liburing: Upgrade to 2.7 and fix build on riscv32

Message ID 20240917060424.1692067-3-raj.khem@gmail.com
State New
Headers show
Series [meta-oe,01/12] protobuf-c: Link with libatomic on riscv32 | expand

Commit Message

Khem Raj Sept. 17, 2024, 6:04 a.m. UTC
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 ...ibc.c-only-when-CONFIG_NOLIBC-is-set.patch | 43 +++++++++++++++++++
 .../{liburing_2.6.bb => liburing_2.7.bb}      |  8 ++--
 2 files changed, 48 insertions(+), 3 deletions(-)
 create mode 100644 meta-oe/recipes-support/liburing/liburing/0001-test-Compile-nolibc.c-only-when-CONFIG_NOLIBC-is-set.patch
 rename meta-oe/recipes-support/liburing/{liburing_2.6.bb => liburing_2.7.bb} (83%)
diff mbox series

Patch

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 0000000000..32e788123d
--- /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 @@ 
+From 7ea4e55a91e6d5564c6de762c2d1afc78ff9cfd3 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 16 Sep 2024 22:58:38 +0000
+Subject: [PATCH] test: Compile nolibc.c only when CONFIG_NOLIBC is set
+
+building nolibc.c fails for non nolibc targets
+
+Fixes
+In file included from nolibc.c:33:
+./../src/lib.h:20:2: error: "This arch doesn't support building liburing without libc"
+   20 | #error "This arch doesn't support building liburing without libc"
+      |  ^
+1 error generated.
+
+Upstream-Status: Submitted [https://github.com/axboe/liburing/pull/1232]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ test/Makefile | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/test/Makefile b/test/Makefile
+index 0538a75..0dfecb8 100644
+--- a/test/Makefile
++++ b/test/Makefile
+@@ -126,7 +126,6 @@ test_srcs := \
+ 	msg-ring-overflow.c \
+ 	multicqes_drain.c \
+ 	no-mmap-inval.c \
+-	nolibc.c \
+ 	nop-all-sizes.c \
+ 	nop.c \
+ 	ooo-file-unreg.c \
+@@ -221,6 +220,10 @@ test_srcs := \
+ all_targets :=
+ include ../Makefile.quiet
+ 
++ifeq ($(CONFIG_NOLIBC),y)
++	test_srcs += nolibc.c
++endif
++
+ ifdef CONFIG_HAVE_STATX
+ 	test_srcs += statx.c
+ else ifdef CONFIG_HAVE_GLIBC_STATX
diff --git a/meta-oe/recipes-support/liburing/liburing_2.6.bb b/meta-oe/recipes-support/liburing/liburing_2.7.bb
similarity index 83%
rename from meta-oe/recipes-support/liburing/liburing_2.6.bb
rename to meta-oe/recipes-support/liburing/liburing_2.7.bb
index fc3fe1cac1..7ef182ffae 100644
--- a/meta-oe/recipes-support/liburing/liburing_2.6.bb
+++ b/meta-oe/recipes-support/liburing/liburing_2.7.bb
@@ -9,8 +9,9 @@  SECTION = "libs"
 LICENSE = "LGPL-2.1-only | MIT"
 LIC_FILES_CHKSUM = "file://README;beginline=41;endline=44;md5=2b0e9926530c269f5ae95560370195af"
 
-SRC_URI = "git://github.com/axboe/liburing.git;branch=master;protocol=https"
-SRCREV = "f7dcc1ea60819475dffd3a45059e16f04381bee7"
+SRC_URI = "git://github.com/axboe/liburing.git;branch=master;protocol=https \
+           file://0001-test-Compile-nolibc.c-only-when-CONFIG_NOLIBC-is-set.patch"
+SRCREV = "5227d48b28ad8671e61d444b72678da584d2e6c3"
 
 S = "${WORKDIR}/git"
 
@@ -19,10 +20,11 @@  XCFLAGS = "-pthread"
 XCFLAGS:append:libc-musl = " -lucontext"
 
 USELIBC = ""
-# clang-18 on RV64 emits memset for arch/riscv64/syscall.h provided __do_syscall4 macro
+# clang-18+ on RV64 emits memset for arch/riscv64/syscall.h provided __do_syscall4 macro
 # this does not happen for gcc or older clang, so link with libc since we need memset API
 # -fno-builtin-memset does not help
 USELIBC:riscv64:toolchain-clang = "--use-libc"
+USELIBC:riscv32 = "--use-libc"
 EXTRA_OEMAKE = "'CC=${CC}' 'RANLIB=${RANLIB}' 'AR=${AR}' 'CFLAGS=${CFLAGS} -I${S}/include -DWITHOUT_XATTR' 'LDFLAGS=${LDFLAGS}' 'XCFLAGS=${XCFLAGS}' 'BUILDDIR=${S}'"
 do_configure() {
     ${S}/configure --prefix=${prefix} --libdir=${libdir} --libdevdir=${libdir} --mandir=${mandir} --datadir=${datadir} --includedir=${includedir} ${USELIBC}