diff --git a/configure.ac b/configure.ac index 8023cb3..ab0c31a 100644 --- a/configure.ac +++ b/configure.ac @@ -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])])