summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--configure.in6
-rw-r--r--vm_dump.c3
3 files changed, 14 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index bc28848..bce4515 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Wed Dec 12 15:30:11 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * configure.in: add -fno-omit-frame-pointer if libexecinfo is used.
+ At least on FreeBSD ruby will crash on getting C backtrace
+ when it is compiled with other than -O0.
+
+ * vm_dump.c: enable backtrace on FreeBSD even if with optimizations.
+
Wed Dec 12 16:08:04 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
* test/rdoc/test_rdoc_rdoc.rb (TestRDocRDoc#test_normalized_file_list_non_file_directory):
diff --git a/configure.in b/configure.in
index ba5273a..b38869c 100644
--- a/configure.in
+++ b/configure.in
@@ -2378,6 +2378,12 @@ AS_CASE(["$target_cpu-$target_os"],
AC_CHECK_HEADERS([execinfo.h])
if test "x$ac_cv_header_execinfo_h" = xyes; then
AC_CHECK_LIB([execinfo], [backtrace])
+ execinfo_frame_pointer=no
+ RUBY_TRY_CFLAGS(-fno-omit-frame-pointer, [execinfo_frame_pointer=yes])
+ if test "x$execinfo_frame_pointer" = xyes; then
+ optflags="${optflags+$optflags }-fno-omit-frame-pointer"
+ CFLAGS="$CFLAGS -fno-omit-frame-pointer"
+ fi
fi])
AC_CHECK_FUNCS(backtrace)
diff --git a/vm_dump.c b/vm_dump.c
index c2fa33f..292280c 100644
--- a/vm_dump.c
+++ b/vm_dump.c
@@ -424,9 +424,6 @@ rb_vmdebug_thread_dump_state(VALUE self)
return Qnil;
}
-#if defined(__FreeBSD__) && defined(__OPTIMIZE__)
-#undef HAVE_BACKTRACE
-#endif
#ifndef HAVE_BACKTRACE
#define HAVE_BACKTRACE 0
#endif