pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pkg/44846: lang/mono needs some patches to compile on DragonFly



The following reply was made to PR pkg/44846; it has been noted by GNATS.

From: "OBATA Akio" <obache%netbsd.org@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: pkg/44846: lang/mono needs some patches to compile on DragonFly
Date: Fri, 13 May 2011 20:49:52 +0900

 On Sun, 10 Apr 2011 00:40:01 +0900, <ftigeot%wolfpond.org@localhost> wrote:
 
 > and add this new patch to patches/
 >
 > $NetBSD$
 >
 > --- mono/mini/mini-amd64.h.orig 2011-01-04 17:39:55 +0000
 > +++ mono/mini/mini-amd64.h
 > @@ -288,7 +288,7 @@ typedef struct {
 > #define MONO_ARCH_NOMAP32BIT
 >-#elif defined (__FreeBSD__)
 > +#elif defined (__FreeBSD__) || defined(__DragonFly__)
 > #define REG_RAX 7
 >  #define REG_RCX 4
 
 It may be result in broken, I feel
   REG_RSP should be 24 (DragonFly), not 23 (FreeBSD)
   REG_RIP should be 21 (DragonFly), not 20 (FreeBSD)
 
 Instead of using it, how about change patch-ad as followings?
 
 
 Index: patches/patch-ad
 ===================================================================
 RCS file: /cvsroot/pkgsrc/lang/mono/patches/patch-ad,v
 retrieving revision 1.21
 diff -u -r1.21 patch-ad
 --- patches/patch-ad    29 Dec 2010 05:41:20 -0000      1.21
 +++ patches/patch-ad    13 May 2011 11:37:37 -0000
 @@ -1,5 +1,9 @@
   $NetBSD: patch-ad,v 1.21 2010/12/29 05:41:20 obache Exp $
 ---- mono/utils/mono-sigcontext.h.orig  2010-11-12 10:24:41.000000000 +0000
 +
 +* treat DragonFly same as FreeBSD.
 +* add NetBSD support.
 +
 +--- mono/utils/mono-sigcontext.h.orig  2011-02-23 19:21:01 +0000
   +++ mono/utils/mono-sigcontext.h
   @@ -8,14 +8,14 @@
 
 @@ -18,10 +22,26 @@
          #define UCONTEXT_REG_EAX(ctx) 
(((ucontext_t*)(ctx))->uc_mcontext.mc_eax)
          #define UCONTEXT_REG_EBX(ctx) 
(((ucontext_t*)(ctx))->uc_mcontext.mc_ebx)
          #define UCONTEXT_REG_ECX(ctx) 
(((ucontext_t*)(ctx))->uc_mcontext.mc_ecx)
 -@@ -101,6 +101,20 @@
 +@@ -99,8 +99,34 @@
 +       #define UCONTEXT_REG_R13(ctx) 
(((ucontext_t*)(ctx))->uc_mcontext->__ss.__r13)
 +       #define UCONTEXT_REG_R14(ctx) 
(((ucontext_t*)(ctx))->uc_mcontext->__ss.__r14)
          #define UCONTEXT_REG_R15(ctx) 
(((ucontext_t*)(ctx))->uc_mcontext->__ss.__r15)
 - #elif defined(__FreeBSD__)
 - #define UCONTEXT_GREGS(ctx)   
((guint64*)&(((ucontext_t*)(ctx))->uc_mcontext))
 +-#elif defined(__FreeBSD__)
 +-#define UCONTEXT_GREGS(ctx)   
((guint64*)&(((ucontext_t*)(ctx))->uc_mcontext))
 ++#elif defined(__FreeBSD__) || defined(__DragonFly__)
 ++      #define UCONTEXT_REG_RAX(ctx) 
(((ucontext_t*)(ctx))->uc_mcontext.mc_rax)
 ++      #define UCONTEXT_REG_RBX(ctx) 
(((ucontext_t*)(ctx))->uc_mcontext.mc_rbx)
 ++      #define UCONTEXT_REG_RCX(ctx) 
(((ucontext_t*)(ctx))->uc_mcontext.mc_rcx)
 ++      #define UCONTEXT_REG_RDX(ctx) 
(((ucontext_t*)(ctx))->uc_mcontext.mc_rdx)
 ++      #define UCONTEXT_REG_RBP(ctx) 
(((ucontext_t*)(ctx))->uc_mcontext.mc_rbp)
 ++      #define UCONTEXT_REG_RSP(ctx) 
(((ucontext_t*)(ctx))->uc_mcontext.mc_rsp)
 ++      #define UCONTEXT_REG_RSI(ctx) 
(((ucontext_t*)(ctx))->uc_mcontext.mc_rsi)
 ++      #define UCONTEXT_REG_RDI(ctx) 
(((ucontext_t*)(ctx))->uc_mcontext.mc_rdi)
 ++      #define UCONTEXT_REG_RIP(ctx) 
(((ucontext_t*)(ctx))->uc_mcontext.mc_rip)
 ++      #define UCONTEXT_REG_R12(ctx) 
(((ucontext_t*)(ctx))->uc_mcontext.mc_r12)
 ++      #define UCONTEXT_REG_R13(ctx) 
(((ucontext_t*)(ctx))->uc_mcontext.mc_r13)
 ++      #define UCONTEXT_REG_R14(ctx) 
(((ucontext_t*)(ctx))->uc_mcontext.mc_r14)
 ++      #define UCONTEXT_REG_R15(ctx) 
(((ucontext_t*)(ctx))->uc_mcontext.mc_r15)
   +#elif defined(__NetBSD__)
   +      #define UCONTEXT_REG_RAX(ctx) 
(((ucontext_t*)(ctx))->uc_mcontext.__gregs [_REG_RAX])
   +      #define UCONTEXT_REG_RBX(ctx) 
(((ucontext_t*)(ctx))->uc_mcontext.__gregs [_REG_RBX])
 
 
 -- 
 OBATA Akio / obache%NetBSD.org@localhost
 


Home | Main Index | Thread Index | Old Index