From 664ef652d970e14a4c941bf650cb50dbb4128b05 Mon Sep 17 00:00:00 2001 From: Jason Evans Date: Sat, 18 Feb 2017 00:02:23 -0800 Subject: [PATCH] Avoid -lgcc for heap profiling if unwind.h is missing. This removes an unneeded library dependency when falling back to intrinsics-based backtracing (or failing to enable heap profiling at all). --- configure.ac | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index e71edd72..1627a3d9 100644 --- a/configure.ac +++ b/configure.ac @@ -1082,7 +1082,9 @@ fi if test "x$backtrace_method" = "x" -a "x$enable_prof_libgcc" = "x1" \ -a "x$GCC" = "xyes" ; then AC_CHECK_HEADERS([unwind.h], , [enable_prof_libgcc="0"]) - AC_CHECK_LIB([gcc], [_Unwind_Backtrace], [JE_APPEND_VS(LIBS, -lgcc)], [enable_prof_libgcc="0"]) + if test "x${enable_prof_libgcc}" = "x1" ; then + AC_CHECK_LIB([gcc], [_Unwind_Backtrace], [JE_APPEND_VS(LIBS, -lgcc)], [enable_prof_libgcc="0"]) + fi if test "x${enable_prof_libgcc}" = "x1" ; then backtrace_method="libgcc" AC_DEFINE([JEMALLOC_PROF_LIBGCC], [ ])