mirror of
https://github.com/gperftools/gperftools
synced 2024-12-25 16:52:05 +00:00
enable emergency malloc by default on arm when using libunwind
Because by default libunwind on arm does fopen which mallocs which will deadlock unless we enable emergency malloc.
This commit is contained in:
parent
7f12051dbe
commit
4f3410e759
11
configure.ac
11
configure.ac
@ -266,6 +266,7 @@ if test "$enable_libunwind" = yes; then
|
||||
AC_CHECK_LIB(unwind, backtrace, UNWIND_LIBS=-lunwind,
|
||||
[AC_CHECK_LIB(execinfo, backtrace, UNWIND_LIBS=-lexecinfo, UNWIND_LIBS=)])
|
||||
AC_SUBST(UNWIND_LIBS)
|
||||
will_use_libunwind=yes
|
||||
else
|
||||
AC_CHECK_LIB(execinfo, backtrace, UNWIND_LIBS=-lexecinfo, UNWIND_LIBS=)
|
||||
AC_SUBST(UNWIND_LIBS)
|
||||
@ -390,11 +391,19 @@ AC_CACHE_CHECK([if target has _Unwind_Backtrace],
|
||||
AS_IF([test "x$perftools_cv_have_unwind_backtrace" = xyes],
|
||||
[AC_DEFINE(HAVE_UNWIND_BACKTRACE, 1, [Whether <unwind.h> contains _Unwind_Backtrace])])
|
||||
|
||||
AS_IF([test "x$enable_backtrace" = xyes],
|
||||
[default_emergency_malloc=yes],
|
||||
[default_emergency_malloc=no])
|
||||
|
||||
AS_IF([test "x$will_use_libunwind" = xyes],
|
||||
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM(, [return __arm__])],
|
||||
[default_emergency_malloc=yes])])
|
||||
|
||||
AC_ARG_ENABLE([emergency-malloc],
|
||||
[AS_HELP_STRING([--enable-emergency-malloc],
|
||||
[build emergency malloc feature])],
|
||||
[enable_emergency_malloc="$enableval"],
|
||||
[enable_emergency_malloc="$enable_backtrace"])
|
||||
[enable_emergency_malloc="$default_emergency_malloc"])
|
||||
|
||||
AM_CONDITIONAL(BUILD_EMERGENCY_MALLOC, [test "x$enable_emergency_malloc" = xyes])
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user