backward-cpp
backward-cpp copied to clipboard
Failure to link with clang (`_Unwind_GetIPInfo` not resolved), needs `-lunwind`
For the record (might go to the docs?), compiling with clang 7 on arm (armv6k-unknown-linux-gnueabihf) resulted in undefined symbol _Unwind_GetIPInfo; this was solved by linking against -lunwind from llvm. Feel free to add somewhere or just close the issue. Thanks for backward!
On arm, _Unwind_GetIPInfo is defined inline in unwind-arm-common.h (as a stub) for gcc.
The symbol is not present in libgcc (except for FreeBSD).
But both clang and libunwind (www.nongnu.org/libunwind) have the prototype in their unwind.h, so there are link failures with either :
- clang with libgcc (using the libunwind from llvm means overwriting parts of libgcc, this is usually meant to be used with compiler-rt only)
- libunwind (with either gcc, or clang with libgcc), unless explicitly configured with
--enable-cxx-exceptions