summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Groffen <grobian@gentoo.org>2021-05-30 16:02:17 +0200
committerFabian Groffen <grobian@gentoo.org>2021-05-30 16:02:17 +0200
commit9f43b91a9e3987fbb5aa958d0b32ed5759d7c230 (patch)
tree4f453634c1ff889a82865739650edfbfacd7b2b6 /sys-apps/ibm-powerpc-utils
parentsys-libs/librtas-2.0.2-r1: fix resulting libs using musl (diff)
downloadgentoo-9f43b91a9e3987fbb5aa958d0b32ed5759d7c230.tar.gz
gentoo-9f43b91a9e3987fbb5aa958d0b32ed5759d7c230.tar.bz2
gentoo-9f43b91a9e3987fbb5aa958d0b32ed5759d7c230.zip
sys-apps/ibm-powerpc-utils: fix build using musl
Closes: https://bugs.gentoo.org/779109 Package-Manager: Portage-3.0.18, Repoman-3.0.2 Signed-off-by: Fabian Groffen <grobian@gentoo.org>
Diffstat (limited to 'sys-apps/ibm-powerpc-utils')
-rw-r--r--sys-apps/ibm-powerpc-utils/files/ibm-powerpc-utils-1.3.8-musl.patch95
-rw-r--r--sys-apps/ibm-powerpc-utils/ibm-powerpc-utils-1.3.8-r1.ebuild3
-rw-r--r--sys-apps/ibm-powerpc-utils/ibm-powerpc-utils-99999.ebuild3
3 files changed, 99 insertions, 2 deletions
diff --git a/sys-apps/ibm-powerpc-utils/files/ibm-powerpc-utils-1.3.8-musl.patch b/sys-apps/ibm-powerpc-utils/files/ibm-powerpc-utils-1.3.8-musl.patch
new file mode 100644
index 000000000000..5357e5fdcef3
--- /dev/null
+++ b/sys-apps/ibm-powerpc-utils/files/ibm-powerpc-utils-1.3.8-musl.patch
@@ -0,0 +1,95 @@
+From ec0eb99a402ff9371965c2c8726bc400674215b7 Mon Sep 17 00:00:00 2001
+From: Fabian Groffen <grobian@gentoo.org>
+Date: Fri, 21 May 2021 11:25:21 +0200
+Subject: [PATCH] add includes/defines for musl libc support
+
+- add some missing includes to get proper definitions for beXXtoh and
+ PATH_MAX
+- guard backtrace() from execinfo.h usage for it is glibc only
+
+PR: https://github.com/ibm-power-utilities/powerpc-utils/pull/63
+Signed-off-by: Fabian Groffen <grobian@gentoo.org>
+---
+ src/common/cpu_info_helpers.c | 1 +
+ src/drmgr/common.c | 6 ++++++
+ src/drmgr/dr.h | 1 +
+ src/rtas_dbg.c | 1 +
+ 4 files changed, 9 insertions(+)
+
+diff --git a/src/common/cpu_info_helpers.c b/src/common/cpu_info_helpers.c
+index 3d08ff7..925f220 100644
+--- a/src/common/cpu_info_helpers.c
++++ b/src/common/cpu_info_helpers.c
+@@ -29,6 +29,7 @@
+ #include <errno.h>
+ #include <stdbool.h>
+ #include <dirent.h>
++#include <limits.h>
+ #include <sys/stat.h>
+ #include <sys/types.h>
+ #include "cpu_info_helpers.h"
+diff --git a/src/drmgr/common.c b/src/drmgr/common.c
+index 5e8135b..32cf805 100644
+--- a/src/drmgr/common.c
++++ b/src/drmgr/common.c
+@@ -28,7 +28,9 @@
+ #include <signal.h>
+ #include <errno.h>
+ #include <dirent.h>
++#ifdef __GLIBC__
+ #include <execinfo.h>
++#endif
+ #include <ctype.h>
+ #include <sys/wait.h>
+ #include <endian.h>
+@@ -853,6 +855,7 @@ sighandler(int signo)
+ say(ERROR, "Received signal %d, attempting to cleanup and exit\n",
+ signo);
+
++#ifdef __GLIBC__
+ if (log_fd) {
+ void *callstack[128];
+ int sz;
+@@ -860,6 +863,7 @@ sighandler(int signo)
+ sz = backtrace(callstack, 128);
+ backtrace_symbols_fd(callstack, sz, log_fd);
+ }
++#endif
+
+ dr_fini();
+ exit(-1);
+@@ -925,8 +929,10 @@ sig_setup(void)
+ if (sigaction(SIGBUS, &sigact, NULL))
+ return -1;
+
++#ifdef __GLIBC__
+ /* dummy call to backtrace to get symbol loaded */
+ backtrace(callstack, 128);
++#endif
+ return 0;
+ }
+
+diff --git a/src/drmgr/dr.h b/src/drmgr/dr.h
+index f171bfe..b32d49a 100644
+--- a/src/drmgr/dr.h
++++ b/src/drmgr/dr.h
+@@ -26,6 +26,7 @@
+ #include <nl_types.h>
+ #include <unistd.h>
+ #include <stdarg.h>
++#include <limits.h>
+ #include "rtas_calls.h"
+ #include "drpci.h"
+
+diff --git a/src/rtas_dbg.c b/src/rtas_dbg.c
+index 526e78b..ebc7474 100644
+--- a/src/rtas_dbg.c
++++ b/src/rtas_dbg.c
+@@ -32,6 +32,7 @@
+ #include <getopt.h>
+ #include <dirent.h>
+ #include <string.h>
++#include <endian.h>
+ #include <sys/syscall.h>
+ #include <unistd.h>
+ #include <linux/unistd.h>
diff --git a/sys-apps/ibm-powerpc-utils/ibm-powerpc-utils-1.3.8-r1.ebuild b/sys-apps/ibm-powerpc-utils/ibm-powerpc-utils-1.3.8-r1.ebuild
index d828529d9685..01005efd85fb 100644
--- a/sys-apps/ibm-powerpc-utils/ibm-powerpc-utils-1.3.8-r1.ebuild
+++ b/sys-apps/ibm-powerpc-utils/ibm-powerpc-utils-1.3.8-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
@@ -22,6 +22,7 @@ RDEPEND="
PATCHES=(
"${FILESDIR}"/${PN}-1.3.5-docdir.patch
+ "${FILESDIR}"/${P}-musl.patch
)
src_prepare() {
diff --git a/sys-apps/ibm-powerpc-utils/ibm-powerpc-utils-99999.ebuild b/sys-apps/ibm-powerpc-utils/ibm-powerpc-utils-99999.ebuild
index b6e7ae3be805..d4d181b373a4 100644
--- a/sys-apps/ibm-powerpc-utils/ibm-powerpc-utils-99999.ebuild
+++ b/sys-apps/ibm-powerpc-utils/ibm-powerpc-utils-99999.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
@@ -20,6 +20,7 @@ RDEPEND="
PATCHES=(
"${FILESDIR}"/${PN}-1.3.5-docdir.patch
+ "${FILESDIR}"/${P}-musl.patch # PR #63
)
src_prepare() {