<div dir="ltr">Hi Ed,<div><br></div><div>I have a feeling that the no-exceptions builders are missing a few configuration bits.</div><div><br></div><div>"No-exceptions" libraries should not require libunwind...</div><div><br></div><div>Looking at the cmake configs: <a href="http://lab.llvm.org:8011/builders/libcxx-libcxxabi-libunwind-arm-linux-noexceptions/builds/430/steps/cmake/logs/stdio">http://lab.llvm.org:8011/builders/libcxx-libcxxabi-libunwind-arm-linux-noexceptions/builds/430/steps/cmake/logs/stdio</a></div><div><br></div><div>I see that it's missing the -DLIBCXXABI_ENALBE_EXCEPTIONS=OFF flag and the -DLIBCXX_USE_LLVM_UNWINDER=ON should also be dropped I think.</div><div><br></div><div>I'll upload a patch to fix this soon, and ask Galina to restart the build-master. You will be able to continue with your work afterward.</div><div><br></div><div>Sorry about the trouble.</div><div><br></div><div>/ Asiri</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 23, 2017 at 9:13 AM, Ed Schouten via cfe-commits <span dir="ltr"><<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: ed<br>
Date: Thu Feb 23 03:13:22 2017<br>
New Revision: 295948<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=295948&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project?rev=295948&view=rev</a><br>
Log:<br>
Revert r295944.<br>
<br>
Even though the change works perfectly fine on CloudABI, it fails to<br>
work on the libcxx-libcxxabi-libunwind-<wbr>arm-linux-noexceptions build bot.<br>
Looking at the code, this may be attributed to the fact that the code<br>
doesn't take the PT_LOAD addresses into consideration.<br>
<br>
I will rework this change to fix that and send out an updated version<br>
for review in the nearby future.<br>
<br>
Modified:<br>
    libunwind/trunk/src/<wbr>AddressSpace.hpp<br>
<br>
Modified: libunwind/trunk/src/<wbr>AddressSpace.hpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/libunwind/trunk/src/AddressSpace.hpp?rev=295948&r1=295947&r2=295948&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/libunwind/trunk/src/<wbr>AddressSpace.hpp?rev=295948&<wbr>r1=295947&r2=295948&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- libunwind/trunk/src/<wbr>AddressSpace.hpp (original)<br>
+++ libunwind/trunk/src/<wbr>AddressSpace.hpp Thu Feb 23 03:13:22 2017<br>
@@ -35,17 +35,29 @@ namespace libunwind {<br>
 #include "Registers.hpp"<br>
<br>
 #if _LIBUNWIND_ARM_EHABI<br>
+#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)<br>
+<br>
+typedef void *_Unwind_Ptr;<br>
+<br>
+#elif defined(__linux__)<br>
+<br>
+typedef long unsigned int *_Unwind_Ptr;<br>
+extern "C" _Unwind_Ptr __gnu_Unwind_Find_exidx(_<wbr>Unwind_Ptr addr, int *len);<br>
+<br>
+// Emulate the BSD dl_unwind_find_exidx API when on a GNU libdl system.<br>
+#define dl_unwind_find_exidx __gnu_Unwind_Find_exidx<br>
+<br>
+#elif !defined(_LIBUNWIND_IS_<wbr>BAREMETAL)<br>
+#include <link.h><br>
+#else // !defined(_LIBUNWIND_IS_<wbr>BAREMETAL)<br>
+// When statically linked on bare-metal, the symbols for the EH table are looked<br>
+// up without going through the dynamic loader.<br>
 struct EHTEntry {<br>
   uint32_t functionOffset;<br>
   uint32_t unwindOpcodes;<br>
 };<br>
-#if defined(_LIBUNWIND_IS_<wbr>BAREMETAL)<br>
-// When statically linked on bare-metal, the symbols for the EH table are looked<br>
-// up without going through the dynamic loader.<br>
 extern EHTEntry __exidx_start;<br>
 extern EHTEntry __exidx_end;<br>
-#else<br>
-#include <link.h><br>
 #endif // !defined(_LIBUNWIND_IS_<wbr>BAREMETAL)<br>
 #endif // _LIBUNWIND_ARM_EHABI<br>
<br>
@@ -356,15 +368,23 @@ inline bool LocalAddressSpace::findUnwin<br>
     info.compact_unwind_section_<wbr>length = dyldInfo.compact_unwind_<wbr>section_length;<br>
     return true;<br>
   }<br>
