aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcbergstrom <sjsdfkdjdjd@github.com>2014-05-09 01:35:41 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-05-09 01:35:41 +0000
commit1a692c2f7d91a7081997cf50aa23597fdb377fcd (patch)
tree6ddd84070df7e8b12d5785d24cf695f8ffcc6877
parent6ec9b35c6a51bfe849981888cc68d16a1a15062c (diff)
parent460ec6a0be3bf039fa67b44c98ea764e1e6265b6 (diff)
downloadlibcxxrt-1a692c2f7d91a7081997cf50aa23597fdb377fcd.tar.gz
am 460ec6a0: Merge pull request #20 from jsonn/master
* commit '460ec6a0be3bf039fa67b44c98ea764e1e6265b6': Fix inverted condition. Disable most of EHABI when __ARM_DWARF_EH__ is defined and use the normal Itanium ABI instead. The one exception is the guard ABI, using 64bit really just complicates things.
-rw-r--r--src/cxxabi.h2
-rw-r--r--src/exception.cc18
-rw-r--r--src/unwind.h2
3 files changed, 11 insertions, 11 deletions
diff --git a/src/cxxabi.h b/src/cxxabi.h
index 7c83360..411c4c7 100644
--- a/src/cxxabi.h
+++ b/src/cxxabi.h
@@ -110,7 +110,7 @@ struct __cxa_exception
* handler count reaches 0 (which it doesn't with the top bit set).
*/
int handlerCount;
-#ifdef __arm__
+#if defined(__arm__) && !defined(__ARM_DWARF_EH__)
/**
* The ARM EH ABI requires the unwind library to keep track of exceptions
* during cleanups. These support nesting, so we need to keep a list of
diff --git a/src/exception.cc b/src/exception.cc
index edd99ae..ed5ad2b 100644
--- a/src/exception.cc
+++ b/src/exception.cc
@@ -71,7 +71,7 @@ static void saveLandingPad(struct _Unwind_Context *context,
int selector,
dw_eh_ptr_t landingPad)
{
-#ifdef __arm__
+#if defined(__arm__) && !defined(__ARM_DWARF_EH__)
// On ARM, we store the saved exception in the generic part of the structure
ucb->barrier_cache.sp = _Unwind_GetGR(context, 13);
ucb->barrier_cache.bitpattern[1] = static_cast<uint32_t>(selector);
@@ -95,7 +95,7 @@ static int loadLandingPad(struct _Unwind_Context *context,
unsigned long *selector,
dw_eh_ptr_t *landingPad)
{
-#ifdef __arm__
+#if defined(__arm__) && !defined(__ARM_DWARF_EH__)
*selector = ucb->barrier_cache.bitpattern[1];
*landingPad = reinterpret_cast<dw_eh_ptr_t>(ucb->barrier_cache.bitpattern[3]);
return 1;
@@ -113,7 +113,7 @@ static int loadLandingPad(struct _Unwind_Context *context,
static inline _Unwind_Reason_Code continueUnwinding(struct _Unwind_Exception *ex,
struct _Unwind_Context *context)
{
-#ifdef __arm__
+#if defined(__arm__) && !defined(__ARM_DWARF_EH__)
if (__gnu_unwind_frame(ex, context) != _URC_OK) { return _URC_FAILURE; }
#endif
return _URC_CONTINUE_UNWIND;
@@ -204,7 +204,7 @@ struct __cxa_dependent_exception
terminate_handler terminateHandler;
__cxa_exception *nextException;
int handlerCount;
-#ifdef __arm__
+#if defined(__arm__) && !defined(__ARM_DWARF_EH__)
_Unwind_Exception *nextCleanup;
int cleanupCount;
#endif
@@ -686,7 +686,7 @@ static void report_failure(_Unwind_Reason_Code err, __cxa_exception *thrown_exce
case _URC_FATAL_PHASE1_ERROR:
fprintf(stderr, "Fatal error during phase 1 unwinding\n");
break;
-#ifndef __arm__
+#if !defined(__arm__) || defined(__ARM_DWARF_EH__)
case _URC_FATAL_PHASE2_ERROR:
fprintf(stderr, "Fatal error during phase 2 unwinding\n");
break;
@@ -982,7 +982,7 @@ static handler_type check_action_record(_Unwind_Context *context,
{
bool matched = false;
*selector = filter;
-#ifdef __arm__
+#if defined(__arm__) && !defined(__ARM_DWARF_EH__)
filter++;
std::type_info *handler_type = get_type_info_entry(context, lsda, filter--);
while (handler_type)
@@ -1027,7 +1027,7 @@ static handler_type check_action_record(_Unwind_Context *context,
static void pushCleanupException(_Unwind_Exception *exceptionObject,
__cxa_exception *ex)
{
-#ifdef __arm__
+#if defined(__arm__) && !defined(__ARM_DWARF_EH__)
__cxa_thread_info *info = thread_info_fast();
if (ex)
{
@@ -1072,7 +1072,7 @@ BEGIN_PERSONALITY_FUNCTION(__gxx_personality_v0)
realEx = realExceptionFromException(ex);
}
-#ifdef __arm__
+#if defined(__arm__) && !defined(__ARM_DWARF_EH__)
unsigned char *lsda_addr =
static_cast<unsigned char*>(_Unwind_GetLanguageSpecificData(context));
#else
@@ -1496,7 +1496,7 @@ namespace std
return ATOMIC_LOAD(&terminateHandler);
}
}
-#ifdef __arm__
+#if defined(__arm__) && !defined(__ARM_DWARF_EH__)
extern "C" _Unwind_Exception *__cxa_get_cleanup(void)
{
__cxa_thread_info *info = thread_info_fast();
diff --git a/src/unwind.h b/src/unwind.h
index e463a2a..130dd6d 100644
--- a/src/unwind.h
+++ b/src/unwind.h
@@ -27,7 +27,7 @@
extern "C" {
#endif
-#ifdef __arm__
+#if defined(__arm__) && !defined(__ARM_DWARF_EH__)
#include "unwind-arm.h"
#else
#include "unwind-itanium.h"