Skip to content
  • Michał Kępień's avatar
    Check for _Unwind_Backtrace() support · a51cde6c
    Michał Kępień authored
    Some operating systems (e.g. Linux, FreeBSD) provide the
    _Unwind_Backtrace() function in libgcc_s.so, which is automatically
    linked into any binary using the functions provided by that library.  On
    OpenBSD, though, _Unwind_Backtrace() is provided by libc++abi.so, which
    is not automatically linked into binaries produced by the stock system C
    compiler.
    
    Meanwhile, lib/isc/backtrace.c assumes that any GNU-compatible toolchain
    allows _Unwind_Backtrace() to be used without any extra provisions in
    the build system.  This causes build failures on OpenBSD (and possibly
    other systems).
    
    Instead of making assumptions, actually check for _Unwind_Backtrace()
    support in the toolchain if the backtrace() function is unavailable.
    
    (cherry picked from commit 10d70557)
    a51cde6c