aboutsummaryrefslogtreecommitdiff
path: root/system
diff options
context:
space:
mode:
Diffstat (limited to 'system')
-rw-r--r--system/include/unwind.h154
-rw-r--r--system/lib/debugging.cpp2
-rw-r--r--system/lib/libcxxabi/CREDITS.TXT22
-rw-r--r--system/lib/libcxxabi/LICENSE.TXT76
-rw-r--r--system/lib/libcxxabi/Makefile28
-rw-r--r--system/lib/libcxxabi/include/cxa_demangle.h167
-rw-r--r--system/lib/libcxxabi/include/cxxabi.h175
-rwxr-xr-xsystem/lib/libcxxabi/lib/buildit90
-rw-r--r--system/lib/libcxxabi/readme.txt1
-rw-r--r--system/lib/libcxxabi/src/abort_message.cpp60
-rw-r--r--system/lib/libcxxabi/src/abort_message.h33
-rw-r--r--system/lib/libcxxabi/src/cxa_aux_runtime.cpp34
-rw-r--r--system/lib/libcxxabi/src/cxa_demangle.cpp10798
-rw-r--r--system/lib/libcxxabi/src/cxa_exception.cpp622
-rw-r--r--system/lib/libcxxabi/src/cxa_exception.hpp118
-rw-r--r--system/lib/libcxxabi/src/cxa_exception_storage.cpp91
-rw-r--r--system/lib/libcxxabi/src/cxa_guard.cpp231
-rw-r--r--system/lib/libcxxabi/src/cxa_handlers.cpp196
-rw-r--r--system/lib/libcxxabi/src/cxa_handlers.hpp26
-rw-r--r--system/lib/libcxxabi/src/cxa_new_delete.cpp231
-rw-r--r--system/lib/libcxxabi/src/cxa_personality.cpp987
-rw-r--r--system/lib/libcxxabi/src/cxa_unexpected.cpp27
-rw-r--r--system/lib/libcxxabi/src/cxa_vector.cpp367
-rw-r--r--system/lib/libcxxabi/src/cxa_virtual.cpp31
-rw-r--r--system/lib/libcxxabi/src/exception.cpp41
-rw-r--r--system/lib/libcxxabi/src/fallback_malloc.ipp174
-rw-r--r--system/lib/libcxxabi/src/private_typeinfo.cpp1036
-rw-r--r--system/lib/libcxxabi/src/private_typeinfo.h246
-rw-r--r--system/lib/libcxxabi/src/stdexcept.cpp122
-rw-r--r--system/lib/libcxxabi/src/temporary.cpp41
-rw-r--r--system/lib/libcxxabi/src/typeinfo.cpp53
-rw-r--r--system/lib/libcxxabi/symbols12
32 files changed, 16292 insertions, 0 deletions
diff --git a/system/include/unwind.h b/system/include/unwind.h
new file mode 100644
index 00000000..f8d43d0d
--- /dev/null
+++ b/system/include/unwind.h
@@ -0,0 +1,154 @@
+/* libunwind - a platform-independent unwind library
+ Copyright (C) 2003 Hewlett-Packard Co
+ Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
+
+This file is part of libunwind.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+
+#ifndef _UNWIND_H
+#define _UNWIND_H
+
+/* For uint64_t */
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Minimal interface as per C++ ABI draft standard:
+
+ http://www.codesourcery.com/cxx-abi/abi-eh.html */
+
+typedef enum
+ {
+ _URC_NO_REASON = 0,
+ _URC_FOREIGN_EXCEPTION_CAUGHT = 1,
+ _URC_FATAL_PHASE2_ERROR = 2,
+ _URC_FATAL_PHASE1_ERROR = 3,
+ _URC_NORMAL_STOP = 4,
+ _URC_END_OF_STACK = 5,
+ _URC_HANDLER_FOUND = 6,
+ _URC_INSTALL_CONTEXT = 7,
+ _URC_CONTINUE_UNWIND = 8
+ }
+_Unwind_Reason_Code;
+
+typedef int _Unwind_Action;
+
+#define _UA_SEARCH_PHASE 1
+#define _UA_CLEANUP_PHASE 2
+#define _UA_HANDLER_FRAME 4
+#define _UA_FORCE_UNWIND 8
+
+struct _Unwind_Context; /* opaque data-structure */
+struct _Unwind_Exception; /* forward-declaration */
+
+typedef void (*_Unwind_Exception_Cleanup_Fn) (_Unwind_Reason_Code,
+ struct _Unwind_Exception *);
+
+typedef _Unwind_Reason_Code (*_Unwind_Stop_Fn) (int, _Unwind_Action,
+ uint64_t,
+ struct _Unwind_Exception *,
+ struct _Unwind_Context *,
+ void *);
+
+/* The C++ ABI requires exception_class, private_1, and private_2 to
+ be of type uint64 and the entire structure to be
+ double-word-aligned. Please note that exception_class stays 64-bit
+ even on 32-bit machines for gcc compatibility. */
+struct _Unwind_Exception
+ {
+ uint64_t exception_class;
+ _Unwind_Exception_Cleanup_Fn exception_cleanup;
+ unsigned long private_1;
+ unsigned long private_2;
+ } __attribute__((__aligned__));
+
+extern _Unwind_Reason_Code _Unwind_RaiseException (struct _Unwind_Exception *);
+extern _Unwind_Reason_Code _Unwind_ForcedUnwind (struct _Unwind_Exception *,
+ _Unwind_Stop_Fn, void *);
+extern void _Unwind_Resume (struct _Unwind_Exception *);
+extern void _Unwind_DeleteException (struct _Unwind_Exception *);
+extern unsigned long _Unwind_GetGR (struct _Unwind_Context *, int);
+extern void _Unwind_SetGR (struct _Unwind_Context *, int, unsigned long);
+extern unsigned long _Unwind_GetIP (struct _Unwind_Context *);
+extern unsigned long _Unwind_GetIPInfo (struct _Unwind_Context *, int *);
+extern void _Unwind_SetIP (struct _Unwind_Context *, unsigned long);
+extern unsigned long _Unwind_GetLanguageSpecificData (struct _Unwind_Context*);
+extern unsigned long _Unwind_GetRegionStart (struct _Unwind_Context *);
+
+#ifdef _GNU_SOURCE
+
+/* Callback for _Unwind_Backtrace(). The backtrace stops immediately
+ if the callback returns any value other than _URC_NO_REASON. */
+typedef _Unwind_Reason_Code (*_Unwind_Trace_Fn) (struct _Unwind_Context *,
+ void *);
+
+/* See http://gcc.gnu.org/ml/gcc-patches/2001-09/msg00082.html for why
+ _UA_END_OF_STACK exists. */
+# define _UA_END_OF_STACK 16
+
+/* If the unwind was initiated due to a forced unwind, resume that
+ operation, else re-raise the exception. This is used by
+ __cxa_rethrow(). */
+extern _Unwind_Reason_Code
+ _Unwind_Resume_or_Rethrow (struct _Unwind_Exception *);
+
+/* See http://gcc.gnu.org/ml/gcc-patches/2003-09/msg00154.html for why
+ _Unwind_GetBSP() exists. */
+extern unsigned long _Unwind_GetBSP (struct _Unwind_Context *);
+
+/* Return the "canonical frame address" for the given context.
+ This is used by NPTL... */
+extern unsigned long _Unwind_GetCFA (struct _Unwind_Context *);
+
+/* Return the base-address for data references. */
+extern unsigned long _Unwind_GetDataRelBase (struct _Unwind_Context *);
+
+/* Return the base-address for text references. */
+extern unsigned long _Unwind_GetTextRelBase (struct _Unwind_Context *);
+
+/* Call _Unwind_Trace_Fn once for each stack-frame, without doing any
+ cleanup. The first frame for which the callback is invoked is the
+ one for the caller of _Unwind_Backtrace(). _Unwind_Backtrace()
+ returns _URC_END_OF_STACK when the backtrace stopped due to
+ reaching the end of the call-chain or _URC_FATAL_PHASE1_ERROR if it
+ stops for any other reason. */
+extern _Unwind_Reason_Code _Unwind_Backtrace (_Unwind_Trace_Fn, void *);
+
+/* Find the start-address of the procedure containing the specified IP
+ or NULL if it cannot be found (e.g., because the function has no
+ unwind info). Note: there is not necessarily a one-to-one
+ correspondence between source-level functions and procedures: some
+ functions don't have unwind-info and others are split into multiple
+ procedures. */
+extern void *_Unwind_FindEnclosingFunction (void *);
+
+/* See also Linux Standard Base Spec:
+ http://www.linuxbase.org/spec/refspecs/LSB_1.3.0/gLSB/gLSB/libgcc-s.html */
+
+#endif /* _GNU_SOURCE */
+
+#ifdef __cplusplus
+};
+#endif
+
+#endif /* _UNWIND_H */
diff --git a/system/lib/debugging.cpp b/system/lib/debugging.cpp
index ff9e0d68..5dfaf223 100644
--- a/system/lib/debugging.cpp
+++ b/system/lib/debugging.cpp
@@ -18,5 +18,7 @@ void __assert_func(const char *file, int line, const char *assertt, const char *
abort();
}
+//struct _reent *_impure_ptr;
+
}
diff --git a/system/lib/libcxxabi/CREDITS.TXT b/system/lib/libcxxabi/CREDITS.TXT
new file mode 100644
index 00000000..a99245f7
--- /dev/null
+++ b/system/lib/libcxxabi/CREDITS.TXT
@@ -0,0 +1,22 @@
+This file is a partial list of people who have contributed to the LLVM/libc++abi
+project. If you have contributed a patch or made some other contribution to
+LLVM/libc++abi, please submit a patch to this file to add yourself, and it will be
+done!
+
+The list is sorted by surname and formatted to allow easy grepping and
+beautification by scripts. The fields are: name (N), email (E), web-address
+(W), PGP key ID and fingerprint (P), description (D), and snail-mail address
+(S).
+
+N: Howard Hinnant
+E: hhinnant@apple.com
+D: Architect and primary coauthor of libc++abi
+
+N: Marshall Clow
+E: marshall@idio.com
+E: mclow.lists@gmail.com
+E: mclow@qualcomm.com
+D: Architect and primary coauthor of libc++abi
+
+N: Nick Kledzik
+E: kledzik@apple.com
diff --git a/system/lib/libcxxabi/LICENSE.TXT b/system/lib/libcxxabi/LICENSE.TXT
new file mode 100644
index 00000000..40ce7c7d
--- /dev/null
+++ b/system/lib/libcxxabi/LICENSE.TXT
@@ -0,0 +1,76 @@
+==============================================================================
+libc++abi License
+==============================================================================
+
+The libc++abi library is dual licensed under both the University of Illinois
+"BSD-Like" license and the MIT license. As a user of this code you may choose
+to use it under either license. As a contributor, you agree to allow your code
+to be used under both.
+
+Full text of the relevant licenses is included below.
+
+==============================================================================
+
+University of Illinois/NCSA
+Open Source License
+
+Copyright (c) 2009-2010 by the contributors listed in CREDITS.TXT
+
+All rights reserved.
+
+Developed by:
+
+ LLVM Team
+
+ University of Illinois at Urbana-Champaign
+
+ http://llvm.org
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal with
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimers.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimers in the
+ documentation and/or other materials provided with the distribution.
+
+ * Neither the names of the LLVM Team, University of Illinois at
+ Urbana-Champaign, nor the names of its contributors may be used to
+ endorse or promote products derived from this Software without specific
+ prior written permission.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE
+SOFTWARE.
+
+==============================================================================
+
+Copyright (c) 2009-2010 by the contributors listed in CREDITS.TXT
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/system/lib/libcxxabi/Makefile b/system/lib/libcxxabi/Makefile
new file mode 100644
index 00000000..62654ef2
--- /dev/null
+++ b/system/lib/libcxxabi/Makefile
@@ -0,0 +1,28 @@
+OBJECTS = \
+ src/private_typeinfo.bc \
+ $(NULL)
+ #src/cxa_vector.bc \
+ #src/cxa_virtual.bc \
+ #src/temporary.bc \
+ #src/cxa_guard.bc \
+ #src/cxa_unexpected.bc \
+ #src/cxa_exception.bc \
+ #src/cxa_aux_runtime.bc \
+ #src/exception.bc \
+ #src/stdexcept.bc \
+ #src/abort_message.bc \
+ #src/cxa_personality.bc \
+ #src/cxa_new_delete.bc \
+ #src/cxa_handlers.bc \
+ #src/cxa_exception_storage.bc \
+ #src/typeinfo.bc \
+ #src/cxa_demangle.bc
+
+all: libcxxabi.bc
+
+%.bc: %.cpp
+ $(CXX) -I./include $< -o $@
+
+libcxxabi.bc: $(OBJECTS)
+ $(CXX) $(OBJECTS) -o libcxxabi.bc
+
diff --git a/system/lib/libcxxabi/include/cxa_demangle.h b/system/lib/libcxxabi/include/cxa_demangle.h
new file mode 100644
index 00000000..46dc9821
--- /dev/null
+++ b/system/lib/libcxxabi/include/cxa_demangle.h
@@ -0,0 +1,167 @@
+//===-------------------------- cxa_demangle.h ----------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _CXA_DEMANGLE_H
+#define _CXA_DEMANGLE_H
+
+#include <cxxabi.h>
+
+#pragma GCC visibility push(hidden)
+
+namespace __cxxabiv1
+{
+
+namespace __libcxxabi
+{
+
+class __demangle_tree;
+class __node;
+
+char*
+__demangle(__demangle_tree, char*, size_t*, int*);
+
+struct __demangle_tree_rv
+{
+ __demangle_tree* ptr_;
+
+ explicit __demangle_tree_rv(__demangle_tree* ptr)
+ : ptr_(ptr) {}
+};
+
+class __demangle_tree
+{
+ const char* __mangled_name_begin_;
+ const char* __mangled_name_end_;
+ int __status_;
+ __node* __root_;
+ __node* __node_begin_;
+ __node* __node_end_;
+ __node* __node_cap_;
+ __node** __sub_begin_;
+ __node** __sub_end_;
+ __node** __sub_cap_;
+ __node** __t_begin_;
+ __node** __t_end_;
+ __node** __t_cap_;
+ bool __tag_templates_;
+ bool __fix_forward_references_;
+ bool __owns_buf_;
+
+ __demangle_tree& operator=(const __demangle_tree&);
+public:
+ __demangle_tree(const char*, char*, size_t);
+ ~__demangle_tree();
+
+ __demangle_tree(__demangle_tree&);
+ __demangle_tree(__demangle_tree_rv);
+ operator __demangle_tree_rv() {return __demangle_tree_rv(this);}
+
+ int __status() const;
+ size_t size() const;
+ char* __get_demangled_name(char*) const;
+
+ void __parse();
+
+private:
+ const char* __parse_encoding(const char*, const char*);
+ const char* __parse_type(const char*, const char*,
+ bool = true, bool = false);
+ const char* __parse_special_name(const char*, const char*);
+ const char* __parse_name(const char*, const char*);
+ const char* __parse_bare_function_type(const char*, const char*);
+ const char* __parse_call_offset(const char*, const char*);
+ const char* __parse_number(const char*, const char*);
+ const char* __parse_cv_qualifiers(const char* first, const char* last,
+ unsigned& cv, bool = false);
+ const char* __parse_nested_name(const char*, const char*);
+ const char* __parse_discriminator(const char*, const char*);
+ const char* __parse_local_name(const char*, const char*);
+ const char* __parse_unscoped_template_name(const char*, const char*);
+ const char* __parse_unscoped_name(const char*, const char*);
+ const char* __parse_operator_name(const char*, const char*, int* = 0);
+ const char* __parse_unqualified_name(const char*, const char*);
+ const char* __parse_source_name(const char*, const char*);
+ const char* __parse_ctor_dtor_name(const char*, const char*);
+ const char* __parse_unnamed_type_name(const char*, const char*);
+ const char* __parse_template_args(const char*, const char*);
+ const char* __parse_template_arg(const char*, const char*);
+ const char* __parse_expression(const char*, const char*);
+ const char* __parse_expr_primary(const char*, const char*);
+ const char* __parse_substitution(const char*, const char*);
+ const char* __parse_builtin_type(const char*, const char*);
+ const char* __parse_function_type(const char*, const char*);
+ const char* __parse_class_enum_type(const char*, const char*);
+ const char* __parse_array_type(const char*, const char*);
+ const char* __parse_pointer_to_member_type(const char*, const char*);
+ const char* __parse_decltype(const char*, const char*);
+ const char* __parse_template_param(const char*, const char*);
+ const char* __parse_unresolved_name(const char*, const char*);
+ const char* __parse_unresolved_type(const char*, const char*);
+ const char* __parse_base_unresolved_name(const char*, const char*);
+ const char* __parse_simple_id(const char*, const char*);
+ const char* __parse_destructor_name(const char*, const char*);
+ const char* __parse_function_param(const char*, const char*);
+ const char* __parse_const_cast_expr(const char*, const char*);
+ const char* __parse_alignof_expr(const char*, const char*);
+ const char* __parse_call_expr(const char*, const char*);
+ const char* __parse_conversion_expr(const char*, const char*);
+ const char* __parse_delete_array_expr(const char*, const char*);
+ const char* __parse_delete_expr(const char*, const char*);
+ const char* __parse_dynamic_cast_expr(const char*, const char*);
+ const char* __parse_dot_star_expr(const char*, const char*);
+ const char* __parse_dot_expr(const char*, const char*);
+ const char* __parse_decrement_expr(const char*, const char*);
+ const char* __parse_new_expr(const char*, const char*);
+ const char* __parse_increment_expr(const char*, const char*);
+ const char* __parse_arrow_expr(const char*, const char*);
+ const char* __parse_reinterpret_cast_expr(const char*, const char*);
+ const char* __parse_static_cast_expr(const char*, const char*);
+ const char* __parse_sizeof_type_expr(const char*, const char*);
+ const char* __parse_sizeof_param_pack_expr(const char*, const char*);
+ const char* __parse_typeid_expr(const char*, const char*);
+ const char* __parse_throw_expr(const char*, const char*);
+ const char* __parse_pack_expansion(const char*, const char*);
+ const char* __parse_sizeof_function_param_pack_expr(const char*, const char*);
+ const char* __parse_dot_suffix(const char*, const char*);
+ const char* __parse_unresolved_qualifier_level(const char*, const char*);
+ const char* __parse_vector_type(const char*, const char*);
+ const char* __parse_hex_number(const char*, const char*, unsigned long long&);
+
+ template <class _Tp> bool __make();
+ template <class _Tp, class _A0> bool __make(_A0 __a0);
+ template <class _Tp, class _A0, class _A1> bool __make(_A0 __a0, _A1 __a1);
+ template <class _Tp, class _A0, class _A1, class _A2>
+ bool __make(_A0 __a0, _A1 __a1, _A2 __a2);
+ template <class _Tp, class _A0, class _A1, class _A2, class _A3>
+ bool __make(_A0 __a0, _A1 __a1, _A2 __a2, _A3 __a3);
+ template <class _Tp, class _A0, class _A1, class _A2, class _A3, class _A4>
+ bool __make(_A0 __a0, _A1 __a1, _A2 __a2, _A3 __a3, _A4 __a4);
+ template <class _Tp, class _A0, class _A1, class _A2, class _A3, class _A4,
+ class _A5>
+ bool __make(_A0 __a0, _A1 __a1, _A2 __a2, _A3 __a3, _A4 __a4, _A5 __a5);
+
+ friend
+ char*
+ __demangle(__demangle_tree, char*, size_t*, int*);
+
+};
+
+__demangle_tree
+__demangle(const char*);
+
+__demangle_tree
+__demangle(const char*, char*, size_t);
+
+} // __libcxxabi
+} // __cxxabiv1
+
+#pragma GCC visibility pop
+
+
+#endif // _CXA_DEMANGLE_H
diff --git a/system/lib/libcxxabi/include/cxxabi.h b/system/lib/libcxxabi/include/cxxabi.h
new file mode 100644
index 00000000..b08fba0e
--- /dev/null
+++ b/system/lib/libcxxabi/include/cxxabi.h
@@ -0,0 +1,175 @@
+//===--------------------------- cxxabi.h ---------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef __CXXABI_H
+#define __CXXABI_H
+
+/*
+ * This header provides the interface to the C++ ABI as defined at:
+ * http://www.codesourcery.com/cxx-abi/
+ */
+
+#include <stddef.h>
+#include <stdint.h>
+
+#define _LIBCPPABI_VERSION 1001
+#define LIBCXXABI_NORETURN __attribute__((noreturn))
+
+#ifdef __cplusplus
+
+namespace std {
+ class type_info; // forward declaration
+}
+
+
+// runtime routines use C calling conventions, but are in __cxxabiv1 namespace
+namespace __cxxabiv1 {
+ extern "C" {
+
+// 2.4.2 Allocating the Exception Object
+extern void * __cxa_allocate_exception(size_t thrown_size) throw();
+extern void __cxa_free_exception(void * thrown_exception) throw();
+
+// 2.4.3 Throwing the Exception Object
+extern LIBCXXABI_NORETURN void __cxa_throw(void * thrown_exception,
+ std::type_info * tinfo, void (*dest)(void *));
+
+// 2.5.3 Exception Handlers
+extern void * __cxa_get_exception_ptr(void * exceptionObject) throw();
+extern void * __cxa_begin_catch(void * exceptionObject) throw();
+extern void __cxa_end_catch();
+extern std::type_info * __cxa_current_exception_type();
+
+// 2.5.4 Rethrowing Exceptions
+extern LIBCXXABI_NORETURN void __cxa_rethrow();
+
+
+
+// 2.6 Auxiliary Runtime APIs
+extern LIBCXXABI_NORETURN void __cxa_bad_cast(void);
+extern LIBCXXABI_NORETURN void __cxa_bad_typeid(void);
+
+
+
+// 3.2.6 Pure Virtual Function API
+extern LIBCXXABI_NORETURN void __cxa_pure_virtual(void);
+
+// 3.2.7 Deleted Virtual Function API
+extern LIBCXXABI_NORETURN void __cxa_deleted_virtual(void);
+
+// 3.3.2 One-time Construction API
+#ifdef LIBCXXABI_ARMEABI
+extern int __cxa_guard_acquire(uint32_t*);
+extern void __cxa_guard_release(uint32_t*);
+extern void __cxa_guard_abort(uint32_t*);
+#else
+extern int __cxa_guard_acquire(uint64_t*);
+extern void __cxa_guard_release(uint64_t*);
+extern void __cxa_guard_abort(uint64_t*);
+#endif
+
+// 3.3.3 Array Construction and Destruction API
+extern void* __cxa_vec_new(size_t element_count,
+ size_t element_size,
+ size_t padding_size,
+ void (*constructor)(void*),
+ void (*destructor)(void*) );
+
+extern void* __cxa_vec_new2(size_t element_count,
+ size_t element_size,
+ size_t padding_size,
+ void (*constructor)(void*),
+ void (*destructor)(void*),
+ void* (*alloc)(size_t),
+ void (*dealloc)(void*) );
+
+extern void* __cxa_vec_new3(size_t element_count,
+ size_t element_size,
+ size_t padding_size,
+ void (*constructor)(void*),
+ void (*destructor)(void*),
+ void* (*alloc)(size_t),
+ void (*dealloc)(void*, size_t) );
+
+extern void __cxa_vec_ctor(void* array_address,
+ size_t element_count,
+ size_t element_size,
+ void (*constructor)(void*),
+ void (*destructor)(void*) );
+
+
+extern void __cxa_vec_dtor(void* array_address,
+ size_t element_count,
+ size_t element_size,
+ void (*destructor)(void*) );
+
+
+extern void __cxa_vec_cleanup(void* array_address,
+ size_t element_count,
+ size_t element_size,
+ void (*destructor)(void*) );
+
+
+extern void __cxa_vec_delete(void* array_address,
+ size_t element_size,
+ size_t padding_size,
+ void (*destructor)(void*) );
+
+
+extern void __cxa_vec_delete2(void* array_address,
+ size_t element_size,
+ size_t padding_size,
+ void (*destructor)(void*),
+ void (*dealloc)(void*) );
+
+
+extern void __cxa_vec_delete3(void* __array_address,
+ size_t element_size,
+ size_t padding_size,
+ void (*destructor)(void*),
+ void (*dealloc) (void*, size_t));
+
+
+extern void __cxa_vec_cctor(void* dest_array,
+ void* src_array,
+ size_t element_count,
+ size_t element_size,
+ void (*constructor) (void*, void*),
+ void (*destructor)(void*) );
+
+
+// 3.3.5.3 Runtime API
+extern int __cxa_atexit(void (*f)(void*), void* p, void* d);
+extern int __cxa_finalize(void*);
+
+
+// 3.4 Demangler API
+extern char* __cxa_demangle(const char* mangled_name,
+ char* output_buffer,
+ size_t* length,
+ int* status);
+
+// Apple additions to support C++ 0x exception_ptr class
+// These are primitives to wrap a smart pointer around an exception object
+extern void * __cxa_current_primary_exception() throw();
+extern void __cxa_rethrow_primary_exception(void* primary_exception);
+extern void __cxa_increment_exception_refcount(void* primary_exception) throw();
+extern void __cxa_decrement_exception_refcount(void* primary_exception) throw();
+
+// Apple addition to support std::uncaught_exception()
+extern bool __cxa_uncaught_exception() throw();
+
+ } // extern "C"
+} // namespace __cxxabiv1
+
+#endif // __cplusplus
+
+namespace abi = __cxxabiv1;
+
+#endif // __CXXABI_H
diff --git a/system/lib/libcxxabi/lib/buildit b/system/lib/libcxxabi/lib/buildit
new file mode 100755
index 00000000..d1d2acda
--- /dev/null
+++ b/system/lib/libcxxabi/lib/buildit
@@ -0,0 +1,90 @@
+#! /bin/sh
+#
+# Set the $TRIPLE environment variable to your system's triple before
+# running this script. If you set $CXX, that will be used to compile
+# the library. Otherwise we'll use clang++.
+
+set -e
+
+if [ `basename $(pwd)` != "lib" ]
+then
+ echo "current directory must be lib"
+ exit 1
+fi
+
+if [ -z "$CXX" ]
+then
+ CXX=clang++
+fi
+
+if [ -z "$CC" ]
+then
+ CC=clang
+fi
+
+if [ -z $RC_ProjectSourceVersion ]
+then
+ RC_ProjectSourceVersion=1
+fi
+
+EXTRA_FLAGS="-std=c++0x -stdlib=libc++ -fstrict-aliasing -Wstrict-aliasing=2 -Wnewline-eof"
+
+case $TRIPLE in
+ *-apple-*)
+ if [ -z $RC_XBS ]
+ then
+ RC_CFLAGS="-arch i386 -arch x86_64"
+ fi
+ SOEXT=dylib
+ if [ -n "$SDKROOT" ]
+ then
+ EXTRA_FLAGS+="-isysroot ${SDKROOT}"
+ CXX=`xcrun -sdk "${SDKROOT}" -find clang++`
+ CC=`xcrun -sdk "${SDKROOT}" -find clang`
+ fi
+ LDSHARED_FLAGS="-o libc++abi.dylib \
+ -dynamiclib -nodefaultlibs \
+ -current_version ${RC_ProjectSourceVersion} \
+ -compatibility_version 1 \
+ -install_name /usr/lib/libc++abi.dylib \
+ -lSystem"
+ ;;
+ *-*-mingw*)
+ # FIXME: removing libgcc and libsupc++ dependencies means porting libcxxrt and LLVM/compiler-rt
+ SOEXT=dll
+ LDSHARED_FLAGS="-o libc++abi.dll \
+ -shared -nodefaultlibs -Wl,--export-all-symbols -Wl,--allow-multiple-definition -Wl,--out-implib,libc++abi.dll.a \
+ -lsupc++ -lpthread -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcr100 -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt"
+ ;;
+ *)
+ RC_CFLAGS="-fPIC"
+ SOEXT=so
+ LDSHARED_FLAGS="-o libc++abi.so.1.0 \
+ -shared -nodefaultlibs -Wl,-soname,libc++abi.so.1 \
+ -lpthread -lrt -lc -lstdc++"
+ ;;
+esac
+
+if [ -z $RC_XBS ]
+then
+ rm -f libc++abi.1.$SOEXT*
+fi
+
+set -x
+
+for FILE in ../src/*.cpp; do
+ $CXX -c -g -O3 $RC_CFLAGS $EXTRA_FLAGS -I../include $FILE
+done
+case $TRIPLE in
+ *-*-mingw*)
+ for FILE in ../src/support/win32/*.cpp; do
+ $CXX -c -g -Os $RC_CFLAGS $EXTRA_FLAGS -I../include $FILE
+ done
+ ;;
+esac
+$CC *.o $RC_CFLAGS $LDSHARED_FLAGS $EXTRA_FLAGS
+
+if [ -z $RC_XBS ]
+then
+ rm *.o
+fi
diff --git a/system/lib/libcxxabi/readme.txt b/system/lib/libcxxabi/readme.txt
new file mode 100644
index 00000000..0be9a318
--- /dev/null
+++ b/system/lib/libcxxabi/readme.txt
@@ -0,0 +1 @@
+These files are from libcxxabi, svn revision 151132, Feb 22 2012
diff --git a/system/lib/libcxxabi/src/abort