From 6f6a076086f85942bb5eb22a4fda275a25dbe59f Mon Sep 17 00:00:00 2001 From: nagachika Date: Mon, 25 Aug 2014 15:03:42 +0000 Subject: 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] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@47276 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 12 ++++++++++++ configure.in | 28 +++++++++++++++++++++------- eval_intern.h | 3 ++- version.h | 6 +++--- 4 files changed, 38 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 44e30b830a..6cf6df4eb6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +Tue Aug 26 00:02:51 2014 Nobuyoshi Nakada + + * 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 + + * 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 * parse.y (parser_yylex): fix invalid char in eval, should raise diff --git a/configure.in b/configure.in index 6801a07b57..dc55f55b3a 100644 --- a/configure.in +++ b/configure.in @@ -2022,13 +2022,25 @@ AC_CACHE_CHECK(for sigsetjmp as a macro or function, ac_cv_func_sigsetjmp, 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 - jmp_buf jb; void t(v) int v; {__builtin_longjmp(jb, v);}], - [__builtin_setjmp(jb);], - [ac_cv_func___builtin_setjmp=yes], + @%:@include + 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, [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 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. diff --git a/eval_intern.h b/eval_intern.h index 5064fde257..2e00efde03 100644 --- a/eval_intern.h +++ b/eval_intern.h @@ -154,7 +154,8 @@ NORETURN(static inline void rb_threadptr_tag_jump(rb_thread_t *, int)); 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); } /* diff --git a/version.h b/version.h index 555bc7b605..21ebbeb37a 100644 --- a/version.h +++ b/version.h @@ -1,10 +1,10 @@ #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" -- cgit v1.2.3