diff options
author | Doug Nazar <nazard@nazar.ca> | 2019-09-04 23:36:06 -0400 |
---|---|---|
committer | Dave Watson <dade.watson@gmail.com> | 2019-10-03 08:18:57 -0700 |
commit | a36ec8cfdb8764e4f8bf6b16a149a60ea6ad038d (patch) | |
tree | fbdf99561b77a53abef97428e6e60a842405b967 /configure.ac | |
parent | b316234d63c7ff6fcfac6d72e0f27394fe86af80 (diff) | |
download | libunwind-a36ec8cfdb8764e4f8bf6b16a149a60ea6ad038d.tar.gz |
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.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 17 |
1 files changed, 17 insertions, 0 deletions
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)])) |