diff options
Diffstat (limited to 'experimental/mono/musl-ppc.patch')
-rw-r--r-- | experimental/mono/musl-ppc.patch | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/experimental/mono/musl-ppc.patch b/experimental/mono/musl-ppc.patch new file mode 100644 index 000000000..79706fb9d --- /dev/null +++ b/experimental/mono/musl-ppc.patch @@ -0,0 +1,33 @@ +Musl does not include kernel headers. + +Also, fix context handling for ppc32/musl. + +--- mono.old/mono/utils/mono-sigcontext.h ++++ mono.new/mono/utils/mono-sigcontext.h +@@ -321,6 +321,8 @@ typedef struct ucontext { + + #elif defined(__mono_ppc__) + ++#include <asm/ptrace.h> ++ + #if HAVE_UCONTEXT_H + #include <ucontext.h> + #endif +@@ -334,10 +336,17 @@ typedef struct ucontext { + #define UCONTEXT_REG_NIP(ctx) (((os_ucontext*)(ctx))->uc_mcontext.gp_regs [PT_NIP]) + #define UCONTEXT_REG_LNK(ctx) (((os_ucontext*)(ctx))->uc_mcontext.gp_regs [PT_LNK]) + #else ++#ifdef __GLIBC__ + #define UCONTEXT_REG_Rn(ctx, n) (((os_ucontext*)(ctx))->uc_mcontext.uc_regs->gregs [(n)]) + #define UCONTEXT_REG_FPRn(ctx, n) (((os_ucontext*)(ctx))->uc_mcontext.uc_regs->fpregs.fpregs [(n)]) + #define UCONTEXT_REG_NIP(ctx) (((os_ucontext*)(ctx))->uc_mcontext.uc_regs->gregs [PT_NIP]) + #define UCONTEXT_REG_LNK(ctx) (((os_ucontext*)(ctx))->uc_mcontext.uc_regs->gregs [PT_LNK]) ++#else ++ #define UCONTEXT_REG_Rn(ctx, n) (((os_ucontext*)(ctx))->uc_mcontext.gregs [(n)]) ++ #define UCONTEXT_REG_FPRn(ctx, n) (((os_ucontext*)(ctx))->uc_mcontext.fpregs.fpregs [(n)]) ++ #define UCONTEXT_REG_NIP(ctx) (((os_ucontext*)(ctx))->uc_mcontext.gregs [PT_NIP]) ++ #define UCONTEXT_REG_LNK(ctx) (((os_ucontext*)(ctx))->uc_mcontext.gregs [PT_LNK]) ++#endif + #endif + #elif defined (__APPLE__) && defined (_STRUCT_MCONTEXT) + typedef struct __darwin_ucontext os_ucontext; |