From 45ab816b66220708c1e2beeb8fe2b2da91c99566 Mon Sep 17 00:00:00 2001 From: Krzesimir Nowak Date: Wed, 9 Mar 2022 20:11:11 +0100 Subject: [PATCH] sys-libs/liburing: Sync with gentoo It's from gentoo commit 31e437d5c46c16b4f86e255561b41dba9dbfba04. --- .../portage-stable/sys-libs/liburing/Manifest | 2 +- .../files/liburing-2.1-arm-syscall.patch | 54 +++++++++++++++ .../sys-libs/liburing/liburing-2.1-r1.ebuild | 67 +++++++++++++++++++ ...ing-0.7-r1.ebuild => liburing-9999.ebuild} | 22 ++++-- .../sys-libs/liburing/metadata.xml | 2 +- 5 files changed, 140 insertions(+), 7 deletions(-) create mode 100644 sdk_container/src/third_party/portage-stable/sys-libs/liburing/files/liburing-2.1-arm-syscall.patch create mode 100644 sdk_container/src/third_party/portage-stable/sys-libs/liburing/liburing-2.1-r1.ebuild rename sdk_container/src/third_party/portage-stable/sys-libs/liburing/{liburing-0.7-r1.ebuild => liburing-9999.ebuild} (62%) diff --git a/sdk_container/src/third_party/portage-stable/sys-libs/liburing/Manifest b/sdk_container/src/third_party/portage-stable/sys-libs/liburing/Manifest index 90602b3316..397baaaf05 100644 --- a/sdk_container/src/third_party/portage-stable/sys-libs/liburing/Manifest +++ b/sdk_container/src/third_party/portage-stable/sys-libs/liburing/Manifest @@ -1 +1 @@ -DIST liburing-0.7.tar.bz2 86386 BLAKE2B a4fa00cc8e384f9909f3c628d479774beaffd5ab09c9f321ef22bfbabd273e4c8d4dbb30a3280633e89e1a79e893348e68f0aa2f3b1b4deda56759f77d9b1875 SHA512 9a23bc08e0fa59273264295859dddbe3276b2911df6d937b3c6f7647a250a3175222b5f051f3094efc98e48cacd242511327c5c5b895ebde10c8c87929ba4328 +DIST liburing-2.1.tar.bz2 120806 BLAKE2B 3a09d1504150ed1c111f064187d868fd86ec7c3dbf661f73999f7fbb9c945b528f7ab2e0cfff5d270a1a977f04deedc7c790b6df8708ef2884fbf28c1a9ffd1b SHA512 a658454869b01752b5e499c4f0b50c342a8ff63b3dd1a473a96f9fad03f22a6e4d2354b0e658a4e7e50ea27440a84ee274856b3687803583bc80cb4bc45aec71 diff --git a/sdk_container/src/third_party/portage-stable/sys-libs/liburing/files/liburing-2.1-arm-syscall.patch b/sdk_container/src/third_party/portage-stable/sys-libs/liburing/files/liburing-2.1-arm-syscall.patch new file mode 100644 index 0000000000..a652b05214 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/sys-libs/liburing/files/liburing-2.1-arm-syscall.patch @@ -0,0 +1,54 @@ +https://github.com/axboe/liburing/commit/cb350a8989adbd65db574325d9a86d5437d800da +https://bugs.gentoo.org/816798 + +From cb350a8989adbd65db574325d9a86d5437d800da Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Mon, 13 Sep 2021 23:56:08 +0200 +Subject: [PATCH] test: Use syscall wrappers instead of using syscall(2) + directly + +Some of these syscalls have different entry points depending on the +architecture. Use the wrappers to avoid having to reimplement them +portably. + +Fixes build failures on Debian armel and armhf builds. + +Signed-off-by: Guillem Jover +--- a/test/sqpoll-cancel-hang.c ++++ b/test/sqpoll-cancel-hang.c +@@ -4,7 +4,6 @@ + #include + #include + #include +-#include + #include + #include + #include +@@ -29,8 +28,6 @@ static uint64_t current_time_ms(void) + + #define IORING_OFF_SQES 0x10000000ULL + +-#define sys_io_uring_setup 425 +- + static void kill_and_wait(int pid, int* status) + { + kill(-pid, SIGKILL); +@@ -53,7 +50,7 @@ a5) + void* vma2 = (void*)a3; + void** ring_ptr_out = (void**)a4; + void** sqes_ptr_out = (void**)a5; +- uint32_t fd_io_uring = syscall(sys_io_uring_setup, entries, setup_params); ++ uint32_t fd_io_uring = __sys_io_uring_setup(entries, setup_params); + uint32_t sq_ring_sz = setup_params->sq_off.array + + setup_params->sq_entries * sizeof(uint32_t); + uint32_t cq_ring_sz = setup_params->cq_off.cqes + +@@ -135,7 +132,7 @@ void trigger_bug(void) + } + int main(void) + { +- syscall(__NR_mmap, 0x20000000ul, 0x1000000ul, 7ul, 0x32ul, -1, 0ul); ++ mmap((void *)0x20000000ul, 0x1000000ul, 7ul, 0x32ul, -1, 0ul); + int pid = fork(); + if (pid < 0) + exit(1); + diff --git a/sdk_container/src/third_party/portage-stable/sys-libs/liburing/liburing-2.1-r1.ebuild b/sdk_container/src/third_party/portage-stable/sys-libs/liburing/liburing-2.1-r1.ebuild new file mode 100644 index 0000000000..ae14b067cb --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/sys-libs/liburing/liburing-2.1-r1.ebuild @@ -0,0 +1,67 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit multilib-minimal toolchain-funcs + +DESCRIPTION="Efficient I/O with io_uring" +HOMEPAGE="https://github.com/axboe/liburing" +if [[ "${PV}" == *9999 ]] ; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/axboe/liburing.git" +else + SRC_URI="https://git.kernel.dk/cgit/${PN}/snapshot/${P}.tar.bz2" + KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ppc ppc64 ~riscv sparc x86" +fi +LICENSE="MIT" +SLOT="0/2" # liburing.so major version + +IUSE="static-libs" +# fsync test hangs forever +RESTRICT="test" + +PATCHES=( + # Upstream, bug #816798 + "${FILESDIR}"/${P}-arm-syscall.patch +) + +src_prepare() { + default + + if [[ "${PV}" != *9999 ]] ; then + # Make sure pkgconfig files contain the correct version + # bug #809095 and #833895 + sed -i "/^Version:/s@[[:digit:]\.]\+@${PV}@" ${PN}.spec || die + fi + + multilib_copy_sources +} + +multilib_src_configure() { + local myconf=( + --prefix="${EPREFIX}/usr" + --libdir="${EPREFIX}/usr/$(get_libdir)" + --libdevdir="${EPREFIX}/usr/$(get_libdir)" + --mandir="${EPREFIX}/usr/share/man" + --cc="$(tc-getCC)" + ) + # No autotools configure! "econf" will fail. + TMPDIR="${T}" ./configure "${myconf[@]}" +} + +multilib_src_compile() { + emake V=1 AR="$(tc-getAR)" RANLIB="$(tc-getRANLIB)" +} + +multilib_src_install_all() { + einstalldocs + + if ! use static-libs ; then + find "${ED}" -type f -name "*.a" -delete || die + fi +} + +multilib_src_test() { + emake V=1 runtests +} diff --git a/sdk_container/src/third_party/portage-stable/sys-libs/liburing/liburing-0.7-r1.ebuild b/sdk_container/src/third_party/portage-stable/sys-libs/liburing/liburing-9999.ebuild similarity index 62% rename from sdk_container/src/third_party/portage-stable/sys-libs/liburing/liburing-0.7-r1.ebuild rename to sdk_container/src/third_party/portage-stable/sys-libs/liburing/liburing-9999.ebuild index c349d80f97..c7427bfe9a 100644 --- a/sdk_container/src/third_party/portage-stable/sys-libs/liburing/liburing-0.7-r1.ebuild +++ b/sdk_container/src/third_party/portage-stable/sys-libs/liburing/liburing-9999.ebuild @@ -1,16 +1,21 @@ -# Copyright 1999-2020 Gentoo Authors +# Copyright 1999-2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -EAPI=7 +EAPI=8 inherit multilib-minimal toolchain-funcs DESCRIPTION="Efficient I/O with io_uring" HOMEPAGE="https://github.com/axboe/liburing" -SRC_URI="https://git.kernel.dk/cgit/${PN}/snapshot/${P}.tar.bz2" -KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~ppc ppc64 sparc x86" +if [[ "${PV}" == *9999 ]] ; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/axboe/liburing.git" +else + SRC_URI="https://git.kernel.dk/cgit/${PN}/snapshot/${P}.tar.bz2" + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~riscv ~sparc ~x86" +fi LICENSE="MIT" -SLOT="0/1.0.7" # liburing.so version +SLOT="0/2" # liburing.so major version IUSE="static-libs" # fsync test hangs forever @@ -18,6 +23,13 @@ RESTRICT="test" src_prepare() { default + + if [[ "${PV}" != *9999 ]] ; then + # Make sure pkgconfig files contain the correct version + # bug #809095 and #833895 + sed -i "/^Version:/s@[[:digit:]\.]\+@${PV}@" ${PN}.spec || die + fi + multilib_copy_sources } diff --git a/sdk_container/src/third_party/portage-stable/sys-libs/liburing/metadata.xml b/sdk_container/src/third_party/portage-stable/sys-libs/liburing/metadata.xml index e9a23bab52..52230348c9 100644 --- a/sdk_container/src/third_party/portage-stable/sys-libs/liburing/metadata.xml +++ b/sdk_container/src/third_party/portage-stable/sys-libs/liburing/metadata.xml @@ -1,5 +1,5 @@ - + polynomial-c@gentoo.org