diff --git a/0001-enable-libc.patch b/0001-enable-libc.patch new file mode 100644 index 0000000000000000000000000000000000000000..ddee0882fdbb7dc2f8b6eeb6b5e6d928c27b5ce5 --- /dev/null +++ b/0001-enable-libc.patch @@ -0,0 +1,22 @@ +diff --git a/configure b/configure +index 28f3eb0..9f7cff4 100755 +--- a/configure ++++ b/configure +@@ -413,9 +413,15 @@ int main(void){ + #endif + } + EOF +-if compile_prog "" "" "nolibc support"; then +- liburing_nolibc="yes" +-fi ++# Temporarily disable nolibc because false positives exist and compilation may ++# fail later. The issue is that compile_prog does not use the CFLAGS modified ++# for nolibc, so it cannot detect when nolibc won't work (e.g. due to the gcc ++# stack protector requiring __stack_chk_fail_local from libc on i686). ++# ++# if compile_prog "" "" "nolibc support"; then ++# liburing_nolibc="yes" ++# fi ++liburing_nolibc="no" + print_config "nolibc support" "$liburing_nolibc"; + ############################################################################# diff --git a/0001-examples-ucontext-cp.c-cope-with-variable-SIGSTKSZ.patch b/0001-examples-ucontext-cp.c-cope-with-variable-SIGSTKSZ.patch deleted file mode 100644 index b821d4e56f75d5056485b0a2f20a349d08c2808d..0000000000000000000000000000000000000000 --- a/0001-examples-ucontext-cp.c-cope-with-variable-SIGSTKSZ.patch +++ /dev/null @@ -1,77 +0,0 @@ -From 8aac320ae8445c5434ab3be1761414a5247e5d42 Mon Sep 17 00:00:00 2001 -From: Stefan Hajnoczi -Date: Tue, 13 Apr 2021 16:03:19 +0100 -Subject: examples/ucontext-cp.c: cope with variable SIGSTKSZ -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -The size of C arrays at file scope must be constant. The following -compiler error occurs with recent upstream glibc (2.33.9000): - - CC ucontext-cp - ucontext-cp.c:31:23: error: variably modified ‘stack_buf’ at file scope - 31 | unsigned char stack_buf[SIGSTKSZ]; - | ^~~~~~~~~ - make[1]: *** [Makefile:26: ucontext-cp] Error 1 - -The following glibc commit changed SIGSTKSZ from a constant value to a -variable: - - commit 6c57d320484988e87e446e2e60ce42816bf51d53 - Author: H.J. Lu - Date: Mon Feb 1 11:00:38 2021 -0800 - - sysconf: Add _SC_MINSIGSTKSZ/_SC_SIGSTKSZ [BZ #20305] - ... - +# define SIGSTKSZ sysconf (_SC_SIGSTKSZ) - -Allocate the stack buffer explicitly to avoid declaring an array at file -scope. - -Cc: H.J. Lu -Signed-off-by: Stefan Hajnoczi -Signed-off-by: Jens Axboe ---- - examples/ucontext-cp.c | 12 +++++++++--- - 1 file changed, 9 insertions(+), 3 deletions(-) - -diff --git a/examples/ucontext-cp.c b/examples/ucontext-cp.c -index 0b2a6b5..ea0c934 100644 ---- a/examples/ucontext-cp.c -+++ b/examples/ucontext-cp.c -@@ -28,7 +28,7 @@ - - typedef struct { - struct io_uring *ring; -- unsigned char stack_buf[SIGSTKSZ]; -+ unsigned char *stack_buf; - ucontext_t ctx_main, ctx_fnew; - } async_context; - -@@ -115,8 +115,13 @@ static int setup_context(async_context *pctx, struct io_uring *ring) - perror("getcontext"); - return -1; - } -- pctx->ctx_fnew.uc_stack.ss_sp = &pctx->stack_buf; -- pctx->ctx_fnew.uc_stack.ss_size = sizeof(pctx->stack_buf); -+ pctx->stack_buf = malloc(SIGSTKSZ); -+ if (!pctx->stack_buf) { -+ perror("malloc"); -+ return -1; -+ } -+ pctx->ctx_fnew.uc_stack.ss_sp = pctx->stack_buf; -+ pctx->ctx_fnew.uc_stack.ss_size = SIGSTKSZ; - pctx->ctx_fnew.uc_link = &pctx->ctx_main; - - return 0; -@@ -174,6 +179,7 @@ static void copy_file_wrapper(arguments_bundle *pbundle) - free(iov.iov_base); - close(pbundle->infd); - close(pbundle->outfd); -+ free(pbundle->pctx->stack_buf); - free(pbundle->pctx); - free(pbundle); - --- -cgit v1.2.3 diff --git a/liburing-0.7.tar.gz b/liburing-0.7.tar.gz deleted file mode 100644 index 031087779398d6a8ee8f16df6d430d5e0263d0f3..0000000000000000000000000000000000000000 Binary files a/liburing-0.7.tar.gz and /dev/null differ diff --git a/liburing-2.4.tar.gz b/liburing-2.4.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..4ef8d898017a5ed9fb1eed81ebb05b8a1854b3ec Binary files /dev/null and b/liburing-2.4.tar.gz differ diff --git a/liburing-Add-sw64-architecture.patch b/liburing-Add-sw64-architecture.patch deleted file mode 100644 index 1eca2a10b2d2122012a73f17a6fbf4f94a5bbcd9..0000000000000000000000000000000000000000 --- a/liburing-Add-sw64-architecture.patch +++ /dev/null @@ -1,38 +0,0 @@ -From d09c9df44e060a648640738bbb12f74f84437643 Mon Sep 17 00:00:00 2001 -From: wzx -Date: Thu, 10 Nov 2022 14:47:45 +0800 -Subject: [PATCH] Add sw64 architecture - -Add sw64 architecture in src/syscall.c to support sw64 architecture. - -Signed-off-by: wzx ---- - src/syscall.c | 12 +++++++++++- - 1 file changed, 11 insertions(+), 1 deletion(-) - -diff --git a/src/syscall.c b/src/syscall.c -index c41e099..ea7a69f 100644 ---- a/src/syscall.c -+++ b/src/syscall.c -@@ -24,7 +24,17 @@ - # ifndef __NR_io_uring_register - # define __NR_io_uring_register 537 - # endif --#else /* !__alpha__ */ -+#elif defined __sw_64__ -+# ifndef __NR_io_uring_setup -+# define __NR_io_uring_setup 272 -+# endif -+# ifndef __NR_io_uring_enter -+# define __NR_io_uring_enter 273 -+# endif -+# ifndef __NR_io_uring_register -+# define __NR_io_uring_register 274 -+# endif -+#else /* !__alpha__ && !__sw_64__*/ - # ifndef __NR_io_uring_setup - # define __NR_io_uring_setup 425 - # endif --- -2.33.0 - diff --git a/liburing.spec b/liburing.spec index 8ae843d4d940be893afdd65d676358f39d9f11b8..1196acb9db02f50fc2998a31d9b78047843a50c6 100644 --- a/liburing.spec +++ b/liburing.spec @@ -1,14 +1,15 @@ Name: liburing -Version: 0.7 -Release: 3 +Version: 2.4 +Release: 1 Summary: Linux-native io_uring I/O access library License: (GPLv2 with exceptions and LGPLv2+) or MIT Source0: https://brick.kernel.dk/snaps/%{name}-%{version}.tar.gz URL: https://git.kernel.dk/cgit/liburing/ BuildRequires: gcc +BuildRequires: gcc-c++ +BuildRequires: make -Patch1: 0001-examples-ucontext-cp.c-cope-with-variable-SIGSTKSZ.patch -Patch2: liburing-Add-sw64-architecture.patch +Patch1: 0001-enable-libc.patch %description Provides native async IO for the Linux kernel, in a fast and efficient @@ -37,17 +38,25 @@ for the Linux-native io_uring. %files %attr(0755,root,root) %{_libdir}/liburing.so.* +%attr(0755,root,root) %{_libdir}/liburing-ffi.so.* %license COPYING %files devel %{_includedir}/liburing/ %{_includedir}/liburing.h %{_libdir}/liburing.so +%{_libdir}/liburing-ffi.so %exclude %{_libdir}/liburing.a +%exclude %{_libdir}/liburing-ffi.a %{_libdir}/pkgconfig/* %{_mandir}/man2/* +%{_mandir}/man3/* +%{_mandir}/man7/* %changelog +* Mon Mar 31 2025 yangchen - 2.4-1 +- Update to liburing 2.4 + * Fri Oct 21 2022 wuzx - 0.7-3 - add sw64 patch