[compiler-rt] Define ElfW() macro if it's not defined

Summary:
The `ElfW()` macro is not provided by `<link.h>` on some
systems (e.g., FreeBSD). On these systems the data structures are
just called `Elf_XXX`. Define `ElfW()` locally.

(This fix is taken from [libunwind](9b05596eff/libunwind/src/AddressSpace.hpp (L144-L157)).)

Reviewers: compnerd

Differential revision: https://reviews.llvm.org/D75907
This commit is contained in:
Sergej Jaskiewicz 2020-03-10 18:53:07 +03:00
parent c8ede5e485
commit f7c4d796ba

View File

@ -35,6 +35,10 @@
#include <sys/resource.h>
#include <syslog.h>
#if !defined(ElfW)
#define ElfW(type) Elf_##type
#endif
#if SANITIZER_FREEBSD
#include <pthread_np.h>
#include <osreldate.h>