diff options
author | Hajimu UMEMOTO <ume@FreeBSD.org> | 2006-01-20 19:32:32 +0000 |
---|---|---|
committer | Hajimu UMEMOTO <ume@FreeBSD.org> | 2006-01-20 19:32:32 +0000 |
commit | 0b7f56dce4ce7fdb013d6f049bfd0fa6d8aff15c (patch) | |
tree | 38ca48e67213f91c94b491eee9b652cfe56fb920 /lang/ruby18 | |
parent | Update from 1.3.6 to 1.3.7. Prepare for the looming Xorg release, (diff) |
eval.c (FUNCTION_CALL_MAY_RETURN_TWICE): use only for SPARC and IA64
before gcc 4.0.3.
previous one broke xcgroup of XCAST6:
http://sourceforge.net/projects/xcast6/
Reported by: SUZUKI Koichi <metal__at__gc5.so-net.ne.jp>
Obtained from: http://www.ruby-lang.org/cgi-bin/cvsweb.cgi/ruby/eval.c.diff?r1=1.616.2.148;r2=1.616.2.149
Notes
Notes:
svn path=/head/; revision=154007
Diffstat (limited to 'lang/ruby18')
-rw-r--r-- | lang/ruby18/Makefile | 2 | ||||
-rw-r--r-- | lang/ruby18/files/patch-eval.c | 58 |
2 files changed, 43 insertions, 17 deletions
diff --git a/lang/ruby18/Makefile b/lang/ruby18/Makefile index d22c770816c5..17929f5f0755 100644 --- a/lang/ruby18/Makefile +++ b/lang/ruby18/Makefile @@ -7,7 +7,7 @@ PORTNAME= ruby PORTVERSION= ${RUBY_PORTVERSION} -PORTREVISION= 2 +PORTREVISION= 3 PORTEPOCH= 1 CATEGORIES= lang ruby ipv6 MASTER_SITES= ${MASTER_SITE_RUBY} diff --git a/lang/ruby18/files/patch-eval.c b/lang/ruby18/files/patch-eval.c index 92160482485c..06f539215e5e 100644 --- a/lang/ruby18/files/patch-eval.c +++ b/lang/ruby18/files/patch-eval.c @@ -1,6 +1,8 @@ ---- eval.c 2005/12/31 13:57:36 1.616.2.147 -+++ eval.c 2006/01/18 15:01:22 1.616.2.148 -@@ -129,7 +129,8 @@ rb_jump_context(env, val) +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) * But it has not the problem because gcc knows setjmp may return twice. * gcc detects setjmp and generates setjmp safe code. * @@ -10,31 +12,55 @@ * It fix the problem on IA64. * It is not required that setjmp is called at run time, since the problem is * register usage. -@@ -138,11 +139,23 @@ rb_jump_context(env, val) + * + * Since the magic setjmp is not enough for SPARC, * inline asm is used to prohibit registers in register windows. - */ - #if defined (__GNUC__) && (defined(sparc) || defined(__sparc__)) ++ * ++ * Since the problem is fixed at gcc 4.0.3, the magic is applied only for ++ * prior versions of gcc. ++ * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21957 ++ * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22127 ++ */ ++#define GCC_VERSION_BEFORE(major, minor, patchlevel) \ ++ (defined(__GNUC__) && !defined(__INTEL_COMPILER) && \ ++ ((__GNUC__ < (major)) || \ ++ (__GNUC__ == (major) && __GNUC_MINOR__ < (minor)) || \ ++ (__GNUC__ == (major) && __GNUC_MINOR__ == (minor) && __GNUC_PATCHLEVEL__ < (patchlevel)))) ++#if GCC_VERSION_BEFORE(4,0,3) ++#if defined(sparc) || defined(__sparc__) +#ifdef __pic__ +/* + * %l7 is excluded for PIC because it is PIC register. + * http://lists.freebsd.org/pipermail/freebsd-sparc64/2006-January/003739.html -+ */ -+#define FUNCTION_CALL_MAY_RETURN_TWICE \ -+ ({ __asm__ volatile ("" : : : \ -+ "%o0", "%o1", "%o2", "%o3", "%o4", "%o5", "%o7", \ -+ "%l0", "%l1", "%l2", "%l3", "%l4", "%l5", "%l6", \ -+ "%i0", "%i1", "%i2", "%i3", "%i4", "%i5", "%i7"); }) -+#else + */ +-#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", "%l7", \ ++ "%l0", "%l1", "%l2", "%l3", "%l4", "%l5", "%l6", \ "%i0", "%i1", "%i2", "%i3", "%i4", "%i5", "%i7"); }) -+#endif #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) static jmp_buf function_call_may_return_twice_jmp_buf; int function_call_may_return_twice_false = 0; -@@ -155,6 +168,7 @@ int function_call_may_return_twice_false + #define FUNCTION_CALL_MAY_RETURN_TWICE \ + (function_call_may_return_twice_false ? \ + setjmp(function_call_may_return_twice_jmp_buf) : \ + 0) ++#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) #define ruby_setjmp(j) ((j)->status = 0, \ FUNCTION_CALL_MAY_RETURN_TWICE, \ getcontext(&(j)->context), \ |