aboutsummaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2011-05-13 11:55:22 -0700
committerBen Pfaff <blp@nicira.com>2011-05-13 14:37:14 -0700
commit0e6644c3880be9684f37f48da84907bb67112514 (patch)
tree200eaf5525aa47c11d373ab76bae12528ad1d64e /m4
parent498b2a5a68dcfea734f42ba548b7c61aabd8385b (diff)
backtrace: Make backtrace_capture() work on more systems.
The backtrace_capture() implementation only worked properly with GNU C on systems that have a simple stack frame with a frame pointer. Notably, the x86-64 ABI by default has no frame pointer, so this failed on x86-64. However, glibc has a function named backtrace() that does what we want. This commit tests for this function and uses it when it is present, fixing x86-64 backtraces.
Diffstat (limited to 'm4')
-rw-r--r--m4/openvswitch.m45
1 files changed, 5 insertions, 0 deletions
diff --git a/m4/openvswitch.m4 b/m4/openvswitch.m4
index e6d03a6b..73db4bba 100644
--- a/m4/openvswitch.m4
+++ b/m4/openvswitch.m4
@@ -152,6 +152,11 @@ AC_DEFUN([OVS_CHECK_LOGDIR],
[LOGDIR='${localstatedir}/log/${PACKAGE}'])
AC_SUBST([LOGDIR])])
+dnl Defines HAVE_BACKTRACE if backtrace() is declared in <execinfo.h>
+dnl and exists in libc.
+AC_DEFUN([OVS_CHECK_BACKTRACE],
+ [AC_CHECK_HEADER([execinfo.h], [AC_CHECK_FUNCS([backtrace])])])
+
dnl Checks for __malloc_hook, etc., supported by glibc.
AC_DEFUN([OVS_CHECK_MALLOC_HOOKS],
[AC_CACHE_CHECK(