aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Albert <danalbert@google.com>2014-05-16 02:16:16 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-05-16 02:16:16 +0000
commit7caf3dc7800cd1b6f893b62d91d454bbcb42838e (patch)
tree82eab3afae57163bbf1af0826bb3dabd86b1f5c6
parentb9d834bf13354e369d1e0dd96201e9fe3a952e03 (diff)
parent86f59b9a49bfc263bdc242e194e9550f82c3b21a (diff)
downloadlibcxxrt-7caf3dc7800cd1b6f893b62d91d454bbcb42838e.tar.gz
am 86f59b9a: Removes libdl code for target builds
* commit '86f59b9a49bfc263bdc242e194e9550f82c3b21a': Removes libdl code for target builds
-rw-r--r--Android.mk2
-rw-r--r--src/exception.cc4
2 files changed, 5 insertions, 1 deletions
diff --git a/Android.mk b/Android.mk
index 82e0b01..2c4e2a3 100644
--- a/Android.mk
+++ b/Android.mk
@@ -46,7 +46,7 @@ LOCAL_CLANG := true
LOCAL_CPP_EXTENSION := .cc
LOCAL_SRC_FILES := $(LIBCXXRT_SRC_FILES)
LOCAL_CFLAGS := $(LIBCXXRT_CFLAGS)
-LOCAL_CPPFLAGS := $(LIBCXXRT_CPPFLAGS)
+LOCAL_CPPFLAGS := $(LIBCXXRT_CPPFLAGS) -DNO_LIBDL
LOCAL_RTTI_FLAG := $(LIBCXXRT_RTTI_FLAG)
LOCAL_LDFLAGS := -nodefaultlibs
LOCAL_SYSTEM_SHARED_LIBRARIES := libc
diff --git a/src/exception.cc b/src/exception.cc
index ed5ad2b..663a4e8 100644
--- a/src/exception.cc
+++ b/src/exception.cc
@@ -642,6 +642,7 @@ void __cxa_free_dependent_exception(void *thrown_exception)
free_exception(reinterpret_cast<char*>(ex));
}
+#ifndef NO_LIBDL
/**
* Callback function used with _Unwind_Backtrace().
*
@@ -666,6 +667,7 @@ static _Unwind_Reason_Code trace(struct _Unwind_Context *context, void *c)
}
return _URC_CONTINUE_UNWIND;
}
+#endif
/**
* Report a failure that occurred when attempting to throw an exception.
@@ -722,7 +724,9 @@ static void report_failure(_Unwind_Reason_Code err, __cxa_exception *thrown_exce
if (status == 0) { free(demangled); }
// Print a back trace if no handler is found.
// TODO: Make this optional
+#ifndef NO_LIBDL
_Unwind_Backtrace(trace, 0);
+#endif
// Just abort. No need to call std::terminate for the second time
abort();