-#elif _LIBUNWIND_ARM_EHABI && defined(_LIBUNWIND_IS_<wbr>BAREMETAL)<br>
+#elif _LIBUNWIND_ARM_EHABI<br>
+ #ifdef _LIBUNWIND_IS_BAREMETAL<br>
   // Bare metal is statically linked, so no need to ask the dynamic loader<br>
   info.arm_section =        (uintptr_t)(&__exidx_start);<br>
   info.arm_section_length = (uintptr_t)(&__exidx_end - &__exidx_start);<br>
+ #else<br>
+  int length = 0;<br>
+  info.arm_section = (uintptr_t) dl_unwind_find_exidx(<br>
+      (_Unwind_Ptr) targetAddr, &length);<br>
+  info.arm_section_length = (uintptr_t)length;<br>
+ #endif<br>
   _LIBUNWIND_TRACE_UNWINDING("<wbr>findUnwindSections: section %X length %x",<br>
                              info.arm_section, info.arm_section_length);<br>
   if (info.arm_section && info.arm_section_length)<br>
     return true;<br>
-#elif _LIBUNWIND_ARM_EHABI || _LIBUNWIND_SUPPORT_DWARF_<wbr>UNWIND<br>
+#elif _LIBUNWIND_SUPPORT_DWARF_<wbr>UNWIND<br>
+#if _LIBUNWIND_SUPPORT_DWARF_INDEX<br>
   struct dl_iterate_cb_data {<br>
     LocalAddressSpace *addressSpace;<br>
     UnwindInfoSections *sects;<br>
@@ -375,6 +395,9 @@ inline bool LocalAddressSpace::findUnwin<br>
   int found = dl_iterate_phdr(<br>
       [](struct dl_phdr_info *pinfo, size_t, void *data) -> int {<br>
         auto cbdata = static_cast<dl_iterate_cb_data *>(data);<br>
+        size_t object_length;<br>
+        bool found_obj = false;<br>
+        bool found_hdr = false;<br>
<br>
         assert(cbdata);<br>
         assert(cbdata->sects);<br>
@@ -390,14 +413,6 @@ inline bool LocalAddressSpace::findUnwin<br>
         typedef ElfW(Phdr) Elf_Phdr;<br>
 #endif<br>
<br>
- #if _LIBUNWIND_SUPPORT_DWARF_<wbr>UNWIND<br>
-  #if !_LIBUNWIND_SUPPORT_DWARF_<wbr>INDEX<br>
-   #error "_LIBUNWIND_SUPPORT_DWARF_<wbr>UNWIND requires _LIBUNWIND_SUPPORT_DWARF_INDEX on this platform."<br>
-  #endif<br>
-        size_t object_length;<br>
-        bool found_obj = false;<br>
-        bool found_hdr = false;<br>
-<br>
         for (Elf_Half i = 0; i < pinfo->dlpi_phnum; i++) {<br>
           const Elf_Phdr *phdr = &pinfo->dlpi_phdr[i];<br>
           if (phdr->p_type == PT_LOAD) {<br>
@@ -427,22 +442,12 @@ inline bool LocalAddressSpace::findUnwin<br>
         } else {<br>
           return false;<br>
         }<br>
- #else // _LIBUNWIND_ARM_EHABI<br>
-        for (Elf_Half i = 0; i < pinfo->dlpi_phnum; i++) {<br>
-          const Elf_Phdr *phdr = &pinfo->dlpi_phdr[i];<br>
-          if (phdr->p_type == PT_ARM_EXIDX) {<br>
-            uintptr_t exidx_start = pinfo->dlpi_addr + phdr->p_vaddr;<br>
-            cbdata->sects->arm_section = exidx_start;<br>
-            cbdata->sects->arm_section_<wbr>length = phdr->p_memsz /<br>
-                                                sizeof(EHTEntry);<br>
-            return true;<br>
-          }<br>
-        }<br>
-        return false;<br>
- #endif<br>
       },<br>
       &cb_data);<br>
   return static_cast<bool>(found);<br>
+#else<br>
+#error "_LIBUNWIND_SUPPORT_DWARF_<wbr>UNWIND requires _LIBUNWIND_SUPPORT_DWARF_INDEX on this platform."<br>
+#endif<br>
 #endif<br>
<br>
   return false;<br>
<br>
<br>
______________________________<wbr>_________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div>