diff --git a/srcpkgs/ltrace/patches/musl-ppc.patch b/srcpkgs/ltrace/patches/musl-ppc.patch new file mode 100644 index 0000000000..8fca019675 --- /dev/null +++ b/srcpkgs/ltrace/patches/musl-ppc.patch @@ -0,0 +1,36 @@ +--- sysdeps/linux-gnu/ppc/regs.c ++++ sysdeps/linux-gnu/ppc/regs.c +@@ -27,7 +27,9 @@ + #include + #include + #include ++#ifdef __GLIBC__ + #include ++#endif + + #include "proc.h" + #include "common.h" +@@ -50,7 +52,13 @@ void + set_instruction_pointer(struct process *proc, void *addr) + { + if (ptrace(PTRACE_POKEUSER, proc->pid, sizeof(long)*PT_NIP, addr) != 0) ++ { ++#ifdef __GLIBC__ + error(0, errno, "set_instruction_pointer"); ++#else ++ fprintf(stderr, "set_instruction_pointer: %s\n", strerror(errno)); ++#endif ++ } + } + + void * +--- sysdeps/linux-gnu/ppc/trace.c ++++ sysdeps/linux-gnu/ppc/trace.c +@@ -24,6 +24,7 @@ + + #include "config.h" + ++#include + #include + #include + #include diff --git a/srcpkgs/ltrace/template b/srcpkgs/ltrace/template index 862ac67cb0..a26e64e3c7 100644 --- a/srcpkgs/ltrace/template +++ b/srcpkgs/ltrace/template @@ -17,14 +17,13 @@ checksum=4aecf69e4a33331aed1e50ce4907e73a98cbccc4835febc3473863474304d547 CFLAGS="-Wno-error -D_GNU_SOURCE" pre_configure() { - case "$XBPS_TARGET_MACHINE" in - *-musl) + if [ "$XBPS_TARGET_LIBC" = "musl" ]; then sed -i '/HOST_OS/s/linux-uclibc/linux-musl/g' configure.ac sed -i -e '/error.h/d' -e 's/error(1, errno/err(1/' \ read_config_file.c expr.c zero.c sed -i '1i#include ' proc.h sed -i 's/#ifndef __mips__/#if 0/' proc.c - esac + fi autoreconf -fi }