From 9dd0113023283583441fc4f3cc571c275ec5ec0b Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 4 Apr 2014 02:37:27 +0000 Subject: [PATCH] configure.in: get rid of clang fatal error * configure.in (ac_cv_func___builtin_setjmp): get rid of a bug in clang 3.3 and 3.4, which __builtin_setjmp() causes fatal error in backend, linker error, or segmentation fault. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45515 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- configure.in | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/configure.in b/configure.in index a7d3c75a7d..2094f7b4a7 100644 --- a/configure.in +++ b/configure.in @@ -2080,15 +2080,16 @@ fi AC_CACHE_CHECK(for __builtin_setjmp, ac_cv_func___builtin_setjmp, [ ac_cv_func___builtin_setjmp=no - for cast in "" "(void *)"; do + for cast in "" "(void **)"; do RUBY_WERROR_FLAG( [AC_TRY_LINK([@%:@include @%:@include jmp_buf jb; - void t(void) {__builtin_longjmp($cast jb, 1);}], + void t(void) {__builtin_longjmp($cast jb, 1);} + int jump(void) {(void)(__builtin_setjmp($cast jb) ? 1 : 0); return 0;}], [ void (*volatile f)(void) = t; - if (!__builtin_setjmp($cast jb)) printf("%d\n", f != 0); + if (!jump()) printf("%d\n", f != 0); ], [ac_cv_func___builtin_setjmp="yes with cast ($cast)"]) ])