commit: 0564906652c69469deab2b7814bb4736d7be5881 Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org> AuthorDate: Sun Aug 4 16:16:13 2024 +0000 Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org> CommitDate: Sun Aug 4 16:17:21 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=05649066
sys-apps/iproute2: fix build on musl Closes: https://bugs.gentoo.org/936234 Closes: https://bugs.gentoo.org/926341 Closes: https://github.com/gentoo/gentoo/pull/37658 Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org> .../iproute2/files/iproute2-6.10.0-musl-1.patch | 41 +++++++++++++++++++++ .../iproute2/files/iproute2-6.10.0-musl-2.patch | 43 ++++++++++++++++++++++ sys-apps/iproute2/iproute2-6.10.0.ebuild | 2 + 3 files changed, 86 insertions(+) diff --git a/sys-apps/iproute2/files/iproute2-6.10.0-musl-1.patch b/sys-apps/iproute2/files/iproute2-6.10.0-musl-1.patch new file mode 100644 index 000000000000..c1b7788debdc --- /dev/null +++ b/sys-apps/iproute2/files/iproute2-6.10.0-musl-1.patch @@ -0,0 +1,41 @@ +From fbbe03cbc4fa8c801967aac2e2c444e93b2ca96a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= <[email protected]> +Date: Sun, 4 Aug 2024 16:22:07 +0200 +Subject: [PATCH 1/2] libnetlink.h: Include <endian.h> explicitly for musl +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The code added in "f_flower: implement pfcp opts" uses h2be64, +defined in endian.h. While this is pulled in around some corners +for glibc (see below), that's not the case for musl and an +explicit include is required there. + +. /usr/include/libmnl/libmnl.h +.. /usr/include/sys/socket.h +... /usr/include/bits/socket.h +.... /usr/include/sys/types.h +..... /usr/include/endian.h + +Fixes: 976dca372 ("f_flower: implement pfcp opts") +Bug: https://bugs.gentoo.org/936234 +Signed-off-by: Andreas K. Hüttel <[email protected]> +--- + include/libnetlink.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/include/libnetlink.h b/include/libnetlink.h +index 30f0c2d2..7074e913 100644 +--- a/include/libnetlink.h ++++ b/include/libnetlink.h +@@ -4,6 +4,7 @@ + + #include <stdio.h> + #include <string.h> ++#include <endian.h> + #include <asm/types.h> + #include <linux/netlink.h> + #include <linux/rtnetlink.h> +-- +2.44.2 + diff --git a/sys-apps/iproute2/files/iproute2-6.10.0-musl-2.patch b/sys-apps/iproute2/files/iproute2-6.10.0-musl-2.patch new file mode 100644 index 000000000000..11764be0964d --- /dev/null +++ b/sys-apps/iproute2/files/iproute2-6.10.0-musl-2.patch @@ -0,0 +1,43 @@ +From 40a430cf13876120416d82d581745033d273576c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= <[email protected]> +Date: Sun, 4 Aug 2024 17:47:35 +0200 +Subject: [PATCH 2/2] rdma.c: Add <libgen.h> include for basename on musl +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This include file is required on musl for availability of basename. + +Note that for glibc adding the include can have the side effect of +switching from the GNU implementation of basename (which does not touch +its argument) to the POSIX implementation (which under certain +circumstances modifies the string passed to it, e.g. removing trailing +slashes). + +This is safe however since the C99 and C11 standard says: +> The parameters argc and argv and the strings pointed to by the argv +> array shall be modifiable by the program, and retain their last-stored +> values between program startup and program termination. +(multiple google results, unfortunately no official reference link) + +Bug: https://bugs.gentoo.org/926341 +Signed-off-by: Andreas K. Hüttel <[email protected]> +--- + rdma/rdma.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/rdma/rdma.c b/rdma/rdma.c +index 131c6b2a..f835bf3f 100644 +--- a/rdma/rdma.c ++++ b/rdma/rdma.c +@@ -4,6 +4,7 @@ + * Authors: Leon Romanovsky <[email protected]> + */ + ++#include <libgen.h> + #include "rdma.h" + #include "version.h" + #include "color.h" +-- +2.44.2 + diff --git a/sys-apps/iproute2/iproute2-6.10.0.ebuild b/sys-apps/iproute2/iproute2-6.10.0.ebuild index 3d0c9ec799da..0b232fbeecbb 100644 --- a/sys-apps/iproute2/iproute2-6.10.0.ebuild +++ b/sys-apps/iproute2/iproute2-6.10.0.ebuild @@ -48,6 +48,8 @@ BDEPEND=" " PATCHES=( + "${FILESDIR}"/${PN}-6.10.0-musl-1.patch # bug #936234 + "${FILESDIR}"/${PN}-6.10.0-musl-2.patch # bug #926341 "${FILESDIR}"/${PN}-6.9.0-mtu.patch # bug #291907 "${FILESDIR}"/${PN}-6.8.0-configure-nomagic-nolibbsd.patch # bug #643722 & #911727 "${FILESDIR}"/${PN}-6.8.0-disable-libbsd-fallback.patch # bug #911727
