[PATCH] Fix libunwind to build on FreeBSD

Phabricator reviews at reviews.llvm.org
Wed May 6 03:36:04 PDT 2015


REPOSITORY
  rL LLVM

http://reviews.llvm.org/D9272

Files:
  libunwind/trunk/src/AddressSpace.hpp

Index: libunwind/trunk/src/AddressSpace.hpp
===================================================================
--- libunwind/trunk/src/AddressSpace.hpp
+++ libunwind/trunk/src/AddressSpace.hpp
@@ -395,8 +395,15 @@
           return false;
         }
 
-        for (ElfW(Half) i = 0; i < pinfo->dlpi_phnum; i++) {
-          const ElfW(Phdr) *phdr = &pinfo->dlpi_phdr[i];
+#if !defined(Elf_Half)
+        typedef ElfW(Half) Elf_Half;
+#endif
+#if !defined(Elf_Phdr)
+        typedef ElfW(Phdr) Elf_Phdr;
+#endif
+
+        for (Elf_Half i = 0; i < pinfo->dlpi_phnum; i++) {
+          const Elf_Phdr *phdr = &pinfo->dlpi_phdr[i];
           if (phdr->p_type == PT_LOAD) {
             uintptr_t begin = pinfo->dlpi_addr + phdr->p_vaddr;
             uintptr_t end = begin + phdr->p_memsz;

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D9272.25027.patch
Type: text/x-patch
Size: 790 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150506/b9b8b5de/attachment.bin>


More information about the llvm-commits mailing list