patches/mono-02-sgen.diff
author jurikm
Sun, 12 Feb 2012 14:04:10 +0000
changeset 8245 383896da4129
parent 3798 9e63fe04e9f8
permissions -rw-r--r--
SFEsauerbraten.spec: add IPS package name
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3798
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
     1
--- a/configure.in	Mon Sep 19 02:59:42 2011
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
     2
+++ b/configure.in	Mon Sep 19 03:00:51 2011
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
     3
@@ -2198,6 +2198,7 @@
3659
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
     4
 			# foo.c:6: warning: visibility attribute not supported in this configuration; ignored
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
     5
 			# ld: fatal: relocation error: R_386_GOTOFF: file /var/tmp//ccxYR96k.o: symbol astruct: relocation must bind locally
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
     6
 			have_visibility_hidden=no
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
     7
+			sgen_supported=true
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
     8
 			;;
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
     9
 		  cygwin*)
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
    10
 			have_visibility_hidden=no		  
3798
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    11
@@ -2269,6 +2270,7 @@
3659
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
    12
 		if test x"$AR" = xfalse; then
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
    13
 			AC_MSG_ERROR([The required utility 'ar' is not found in your PATH. Usually it can be found in /usr/ccs/bin.])
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
    14
 		fi
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
    15
+		sgen_supported=true
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
    16
 		;;
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
    17
        alpha*-*-linux* | alpha*-*-osf*)
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
    18
 		TARGET=ALPHA;
3798
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    19
--- a/mono/metadata/sgen-archdep.h	Mon Sep 19 03:01:52 2011
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    20
+++ b/mono/metadata/sgen-archdep.h	Mon Sep 19 03:04:32 2011
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    21
@@ -213,6 +213,78 @@
3659
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
    22
 	((a)[15] = (gpointer) (UCONTEXT_GREGS((ctx))) [15]);		\
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
    23
 	} while (0)
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
    24
 
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
    25
+#elif defined(__sparc__)
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
    26
+
3798
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    27
+#define REDZONE_SIZE   0
3659
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
    28
+
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
    29
+/* Don't bother with %g0 (%r0), it's always hard-coded to zero */
3798
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    30
+#define ARCH_NUM_REGS 15       
3659
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
    31
+#ifdef __sparcv9
3798
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    32
+#define ARCH_STORE_REGS(ptr)   \
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    33
+       __asm__ __volatile__(   \
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    34
+               "st %%g1,[%0]\n\t"      \
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    35
+               "st %%g2,[%0+0x08]\n\t" \
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    36
+               "st %%g3,[%0+0x10]\n\t" \
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    37
+               "st %%g4,[%0+0x18]\n\t" \
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    38
+               "st %%g5,[%0+0x20]\n\t" \
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    39
+               "st %%g6,[%0+0x28]\n\t" \
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    40
+               "st %%g7,[%0+0x30]\n\t" \
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    41
+               "st %%o0,[%0+0x38]\n\t" \
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    42
+               "st %%o1,[%0+0x40]\n\t" \
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    43
+               "st %%o2,[%0+0x48]\n\t" \
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    44
+               "st %%o3,[%0+0x50]\n\t" \
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    45
+               "st %%o4,[%0+0x58]\n\t" \
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    46
+               "st %%o5,[%0+0x60]\n\t" \
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    47
+               "st %%o6,[%0+0x68]\n\t" \
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    48
+               "st %%o7,[%0+0x70]\n\t" \
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    49
+               :                       \
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    50
+               : "r" (ptr)             \
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    51
+               : "memory"                      \
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    52
+       )
3659
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
    53
