-
Notifications
You must be signed in to change notification settings - Fork 0
/
rb-9.1.0-svn-diff.patch
452 lines (435 loc) · 14.8 KB
/
rb-9.1.0-svn-diff.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
Index: src/broker/cas_net_buf.h
===================================================================
--- src/broker/cas_net_buf.h (revision 10811)
+++ src/broker/cas_net_buf.h (working copy)
@@ -44,7 +44,7 @@
#if (defined(SOLARIS) && !defined(SOLARIS_X86)) || defined(HPUX) || defined(AIX) || defined(PPC_LINUX)
#define BYTE_ORDER_BIG_ENDIAN
-#elif defined(WINDOWS) || defined(LINUX) || defined(OSF1) || defined(ALPHA_LINUX) || defined(UNIXWARE7) || defined(SOLARIS_X86)
+#elif defined(WINDOWS) || defined(LINUX) || defined(OSF1) || defined(ALPHA_LINUX) || defined(UNIXWARE7) || defined(SOLARIS_X86) || defined(MAC_OS)
#ifdef BYTE_ORDER_BIG_ENDIAN
#error BYTE_ORDER_BIG_ENDIAN defined
#endif
Index: src/cci/cci_net_buf.h
===================================================================
--- src/cci/cci_net_buf.h (revision 10811)
+++ src/cci/cci_net_buf.h (working copy)
@@ -56,7 +56,7 @@
#if (defined(SOLARIS) && !defined(SOLARIS_X86)) || defined(HPUX) || defined(AIX)
#define BYTE_ORDER_BIG_ENDIAN
-#elif defined(WINDOWS) || defined(LINUX) || defined(SOLARIS_X86)
+#elif defined(WINDOWS) || defined(LINUX) || defined(SOLARIS_X86) || defined(MAC_OS)
#ifdef BYTE_ORDER_BIG_ENDIAN
#error BYTE_ORDER_BIG_ENDIAN defined
#endif
Index: src/cci/cci_common.h
===================================================================
--- src/cci/cci_common.h (revision 10811)
+++ src/cci/cci_common.h (working copy)
@@ -67,6 +67,8 @@
#if defined(WINDOWS)
#define __func__ __FUNCTION__
#define gettid() GetCurrentThreadId()
+#elif defined(MAC_OS)
+#define gettid() getpid()
#else
#define gettid() syscall(__NR_gettid)
#endif
Index: src/base/getopt.h
===================================================================
--- src/base/getopt.h (revision 10811)
+++ src/base/getopt.h (working copy)
@@ -61,6 +61,7 @@
{
#endif
+#if !defined(MAC_OS)
int getopt (int, char *const *, const char *);
int getopt_long (int, char *const *, const char *,
const struct option *, int *);
@@ -77,6 +78,7 @@
extern int optind;
extern int optopt;
#endif
+#endif
#ifdef __cplusplus
};
Index: src/base/porting.h
===================================================================
--- src/base/porting.h (revision 10811)
+++ src/base/porting.h (working copy)
@@ -33,6 +33,10 @@
#define __attribute__(X)
#endif
+#if defined(MAC_OS)
+#include <stdlib.h>
+#endif
+
#if defined(WINDOWS)
#define IMPORT_VAR __declspec(dllimport)
#define EXPORT_VAR __declspec(dllexport)
@@ -258,7 +262,7 @@
/*
#define _setjmp setjmp
*/
-#else /* WINDOWS */
+#elif !defined(MAC_OS) /* WINDOWS */
#if !defined(HAVE_CTIME_R)
# error "HAVE_CTIME_R"
@@ -428,7 +432,7 @@
va_list argptr);
#endif
-#if defined(WINDOWS)
+#if defined(WINDOWS) || defined(MAC_OS)
/* The following structure is used to generate uniformly distributed
* pseudo-random numbers reentrantly.
*/
@@ -436,7 +440,9 @@
{
unsigned short _rand48_seed[3];
};
+#endif
+#if defined(WINDOWS)
/* These functions are implemented in rand.c. And rand.c will be included
* on Windows build.
*/
@@ -457,10 +463,13 @@
} pthread_mutex_t;
typedef HANDLE pthread_mutexattr_t;
+#endif
-
+#if defined(WINDOWS) || defined(MAC_OS)
#define PTHREAD_MUTEX_INITIALIZER {{ NULL, 0, 0, NULL, NULL, 0 }, NULL}
+#endif
+#if defined(WINDOWS)
typedef union
{
CONDITION_VARIABLE native_cond;
Index: configure.ac
===================================================================
--- configure.ac (revision 10811)
+++ configure.ac (working copy)
@@ -90,7 +90,7 @@
case $SYSTEM_TYPE in
*linux*) SYS_DEFS="-DGCC -DLINUX -D_GNU_SOURCE -DI386"
SYS_LIBS="" ;;
- *) SYS_DEFS=""
+ *) SYS_DEFS="-DMAC_OS"
SYS_LIBS="" ;;
esac
Index: external/gc6.7/darwin_stop_world.c
===================================================================
--- external/gc6.7/darwin_stop_world.c (revision 10811)
+++ external/gc6.7/darwin_stop_world.c (working copy)
@@ -79,6 +79,8 @@
ppc_thread_state_t state;
#elif defined(I386)
i386_thread_state_t state;
+#elif defined(X86_64)
+ x86_thread_state64_t state;
#else
# error FIXME for non-x86 || ppc architectures
#endif
@@ -102,15 +104,36 @@
if(r != KERN_SUCCESS) ABORT("thread_get_state failed");
#if defined(I386)
- lo = state.esp;
+ lo = state.__esp;
- GC_push_one(state.eax);
- GC_push_one(state.ebx);
- GC_push_one(state.ecx);
- GC_push_one(state.edx);
- GC_push_one(state.edi);
- GC_push_one(state.esi);
- GC_push_one(state.ebp);
+ GC_push_one(state.__eax);
+ GC_push_one(state.__ebx);
+ GC_push_one(state.__ecx);
+ GC_push_one(state.__edx);
+ GC_push_one(state.__edi);
+ GC_push_one(state.__esi);
+ GC_push_one(state.__ebp);
+#elif defined(X86_64)
+ lo = (void *)state.THREAD_FLD(rsp);
+# ifndef DARWIN_DONT_PARSE_STACK
+ *phi = GC_FindTopOfStack(state.THREAD_FLD(rsp));
+# endif
+ GC_push_one(state.THREAD_FLD(rax));
+ GC_push_one(state.THREAD_FLD(rbx));
+ GC_push_one(state.THREAD_FLD(rcx));
+ GC_push_one(state.THREAD_FLD(rdx));
+ GC_push_one(state.THREAD_FLD(rdi));
+ GC_push_one(state.THREAD_FLD(rsi));
+ GC_push_one(state.THREAD_FLD(rbp));
+ /* GC_push_one(state.THREAD_FLD(rsp)); */
+ GC_push_one(state.THREAD_FLD(r8));
+ GC_push_one(state.THREAD_FLD(r9));
+ GC_push_one(state.THREAD_FLD(r10));
+ GC_push_one(state.THREAD_FLD(r11));
+ GC_push_one(state.THREAD_FLD(r12));
+ GC_push_one(state.THREAD_FLD(r13));
+ GC_push_one(state.THREAD_FLD(r14));
+ GC_push_one(state.THREAD_FLD(r15));
#elif defined(POWERPC)
lo = (void*)(state.r1 - PPC_RED_ZONE_SIZE);
Index: external/gc6.7/include/private/gc_priv.h
===================================================================
--- external/gc6.7/include/private/gc_priv.h (revision 10811)
+++ external/gc6.7/include/private/gc_priv.h (working copy)
@@ -464,6 +464,59 @@
# define GETENV(name) 0
#endif
+#if defined(DARWIN)
+# if defined(POWERPC)
+# if CPP_WORDSZ == 32
+# define GC_THREAD_STATE_T ppc_thread_state_t
+# define GC_MACH_THREAD_STATE PPC_THREAD_STATE
+# define GC_MACH_THREAD_STATE_COUNT PPC_THREAD_STATE_COUNT
+# else
+# define GC_THREAD_STATE_T ppc_thread_state64_t
+# define GC_MACH_THREAD_STATE PPC_THREAD_STATE64
+# define GC_MACH_THREAD_STATE_COUNT PPC_THREAD_STATE64_COUNT
+# endif
+# elif defined(I386) || defined(X86_64)
+# if CPP_WORDSZ == 32
+# define GC_THREAD_STATE_T x86_thread_state32_t
+# define GC_MACH_THREAD_STATE x86_THREAD_STATE32
+# define GC_MACH_THREAD_STATE_COUNT x86_THREAD_STATE32_COUNT
+# else
+# define GC_THREAD_STATE_T x86_thread_state64_t
+# define GC_MACH_THREAD_STATE x86_THREAD_STATE64
+# define GC_MACH_THREAD_STATE_COUNT x86_THREAD_STATE64_COUNT
+# endif
+# else
+# if defined(ARM32)
+# define GC_THREAD_STATE_T arm_thread_state_t
+# else
+# error define GC_THREAD_STATE_T
+# endif
+# define GC_MACH_THREAD_STATE MACHINE_THREAD_STATE
+# define GC_MACH_THREAD_STATE_COUNT MACHINE_THREAD_STATE_COUNT
+# endif
+
+# if CPP_WORDSZ == 32
+# define GC_MACH_HEADER mach_header
+# define GC_MACH_SECTION section
+# define GC_GETSECTBYNAME getsectbynamefromheader
+# else
+# define GC_MACH_HEADER mach_header_64
+# define GC_MACH_SECTION section_64
+# define GC_GETSECTBYNAME getsectbynamefromheader_64
+# endif
+
+ /* Try to work out the right way to access thread state structure */
+ /* members. The structure has changed its definition in different */
+ /* Darwin versions. This now defaults to the (older) names */
+ /* without __, thus hopefully, not breaking any existing */
+ /* Makefile.direct builds. */
+# if __DARWIN_UNIX03
+# define THREAD_FLD(x) __ ## x
+# else
+# define THREAD_FLD(x) x
+# endif
+#endif /* DARWIN */
+
/*********************************/
/* */
/* Word-size-dependent defines */
Index: external/gc6.7/include/private/gcconfig.h
===================================================================
--- external/gc6.7/include/private/gcconfig.h (revision 10811)
+++ external/gc6.7/include/private/gcconfig.h (working copy)
@@ -59,6 +59,11 @@
# define FREEBSD
# endif
+/* And one for Darwin: */
+# if defined(macosx) || (defined(__APPLE__) && defined(__MACH__))
+# define DARWIN
+# endif
+
/* Determine the machine type: */
# if defined(__arm__) || defined(__thumb__)
# define ARM32
@@ -297,8 +302,11 @@
# define MACOS
# define mach_type_known
# endif
-# if defined(macosx) || (defined(__APPLE__) && defined(__MACH__))
+# if defined(macosx) || (defined(__APPLE__) && defined(__MACH__)) || defined(MAC_OS)
# define DARWIN
+# define DATASTART ((ptr_t) get_etext())
+# define DATAEND /* not needed */
+# define STACKBOTTOM ((ptr_t) LMGetCurStackBase())
# if defined(__ppc__) || defined(__ppc64__)
# define POWERPC
# define mach_type_known
@@ -306,6 +314,13 @@
# if defined(__i386__)
# define I386
# define mach_type_known
+# elif defined(__x86_64__) || defined(__x86_64)
+# define X86_64
+# define mach_type_known
+# elif defined(__arm__)
+# define ARM32
+# define mach_type_known
+# define DARWIN_DONT_PARSE_STACK
# endif
# endif
# if defined(NeXT) && defined(mc68000)
@@ -795,27 +810,29 @@
# define DATAEND (_end)
# endif
# ifdef DARWIN
-# ifdef __ppc64__
+# define OS_TYPE "DARWIN"
+# define DYNAMIC_LOADING
+# if defined(__ppc64__)
# define ALIGNMENT 8
# define CPP_WORDSZ 64
+# define STACKBOTTOM ((ptr_t) 0x7fff5fc00000)
+# define CACHE_LINE_SIZE 64
+# ifndef HBLKSIZE
+# define HBLKSIZE 4096
+# endif
# else
# define ALIGNMENT 4
+# define STACKBOTTOM ((ptr_t) 0xc0000000)
# endif
-# define OS_TYPE "DARWIN"
-# define DYNAMIC_LOADING
/* XXX: see get_end(3), get_etext() and get_end() should not be used.
These aren't used when dyld support is enabled (it is by default) */
# define DATASTART ((ptr_t) get_etext())
-# define DATAEND ((ptr_t) get_end())
-# define STACKBOTTOM ((ptr_t) 0xc0000000)
-# define USE_MMAP
+# define DATAEND ((ptr_t) get_end())
+# ifndef USE_MMAP
+# define USE_MMAP
+# endif
# define USE_MMAP_ANON
-# define USE_ASM_PUSH_REGS
- /* This is potentially buggy. It needs more testing. See the comments in
- os_dep.c. It relies on threads to track writes. */
-# ifdef GC_DARWIN_THREADS
-/* # define MPROTECT_VDB -- diabled for now. May work for some apps. */
-# endif
+# define MPROTECT_VDB
# include <unistd.h>
# define GETPAGESIZE() getpagesize()
# if defined(USE_PPC_PREFETCH) && defined(__GNUC__)
@@ -1318,14 +1335,11 @@
# define DATASTART ((ptr_t) get_etext())
# define DATAEND ((ptr_t) get_end())
# define STACKBOTTOM ((ptr_t) 0xc0000000)
-# define USE_MMAP
+# ifndef USE_MMAP
+# define USE_MMAP
+# endif
# define USE_MMAP_ANON
-# define USE_ASM_PUSH_REGS
- /* This is potentially buggy. It needs more testing. See the comments in
- os_dep.c. It relies on threads to track writes. */
-# ifdef GC_DARWIN_THREADS
-/* # define MPROTECT_VDB -- disabled for now. May work for some apps. */
-# endif
+# define MPROTECT_VDB
# include <unistd.h>
# define GETPAGESIZE() getpagesize()
/* There seems to be some issues with trylock hanging on darwin. This
@@ -1993,6 +2007,49 @@
# define PREFETCH_FOR_WRITE(x) __builtin_prefetch((x), 1)
# endif
# endif
+# ifdef DARWIN
+# define OS_TYPE "DARWIN"
+# define DARWIN_DONT_PARSE_STACK
+# define DYNAMIC_LOADING
+ /* XXX: see get_end(3), get_etext() and get_end() should not be used. */
+ /* These aren't used when dyld support is enabled (it is by default) */
+# define DATASTART ((ptr_t) get_etext())
+# define DATAEND ((ptr_t) get_end())
+# define STACKBOTTOM ((ptr_t) 0x7fff5fc00000)
+# ifndef USE_MMAP
+# define USE_MMAP
+# endif
+# define USE_MMAP_ANON
+# define MPROTECT_VDB
+# include <unistd.h>
+# define GETPAGESIZE() getpagesize()
+ /* There seems to be some issues with trylock hanging on darwin. */
+ /* This should be looked into some more. */
+# define NO_PTHREAD_TRYLOCK
+# endif
+# ifdef FREEBSD
+# define OS_TYPE "FREEBSD"
+# ifndef GC_FREEBSD_THREADS
+# define MPROTECT_VDB
+# endif
+# ifdef __GLIBC__
+# define SIG_SUSPEND (32+6)
+# define SIG_THR_RESTART (32+5)
+ extern int _end[];
+# define DATAEND (ptr_t)(_end)
+# else
+# define SIG_SUSPEND SIGUSR1
+# define SIG_THR_RESTART SIGUSR2
+# endif
+# define FREEBSD_STACKBOTTOM
+# ifdef __ELF__
+# define DYNAMIC_LOADING
+# endif
+ extern char etext[];
+ ptr_t GC_FreeBSDGetDataStart(size_t, ptr_t);
+# define DATASTART GC_FreeBSDGetDataStart(0x1000, (ptr_t)etext)
+# define DATASTART_IS_FUNC
+# endif
# ifdef NETBSD
# define OS_TYPE "NETBSD"
# ifdef __ELF__
Index: external/gc6.7/os_dep.c
===================================================================
--- external/gc6.7/os_dep.c (revision 10811)
+++ external/gc6.7/os_dep.c (working copy)
@@ -3802,10 +3802,17 @@
mach_msg_type_number_t exc_state_count = PPC_EXCEPTION_STATE64_COUNT;
ppc_exception_state64_t exc_state;
# endif
-# elif defined(I386)
+# elif defined(I386) || defined(X86_64)
+# if CPP_WORDSZ == 32
thread_state_flavor_t flavor = i386_EXCEPTION_STATE;
mach_msg_type_number_t exc_state_count = i386_EXCEPTION_STATE_COUNT;
i386_exception_state_t exc_state;
+# else
+ thread_state_flavor_t flavor = x86_EXCEPTION_STATE64;
+ mach_msg_type_number_t exc_state_count = x86_EXCEPTION_STATE64_COUNT;
+ x86_exception_state64_t exc_state;
+# endif
+# define DARWIN_EXC_STATE_DAR THREAD_FLD(faultvaddr)
# else
# error FIXME for non-ppc/x86 darwin
# endif
@@ -3839,8 +3846,8 @@
/* This is the address that caused the fault */
#if defined(POWERPC)
addr = (char*) exc_state.dar;
-#elif defined (I386)
- addr = (char*) exc_state.faultvaddr;
+#elif defined (I386) || defined(X86_64)
+ addr = (char*) exc_state.DARWIN_EXC_STATE_DAR;
#else
# error FIXME for non POWERPC/I386
#endif
Index: external/libregex38a/include/regex38a.h
===================================================================
--- external/libregex38a/include/regex38a.h (revision 10811)
+++ external/libregex38a/include/regex38a.h (working copy)
@@ -1,5 +1,5 @@
-#ifndef _REGEX_H_
-#define _REGEX_H_ /* never again */
+#ifndef _CUB_REGEX_H_
+#define _CUB_REGEX_H_ /* never again */
/* ========= begin header generated by ./mkh ========= */
#ifdef __cplusplus
extern "C" {