diff --git a/package/powerpc-utils/0001-add-includes-defines-for-musl-libc-support.patch b/package/powerpc-utils/0001-add-includes-defines-for-musl-libc-support.patch new file mode 100644 index 0000000000..b0206c6e6c --- /dev/null +++ b/package/powerpc-utils/0001-add-includes-defines-for-musl-libc-support.patch @@ -0,0 +1,101 @@ +From 2efa853ef04c331444c9014af108d17544d5ed1b Mon Sep 17 00:00:00 2001 +From: Fabian Groffen +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 + +Signed-off-by: Fabian Groffen +Reviewed-by: Nathan Lynch +Signed-off-by: Tyrel Datwyler +Upstream: c73206b62d6d827cbc37a10f0195b5d2cf3f2fbb +Signed-off-by: Thomas Petazzoni +--- + 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 + #include + #include ++#include + #include + #include + #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 + #include + #include ++#ifdef __GLIBC__ + #include ++#endif + #include + #include + #include +@@ -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 + #include + #include ++#include + #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 + #include + #include ++#include + #include + #include + #include +-- +2.37.1 +