diff options
author | Hajimu UMEMOTO <ume@FreeBSD.org> | 2006-01-21 18:11:33 +0000 |
---|---|---|
committer | Hajimu UMEMOTO <ume@FreeBSD.org> | 2006-01-21 18:11:33 +0000 |
commit | d105ac64b38b06a6f275e7a1abdac9dc0853f57e (patch) | |
tree | ecf6c4d106f71ea9f222a23fed126d60ca2d8e7c /lang/ruby18 | |
parent | Upgrade to the latest cvs snapshot(0.9.8.a.20060120). (diff) |
fix build on AMD64 for workaround.
Reported by: many
Notes
Notes:
svn path=/head/; revision=154070
Diffstat (limited to 'lang/ruby18')
-rw-r--r-- | lang/ruby18/files/patch-eval.c | 39 |
1 files changed, 22 insertions, 17 deletions
diff --git a/lang/ruby18/files/patch-eval.c b/lang/ruby18/files/patch-eval.c index 06f539215e5e..9c0f6694b835 100644 --- a/lang/ruby18/files/patch-eval.c +++ b/lang/ruby18/files/patch-eval.c @@ -1,8 +1,8 @@ Index: eval.c diff -u -p eval.c.orig eval.c --- eval.c.orig Tue Dec 20 22:41:47 2005 -+++ eval.c Sat Jan 21 04:13:25 2006 -@@ -129,32 +129,62 @@ rb_jump_context(env, val) ++++ eval.c Sun Jan 22 02:50:12 2006 +@@ -129,20 +129,44 @@ rb_jump_context(env, val) * But it has not the problem because gcc knows setjmp may return twice. * gcc detects setjmp and generates setjmp safe code. * @@ -34,37 +34,42 @@ diff -u -p eval.c.orig eval.c + * http://lists.freebsd.org/pipermail/freebsd-sparc64/2006-January/003739.html */ -#if defined (__GNUC__) && (defined(sparc) || defined(__sparc__)) - #define FUNCTION_CALL_MAY_RETURN_TWICE \ - ({ __asm__ volatile ("" : : : \ - "%o0", "%o1", "%o2", "%o3", "%o4", "%o5", "%o7", \ -- "%l0", "%l1", "%l2", "%l3", "%l4", "%l5", "%l6", "%l7", \ -+ "%l0", "%l1", "%l2", "%l3", "%l4", "%l5", "%l6", \ - "%i0", "%i1", "%i2", "%i3", "%i4", "%i5", "%i7"); }) - #else +#define FUNCTION_CALL_MAY_RETURN_TWICE \ + ({ __asm__ volatile ("" : : : \ + "%o0", "%o1", "%o2", "%o3", "%o4", "%o5", "%o7", \ -+ "%l0", "%l1", "%l2", "%l3", "%l4", "%l5", "%l6", "%l7", \ ++ "%l0", "%l1", "%l2", "%l3", "%l4", "%l5", "%l6", \ + "%i0", "%i1", "%i2", "%i3", "%i4", "%i5", "%i7"); }) ++#else + #define FUNCTION_CALL_MAY_RETURN_TWICE \ + ({ __asm__ volatile ("" : : : \ + "%o0", "%o1", "%o2", "%o3", "%o4", "%o5", "%o7", \ + "%l0", "%l1", "%l2", "%l3", "%l4", "%l5", "%l6", "%l7", \ + "%i0", "%i1", "%i2", "%i3", "%i4", "%i5", "%i7"); }) +#endif -+#elif defined(__ia64) + #else static jmp_buf function_call_may_return_twice_jmp_buf; int function_call_may_return_twice_false = 0; - #define FUNCTION_CALL_MAY_RETURN_TWICE \ - (function_call_may_return_twice_false ? \ +@@ -151,11 +175,23 @@ int function_call_may_return_twice_false setjmp(function_call_may_return_twice_jmp_buf) : \ 0) + #endif +#else +#define FUNCTION_CALL_MAY_RETURN_TWICE 0 +#endif -+#else -+#define FUNCTION_CALL_MAY_RETURN_TWICE 0 - #endif #define ruby_longjmp(env, val) rb_jump_context(env, val) ++#if GCC_VERSION_BEFORE(4,0,3) && \ ++ (defined(sparc) || defined(__sparc__) || defined(__ia64)) ++#define ruby_setjmp(j) ((j)->status = 0, \ ++ FUNCTION_CALL_MAY_RETURN_TWICE, \ ++ getcontext(&(j)->context), \ ++ FUNCTION_CALL_MAY_RETURN_TWICE, \ ++ (j)->status) ++#else #define ruby_setjmp(j) ((j)->status = 0, \ FUNCTION_CALL_MAY_RETURN_TWICE, \ getcontext(&(j)->context), \ -+ FUNCTION_CALL_MAY_RETURN_TWICE, \ (j)->status) ++#endif #else typedef jmp_buf rb_jmpbuf_t; + #if !defined(setjmp) && defined(HAVE__SETJMP) |