[compiler-rt] f7c4d79 - [compiler-rt] Define ElfW() macro if it's not defined
Sergej Jaskiewicz via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 10 08:54:41 PDT 2020
Author: Sergej Jaskiewicz
Date: 2020-03-10T18:54:28+03:00
New Revision: f7c4d796ba67dba27361d07a77eefde05d2e0c9c
URL: https://github.com/llvm/llvm-project/commit/f7c4d796ba67dba27361d07a77eefde05d2e0c9c
DIFF: https://github.com/llvm/llvm-project/commit/f7c4d796ba67dba27361d07a77eefde05d2e0c9c.diff
LOG: [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](https://github.com/llvm/llvm-project/blob/9b05596eff21388ae6f17cdea8df0538dc630441/libunwind/src/AddressSpace.hpp#L144-L157).)
Reviewers: compnerd
Differential revision: https://reviews.llvm.org/D75907
Added:
Modified:
compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
Removed:
################################################################################
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
index edbe8402808a..4d17c9686e4e 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
@@ -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>
More information about the llvm-commits
mailing list