[Mono-dev] [PATCH] Re: trunk compile error, sgen-gc.c
KISHIMOTO, Makoto
ksmakoto at dd.iij4u.or.jp
Sun Dec 19 18:48:27 EST 2010
Hello,
I tried to patch. This looks work fine.
diff --git a/mono/utils/mono-sigcontext.h b/mono/utils/mono-sigcontext.h
index 2335f6f..dfe383c 100644
--- a/mono/utils/mono-sigcontext.h
+++ b/mono/utils/mono-sigcontext.h
@@ -58,7 +58,7 @@
#define UCONTEXT_REG_EDI(ctx) (((ucontext_t*)(ctx))->uc_mcontext.__gregs [_REG_EDI])
#define UCONTEXT_REG_EIP(ctx) (((ucontext_t*)(ctx))->uc_mcontext.__gregs [_REG_EIP])
#elif defined(__OpenBSD__)
- #define UCONTEXT_REG_EAX(ctx) (((ucontext_t*)(ctx))->sc_eax)
+ #define UCONTEXT_REG_EAX(ctx) (((ucontext_t*)(ctx))->sc_eax)
#define UCONTEXT_REG_EBX(ctx) (((ucontext_t*)(ctx))->sc_ebx)
#define UCONTEXT_REG_ECX(ctx) (((ucontext_t*)(ctx))->sc_ecx)
#define UCONTEXT_REG_EDX(ctx) (((ucontext_t*)(ctx))->sc_edx)
@@ -81,6 +81,10 @@
#elif defined(__x86_64__)
+#if defined(__FreeBSD__)
+#include <ucontext.h>
+#endif
+
#if defined(__APPLE__)
#define UCONTEXT_REG_RAX(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__ss.__rax)
#define UCONTEXT_REG_RBX(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__ss.__rbx)
@@ -100,7 +104,23 @@
#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))
+ #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_R8(ctx) (((ucontext_t*)(ctx))->uc_mcontext.mc_r8)
+ #define UCONTEXT_REG_R9(ctx) (((ucontext_t*)(ctx))->uc_mcontext.mc_r9)
+ #define UCONTEXT_REG_R10(ctx) (((ucontext_t*)(ctx))->uc_mcontext.mc_r10)
+ #define UCONTEXT_REG_R11(ctx) (((ucontext_t*)(ctx))->uc_mcontext.mc_r11)
+ #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(__OpenBSD__)
/* OpenBSD/amd64 has no gregs array, ucontext_t == sigcontext */
#define UCONTEXT_REG_RAX(ctx) (((ucontext_t*)(ctx))->sc_rax)
On Sun, 19 Dec 2010 23:15:04 +0100
Zoltan Varga <vargaz at gmail.com> wrote:
> Hi,
>
> Use configure --with-sgen=no in the meantime until this is fixed.
>
> Zoltan
>
> On Wed, Dec 15, 2010 at 1:47 AM, KISHIMOTO, Makoto
> <ksmakoto at dd.iij4u.or.jp>wrote:
>
> > Hello,
> >
> > At my FreeBSD box, trunk build failed.
> > Errors are following.
> >
> > $ gmake
> > (snip)
> > ../../doltlibtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I.
> > -I../../../mono/mono/metadata -I../.. -I../../../mono -I../../../mono/mono
> > -I../../../mono/libgc/include -I../../../mono/eglib/src -I../../eglib/src
> > -DMONO_BINDIR=\"/usr/local/bin/\" -DMONO_ASSEMBLIES=\"/usr/local/lib\"
> > -DMONO_CFG_DIR=\"/usr/local/etc\" -DGC_FREEBSD_THREADS -DPLATFORM_BSD
> > -DHAVE_SGEN_GC -DHAVE_MOVING_COLLECTOR -DHAVE_WRITE_BARRIERS -g -O2
> > -fno-strict-aliasing -Wdeclaration-after-statement -g -Wall -Wunused
> > -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes
> > -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-cast-qual
> > -Wwrite-strings -mno-tls-direct-seg-refs -MT
> > libmonoruntimesgen_la-sgen-os-mach.lo -MD -MP -MF
> > .deps/libmonoruntimesgen_la-sgen-os-mach.Tpo -c -o
> > libmonoruntimesgen_la-sgen-os-mach.lo `test -f 'sgen-os-mach.c' || echo
> > '../../../mono/mono/metadata/'`sgen-os-mach.c
> > mv -f .deps/libmonoruntimesgen_la-sgen-os-mach.Tpo
> > .deps/libmonoruntimesgen_la-sgen-os-mach.Plo
> > ../../doltlibtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I.
> > -I../../../mono/mono/metadata -I../.. -I../../../mono -I../../../mono/mono
> > -I../../../mono/libgc/include -I../../../mono/eglib/src -I../../eglib/src
> > -DMONO_BINDIR=\"/usr/local/bin/\" -DMONO_ASSEMBLIES=\"/usr/local/lib\"
> > -DMONO_CFG_DIR=\"/usr/local/etc\" -DGC_FREEBSD_THREADS -DPLATFORM_BSD
> > -DHAVE_SGEN_GC -DHAVE_MOVING_COLLECTOR -DHAVE_WRITE_BARRIERS -g -O2
> > -fno-strict-aliasing -Wdeclaration-after-statement -g -Wall -Wunused
> > -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes
> > -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-cast-qual
> > -Wwrite-strings -mno-tls-direct-seg-refs -MT
> > libmonoruntimesgen_la-sgen-gc.lo -MD -MP -MF
> > .deps/libmonoruntimesgen_la-sgen-gc.Tpo -c -o
> > libmonoruntimesgen_la-sgen-gc.lo `test -f 'sgen-gc.c' || echo
> > '../../../mono/mono/metadata/'`sgen-gc.c
> > ../../../mono/mono/metadata/sgen-gc.c: In function
> > 'mono_sgen_thread_info_lookup':
> > ../../../mono/mono/metadata/sgen-gc.c:4863: warning: cast from pointer to
> > integer of different size
> > ../../../mono/mono/metadata/sgen-gc.c: In function 'suspend_handler':
> > ../../../mono/mono/metadata/sgen-gc.c:5022: error: 'ucontext_t' undeclared
> > (first use in this function)
> > ../../../mono/mono/metadata/sgen-gc.c:5022: error: (Each undeclared
> > identifier is reported only once
> > ../../../mono/mono/metadata/sgen-gc.c:5022: error: for each function it
> > appears in.)
> > ../../../mono/mono/metadata/sgen-gc.c:5022: error: expected expression
> > before ')' token
> > ../../../mono/mono/metadata/sgen-gc.c:5022: error: 'REG_RIP' undeclared
> > (first use in this function)
> > ../../../mono/mono/metadata/sgen-gc.c:5033: error: expected expression
> > before ')' token
> > ../../../mono/mono/metadata/sgen-gc.c:5033: error: 'REG_RSP' undeclared
> > (first use in this function)
> > ../../../mono/mono/metadata/sgen-gc.c:5039: error: expected expression
> > before ')' token
> > ../../../mono/mono/metadata/sgen-gc.c:5039: error: 'REG_RAX' undeclared
> > (first use in this function)
> > ../../../mono/mono/metadata/sgen-gc.c:5039: error: expected expression
> > before ')' token
> > ../../../mono/mono/metadata/sgen-gc.c:5039: error: 'REG_RBX' undeclared
> > (first use in this function)
> > ../../../mono/mono/metadata/sgen-gc.c:5039: error: expected expression
> > before ')' token
> > ../../../mono/mono/metadata/sgen-gc.c:5039: error: 'REG_RCX' undeclared
> > (first use in this function)
> > ../../../mono/mono/metadata/sgen-gc.c:5039: error: expected expression
> > before ')' token
> > ../../../mono/mono/metadata/sgen-gc.c:5039: error: 'REG_RDX' undeclared
> > (first use in this function)
> > ../../../mono/mono/metadata/sgen-gc.c:5039: error: expected expression
> > before ')' token
> > ../../../mono/mono/metadata/sgen-gc.c:5039: error: 'REG_RSI' undeclared
> > (first use in this function)
> > ../../../mono/mono/metadata/sgen-gc.c:5039: error: expected expression
> > before ')' token
> > ../../../mono/mono/metadata/sgen-gc.c:5039: error: 'REG_RDI' undeclared
> > (first use in this function)
> > ../../../mono/mono/metadata/sgen-gc.c:5039: error: expected expression
> > before ')' token
> > ../../../mono/mono/metadata/sgen-gc.c:5039: error: 'REG_RBP' undeclared
> > (first use in this function)
> > ../../../mono/mono/metadata/sgen-gc.c:5039: error: expected expression
> > before ')' token
> > ../../../mono/mono/metadata/sgen-gc.c:5039: error: 'REG_R8' undeclared
> > (first use in this function)
> > ../../../mono/mono/metadata/sgen-gc.c:5039: error: expected expression
> > before ')' token
> > ../../../mono/mono/metadata/sgen-gc.c:5039: error: 'REG_R9' undeclared
> > (first use in this function)
> > ../../../mono/mono/metadata/sgen-gc.c:5039: error: expected expression
> > before ')' token
> > ../../../mono/mono/metadata/sgen-gc.c:5039: error: 'REG_R10' undeclared
> > (first use in this function)
> > ../../../mono/mono/metadata/sgen-gc.c:5039: error: expected expression
> > before ')' token
> > ../../../mono/mono/metadata/sgen-gc.c:5039: error: 'REG_R11' undeclared
> > (first use in this function)
> > ../../../mono/mono/metadata/sgen-gc.c:5039: error: expected expression
> > before ')' token
> > ../../../mono/mono/metadata/sgen-gc.c:5039: error: 'REG_R12' undeclared
> > (first use in this function)
> > ../../../mono/mono/metadata/sgen-gc.c:5039: error: expected expression
> > before ')' token
> > ../../../mono/mono/metadata/sgen-gc.c:5039: error: 'REG_R13' undeclared
> > (first use in this function)
> > ../../../mono/mono/metadata/sgen-gc.c:5039: error: expected expression
> > before ')' token
> > ../../../mono/mono/metadata/sgen-gc.c:5039: error: 'REG_R14' undeclared
> > (first use in this function)
> > ../../../mono/mono/metadata/sgen-gc.c:5039: error: expected expression
> > before ')' token
> > ../../../mono/mono/metadata/sgen-gc.c:5039: error: 'REG_R15' undeclared
> > (first use in this function)
> > ../../../mono/mono/metadata/sgen-gc.c: In function
> > 'gc_register_current_thread':
> > ../../../mono/mono/metadata/sgen-gc.c:5681: warning: cast from pointer to
> > integer of different size
> > ../../../mono/mono/metadata/sgen-gc.c: In function
> > 'unregister_current_thread':
> > ../../../mono/mono/metadata/sgen-gc.c:5722: warning: cast from pointer to
> > integer of different size
> > gmake[3]: *** [libmonoruntimesgen_la-sgen-gc.lo] Error 1
> > gmake[3]: Leaving directory
> > `/export/home/ksmakoto/Mono/BUILD/mono/metadata'
> > gmake[2]: *** [all-recursive] Error 1
> > gmake[2]: Leaving directory `/export/home/ksmakoto/Mono/BUILD/mono'
> > gmake[1]: *** [all-recursive] Error 1
> > gmake[1]: Leaving directory `/export/home/ksmakoto/Mono/BUILD'
> > gmake: *** [all] Error 2
> > _______________________________________________
> > Mono-devel-list mailing list
> > Mono-devel-list at lists.ximian.com
> > http://lists.ximian.com/mailman/listinfo/mono-devel-list
> >
--
______ - http://www.dd.iij4u.or.jp/~ksmakoto/
More information about the Mono-devel-list
mailing list