Index: src/Unwind/AddressSpace.hpp =================================================================== --- src/Unwind/AddressSpace.hpp +++ src/Unwind/AddressSpace.hpp @@ -57,9 +57,18 @@ #endif // !defined(_LIBUNWIND_IS_BAREMETAL) #endif // LIBCXXABI_ARM_EHABI -#if defined(__linux__) +#if defined(__CloudABI__) || defined(__FreeBSD__) || defined(__linux__) #if _LIBUNWIND_SUPPORT_DWARF_UNWIND && _LIBUNWIND_SUPPORT_DWARF_INDEX #include +// Macro for machine-independent access to the ELF program headers. This +// macro is not available on some systems (e.g., FreeBSD). On these +// systems the data structures are called Elf{32,64}_XXX. Define ElfW() +// locally. +#ifndef ElfW +#define ElfW(type) ElfW2(__INTPTR_WIDTH__, type) +#define ElfW2(width, type) ElfW3(width, type) +#define ElfW3(width, type) Elf##width##_##type +#endif #include "EHHeaderParser.hpp" #endif #endif