public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: sys-libs/liburing/files/, sys-libs/liburing/
@ 2021-03-12 15:06 Jory Pratt
  0 siblings, 0 replies; 5+ messages in thread
From: Jory Pratt @ 2021-03-12 15:06 UTC (permalink / raw
  To: gentoo-commits

commit:     a76defdd03f53949133c2a18dec2ec2b8aa07ef6
Author:     Jory Pratt <anarchy <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 12 15:06:33 2021 +0000
Commit:     Jory Pratt <anarchy <AT> gentoo <DOT> org>
CommitDate: Fri Mar 12 15:06:47 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a76defdd

sys-libs/liburing: add support to detect ucontext.h

Closes: https://bugs.gentoo.org/713528
Closes: https://github.com/gentoo/musl/issues/379
Package-Manager: Portage-3.0.17, Repoman-3.0.2
Signed-off-by: Jory Pratt <anarchy <AT> gentoo.org>

 .../files/liburing-0.7-ucontext_h-detection.patch  | 72 ++++++++++++++++++++++
 sys-libs/liburing/liburing-0.7-r1.ebuild           |  6 +-
 2 files changed, 77 insertions(+), 1 deletion(-)

diff --git a/sys-libs/liburing/files/liburing-0.7-ucontext_h-detection.patch b/sys-libs/liburing/files/liburing-0.7-ucontext_h-detection.patch
new file mode 100644
index 00000000000..24b847d919d
--- /dev/null
+++ b/sys-libs/liburing/files/liburing-0.7-ucontext_h-detection.patch
@@ -0,0 +1,72 @@
+From 1cf969dfcba797a02d74540965677b92d3884cfa Mon Sep 17 00:00:00 2001
+From: Simon Zeni <simon@bl4ckb0ne.ca>
+Date: Tue, 27 Oct 2020 22:31:21 -0400
+Subject: [PATCH] examples: disable ucontext-cp if ucontext.h is not available
+
+The header file `ucontext.h` is not available on musl based distros. The
+example `ucontext-cp` is not built if `configure` fails to locate the
+header.
+
+Signed-off-by: Simon Zeni <simon@bl4ckb0ne.ca>
+Signed-off-by: Jens Axboe <axboe@kernel.dk>
+---
+ configure         | 21 +++++++++++++++++++++
+ examples/Makefile |  6 +++++-
+ 2 files changed, 26 insertions(+), 1 deletion(-)
+
+diff --git a/configure b/configure
+index c911f59..3b96cde 100755
+--- a/configure
++++ b/configure
+@@ -287,6 +287,24 @@ if compile_prog_cxx "" "" "C++"; then
+ fi
+ print_config "C++" "$has_cxx"
+ 
++##########################################
++# check for ucontext support
++has_ucontext="no"
++cat > $TMPC << EOF
++#include <ucontext.h>
++int main(int argc, char **argv)
++{
++  ucontext_t ctx;
++  getcontext(&ctx);
++  return 0;
++}
++EOF
++if compile_prog "" "" "has_ucontext"; then
++  has_ucontext="yes"
++fi
++print_config "has_ucontext" "$has_ucontext"
++
++
+ #############################################################################
+ 
+ if test "$__kernel_rwf_t" = "yes"; then
+@@ -304,6 +322,9 @@ fi
+ if test "$has_cxx" = "yes"; then
+   output_sym "CONFIG_HAVE_CXX"
+ fi
++if test "$has_ucontext" = "yes"; then
++  output_sym "CONFIG_HAVE_UCONTEXT"
++fi
+ 
+ echo "CC=$cc" >> $config_host_mak
+ print_config "CC" "$cc"
+diff --git a/examples/Makefile b/examples/Makefile
+index 0eec627..60c1b71 100644
+--- a/examples/Makefile
++++ b/examples/Makefile
+@@ -10,7 +10,11 @@ ifneq ($(MAKECMDGOALS),clean)
+ include ../config-host.mak
+ endif
+ 
+-all_targets += io_uring-test io_uring-cp link-cp ucontext-cp
++all_targets += io_uring-test io_uring-cp link-cp
++
++ifdef CONFIG_HAVE_UCONTEXT
++all_targets += ucontext-cp
++endif
+ 
+ all: $(all_targets)
+ 

diff --git a/sys-libs/liburing/liburing-0.7-r1.ebuild b/sys-libs/liburing/liburing-0.7-r1.ebuild
index dc6b6076077..715212503eb 100644
--- a/sys-libs/liburing/liburing-0.7-r1.ebuild
+++ b/sys-libs/liburing/liburing-0.7-r1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
@@ -21,6 +21,10 @@ IUSE="static-libs"
 # fsync test hangs forever
 RESTRICT="test"
 
+PATCHES=(
+	"${FILESDIR}"/${PN}-0.7-ucontext_h-detection.patch
+)
+
 src_prepare() {
 	default
 	multilib_copy_sources


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-libs/liburing/files/, sys-libs/liburing/
@ 2021-08-19 16:27 Lars Wendler
  0 siblings, 0 replies; 5+ messages in thread
From: Lars Wendler @ 2021-08-19 16:27 UTC (permalink / raw
  To: gentoo-commits

commit:     4d672144f7917d2560fcc053736ab3b001a9675a
Author:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 19 16:26:27 2021 +0000
Commit:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Thu Aug 19 16:27:32 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4d672144

sys-libs/liburing: Revbump to fix version in pkgconfig file

Thanks-to: Florian Schmaus <flow <AT> gentoo.org>
Closes: https://bugs.gentoo.org/809095
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>

 .../liburing/files/liburing-2.0-spec_version.patch | 29 ++++++++++++++++++++++
 ...{liburing-2.0.ebuild => liburing-2.0-r1.ebuild} |  4 +++
 2 files changed, 33 insertions(+)

diff --git a/sys-libs/liburing/files/liburing-2.0-spec_version.patch b/sys-libs/liburing/files/liburing-2.0-spec_version.patch
new file mode 100644
index 00000000000..fab05916c36
--- /dev/null
+++ b/sys-libs/liburing/files/liburing-2.0-spec_version.patch
@@ -0,0 +1,29 @@
+From 1815337f7dbb530ae3e3bc1175d8da214cf76eb5 Mon Sep 17 00:00:00 2001
+From: Stefan Hajnoczi <stefanha@redhat.com>
+Date: Tue, 9 Mar 2021 14:19:12 +0000
+Subject: [PATCH] spec: bump version to 2.0
+
+The shared library is now liburing.so.2 but the pkgconfig and rpm files
+still say 0.7. Existing binaries link against liburing.so.1 and will not
+automatically pick up the new liburing.so.2 shared library.
+
+Update the version number in liburing.spec so
+
+Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
+Link: https://lore.kernel.org/r/20210309141913.262131-2-stefanha@redhat.com
+Signed-off-by: Jens Axboe <axboe@kernel.dk>
+---
+ liburing.spec | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/liburing.spec b/liburing.spec
+index fa4d9704..8607074c 100644
+--- a/liburing.spec
++++ b/liburing.spec
+@@ -1,5 +1,5 @@
+ Name: liburing
+-Version: 0.7
++Version: 2.0
+ Release: 1%{?dist}
+ Summary: Linux-native io_uring I/O access library
+ License: (GPLv2 with exceptions and LGPLv2+) or MIT

diff --git a/sys-libs/liburing/liburing-2.0.ebuild b/sys-libs/liburing/liburing-2.0-r1.ebuild
similarity index 95%
rename from sys-libs/liburing/liburing-2.0.ebuild
rename to sys-libs/liburing/liburing-2.0-r1.ebuild
index 827024e45bc..652b4092a8b 100644
--- a/sys-libs/liburing/liburing-2.0.ebuild
+++ b/sys-libs/liburing/liburing-2.0-r1.ebuild
@@ -21,6 +21,10 @@ IUSE="static-libs"
 # fsync test hangs forever
 RESTRICT="test"
 
+PATCHES=(
+	"${FILESDIR}/${P}-spec_version.patch" #809095
+)
+
 src_prepare() {
 	default
 	multilib_copy_sources


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-libs/liburing/files/, sys-libs/liburing/
@ 2023-02-14  9:43 Florian Schmaus
  0 siblings, 0 replies; 5+ messages in thread
From: Florian Schmaus @ 2023-02-14  9:43 UTC (permalink / raw
  To: gentoo-commits

commit:     a64761335b231d170720819e773fee9199f8044b
Author:     Florian Schmaus <flow <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 14 09:31:45 2023 +0000
Commit:     Florian Schmaus <flow <AT> gentoo <DOT> org>
CommitDate: Tue Feb 14 09:43:02 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a6476133

sys-libs/liburing: backport musl patch, enable tests

Bug: https://bugs.gentoo.org/888956
Signed-off-by: Florian Schmaus <flow <AT> gentoo.org>

 ...remove-error-from-error_h-for-portability.patch | 140 +++++++++++++++++++++
 ...buring-2.3-r2.ebuild => liburing-2.3-r3.ebuild} |  20 ++-
 2 files changed, 158 insertions(+), 2 deletions(-)

diff --git a/sys-libs/liburing/files/liburing-2.3-remove-error-from-error_h-for-portability.patch b/sys-libs/liburing/files/liburing-2.3-remove-error-from-error_h-for-portability.patch
new file mode 100644
index 000000000000..6af48d08aab0
--- /dev/null
+++ b/sys-libs/liburing/files/liburing-2.3-remove-error-from-error_h-for-portability.patch
@@ -0,0 +1,140 @@
+From 11dc64a71558948aef16730cb363e7e5da773a5b Mon Sep 17 00:00:00 2001
+From: Steffen <steffen.winter@proton.me>
+Date: Mon, 13 Feb 2023 17:32:16 +0100
+Subject: [PATCH 1/3] Add custom error function for tests.
+
+On musl systems, liburing cannot build examples and tests due to
+it's usage of error.h. t_error calls fprintf(stderr, ...) and
+exits.
+
+Closes: #786
+
+Signed-off-by: Steffen Winter <steffen.winter@proton.me>
+--- a/test/helpers.c
++++ b/test/helpers.c
+@@ -8,6 +8,7 @@
+ #include <stdio.h>
+ #include <fcntl.h>
+ #include <unistd.h>
++#include <stdarg.h>
+ #include <sys/types.h>
+ 
+ #include <arpa/inet.h>
+@@ -300,3 +301,20 @@ unsigned __io_uring_flush_sq(struct io_uring *ring)
+ 	 */
+ 	return tail - *sq->khead;
+ }
++
++/*
++ * Implementation of error(3), prints an error message and exits.
++ */
++void t_error(int status, int errnum, const char *format, ...)
++{
++	va_list args;
++    	va_start(args, format);
++
++	vfprintf(stderr, format, args);
++    	if (errnum)
++        	fprintf(stderr, ": %s", strerror(errnum));
++
++	fprintf(stderr, "\n");
++	va_end(args);
++    	exit(status);
++}
+--- a/test/helpers.h
++++ b/test/helpers.h
+@@ -89,6 +89,8 @@ unsigned __io_uring_flush_sq(struct io_uring *ring);
+ 
+ #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
+ 
++void t_error(int status, int errnum, const char *format, ...);
++
+ #ifdef __cplusplus
+ }
+ #endif
+
+From 3b0b4976d7da2e4616fe860fb7a8e52d88d4523b Mon Sep 17 00:00:00 2001
+From: Steffen <steffen.winter@proton.me>
+Date: Mon, 13 Feb 2023 17:56:03 +0100
+Subject: [PATCH 2/3] test: Use t_error instead of glibc's error.
+
+On musl systems, liburing cannot build examples and tests due to
+it's usage of error.h. Replacing calls to error() with t_error().
+
+Closes: #786
+
+Signed-off-by: Steffen Winter <steffen.winter@proton.me>
+--- a/test/defer-taskrun.c
++++ b/test/defer-taskrun.c
+@@ -4,7 +4,6 @@
+ #include <unistd.h>
+ #include <stdlib.h>
+ #include <string.h>
+-#include <error.h>
+ #include <sys/eventfd.h>
+ #include <signal.h>
+ #include <poll.h>
+--- a/test/single-issuer.c
++++ b/test/single-issuer.c
+@@ -5,7 +5,6 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <fcntl.h>
+-#include <error.h>
+ #include <sys/types.h>
+ #include <sys/wait.h>
+ 
+@@ -56,13 +55,13 @@ static int try_submit(struct io_uring *ring)
+ 		return ret;
+ 
+ 	if (ret != 1)
+-		error(1, ret, "submit %i", ret);
++		t_error(1, ret, "submit %i", ret);
+ 	ret = io_uring_wait_cqe(ring, &cqe);
+ 	if (ret)
+-		error(1, ret, "wait fail %i", ret);
++		t_error(1, ret, "wait fail %i", ret);
+ 
+ 	if (cqe->res || cqe->user_data != 42)
+-		error(1, ret, "invalid cqe");
++		t_error(1, ret, "invalid cqe");
+ 
+ 	io_uring_cqe_seen(ring, cqe);
+ 	return 0;
+@@ -105,7 +104,7 @@ int main(int argc, char *argv[])
+ 	ret = io_uring_queue_init(8, &ring, IORING_SETUP_SINGLE_ISSUER |
+ 					    IORING_SETUP_R_DISABLED);
+ 	if (ret)
+-		error(1, ret, "ring init (2) %i", ret);
++		t_error(1, ret, "ring init (2) %i", ret);
+ 
+ 	if (!fork_t()) {
+ 		io_uring_enable_rings(&ring);
+@@ -121,7 +120,7 @@ int main(int argc, char *argv[])
+ 	ret = io_uring_queue_init(8, &ring, IORING_SETUP_SINGLE_ISSUER |
+ 					    IORING_SETUP_R_DISABLED);
+ 	if (ret)
+-		error(1, ret, "ring init (3) %i", ret);
++		t_error(1, ret, "ring init (3) %i", ret);
+ 
+ 	io_uring_enable_rings(&ring);
+ 	if (!fork_t()) {
+@@ -136,7 +135,7 @@ int main(int argc, char *argv[])
+ 	/* test that anyone can submit to a SQPOLL|SINGLE_ISSUER ring */
+ 	ret = io_uring_queue_init(8, &ring, IORING_SETUP_SINGLE_ISSUER|IORING_SETUP_SQPOLL);
+ 	if (ret)
+-		error(1, ret, "ring init (4) %i", ret);
++		t_error(1, ret, "ring init (4) %i", ret);
+ 
+ 	ret = try_submit(&ring);
+ 	if (ret) {
+@@ -156,7 +155,7 @@ int main(int argc, char *argv[])
+ 	/* test that IORING_ENTER_REGISTERED_RING doesn't break anything */
+ 	ret = io_uring_queue_init(8, &ring, IORING_SETUP_SINGLE_ISSUER);
+ 	if (ret)
+-		error(1, ret, "ring init (5) %i", ret);
++		t_error(1, ret, "ring init (5) %i", ret);
+ 
+ 	if (!fork_t()) {
+ 		ret = try_submit(&ring);
+

diff --git a/sys-libs/liburing/liburing-2.3-r2.ebuild b/sys-libs/liburing/liburing-2.3-r3.ebuild
similarity index 79%
rename from sys-libs/liburing/liburing-2.3-r2.ebuild
rename to sys-libs/liburing/liburing-2.3-r3.ebuild
index 2140c9daaf91..f599513579c9 100644
--- a/sys-libs/liburing/liburing-2.3-r2.ebuild
+++ b/sys-libs/liburing/liburing-2.3-r3.ebuild
@@ -19,7 +19,7 @@ SLOT="0/2" # liburing.so major version
 
 IUSE="examples static-libs test"
 # fsync test hangs forever
-RESTRICT="test !test? ( test )"
+RESTRICT="!test? ( test )"
 
 # At least installed headers need <linux/*>, bug #802516
 DEPEND=">=sys-kernel/linux-headers-5.1"
@@ -28,6 +28,8 @@ RDEPEND="${DEPEND}"
 PATCHES=(
 	# https://bugs.gentoo.org/891633
 	"${FILESDIR}/${PN}-2.3-liburing.map-Export-io_uring_-enable_rings-register_.patch"
+	# https://github.com/axboe/liburing/pull/787
+	"${FILESDIR}/${PN}-2.3-remove-error-from-error_h-for-portability.patch"
 )
 
 src_prepare() {
@@ -75,5 +77,19 @@ multilib_src_install_all() {
 }
 
 multilib_src_test() {
-	emake V=1 runtests
+	local disabled_tests=(
+		accept.c
+		fpos.c
+		io_uring_register.c
+		link-timeout.c
+		read-before-exit.c
+		recv-msgall-stream.c
+	)
+	local disabled_test
+	for disabled_test in "${disabled_tests[@]}"; do
+		sed -i "/\s*${disabled_test}/d" test/Makefile \
+			|| die "Failed to remove ${disabled_test}"
+	done
+
+	emake -C test V=1 runtests
 }


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-libs/liburing/files/, sys-libs/liburing/
@ 2023-12-16  8:24 Sam James
  0 siblings, 0 replies; 5+ messages in thread
From: Sam James @ 2023-12-16  8:24 UTC (permalink / raw
  To: gentoo-commits

commit:     1d5c3a0c47948fc5ea7a26a8db9be37806668a41
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 16 08:04:23 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Dec 16 08:23:54 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1d5c3a0c

sys-libs/liburing: fix lld 17 build

Closes: https://bugs.gentoo.org/919780
Signed-off-by: Sam James <sam <AT> gentoo.org>

 sys-libs/liburing/files/liburing-2.5-lld-17.patch | 26 +++++++
 sys-libs/liburing/liburing-2.5-r1.ebuild          | 87 +++++++++++++++++++++++
 2 files changed, 113 insertions(+)

diff --git a/sys-libs/liburing/files/liburing-2.5-lld-17.patch b/sys-libs/liburing/files/liburing-2.5-lld-17.patch
new file mode 100644
index 000000000000..1e31f94959b1
--- /dev/null
+++ b/sys-libs/liburing/files/liburing-2.5-lld-17.patch
@@ -0,0 +1,26 @@
+https://bugs.gentoo.org/919780
+https://github.com/axboe/liburing/commit/92b21aa1b4ea98e322c5eca9db1d94b837f4be75
+
+(Rebased.)
+
+From 92b21aa1b4ea98e322c5eca9db1d94b837f4be75 Mon Sep 17 00:00:00 2001
+From: Jens Axboe <axboe@kernel.dk>
+Date: Mon, 11 Dec 2023 13:14:54 -0700
+Subject: [PATCH] Rename ffi io_uring_prep_sock_cmd _> io_uring_prep_cmd_sock()
+
+The non-ffi versions already use this name, and to make this as painless
+as it can be, rename the ffi version even though it is technically
+the better one. The documentation also matches prep_cmd_sock().
+
+Link: https://github.com/axboe/liburing/issues/1013
+Fixes: 2459fef09411 ("io_uring_prep_cmd: Create a new helper for command ops")
+Signed-off-by: Jens Axboe <axboe@kernel.dk>
+--- a/src/liburing-ffi.map
++++ b/src/liburing-ffi.map
+@@ -179,5 +179,5 @@ LIBURING_2.4 {
+ LIBURING_2.5 {
+ 	global:
+ 		io_uring_queue_init_mem;
+-		io_uring_prep_sock_cmd;
++		io_uring_prep_cmd_sock;
+ } LIBURING_2.4;

diff --git a/sys-libs/liburing/liburing-2.5-r1.ebuild b/sys-libs/liburing/liburing-2.5-r1.ebuild
new file mode 100644
index 000000000000..14dd58f7e6f6
--- /dev/null
+++ b/sys-libs/liburing/liburing-2.5-r1.ebuild
@@ -0,0 +1,87 @@
+# Copyright 1999-2023 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 ~loong ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+	QA_PKGCONFIG_VERSION=${PV}
+fi
+LICENSE="MIT"
+SLOT="0/2" # liburing.so major version
+
+IUSE="examples static-libs test"
+# fsync test hangs forever
+RESTRICT="!test? ( test )"
+
+# At least installed headers need <linux/*>, bug #802516
+DEPEND=">=sys-kernel/linux-headers-5.1"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+	"${FILESDIR}"/${P}-lld-17.patch
+)
+
+src_prepare() {
+	default
+
+	if ! use examples; then
+		sed -e '/examples/d' Makefile -i || die
+	fi
+	if ! use test; then
+		sed -e '/test/d' Makefile -i || 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)"
+		--cxx="$(tc-getCXX)"
+	)
+	# No autotools configure! "econf" will fail.
+	TMPDIR="${T}" ./configure "${myconf[@]}" || die
+}
+
+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() {
+	local disabled_tests=(
+		accept.c
+		fpos.c
+		io_uring_register.c
+		link-timeout.c
+		read-before-exit.c
+		recv-msgall-stream.c
+	)
+	local disabled_test
+	for disabled_test in "${disabled_tests[@]}"; do
+		sed -i "/\s*${disabled_test}/d" test/Makefile \
+			|| die "Failed to remove ${disabled_test}"
+	done
+
+	emake -C test V=1 runtests
+}


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-libs/liburing/files/, sys-libs/liburing/
@ 2023-12-19 18:01 Florian Schmaus
  0 siblings, 0 replies; 5+ messages in thread
From: Florian Schmaus @ 2023-12-19 18:01 UTC (permalink / raw
  To: gentoo-commits

commit:     25c754248c86b71962eaf1f9aa363c1fac5f12d2
Author:     Violet Purcell <vimproved <AT> inventati <DOT> org>
AuthorDate: Tue Dec 19 14:17:08 2023 +0000
Commit:     Florian Schmaus <flow <AT> gentoo <DOT> org>
CommitDate: Tue Dec 19 18:01:06 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=25c75424

sys-libs/liburing: backport fix for building without libgcc

Since 2.4, liburing has been building in its nolibc configuration for
arm64, x86, and amd64. Since 2.5, in this configuration, it explicitly
links to -lgcc. This commit backports a patch that removes the explicit
-lgcc link and replaces it with the output of cc
-print-libgcc-file-name, which fixes building on LLVM-only systems.

Upstream-Commit: https://github.com/axboe/liburing/commit/09b8ded9686f33f1044ad8c612f2281b865cd314
Signed-off-by: Violet Purcell <vimproved <AT> inventati.org>
Closes: https://github.com/gentoo/gentoo/pull/34369
Signed-off-by: Florian Schmaus <flow <AT> gentoo.org>

 .../liburing-2.5-print-libgcc-file-name.patch      | 43 +++++++++++
 sys-libs/liburing/liburing-2.5-r2.ebuild           | 88 ++++++++++++++++++++++
 2 files changed, 131 insertions(+)

diff --git a/sys-libs/liburing/files/liburing-2.5-print-libgcc-file-name.patch b/sys-libs/liburing/files/liburing-2.5-print-libgcc-file-name.patch
new file mode 100644
index 000000000000..bedc6897b901
--- /dev/null
+++ b/sys-libs/liburing/files/liburing-2.5-print-libgcc-file-name.patch
@@ -0,0 +1,43 @@
+From https://github.com/axboe/liburing/commit/09b8ded9686f33f1044ad8c612f2281b865cd314 Mon Sep 17 00:00:00 2001
+From: Violet Purcell <vimproved@inventati.org>
+Date: Sat, 16 Dec 2023 16:17:09 -0500
+Subject: [PATCH] Link against libgcc based on output of
+ -print-libgcc-file-name
+
+GCC and clang have the -print-libgcc-file-name option to automatically
+print out the correct compiler runtime library to link to. This can be
+helpful in case the runtime library is named something other than libgcc
+(i.e. on a system where only LLVM's compiler-rt is used), or if libgcc
+is in a non-standard directory. If the option fails for whatever reason,
+fall back to using "-lgcc".
+
+Signed-off-by: Violet Purcell <vimproved@inventati.org>
+--- a/configure
++++ b/configure
+@@ -202,6 +202,15 @@ print_and_output_mak "relativelibdir" "$relativelibdir"
+ print_and_output_mak "mandir" "$mandir"
+ print_and_output_mak "datadir" "$datadir"
+ 
++####################################################
++# Check for correct compiler runtime library to link with
++libgcc_link_flag="-lgcc"
++if $cc -print-libgcc-file-name >/dev/null 2>&1; then
++  libgcc_link_flag="$($cc $CFLAGS $LDFLAGS -print-libgcc-file-name)"
++fi
++print_and_output_mak "libgcc_link_flag" "$libgcc_link_flag"
++####################################################
++
+ ##########################################
+ # check for compiler -Wstringop-overflow
+ stringop_overflow="no"
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -47,7 +47,7 @@ ifeq ($(CONFIG_NOLIBC),y)
+ 	liburing_srcs += nolibc.c
+ 	override CFLAGS += -nostdlib -nodefaultlibs -ffreestanding -fno-builtin -fno-stack-protector
+ 	override CPPFLAGS += -nostdlib -nodefaultlibs -ffreestanding -fno-builtin -fno-stack-protector
+-	override LINK_FLAGS += -nostdlib -nodefaultlibs -lgcc
++	override LINK_FLAGS += -nostdlib -nodefaultlibs $(libgcc_link_flag)
+ endif
+ 
+ override CPPFLAGS += -MT "$@" -MMD -MP -MF "$@.d"

diff --git a/sys-libs/liburing/liburing-2.5-r2.ebuild b/sys-libs/liburing/liburing-2.5-r2.ebuild
new file mode 100644
index 000000000000..29f679d0a2da
--- /dev/null
+++ b/sys-libs/liburing/liburing-2.5-r2.ebuild
@@ -0,0 +1,88 @@
+# Copyright 1999-2023 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 ~loong ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+	QA_PKGCONFIG_VERSION=${PV}
+fi
+LICENSE="MIT"
+SLOT="0/2" # liburing.so major version
+
+IUSE="examples static-libs test"
+# fsync test hangs forever
+RESTRICT="!test? ( test )"
+
+# At least installed headers need <linux/*>, bug #802516
+DEPEND=">=sys-kernel/linux-headers-5.1"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+	"${FILESDIR}"/${P}-lld-17.patch
+	"${FILESDIR}"/${P}-print-libgcc-file-name.patch
+)
+
+src_prepare() {
+	default
+
+	if ! use examples; then
+		sed -e '/examples/d' Makefile -i || die
+	fi
+	if ! use test; then
+		sed -e '/test/d' Makefile -i || 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)"
+		--cxx="$(tc-getCXX)"
+	)
+	# No autotools configure! "econf" will fail.
+	TMPDIR="${T}" ./configure "${myconf[@]}" || die
+}
+
+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() {
+	local disabled_tests=(
+		accept.c
+		fpos.c
+		io_uring_register.c
+		link-timeout.c
+		read-before-exit.c
+		recv-msgall-stream.c
+	)
+	local disabled_test
+	for disabled_test in "${disabled_tests[@]}"; do
+		sed -i "/\s*${disabled_test}/d" test/Makefile \
+			|| die "Failed to remove ${disabled_test}"
+	done
+
+	emake -C test V=1 runtests
+}


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-12-19 18:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-12 15:06 [gentoo-commits] repo/gentoo:master commit in: sys-libs/liburing/files/, sys-libs/liburing/ Jory Pratt
  -- strict thread matches above, loose matches on Subject: below --
2021-08-19 16:27 Lars Wendler
2023-02-14  9:43 Florian Schmaus
2023-12-16  8:24 Sam James
2023-12-19 18:01 Florian Schmaus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox