Skip to content

Commit

Permalink
dev-libs/libzia: Fix detection of strerror_r return type
Browse files Browse the repository at this point in the history
Closes: https://bugs.gentoo.org/942789
Signed-off-by: Thomas Beierlein <[email protected]>
  • Loading branch information
dl1jbe committed Nov 26, 2024
1 parent 4b27d79 commit a1ed8b4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
14 changes: 14 additions & 0 deletions dev-libs/libzia/files/libzia-4.64-musl-strerror_r.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# fix detecxtion of return type of strerror_r (bug #942789)
diff --git a/configure.ac b/configure.ac
index 0f4efac..2f4526e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -511,7 +511,7 @@ fi

OLDCFLAGS=$CFLAGS
CFLAGS="$CFLAGS -Werror"
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <string.h> ]], [[ int i = strerror_r(1);]])],[ AC_DEFINE([Z_STRERROR_R_RETURNS_INT], [], [strerror_r returns int not char*])],[])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <string.h> ]], [[ int i = strerror_r(1, NULL, 1);]])],[ AC_DEFINE([STRERROR_R_RETURNS_INT], [], [strerror_r returns int not char*])],[])
CFLAGS=$OLDCFLAGS


Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@ src_prepare() {
sed -i -e "s/docsdir/#docsdir/g" \
-e "s/docs_/#docs_/g" Makefile.am || die

# fix build for MUSL (bugs #832235, 935544)
# fix build for MUSL (bugs #832235, 935544, 942789)
if use elibc_musl ; then
sed -i -e "s/zstr.h>/zstr.h>\\n#include <libunwind.h>/" src/zbfd.c || die
sed -i -e "s/ backtrace(/ unw_backtrace(/" src/zbfd.c || die
eapply "${FILESDIR}/${PN}-4.64-musl-strerror_r.patch"
fi

eautoreconf
}

Expand Down

0 comments on commit a1ed8b4

Please sign in to comment.