summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-10-26 09:09:45 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-10-26 09:09:45 +0000
commit767d70841a998c16a7487f9b286a9a944f69e7b7 (patch)
treef7ad13b6a798af772e149f24cd140872871cc88a /configure.in
parent67d7448fca92474e2701e4ca973c03dbb06b4690 (diff)
* Makefile.in (ASFLAGS): needs INCFLAGS.
* configure.in (rb_cv_dynamic_alloca): check if extra source for dynamic size alloca. * missing/x86_64-chkstk.s (___chkstk): necessary for alloca of amd64-mingw32msvc-gcc on Ubutu. * thread_win32.c (ruby_alloca_chkstk): check stack overflow git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in21
1 files changed, 21 insertions, 0 deletions
diff --git a/configure.in b/configure.in
index 5dc59396a2..73e7c138e2 100644
--- a/configure.in
+++ b/configure.in
@@ -1199,6 +1199,27 @@ AS_CASE(["${target_cpu}-${target_os}:${target_archs}"],
[
AC_FUNC_ALLOCA
])
+if test "x$ALLOCA" = "x"; then
+ AC_CACHE_CHECK([for dynamic size alloca], rb_cv_dynamic_alloca, [
+ for chk in ok __chkstk; do
+ AC_TRY_LINK([
+ @%:@ifdef HAVE_ALLOCA_H
+ @%:@include <alloca.h>
+ @%:@endif
+ void $chk() {}
+ int dynamic_alloca_test;
+ int dynamic_alloca_result;],
+ [dynamic_alloca_result = alloca(dynamic_alloca_test) != 0;],
+ [rb_cv_dynamic_alloca=$chk; break])
+ done])
+ if test "x$rb_cv_dynamic_alloca" = "x__chkstk"; then
+ AC_DEFINE_UNQUOTED(RUBY_ALLOCA_CHKSTK, _$rb_cv_dynamic_alloca)
+ AS_CASE("$target_cpu",
+ [x64|x86_64], [
+ AC_SUBST([ALLOCA], [\${LIBOBJDIR}x86_64-chkstk.${ac_objext}])
+ ],)
+ fi
+fi
AC_FUNC_MEMCMP
# http://sources.redhat.com/ml/libc-hacker/2005-08/msg00008.html