+#else
3798
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    54
+#define ARCH_STORE_REGS(ptr)   \
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    55
+       __asm__ __volatile__(   \
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    56
+               "st %%g1,[%0]\n\t"      \
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    57
+               "st %%g2,[%0+0x04]\n\t" \
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    58
+               "st %%g3,[%0+0x08]\n\t" \
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    59
+               "st %%g4,[%0+0x0c]\n\t" \
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    60
+               "st %%g5,[%0+0x10]\n\t" \
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    61
+               "st %%g6,[%0+0x14]\n\t" \
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    62
+               "st %%g7,[%0+0x18]\n\t" \
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    63
+               "st %%o0,[%0+0x1c]\n\t" \
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    64
+               "st %%o1,[%0+0x20]\n\t" \
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    65
+               "st %%o2,[%0+0x24]\n\t" \
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    66
+               "st %%o3,[%0+0x28]\n\t" \
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    67
+               "st %%o4,[%0+0x2c]\n\t" \
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    68
+               "st %%o5,[%0+0x30]\n\t" \
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    69
+               "st %%o6,[%0+0x34]\n\t" \
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    70
+               "st %%o7,[%0+0x38]\n\t" \
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    71
+               :                       \
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    72
+               : "r" (ptr)             \
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    73
+               : "memory"                      \
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    74
+       )
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    75
 #endif
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    76
 
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    77
+#define ARCH_SIGCTX_SP(ctx)    (((ucontext_t *)(ctx))->uc_mcontext.gregs [REG_SP])
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    78
+#define ARCH_SIGCTX_IP(ctx)    (((ucontext_t *)(ctx))->uc_mcontext.gregs [REG_PC])
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    79
+#define ARCH_COPY_SIGCTX_REGS(a,ctx) do {      \
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    80
+       (a)[0] = (gpointer) (((ucontext_t *)(ctx))->uc_mcontext.gregs [REG_G1]);        \
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    81
+       (a)[1] = (gpointer) (((ucontext_t *)(ctx))->uc_mcontext.gregs [REG_G2]);        \
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    82
+       (a)[2] = (gpointer) (((ucontext_t *)(ctx))->uc_mcontext.gregs [REG_G3]);        \
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    83
+       (a)[3] = (gpointer) (((ucontext_t *)(ctx))->uc_mcontext.gregs [REG_G4]);        \
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    84
+       (a)[4] = (gpointer) (((ucontext_t *)(ctx))->uc_mcontext.gregs [REG_G5]);        \
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    85
+       (a)[5] = (gpointer) (((ucontext_t *)(ctx))->uc_mcontext.gregs [REG_G6]);        \
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    86
+       (a)[6] = (gpointer) (((ucontext_t *)(ctx))->uc_mcontext.gregs [REG_G7]);        \
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    87
+       (a)[7] = (gpointer) (((ucontext_t *)(ctx))->uc_mcontext.gregs [REG_O0]);        \
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    88
+       (a)[8] = (gpointer) (((ucontext_t *)(ctx))->uc_mcontext.gregs [REG_O1]);        \
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    89
+       (a)[9] = (gpointer) (((ucontext_t *)(ctx))->uc_mcontext.gregs [REG_O2]);        \
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    90
+       (a)[10] = (gpointer) (((ucontext_t *)(ctx))->uc_mcontext.gregs [REG_O3]);       \
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    91
+       (a)[11] = (gpointer) (((ucontext_t *)(ctx))->uc_mcontext.gregs [REG_O4]);       \
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    92
+       (a)[12] = (gpointer) (((ucontext_t *)(ctx))->uc_mcontext.gregs [REG_O5]);       \
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    93
+       (a)[13] = (gpointer) (((ucontext_t *)(ctx))->uc_mcontext.gregs [REG_O6]);       \
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    94
+       (a)[14] = (gpointer) (((ucontext_t *)(ctx))->uc_mcontext.gregs [REG_O7]);       \
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    95
+       } while (0)
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
    96
+
3659
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
    97
+#endif
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
    98
+
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
    99
 #endif /* __MONO_SGENARCHDEP_H__ */
3798
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
   100
--- a/mono/utils/mono-sigcontext.h	Mon Sep 19 03:05:28 2011
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
   101
