void-packages/srcpkgs/ltrace/patches/musl-ppc.patch

37 lines
776 B
Diff

--- a/sysdeps/linux-gnu/ppc/regs.c
+++ b/sysdeps/linux-gnu/ppc/regs.c
@@ -27,7 +27,9 @@
#include <sys/ptrace.h>
#include <asm/ptrace.h>
#include <errno.h>
+#ifdef __GLIBC__
#include <error.h>
+#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 *
--- a/sysdeps/linux-gnu/ppc/trace.c
+++ b/sysdeps/linux-gnu/ppc/trace.c
@@ -24,6 +24,7 @@
#include "config.h"
+#include <asm/ptrace.h>
#include <assert.h>
#include <elf.h>
#include <errno.h>