void-packages/srcpkgs/libunwind/patches/ppc64-musl.patch

115 lines
8.2 KiB
Diff

--- src/ppc64/Ginit.c
+++ src/ppc64/Ginit.c
@@ -51,7 +51,7 @@ uc_addr (ucontext_t *uc, int reg)
addr = &uc->uc_mcontext.gp_regs[reg - UNW_PPC64_R0];
else if ((unsigned) (reg - UNW_PPC64_F0) < 32)
- addr = &uc->uc_mcontext.fp_regs[reg - UNW_PPC64_F0];
+ addr = &(((double *)&uc->uc_mcontext.fp_regs)[reg - UNW_PPC64_F0]);
else if ((unsigned) (reg - UNW_PPC64_V0) < 32)
addr = (uc->uc_mcontext.v_regs == 0) ? NULL : &uc->uc_mcontext.v_regs->vrregs[reg - UNW_PPC64_V0][0];
--- src/ppc64/ucontext_i.h
+++ src/ppc64/ucontext_i.h
@@ -99,39 +99,39 @@ static vrregset_t dmy_vrregset;
#define UC_MCONTEXT_GREGS_DSISR ((void *)&dmy_ctxt.uc_mcontext.gp_regs[DSISR_IDX] - (void *)&dmy_ctxt)
#define UC_MCONTEXT_GREGS_RESULT ((void *)&dmy_ctxt.uc_mcontext.gp_regs[RESULT_IDX] - (void *)&dmy_ctxt)
-#define UC_MCONTEXT_FREGS_R0 ((void *)&dmy_ctxt.uc_mcontext.fp_regs[0] - (void *)&dmy_ctxt)
-#define UC_MCONTEXT_FREGS_R1 ((void *)&dmy_ctxt.uc_mcontext.fp_regs[1] - (void *)&dmy_ctxt)
-#define UC_MCONTEXT_FREGS_R2 ((void *)&dmy_ctxt.uc_mcontext.fp_regs[2] - (void *)&dmy_ctxt)
-#define UC_MCONTEXT_FREGS_R3 ((void *)&dmy_ctxt.uc_mcontext.fp_regs[3] - (void *)&dmy_ctxt)
-#define UC_MCONTEXT_FREGS_R4 ((void *)&dmy_ctxt.uc_mcontext.fp_regs[4] - (void *)&dmy_ctxt)
-#define UC_MCONTEXT_FREGS_R5 ((void *)&dmy_ctxt.uc_mcontext.fp_regs[5] - (void *)&dmy_ctxt)
-#define UC_MCONTEXT_FREGS_R6 ((void *)&dmy_ctxt.uc_mcontext.fp_regs[6] - (void *)&dmy_ctxt)
-#define UC_MCONTEXT_FREGS_R7 ((void *)&dmy_ctxt.uc_mcontext.fp_regs[7] - (void *)&dmy_ctxt)
-#define UC_MCONTEXT_FREGS_R8 ((void *)&dmy_ctxt.uc_mcontext.fp_regs[8] - (void *)&dmy_ctxt)
-#define UC_MCONTEXT_FREGS_R9 ((void *)&dmy_ctxt.uc_mcontext.fp_regs[9] - (void *)&dmy_ctxt)
-#define UC_MCONTEXT_FREGS_R10 ((void *)&dmy_ctxt.uc_mcontext.fp_regs[10] - (void *)&dmy_ctxt)
-#define UC_MCONTEXT_FREGS_R11 ((void *)&dmy_ctxt.uc_mcontext.fp_regs[11] - (void *)&dmy_ctxt)
-#define UC_MCONTEXT_FREGS_R12 ((void *)&dmy_ctxt.uc_mcontext.fp_regs[12] - (void *)&dmy_ctxt)
-#define UC_MCONTEXT_FREGS_R13 ((void *)&dmy_ctxt.uc_mcontext.fp_regs[13] - (void *)&dmy_ctxt)
-#define UC_MCONTEXT_FREGS_R14 ((void *)&dmy_ctxt.uc_mcontext.fp_regs[14] - (void *)&dmy_ctxt)
-#define UC_MCONTEXT_FREGS_R15 ((void *)&dmy_ctxt.uc_mcontext.fp_regs[15] - (void *)&dmy_ctxt)
-#define UC_MCONTEXT_FREGS_R16 ((void *)&dmy_ctxt.uc_mcontext.fp_regs[16] - (void *)&dmy_ctxt)
-#define UC_MCONTEXT_FREGS_R17 ((void *)&dmy_ctxt.uc_mcontext.fp_regs[17] - (void *)&dmy_ctxt)
-#define UC_MCONTEXT_FREGS_R18 ((void *)&dmy_ctxt.uc_mcontext.fp_regs[18] - (void *)&dmy_ctxt)
-#define UC_MCONTEXT_FREGS_R19 ((void *)&dmy_ctxt.uc_mcontext.fp_regs[19] - (void *)&dmy_ctxt)
-#define UC_MCONTEXT_FREGS_R20 ((void *)&dmy_ctxt.uc_mcontext.fp_regs[20] - (void *)&dmy_ctxt)
-#define UC_MCONTEXT_FREGS_R21 ((void *)&dmy_ctxt.uc_mcontext.fp_regs[21] - (void *)&dmy_ctxt)
-#define UC_MCONTEXT_FREGS_R22 ((void *)&dmy_ctxt.uc_mcontext.fp_regs[22] - (void *)&dmy_ctxt)
-#define UC_MCONTEXT_FREGS_R23 ((void *)&dmy_ctxt.uc_mcontext.fp_regs[23] - (void *)&dmy_ctxt)
-#define UC_MCONTEXT_FREGS_R24 ((void *)&dmy_ctxt.uc_mcontext.fp_regs[24] - (void *)&dmy_ctxt)
-#define UC_MCONTEXT_FREGS_R25 ((void *)&dmy_ctxt.uc_mcontext.fp_regs[25] - (void *)&dmy_ctxt)
-#define UC_MCONTEXT_FREGS_R26 ((void *)&dmy_ctxt.uc_mcontext.fp_regs[26] - (void *)&dmy_ctxt)
-#define UC_MCONTEXT_FREGS_R27 ((void *)&dmy_ctxt.uc_mcontext.fp_regs[27] - (void *)&dmy_ctxt)
-#define UC_MCONTEXT_FREGS_R28 ((void *)&dmy_ctxt.uc_mcontext.fp_regs[28] - (void *)&dmy_ctxt)
-#define UC_MCONTEXT_FREGS_R29 ((void *)&dmy_ctxt.uc_mcontext.fp_regs[29] - (void *)&dmy_ctxt)
-#define UC_MCONTEXT_FREGS_R30 ((void *)&dmy_ctxt.uc_mcontext.fp_regs[30] - (void *)&dmy_ctxt)
-#define UC_MCONTEXT_FREGS_R31 ((void *)&dmy_ctxt.uc_mcontext.fp_regs[31] - (void *)&dmy_ctxt)
-#define UC_MCONTEXT_FREGS_FPSCR ((void *)&dmy_ctxt.uc_mcontext.fp_regs[32] - (void *)&dmy_ctxt)
+#define UC_MCONTEXT_FREGS_R0 ((void *)&(((double *)&dmy_ctxt.uc_mcontext.fp_regs)[0]) - (void *)&dmy_ctxt)
+#define UC_MCONTEXT_FREGS_R1 ((void *)&(((double *)&dmy_ctxt.uc_mcontext.fp_regs)[1]) - (void *)&dmy_ctxt)
+#define UC_MCONTEXT_FREGS_R2 ((void *)&(((double *)&dmy_ctxt.uc_mcontext.fp_regs)[2]) - (void *)&dmy_ctxt)
+#define UC_MCONTEXT_FREGS_R3 ((void *)&(((double *)&dmy_ctxt.uc_mcontext.fp_regs)[3]) - (void *)&dmy_ctxt)
+#define UC_MCONTEXT_FREGS_R4 ((void *)&(((double *)&dmy_ctxt.uc_mcontext.fp_regs)[4]) - (void *)&dmy_ctxt)
+#define UC_MCONTEXT_FREGS_R5 ((void *)&(((double *)&dmy_ctxt.uc_mcontext.fp_regs)[5]) - (void *)&dmy_ctxt)
+#define UC_MCONTEXT_FREGS_R6 ((void *)&(((double *)&dmy_ctxt.uc_mcontext.fp_regs)[6]) - (void *)&dmy_ctxt)
+#define UC_MCONTEXT_FREGS_R7 ((void *)&(((double *)&dmy_ctxt.uc_mcontext.fp_regs)[7]) - (void *)&dmy_ctxt)
+#define UC_MCONTEXT_FREGS_R8 ((void *)&(((double *)&dmy_ctxt.uc_mcontext.fp_regs)[8]) - (void *)&dmy_ctxt)
+#define UC_MCONTEXT_FREGS_R9 ((void *)&(((double *)&dmy_ctxt.uc_mcontext.fp_regs)[9]) - (void *)&dmy_ctxt)
+#define UC_MCONTEXT_FREGS_R10 ((void *)&(((double *)&dmy_ctxt.uc_mcontext.fp_regs)[10]) - (void *)&dmy_ctxt)
+#define UC_MCONTEXT_FREGS_R11 ((void *)&(((double *)&dmy_ctxt.uc_mcontext.fp_regs)[11]) - (void *)&dmy_ctxt)
+#define UC_MCONTEXT_FREGS_R12 ((void *)&(((double *)&dmy_ctxt.uc_mcontext.fp_regs)[12]) - (void *)&dmy_ctxt)
+#define UC_MCONTEXT_FREGS_R13 ((void *)&(((double *)&dmy_ctxt.uc_mcontext.fp_regs)[13]) - (void *)&dmy_ctxt)
+#define UC_MCONTEXT_FREGS_R14 ((void *)&(((double *)&dmy_ctxt.uc_mcontext.fp_regs)[14]) - (void *)&dmy_ctxt)
+#define UC_MCONTEXT_FREGS_R15 ((void *)&(((double *)&dmy_ctxt.uc_mcontext.fp_regs)[15]) - (void *)&dmy_ctxt)
+#define UC_MCONTEXT_FREGS_R16 ((void *)&(((double *)&dmy_ctxt.uc_mcontext.fp_regs)[16]) - (void *)&dmy_ctxt)
+#define UC_MCONTEXT_FREGS_R17 ((void *)&(((double *)&dmy_ctxt.uc_mcontext.fp_regs)[17]) - (void *)&dmy_ctxt)
+#define UC_MCONTEXT_FREGS_R18 ((void *)&(((double *)&dmy_ctxt.uc_mcontext.fp_regs)[18]) - (void *)&dmy_ctxt)
+#define UC_MCONTEXT_FREGS_R19 ((void *)&(((double *)&dmy_ctxt.uc_mcontext.fp_regs)[19]) - (void *)&dmy_ctxt)
+#define UC_MCONTEXT_FREGS_R20 ((void *)&(((double *)&dmy_ctxt.uc_mcontext.fp_regs)[20]) - (void *)&dmy_ctxt)
+#define UC_MCONTEXT_FREGS_R21 ((void *)&(((double *)&dmy_ctxt.uc_mcontext.fp_regs)[21]) - (void *)&dmy_ctxt)
+#define UC_MCONTEXT_FREGS_R22 ((void *)&(((double *)&dmy_ctxt.uc_mcontext.fp_regs)[22]) - (void *)&dmy_ctxt)
+#define UC_MCONTEXT_FREGS_R23 ((void *)&(((double *)&dmy_ctxt.uc_mcontext.fp_regs)[23]) - (void *)&dmy_ctxt)
+#define UC_MCONTEXT_FREGS_R24 ((void *)&(((double *)&dmy_ctxt.uc_mcontext.fp_regs)[24]) - (void *)&dmy_ctxt)
+#define UC_MCONTEXT_FREGS_R25 ((void *)&(((double *)&dmy_ctxt.uc_mcontext.fp_regs)[25]) - (void *)&dmy_ctxt)
+#define UC_MCONTEXT_FREGS_R26 ((void *)&(((double *)&dmy_ctxt.uc_mcontext.fp_regs)[26]) - (void *)&dmy_ctxt)
+#define UC_MCONTEXT_FREGS_R27 ((void *)&(((double *)&dmy_ctxt.uc_mcontext.fp_regs)[27]) - (void *)&dmy_ctxt)
+#define UC_MCONTEXT_FREGS_R28 ((void *)&(((double *)&dmy_ctxt.uc_mcontext.fp_regs)[28]) - (void *)&dmy_ctxt)
+#define UC_MCONTEXT_FREGS_R29 ((void *)&(((double *)&dmy_ctxt.uc_mcontext.fp_regs)[29]) - (void *)&dmy_ctxt)
+#define UC_MCONTEXT_FREGS_R30 ((void *)&(((double *)&dmy_ctxt.uc_mcontext.fp_regs)[30]) - (void *)&dmy_ctxt)
+#define UC_MCONTEXT_FREGS_R31 ((void *)&(((double *)&dmy_ctxt.uc_mcontext.fp_regs)[31]) - (void *)&dmy_ctxt)
+#define UC_MCONTEXT_FREGS_FPSCR ((void *)&(((double *)&dmy_ctxt.uc_mcontext.fp_regs)[32]) - (void *)&dmy_ctxt)
#define UC_MCONTEXT_V_REGS ((void *)&dmy_ctxt.uc_mcontext.v_regs - (void *)&dmy_ctxt)
--- src/ptrace/_UPT_internal.h
+++ src/ptrace/_UPT_internal.h
@@ -37,7 +37,14 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#include <sys/ptrace.h>
#endif
#ifdef HAVE_SYS_PROCFS_H
+#if !defined(__GLIBC__) && defined(__powerpc__)
+/* nasty hack to prevent conflict with asm/ptrace.h */
+#define pt_regs musl_pt_regs
#include <sys/procfs.h>
+#undef pt_regs
+#else
+#include <sys/procfs.h>
+#endif
#endif
#include <errno.h>
--- src/ptrace/_UPT_reg_offset.c
+++ src/ptrace/_UPT_reg_offset.c
@@ -32,6 +32,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
# include <asm/ptrace_offsets.h>
#endif
+#include <asm/ptrace.h>
+
const int _UPT_reg_offset[UNW_REG_LAST + 1] =
{
#ifdef HAVE_ASM_PTRACE_OFFSETS_H