Function wasmer_compiler::engine::unwind::systemv::using_libunwind

source ·
fn using_libunwind() -> bool
Expand description

There are two primary unwinders on Unix platforms: libunwind and libgcc.

Unfortunately their interface to __register_frame is different. The libunwind library takes a pointer to an individual FDE while libgcc takes a null-terminated list of FDEs. This means we need to know what unwinder is being used at runtime.

This detection is done currently by looking for a libunwind-specific symbol. This specific symbol was somewhat recommended by LLVM’s “RTDyldMemoryManager.cpp” file which says:

We use the presence of __unw_add_dynamic_fde to detect libunwind.

I’ll note that there’s also a different libunwind project at https://www.nongnu.org/libunwind/ but that doesn’t appear to have __register_frame so I don’t think that interacts with this.