+++ b/mono/utils/mono-sigcontext.h	Mon Sep 19 03:06:21 2011
3659
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   102
@@ -67,6 +67,16 @@
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   103
 	#define UCONTEXT_REG_ESI(ctx) (((ucontext_t*)(ctx))->sc_esi)
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   104
 	#define UCONTEXT_REG_EDI(ctx) (((ucontext_t*)(ctx))->sc_edi)
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   105
 	#define UCONTEXT_REG_EIP(ctx) (((ucontext_t*)(ctx))->sc_eip)
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   106
+#elif defined(PLATFORM_SOLARIS)
3798
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
   107
+       #define UCONTEXT_REG_EAX(ctx) (((ucontext_t*)(ctx))->uc_mcontext.gregs [EAX])
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
   108
+       #define UCONTEXT_REG_EBX(ctx) (((ucontext_t*)(ctx))->uc_mcontext.gregs [EBX])
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
   109
+       #define UCONTEXT_REG_ECX(ctx) (((ucontext_t*)(ctx))->uc_mcontext.gregs [ECX])
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
   110
+       #define UCONTEXT_REG_EDX(ctx) (((ucontext_t*)(ctx))->uc_mcontext.gregs [EDX])
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
   111
+       #define UCONTEXT_REG_EBP(ctx) (((ucontext_t*)(ctx))->uc_mcontext.gregs [EBP])
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
   112
+       #define UCONTEXT_REG_ESP(ctx) (((ucontext_t*)(ctx))->uc_mcontext.gregs [ESP])
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
   113
+       #define UCONTEXT_REG_ESI(ctx) (((ucontext_t*)(ctx))->uc_mcontext.gregs [ESI])
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
   114
+       #define UCONTEXT_REG_EDI(ctx) (((ucontext_t*)(ctx))->uc_mcontext.gregs [EDI])
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
   115
+       #define UCONTEXT_REG_EIP(ctx) (((ucontext_t*)(ctx))->uc_mcontext.gregs [EIP])
3659
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   116
 #else
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   117
 	#define UCONTEXT_REG_EAX(ctx) (((ucontext_t*)(ctx))->uc_mcontext.gregs [REG_EAX])
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   118
 	#define UCONTEXT_REG_EBX(ctx) (((ucontext_t*)(ctx))->uc_mcontext.gregs [REG_EBX])
3798
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
   119
--- a/configure	Mon Sep 19 03:06:47 2011
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
   120
+++ b/configure	Mon Sep 19 03:07:30 2011
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
   121
@@ -22898,6 +22898,7 @@
3659
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   122
 			# foo.c:6: warning: visibility attribute not supported in this configuration; ignored
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   123
 			# ld: fatal: relocation error: R_386_GOTOFF: file /var/tmp//ccxYR96k.o: symbol astruct: relocation must bind locally
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   124
 			have_visibility_hidden=no
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   125
+			sgen_supported=true
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   126
 			;;
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   127
 		  cygwin*)
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   128
 			have_visibility_hidden=no
3798
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
   129
@@ -23017,6 +23018,7 @@
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
   130
 		if test x"$AR" = xfalse; then
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
   131
 			as_fn_error $? "The required utility 'ar' is not found in your PATH. Usually it can be found in /usr/ccs/bin." "$LINENO" 5
3659
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   132
 		fi
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   133
+		sgen_supported=true
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   134
 		;;
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   135
        alpha*-*-linux* | alpha*-*-osf*)
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   136
 		TARGET=ALPHA;
3798
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
   137
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/X11Keyboard.cs	Mon Sep 19 03:11:00 2011
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
   138
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/X11Keyboard.cs	Mon Sep 19 03:19:04 2011
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
   139
@@ -208,6 +208,8 @@
3659
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   140
 				XSetICFocus (xic);
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   141
 		}
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   142
 
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   143
+		private bool have_Xutf8ResetIC = true;
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   144
+
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   145
 		public void FocusOut (IntPtr window)
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   146
 		{
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   147
 			if (xim == IntPtr.Zero)
3798
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
   148
@@ -216,7 +218,13 @@
3659
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   149
 			this.client_window = IntPtr.Zero;
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   150
 			IntPtr xic = GetXic (window);
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   151
 			if (xic != IntPtr.Zero) {
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   152
-				Xutf8ResetIC (xic);
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   153
+				if (have_Xutf8ResetIC) {
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   154
+					try {
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   155
+						Xutf8ResetIC (xic);
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   156
+					} catch (EntryPointNotFoundException) {
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   157
+						have_Xutf8ResetIC = false;
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   158
+					}
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   159
+				}
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   160
 				XUnsetICFocus (xic);
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   161
 			}
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   162
 		}
