diff options
author | Dan Albert <danalbert@google.com> | 2014-05-15 16:10:21 -0700 |
---|---|---|
committer | Dan Albert <danalbert@google.com> | 2014-05-15 16:12:42 -0700 |
commit | 86f59b9a49bfc263bdc242e194e9550f82c3b21a (patch) | |
tree | 82eab3afae57163bbf1af0826bb3dabd86b1f5c6 | |
parent | 82b5fc4e61d6a8444bd29f2876b19521c2df0924 (diff) | |
download | libcxxrt-86f59b9a49bfc263bdc242e194e9550f82c3b21a.tar.gz |
Removes libdl code for target builds
Bionic's libdl cannot be statically linked.
Change-Id: I2c16dc58be3fb2d15d45311b607459d9e68605e3
-rw-r--r-- | Android.mk | 2 | ||||
-rw-r--r-- | src/exception.cc | 4 |
2 files changed, 5 insertions, 1 deletions
@@ -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(); |