[前][次][番号順一覧][スレッド一覧]

ruby-changes:35194

From: nagachika <ko1@a...>
Date: Tue, 26 Aug 2014 00:04:28 +0900 (JST)
Subject: [ruby-changes:35194] nagachika:r47276 (ruby_2_1): merge revision(s) r45503, r45504, r45508, r45509, r47275: [Backport #9692]

nagachika	2014-08-26 00:03:42 +0900 (Tue, 26 Aug 2014)

  New Revision: 47276

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=47276

  Log:
    merge revision(s) r45503,r45504,r45508,r45509,r47275: [Backport #9692]
    
    * configure.in (ac_cv_func___builtin_setjmp): gcc 4.9 disallows a
      variable as the second argument of __builtin_longjmp().
      [ruby-core:61800] [Bug #9692]
    
    * configure.in (ac_cv_func___builtin_setjmp): __builtin_longjmp() in
      clang 5.1 uses `void**`, not `jmp_buf`.  [Bug #9692]
    
    * configure.in (ac_cv_func___builtin_setjmp): __builtin_longjmp()
      in Apple LLVM 5.1 (LLVM 3.4svn) uses `void**`, not `jmp_buf`.
      [Bug #9692]

  Modified directories:
    branches/ruby_2_1/
  Modified files:
    branches/ruby_2_1/ChangeLog
    branches/ruby_2_1/configure.in
    branches/ruby_2_1/eval_intern.h
    branches/ruby_2_1/version.h
Index: ruby_2_1/eval_intern.h
===================================================================
--- ruby_2_1/eval_intern.h	(revision 47275)
+++ ruby_2_1/eval_intern.h	(revision 47276)
@@ -154,7 +154,8 @@ NORETURN(static inline void rb_threadptr https://github.com/ruby/ruby/blob/trunk/ruby_2_1/eval_intern.h#L154
 static inline void
 rb_threadptr_tag_jump(rb_thread_t *th, int st)
 {
-    ruby_longjmp(th->tag->buf, (th->state = st));
+    th->state = st;
+    ruby_longjmp(th->tag->buf, 1);
 }
 
 /*
Index: ruby_2_1/configure.in
===================================================================
--- ruby_2_1/configure.in	(revision 47275)
+++ ruby_2_1/configure.in	(revision 47276)
@@ -2022,13 +2022,25 @@ AC_CACHE_CHECK(for sigsetjmp as a macro https://github.com/ruby/ruby/blob/trunk/ruby_2_1/configure.in#L2022
 	ac_cv_func_sigsetjmp=yes,
 	ac_cv_func_sigsetjmp=no)])
 
+if test x"${ac_cv_func___builtin_setjmp}" = xyes; then
+   unset ac_cv_func___builtin_setjmp
+fi
 AC_CACHE_CHECK(for __builtin_setjmp, ac_cv_func___builtin_setjmp,
+[
+for cast in "" "(void *)"; do
+RUBY_WERROR_FLAG(
 [AC_TRY_LINK([@%:@include <setjmp.h>
-    jmp_buf jb; void t(v) int v; {__builtin_longjmp(jb, v);}],
-    [__builtin_setjmp(jb);],
-    [ac_cv_func___builtin_setjmp=yes],
+    @%:@include <stdio.h>
+    jmp_buf jb;
+    void t(void) {__builtin_longjmp($cast jb, 1);}],
+    [
+    void (*volatile f)(void) = t;
+    if (!__builtin_setjmp($cast jb)) printf("%d\n", f != 0);
+    ],
+    [ac_cv_func___builtin_setjmp="yes with cast ($cast)"; break],
     [ac_cv_func___builtin_setjmp=no])
 ])
+done])
 
 # we don't use _setjmp if _longjmp doesn't exist.
 test x$ac_cv_func__longjmp = xno && ac_cv_func__setjmp=no
@@ -2046,11 +2058,13 @@ AC_ARG_WITH(setjmp-type, https://github.com/ruby/ruby/blob/trunk/ruby_2_1/configure.in#L2058
 	[setjmpex], [ setjmp_prefix= setjmp_suffix=ex],
 	[''], [ unset setjmp_prefix],
 	[   AC_MSG_ERROR(invalid setjmp type: $withval)])], [unset setjmp_prefix])
+setjmp_cast=
 if test ${setjmp_prefix+set}; then
     if test "${setjmp_prefix}" && eval test '$ac_cv_func_'${setjmp_prefix}setjmp${setjmp_suffix} = no; then
 	AC_MSG_ERROR(${setjmp_prefix}setjmp${setjmp_suffix} is not available)
     fi
-elif test "$ac_cv_func___builtin_setjmp" = yes; then
+elif { AS_CASE("$ac_cv_func___builtin_setjmp", [yes*], [true], [false]); }; then
+    setjmp_cast=`expr "$ac_cv_func___builtin_setjmp" : "yes with cast (\(.*\))"`
     setjmp_prefix=__builtin_
     setjmp_suffix=
 elif test "$ac_cv_header_setjmpex_h:$ac_cv_func__setjmpex" = yes:yes; then
@@ -2071,9 +2085,9 @@ if test x$setjmp_prefix = xsig; then https://github.com/ruby/ruby/blob/trunk/ruby_2_1/configure.in#L2085
 else
     unset setjmp_sigmask
 fi
-AC_MSG_RESULT(${setjmp_prefix}setjmp${setjmp_suffix})
-AC_DEFINE_UNQUOTED([RUBY_SETJMP(env)], [${setjmp_prefix}setjmp${setjmp_suffix}(env${setjmp_sigmask+,0})])
-AC_DEFINE_UNQUOTED([RUBY_LONGJMP(env,val)], [${setjmp_prefix}longjmp(env,val)])
+AC_MSG_RESULT(${setjmp_prefix}setjmp${setjmp_suffix}${setjmp_cast:+($setjmp_cast)})
+AC_DEFINE_UNQUOTED([RUBY_SETJMP(env)], [${setjmp_prefix}setjmp${setjmp_suffix}($setjmp_cast(env)${setjmp_sigmask+,0})])
+AC_DEFINE_UNQUOTED([RUBY_LONGJMP(env,val)], [${setjmp_prefix}longjmp($setjmp_cast(env),val)])
 AC_DEFINE_UNQUOTED(RUBY_JMP_BUF, ${setjmp_sigmask+${setjmp_prefix}}jmp_buf)
 # End of setjmp check.
 
Index: ruby_2_1/ChangeLog
===================================================================
--- ruby_2_1/ChangeLog	(revision 47275)
+++ ruby_2_1/ChangeLog	(revision 47276)
@@ -1,3 +1,15 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/ChangeLog#L1
+Tue Aug 26 00:02:51 2014  Nobuyoshi Nakada  <nobu@r...>
+
+	* configure.in (ac_cv_func___builtin_setjmp): __builtin_longjmp()
+	  in Apple LLVM 5.1 (LLVM 3.4svn) uses `void**`, not `jmp_buf`.
+	  [Bug #9692]
+
+Tue Aug 26 00:02:51 2014  Nobuyoshi Nakada  <nobu@r...>
+
+	* configure.in (ac_cv_func___builtin_setjmp): gcc 4.9 disallows a
+	  variable as the second argument of __builtin_longjmp().
+	  [ruby-core:61800] [Bug #9692]
+
 Mon Aug 25 00:36:56 2014  Nobuyoshi Nakada  <nobu@r...>
 
 	* parse.y (parser_yylex): fix invalid char in eval, should raise
Index: ruby_2_1/version.h
===================================================================
--- ruby_2_1/version.h	(revision 47275)
+++ ruby_2_1/version.h	(revision 47276)
@@ -1,10 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/version.h#L1
 #define RUBY_VERSION "2.1.2"
-#define RUBY_RELEASE_DATE "2014-08-25"
-#define RUBY_PATCHLEVEL 209
+#define RUBY_RELEASE_DATE "2014-08-26"
+#define RUBY_PATCHLEVEL 210
 
 #define RUBY_RELEASE_YEAR 2014
 #define RUBY_RELEASE_MONTH 8
-#define RUBY_RELEASE_DAY 25
+#define RUBY_RELEASE_DAY 26
 
 #include "ruby/version.h"
 

Property changes on: ruby_2_1
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r45503-45504,45508-45509,47275


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]