3798
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
   163
@@ -1173,6 +1181,8 @@
3659
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   164
 			}
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   165
 		}
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   166
 
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   167
+		private bool have_Xutf8LookupString = true;
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   168
+
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   169
 		private int LookupString (ref XEvent xevent, int len, out XKeySym keysym, out IntPtr status)
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   170
 		{
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   171
 			IntPtr keysym_res;
3798
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
   172
@@ -1180,9 +1190,27 @@
3659
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   173
 
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   174
 			status = IntPtr.Zero;
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   175
 			IntPtr xic = GetXic (client_window);
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   176
-			if (xic != IntPtr.Zero) {
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   177
+			if (xic != IntPtr.Zero && have_Xutf8LookupString) {
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   178
 				do {
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   179
-					res = Xutf8LookupString (xic, ref xevent, lookup_byte_buffer, 100, out keysym_res,  out status);
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   180
+					try {
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   181
+						res = Xutf8LookupString (xic, ref xevent, lookup_byte_buffer, 100, out keysym_res,  out status);
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   182
+					} catch (EntryPointNotFoundException) {
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   183
+						have_Xutf8LookupString = false;
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   184
+
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   185
+						/* Duplicate of the non-xic clause */
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   186
+						do {
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   187
+							res = XLookupString (ref xevent, lookup_byte_buffer, 100, out keysym_res, out status);
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   188
+							if ((int) status != -1) // XLookupBufferOverflow
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   189
+								break;
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   190
+							lookup_byte_buffer = new byte [lookup_byte_buffer.Length << 1];
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   191
+						} while (true);
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   192
+						lookup_buffer.Length = 0;
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   193
+						string s2 = Encoding.ASCII.GetString (lookup_byte_buffer, 0, res);
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   194
+						lookup_buffer.Append (s2);
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   195
+						keysym = (XKeySym) keysym_res.ToInt32 ();
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   196
+						return res;
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   197
+					}
3798
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
   198
+					
3659
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   199
 					if ((int) status != -1) // XLookupBufferOverflow
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   200
 						break;
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   201
 					lookup_byte_buffer = new byte [lookup_byte_buffer.Length << 1];
3798
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
   202
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs	Mon Sep 19 03:19:48 2011
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
   203
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs	Mon Sep 19 03:23:16 2011
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
   204
@@ -499,6 +499,12 @@
3659
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   205
 
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   206
 				wake = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.IP);
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   207
 				wake.Connect(listen.LocalEndPoint);
3798
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
   208
+				
3659
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   209
+				// Make this non-blocking, so it doesn't
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   210
+				// deadlock if too many wakes are sent
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   211
+				// before the wake_receive end is polled
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   212
+				wake.Blocking = false;
3798
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
   213
+				
3659
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   214
 				wake_receive = listen.Accept();
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   215
 
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   216
 				#if __MonoCS__
3798
9e63fe04e9f8 2011-09-28 James Choi <[email protected]>
jchoi42
parents: 3659
diff changeset
   217
@@ -1230,7 +1236,13 @@
3659
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   218
 		}
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   219
 
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   220
 		void WakeupMain () {
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   221
-			wake.Send (new byte [] { 0xFF });
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   222
+			try {
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   223
+				wake.Send (new byte [] { 0xFF });
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   224
+			} catch (SocketException ex) {
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   225
+				if (ex.SocketErrorCode != SocketError.WouldBlock) {
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   226
+					throw;
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   227
+				}
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   228
+			}
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   229
 		}
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   230
 
a93ff421c981 SFEmono.spec: bump to 2.10.2
jurikm
parents:
diff changeset
   231
 		XEventQueue ThreadQueue(Thread thread) {