boostorg / stacktrace

C++ library for storing and printing backtraces.
https://boost.org/libs/stacktrace
433 stars 74 forks source link

stacktrace does not work on iOS armv7/armv7s #46

Closed theodelrieu closed 4 years ago

theodelrieu commented 6 years ago

Hello,

When attempting to use the header only version of Stacktrace, I get the following linker error:

Undefined symbols for architecture armv7: "__Unwind_Backtrace", referenced from: boost::stacktrace::detail::this_thread_frames::collect(void const**, unsigned long, unsigned long) in libmylib.a(Error.cpp.o) ld: symbol(s) not found for architecture armv7

I did look in the libSystem.tbd and the __Unwind_Backtrace symbol is only defined for arm64.

The workaround is to define the BOOST_STACKTRACE_USE_NOOP macro. Is there another way to workaround the problem?

apolukhin commented 6 years ago

Did you link with libbacktrace and standard library? Could you please provide a compile and link commands that trigger the issue?

theodelrieu commented 6 years ago

I tried to find a way to get libbacktrace for iOS (and Darwin platforms in general), but it seems upstream was not updated for a while, and the only recent patches I've seen are from a fork inside rustlang.

Do you know if there is a way to get libbacktrace working on macOS/iOS?

ivanarh commented 6 years ago

I've already faced this problem. A solution is to use backtrace() function from execinfo.h instead of __Unwind_Backtrace.

apolukhin commented 4 years ago

This should have been fixed in #70 Please reopen if #70 does not solve issue for you.

Many thanks for the report!