<div dir="ltr"><div>Hi Jonathan and Nick,<br><br></div>I was trying to build libc++abi from repository but failed.  May you provide some instruction to cross compile libc++abi for ARM Linux?  Thanks.<br><br>Logan<br></div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Apr 15, 2014 at 5:23 AM, Jonathan Roelofs <span dir="ltr"><<a href="mailto:jonathan@codesourcery.com" target="_blank">jonathan@codesourcery.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><br>
<br>
On 4/14/14, 1:51 PM, Nick Kledzik wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
On Apr 13, 2014, at 3:16 AM, Logan Chien <<a href="mailto:tzuhsiang.chien@gmail.com" target="_blank">tzuhsiang.chien@gmail.com</a>> wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
I have worked on ARM EHABI zero-cost exception handling for libc++abi.<br>
<br>
With the attached patch, I can compile and run all libc++abi unittests on ARM Linux.<br>
<br>
Is it OK to commit?  Thanks.<br>
<br>
</blockquote>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
diff --git a/include/unwind.h b/include/unwind.h<br>
index c5acd93..e57d756 100644<br>
--- a/include/unwind.h<br>
+++ b/include/unwind.h<br>
@@ -23,8 +23,24 @@<br>
  #define LIBUNWIND_UNAVAIL<br>
  #endif<br>
<br>
+#if !defined(LIBCXXABI_SJLJ)<br>
+#  if defined(__arm__)<br>
+#    if defined(__APPLE__)<br>
+#      define LIBCXXABI_ARM_EHABI 0<br>
+#      define LIBCXXABI_SJLJ 1<br>
+#    else<br>
+#      define LIBCXXABI_ARM_EHABI 1<br>
+#      define LIBCXXABI_SJLJ 0<br>
+#    endif<br>
+#  else<br>
+#    define LIBCXXABI_ARM_EHABI 0<br>
+#    define LIBCXXABI_SJLJ 0<br>
+#  endif<br>
+#endif<br>
</blockquote>
I recently found that the compiler has a built-in define  __USING_SJLJ_EXCEPTIONS__ that is set when compiling for setjump/longjump based exceptions.  Is there are similar built-in for ARM EHABI?  If so, we can set these up without testing for __arm__ or __APPLE__.  In fact, LIBCXXABI_SJLJ can be replaced with __USING_SJLJ_EXCEPTIONS__.  And perhaps LIBCXXABI_ARM_EHABI can be replaced with some built-in?<br>

</blockquote></div></div>
__ARM_EABI_UNWINDER__ perhaps?  I'm not exactly sure what the semantics of it are, and I don't see a definition for it in Clang.  In libgcc's unwinder it's defined in one of the arm config files. I suppose that makes it not a builtin then....<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
diff --git a/src/cxa_exception.cpp b/src/cxa_exception.cpp<br>
index 744dddd..27a55c5 100644<br>
--- a/src/cxa_exception.cpp<br>
+++ b/src/cxa_exception.cpp<br>
@@ -232,7 +232,7 @@ __cxa_throw(void* thrown_object, std::type_info* tinfo, void (*dest)(void*))<br>
      globals->uncaughtExceptions += 1;   // Not atomically, since globals are thread-local<br>
<br>
      exception_header-><u></u>unwindHeader.exception_cleanup = exception_cleanup_func;<br>
-#if __arm__<br>
+#if LIBCXXABI_SJLJ<br>
      _Unwind_SjLj_RaiseException(&<u></u>exception_header-><u></u>unwindHeader);<br>
  #else<br>
</blockquote>
I like the conditional test for SJLJ instead of the processor, but as I recently discovered, most of the existing __arm__ tests can be changed to __USING_SJLJ_EXCEPTIONS__ tests.<br>
<br>
-Nick<br>
<br>
<br></div><div class="">
______________________________<u></u>_________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu" target="_blank">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/cfe-commits</a><br>
<br>
</div></blockquote><div class="im HOEnZb">
<br>
-- <br>
Jon Roelofs<br>
<a href="mailto:jonathan@codesourcery.com" target="_blank">jonathan@codesourcery.com</a><br>
CodeSourcery / Mentor Embedded<br></div><div class="HOEnZb"><div class="h5">
______________________________<u></u>_________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu" target="_blank">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/cfe-commits</a><br>
</div></div></blockquote></div><br></div>