From a36ec8cfdb8764e4f8bf6b16a149a60ea6ad038d Mon Sep 17 00:00:00 2001 From: Doug Nazar Date: Wed, 4 Sep 2019 23:36:06 -0400 Subject: Add support for zlib compressed elf .debug_frame sections In case zlib support is not available, fail to load instead of crashing while trying to read invalid data. --- configure.ac | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 8e62b8bd..11aeb2d2 100644 --- a/configure.ac +++ b/configure.ac @@ -302,6 +302,23 @@ fi AC_SUBST([LIBLZMA]) AM_CONDITIONAL(HAVE_LZMA, test x$enable_minidebuginfo = xyes) +LIBZ= +AC_MSG_CHECKING([whether to support ZLIB-compressed symbol tables]) +AC_ARG_ENABLE(zlibdebuginfo, +AS_HELP_STRING([--enable-zlibdebuginfo], [Enables support for ZLIB-compressed symbol tables]),, [enable_zlibdebuginfo=auto]) +AC_MSG_RESULT([$enable_zlibdebuginfo]) +if test x$enable_zlibdebuginfo != xno; then + AC_CHECK_LIB([z], [uncompress], + [LIBZ=-lz + AC_DEFINE([HAVE_ZLIB], [1], [Define if you have libz]) + enable_zlibdebuginfo=yes], + [if test x$enable_zlibdebuginfo = xyes; then + AC_MSG_FAILURE([libz not found]) + fi]) +fi +AC_SUBST([LIBZ]) +AM_CONDITIONAL(HAVE_ZLIB, test x$enable_zlibdebuginfo = xyes) + AC_MSG_CHECKING([whether to support UNW_CACHE_PER_THREAD]) AC_ARG_ENABLE([per-thread-cache], AS_HELP_STRING([--enable-per-thread-cache], [build with support for UNW_CACHE_PER_THREAD (which imposes a hight TLS memory usage) (default: disabled)])) -- cgit v1.2.1