issue-525: warn user on lack of libunwind but don't fail

Because we now have access to other backtrace capturing method(s) at
runtime.
This commit is contained in:
Aliaksey Kandratsenka 2014-02-16 19:41:37 -08:00
parent 90ba15d1f2
commit b5e584dfdc

View File

@ -217,6 +217,7 @@ AC_ARG_ENABLE(frame_pointers,
, enable_frame_pointers=no)
AM_CONDITIONAL(ENABLE_FRAME_POINTERS, test "$enable_frame_pointers" = yes)
AC_MSG_CHECKING([for x86 without frame pointers])
# Some x86_64 systems do not insert frame pointers by default.
# We want to see if the current system is one of those.
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(, [return __x86_64__ == 1 ? 0 : 1])],
@ -227,10 +228,14 @@ CFLAGS="$CFLAGS -S -O2 -o fp.s"
# We do our own determination of success/failure in the grep, below.
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([int f(int x) {return x;}], [return f(0);])],
[:], [:])
x86_no_fp_by_default=no
AS_IF([test "$is_x86_64" = yes && ! grep 'mov.*rsp.*rbp' fp.s >/dev/null 2>&1], [x86_no_fp_by_default=yes])
AM_CONDITIONAL(X86_64_AND_NO_FP_BY_DEFAULT,
test "$is_x86_64" = yes && ! grep 'mov.*rsp.*rbp' fp.s >/dev/null 2>&1)
test "$x86_no_fp_by_default" = yes)
rm fp.s
CFLAGS="$OLD_CFLAGS"
AC_MSG_RESULT([$x86_no_fp_by_default])
# We need to know if we're i386 so we can turn on -mmms, which is not
# on by default for i386 (it is for x86_64).
@ -464,3 +469,6 @@ AM_CONDITIONAL(WITH_STACK_TRACE, test "$enable_cpu_profiler" = yes -o \
AC_CONFIG_FILES([Makefile
src/gperftools/tcmalloc.h src/windows/gperftools/tcmalloc.h])
AC_OUTPUT
AS_IF([test "$x86_no_fp_by_default" = yes && test "x$UNWIND_LIBS" = x],
[AC_MSG_WARN([No frame pointers and no libunwind. Expect backtrace capturing and unittests to fail])])