From b5408a0879b82101f69b6bf3bc29b6e9e4969941 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Mon, 18 Jul 2022 02:33:38 +0100 Subject: gentoo auto-resync : 18:07:2022 - 02:33:38 --- .../files/debugedit-5.0-musl-error.h-fix.patch | 50 ++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 dev-util/debugedit/files/debugedit-5.0-musl-error.h-fix.patch (limited to 'dev-util/debugedit/files') diff --git a/dev-util/debugedit/files/debugedit-5.0-musl-error.h-fix.patch b/dev-util/debugedit/files/debugedit-5.0-musl-error.h-fix.patch new file mode 100644 index 000000000000..4c7f23911108 --- /dev/null +++ b/dev-util/debugedit/files/debugedit-5.0-musl-error.h-fix.patch @@ -0,0 +1,50 @@ +# musl doesn't provide error.h as a result debugedit is failing to build on +# musl. +# +# With advice from developer Anthony G. Basile I went +# with creating a define that redefines the err function. The major +# improvements over the previous implementation is that this time the patch is +# smaller and more readable compared to previous implementation. +# +# Closes: https://bugs.gentoo.org/714206 +--- a/configure.ac ++++ b/configure.ac +@@ -57,6 +57,8 @@ PKG_CHECK_MODULES([LIBDW], [libdw]) + + # Checks for header files. + AC_CHECK_HEADERS([fcntl.h inttypes.h limits.h malloc.h stddef.h stdint.h stdlib.h string.h unistd.h]) ++AC_CHECK_HEADERS([error.h], ++ [AC_DEFINE(HAVE_ERROR_H, 1, [has error.h -- non musl system])]) + + # Checks for typedefs, structures, and compiler characteristics. + AC_CHECK_HEADER_STDBOOL +--- a/tools/debugedit.c ++++ b/tools/debugedit.c +@@ -25,7 +25,12 @@ + #include + #include + #include ++#ifdef HAVE_ERROR_H + #include ++#else ++#include ++#define error(status, errno, ...) err(status, __VA_ARGS__) ++#endif + #include + #include + #include +--- a/tools/sepdebugcrcfix.c ++++ b/tools/sepdebugcrcfix.c +@@ -29,7 +29,12 @@ + #include + #include + #include ++#ifdef HAVE_ERROR_H + #include ++#else ++#include ++#define error(status, errno, ...) err(status, __VA_ARGS__) ++#endif + #include + #include + -- cgit v1.2.3