llvm-capstone/llvm/cmake/unwind.h
Harald van Dijk 957334382c
[ExecutionEngine] Check for libunwind before calling __register_frame
libgcc and libunwind have different flavours of __register_frame. Both
 flavours are already correctly handled, except that the code to handle
the libunwind flavour is guarded by __APPLE__. This change uses the
presence of __unw_add_dynamic_fde in libunwind instead to detect whether
libunwind is used, rather than hardcoding it as Apple vs. non-Apple.

Fixes PR44074.

Thanks to Albert Jin <albert.jin@gmail.com> and Chris Schafmeister
<chris.schaf@verizon.net> for identifying the problem.

Reviewed By: lhames

Differential Revision: https://reviews.llvm.org/D106129
2021-08-15 13:35:53 +01:00

9 lines
469 B
C

// NOLINT: llvm-header-guard
// __register_frame() is used with dynamically generated code to register the
// FDE for a generated (JIT) code. This header provides protypes, since the gcc
// version of unwind.h may not, so CMake can check if the corresponding symbols
// exist in the runtime.
extern void __register_frame(const void *fde); // NOLINT
extern void __deregister_frame(const void *fde); // NOLINT
extern void __unw_add_dynamic_fde(); // NOLINT