Skip to content

Commit

Permalink
Link zlib always if available
Browse files Browse the repository at this point in the history
Major Linux distribution packages including Debian, Ubuntu, and Fedora
use `--compress-debug-sections=no` to build ruby, and then extract and
compress debug symbols as separate files. However, the configure option
makes ruby not link zlib, thus the generated binary cannot uncompress
the compressed separate debug symbol files, and fails to show C level
backtrace when a critical error like segfault occurs.

This change makes ruby always link zlib if it is available so that it
can show C level backtrace correctly.

Related: Debian packages require #3627
to load debug symbol files.
  • Loading branch information
mame committed Dec 11, 2020
1 parent 288e93b commit 8c5ec10
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions configure.ac
Expand Up @@ -2739,9 +2739,7 @@ AS_IF([test "$rb_cv_binary_elf" = yes], [
AC_CHECK_HEADERS([elf.h elf_abi.h])
AS_IF([test $ac_cv_header_elf_h = yes -o $ac_cv_header_elf_abi_h = yes], [
AC_LIBOBJ([addr2line])
AS_IF([test "x$compress_debug_sections" = xzlib], [
AC_CHECK_LIB([z], [uncompress])
])
AC_CHECK_LIB([z], [uncompress])
])
])

Expand Down

0 comments on commit 8c5ec10

Please sign in to comment.