1 |
commit: 9f43b91a9e3987fbb5aa958d0b32ed5759d7c230 |
2 |
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun May 30 14:02:17 2021 +0000 |
4 |
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun May 30 14:02:17 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9f43b91a |
7 |
|
8 |
sys-apps/ibm-powerpc-utils: fix build using musl |
9 |
|
10 |
Closes: https://bugs.gentoo.org/779109 |
11 |
Package-Manager: Portage-3.0.18, Repoman-3.0.2 |
12 |
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org> |
13 |
|
14 |
.../files/ibm-powerpc-utils-1.3.8-musl.patch | 95 ++++++++++++++++++++++ |
15 |
.../ibm-powerpc-utils-1.3.8-r1.ebuild | 3 +- |
16 |
.../ibm-powerpc-utils-99999.ebuild | 3 +- |
17 |
3 files changed, 99 insertions(+), 2 deletions(-) |
18 |
|
19 |
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 |
20 |
new file mode 100644 |
21 |
index 00000000000..5357e5fdcef |
22 |
--- /dev/null |
23 |
+++ b/sys-apps/ibm-powerpc-utils/files/ibm-powerpc-utils-1.3.8-musl.patch |
24 |
@@ -0,0 +1,95 @@ |
25 |
+From ec0eb99a402ff9371965c2c8726bc400674215b7 Mon Sep 17 00:00:00 2001 |
26 |
+From: Fabian Groffen <grobian@g.o> |
27 |
+Date: Fri, 21 May 2021 11:25:21 +0200 |
28 |
+Subject: [PATCH] add includes/defines for musl libc support |
29 |
+ |
30 |
+- add some missing includes to get proper definitions for beXXtoh and |
31 |
+ PATH_MAX |
32 |
+- guard backtrace() from execinfo.h usage for it is glibc only |
33 |
+ |
34 |
+PR: https://github.com/ibm-power-utilities/powerpc-utils/pull/63 |
35 |
+Signed-off-by: Fabian Groffen <grobian@g.o> |
36 |
+--- |
37 |
+ src/common/cpu_info_helpers.c | 1 + |
38 |
+ src/drmgr/common.c | 6 ++++++ |
39 |
+ src/drmgr/dr.h | 1 + |
40 |
+ src/rtas_dbg.c | 1 + |
41 |
+ 4 files changed, 9 insertions(+) |
42 |
+ |
43 |
+diff --git a/src/common/cpu_info_helpers.c b/src/common/cpu_info_helpers.c |
44 |
+index 3d08ff7..925f220 100644 |
45 |
+--- a/src/common/cpu_info_helpers.c |
46 |
++++ b/src/common/cpu_info_helpers.c |
47 |
+@@ -29,6 +29,7 @@ |
48 |
+ #include <errno.h> |
49 |
+ #include <stdbool.h> |
50 |
+ #include <dirent.h> |
51 |
++#include <limits.h> |
52 |
+ #include <sys/stat.h> |
53 |
+ #include <sys/types.h> |
54 |
+ #include "cpu_info_helpers.h" |
55 |
+diff --git a/src/drmgr/common.c b/src/drmgr/common.c |
56 |
+index 5e8135b..32cf805 100644 |
57 |
+--- a/src/drmgr/common.c |
58 |
++++ b/src/drmgr/common.c |
59 |
+@@ -28,7 +28,9 @@ |
60 |
+ #include <signal.h> |
61 |
+ #include <errno.h> |
62 |
+ #include <dirent.h> |
63 |
++#ifdef __GLIBC__ |
64 |
+ #include <execinfo.h> |
65 |
++#endif |
66 |
+ #include <ctype.h> |
67 |
+ #include <sys/wait.h> |
68 |
+ #include <endian.h> |
69 |
+@@ -853,6 +855,7 @@ sighandler(int signo) |
70 |
+ say(ERROR, "Received signal %d, attempting to cleanup and exit\n", |
71 |
+ signo); |
72 |
+ |
73 |
++#ifdef __GLIBC__ |
74 |
+ if (log_fd) { |
75 |
+ void *callstack[128]; |
76 |
+ int sz; |
77 |
+@@ -860,6 +863,7 @@ sighandler(int signo) |
78 |
+ sz = backtrace(callstack, 128); |
79 |
+ backtrace_symbols_fd(callstack, sz, log_fd); |
80 |
+ } |
81 |
++#endif |
82 |
+ |
83 |
+ dr_fini(); |
84 |
+ exit(-1); |
85 |
+@@ -925,8 +929,10 @@ sig_setup(void) |
86 |
+ if (sigaction(SIGBUS, &sigact, NULL)) |
87 |
+ return -1; |
88 |
+ |
89 |
++#ifdef __GLIBC__ |
90 |
+ /* dummy call to backtrace to get symbol loaded */ |
91 |
+ backtrace(callstack, 128); |
92 |
++#endif |
93 |
+ return 0; |
94 |
+ } |
95 |
+ |
96 |
+diff --git a/src/drmgr/dr.h b/src/drmgr/dr.h |
97 |
+index f171bfe..b32d49a 100644 |
98 |
+--- a/src/drmgr/dr.h |
99 |
++++ b/src/drmgr/dr.h |
100 |
+@@ -26,6 +26,7 @@ |
101 |
+ #include <nl_types.h> |
102 |
+ #include <unistd.h> |
103 |
+ #include <stdarg.h> |
104 |
++#include <limits.h> |
105 |
+ #include "rtas_calls.h" |
106 |
+ #include "drpci.h" |
107 |
+ |
108 |
+diff --git a/src/rtas_dbg.c b/src/rtas_dbg.c |
109 |
+index 526e78b..ebc7474 100644 |
110 |
+--- a/src/rtas_dbg.c |
111 |
++++ b/src/rtas_dbg.c |
112 |
+@@ -32,6 +32,7 @@ |
113 |
+ #include <getopt.h> |
114 |
+ #include <dirent.h> |
115 |
+ #include <string.h> |
116 |
++#include <endian.h> |
117 |
+ #include <sys/syscall.h> |
118 |
+ #include <unistd.h> |
119 |
+ #include <linux/unistd.h> |
120 |
|
121 |
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 |
122 |
index d828529d968..01005efd85f 100644 |
123 |
--- a/sys-apps/ibm-powerpc-utils/ibm-powerpc-utils-1.3.8-r1.ebuild |
124 |
+++ b/sys-apps/ibm-powerpc-utils/ibm-powerpc-utils-1.3.8-r1.ebuild |
125 |
@@ -1,4 +1,4 @@ |
126 |
-# Copyright 1999-2020 Gentoo Authors |
127 |
+# Copyright 1999-2021 Gentoo Authors |
128 |
# Distributed under the terms of the GNU General Public License v2 |
129 |
|
130 |
EAPI=7 |
131 |
@@ -22,6 +22,7 @@ RDEPEND=" |
132 |
|
133 |
PATCHES=( |
134 |
"${FILESDIR}"/${PN}-1.3.5-docdir.patch |
135 |
+ "${FILESDIR}"/${P}-musl.patch |
136 |
) |
137 |
|
138 |
src_prepare() { |
139 |
|
140 |
diff --git a/sys-apps/ibm-powerpc-utils/ibm-powerpc-utils-99999.ebuild b/sys-apps/ibm-powerpc-utils/ibm-powerpc-utils-99999.ebuild |
141 |
index b6e7ae3be80..d4d181b373a 100644 |
142 |
--- a/sys-apps/ibm-powerpc-utils/ibm-powerpc-utils-99999.ebuild |
143 |
+++ b/sys-apps/ibm-powerpc-utils/ibm-powerpc-utils-99999.ebuild |
144 |
@@ -1,4 +1,4 @@ |
145 |
-# Copyright 1999-2020 Gentoo Authors |
146 |
+# Copyright 1999-2021 Gentoo Authors |
147 |
# Distributed under the terms of the GNU General Public License v2 |
148 |
|
149 |
EAPI=7 |
150 |
@@ -20,6 +20,7 @@ RDEPEND=" |
151 |
|
152 |
PATCHES=( |
153 |
"${FILESDIR}"/${PN}-1.3.5-docdir.patch |
154 |
+ "${FILESDIR}"/${P}-musl.patch # PR #63 |
155 |
) |
156 |
|
157 |
src_prepare() { |