commit:     844fbd1e96beda0fb94ea06aba8f2618bfdad1f7
Author:     Holger Hoffstätte <holger <AT> applied-asynchrony <DOT> com>
AuthorDate: Sat Apr 13 13:58:37 2024 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Mon May 20 15:52:38 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=844fbd1e

dev-debug/sysdig: don't try to link against libanl on musl

libanl is an empty stub library since glibc-2.34 and does not exist
on musl. Since sysdig uses c-ares and therefore does not even need
glibc's async name lookups, we can safely remove it when building
on musl.

Bug: https://bugs.gentoo.org/929227
Bug: https://bugs.gentoo.org/929907
Signed-off-by: Holger Hoffstätte <holger <AT> applied-asynchrony.com>
Closes: https://github.com/gentoo/gentoo/pull/36237
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 dev-debug/sysdig/files/0.29.3-libs-no-libanl.patch | 16 ++++++++++++++++
 dev-debug/sysdig/sysdig-0.29.3-r2.ebuild           | 12 +++++++++---
 2 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/dev-debug/sysdig/files/0.29.3-libs-no-libanl.patch 
b/dev-debug/sysdig/files/0.29.3-libs-no-libanl.patch
new file mode 100644
index 000000000000..16563aee8ca0
--- /dev/null
+++ b/dev-debug/sysdig/files/0.29.3-libs-no-libanl.patch
@@ -0,0 +1,16 @@
+
+Remove libanl from list of linked libraries as it is not needed at all
+and does not exist on musl.
+
+--- 
libs-e5c53d648f3c4694385bbe488e7d47eaa36c229a/userspace/libsinsp/CMakeLists.txt~
   2022-03-25 09:50:03.000000000 +0000
++++ 
libs-e5c53d648f3c4694385bbe488e7d47eaa36c229a/userspace/libsinsp/CMakeLists.txt 
   2024-04-13 13:40:53.222240196 +0000
+@@ -230,8 +230,7 @@ if(NOT WIN32)
+ 
+                       if(NOT MUSL_OPTIMIZED_BUILD)
+                               list(APPEND SINSP_LIBRARIES
+-                              rt
+-                              anl)
++                              rt)
+                       endif()
+ 
+               else()

diff --git a/dev-debug/sysdig/sysdig-0.29.3-r2.ebuild 
b/dev-debug/sysdig/sysdig-0.29.3-r2.ebuild
index 7262049544d9..64902719ed6b 100644
--- a/dev-debug/sysdig/sysdig-0.29.3-r2.ebuild
+++ b/dev-debug/sysdig/sysdig-0.29.3-r2.ebuild
@@ -46,9 +46,15 @@ DEPEND="${RDEPEND}
 PDEPEND="modules? ( =dev-debug/scap-driver-${PV}* )"
 
 src_prepare() {
-       # manually apply patch to falcosecurity-libs dependency
-       pushd "${WORKDIR}" && \
-               eapply -p0 "${FILESDIR}/${PV}-libs-gcc13.patch" && \
+       # manually apply patches to falcosecurity-libs dependency
+       pushd "${WORKDIR}"
+               # gcc13 needs explicit <cstdint>
+               eapply -p0 "${FILESDIR}/${PV}-libs-gcc13.patch" || die
+
+               # musl has no libanl (#929227)
+               if [ ${ELIBC} == "musl" ] ; then
+                       eapply -p0 "${FILESDIR}/${PV}-libs-no-libanl.patch" || 
die
+               fi
        popd
 
        # force C++14 standard for libs & main

Reply via email to