Refresh EH/{gabi++,stlport}

This is gabi++ and stlport with exception handling supports.

Change-Id: I0d5b56af4b744d9d1812574474f2b2b513af9968
diff --git a/9/sources/cxx-stl/EH/gabi++/include/cxxabi.h b/9/sources/cxx-stl/EH/gabi++/include/cxxabi.h
index 6f44bbe..5684afb 100644
--- a/9/sources/cxx-stl/EH/gabi++/include/cxxabi.h
+++ b/9/sources/cxx-stl/EH/gabi++/include/cxxabi.h
@@ -29,328 +29,188 @@
 #ifndef __GABIXX_CXXABI_H__
 #define __GABIXX_CXXABI_H__
 
+// The specifications for the declarations found in this header are
+// the following:
+//
+// - Itanium C++ ABI [1]
+//   Used on about every CPU architecture, _except_ ARM, this
+//   is also commonly referred as the "generic C++ ABI".
+//
+//   NOTE: This document seems to only covers C++98
+//
+// - Itanium C++ ABI: Exception Handling. [2]
+//   Supplement to the above document describing how exception
+//   handle works with the generic C++ ABI. Again, this only
+//   seems to support C++98.
+//
+// - C++ ABI for the ARM architecture [3]
+//   Describes the ARM C++ ABI, mainly as a set of differences from
+//   the generic one.
+//
+// - Exception Handling for the ARM Architecture [4]
+//   Describes exception handling for ARM in detail. There are rather
+//   important differences in the stack unwinding process and
+//   exception cleanup.
+//
+// There are also no freely availabel documentation about certain
+// features introduced in C++0x or later. In this case, the best
+// source for information are the GNU and LLVM C++ runtime libraries
+// (libcxxabi, libsupc++ and even libc++ sources), as well as a few
+// proposals, for example:
+//
+// - For exception propagation:
+//   http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2007/n2179.html
+//   But the paper only describs the high-level language feature, not
+//   the low-level runtime support required to implement it.
+//
+// - For nested exceptions:
+//   http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2008/n2559.html
+//   Yet another high-level description without low-level details.
+//
+#include <gabixx_config.h>
+
 #include <exception>
 #include <stdint.h>
 #include <typeinfo>
 #include <unwind.h>
 
+// When LIBCXXABI, gabi++ should emulate libc++abi. _LIBCPPABI_VERSION must
+// be defined in cxxabi.h to complete this abstraction for libc++.
+#if defined(LIBCXXABI)
+#define _LIBCPPABI_VERSION 1001
+#endif
+
 namespace __cxxabiv1
 {
-  // Derived types of type_info below are based on 2.9.5 of C++ ABI.
-
-  class __shim_type_info : public std::type_info
-  {
-   public:
-    virtual ~__shim_type_info();
-    virtual bool can_catch(const __shim_type_info* thrown_type,
-                           void*& adjustedPtr) const = 0;
-  };
-
-  // Typeinfo for fundamental types.
-  class __fundamental_type_info : public __shim_type_info
-  {
-  public:
-    virtual ~__fundamental_type_info();
-    virtual bool can_catch(const __shim_type_info* thrown_type,
-                           void*& adjustedPtr) const;
-  };
-
-  // Typeinfo for array types.
-  class __array_type_info : public __shim_type_info
-  {
-  public:
-    virtual ~__array_type_info();
-    virtual bool can_catch(const __shim_type_info* thrown_type,
-                           void*& adjustedPtr) const;
-  };
-
-  // Typeinfo for function types.
-  class __function_type_info : public __shim_type_info
-  {
-  public:
-    virtual ~__function_type_info();
-    virtual bool can_catch(const __shim_type_info* thrown_type,
-                           void*& adjustedPtr) const;
-  };
-
-  // Typeinfo for enum types.
-  class __enum_type_info : public __shim_type_info
-  {
-  public:
-    virtual ~__enum_type_info();
-    virtual bool can_catch(const __shim_type_info* thrown_type,
-                           void*& adjustedPtr) const;
-  };
-
-
-  class __class_type_info;
-
-  // Used in __vmi_class_type_info
-  struct __base_class_type_info
-  {
-  public:
-    const __class_type_info *__base_type;
-
-    long __offset_flags;
-
-    enum __offset_flags_masks {
-      __virtual_mask = 0x1,
-      __public_mask = 0x2,
-      __offset_shift = 8   // lower 8 bits are flags
-    };
-
-    bool is_virtual() const {
-      return (__offset_flags & __virtual_mask) != 0;
-    }
-
-    bool is_public() const {
-      return (__offset_flags & __public_mask) != 0;
-    }
-
-    // FIXME: Right-shift of signed integer is implementation dependent.
-    // GCC Implement is as signed (as we expect)
-    long offset() const {
-      return __offset_flags >> __offset_shift;
-    }
-
-    long flags() const {
-      return __offset_flags & ((1 << __offset_shift) - 1);
-    }
-  };
-
-  // Helper struct to support catch-clause match
-  struct __UpcastInfo {
-    enum ContainedStatus {
-      unknown = 0,
-      has_public_contained,
-      has_ambig_or_not_public
-    };
-
-    ContainedStatus status;
-    const __class_type_info* base_type;
-    void* adjustedPtr;
-    unsigned int premier_flags;
-    bool nullobj_may_conflict;
-
-    __UpcastInfo(const __class_type_info* type);
-  };
-
-  // Typeinfo for classes with no bases.
-  class __class_type_info : public __shim_type_info
-  {
-  public:
-    virtual ~__class_type_info();
-    virtual bool can_catch(const __shim_type_info* thrown_type,
-                           void*& adjustedPtr) const;
-
-    enum class_type_info_code {
-      CLASS_TYPE_INFO_CODE,
-      SI_CLASS_TYPE_INFO_CODE,
-      VMI_CLASS_TYPE_INFO_CODE
-    };
-
-    virtual class_type_info_code
-      code() const { return CLASS_TYPE_INFO_CODE; }
-
-    virtual bool walk_to(const __class_type_info* base_type,
-                         void*& adjustedPtr,
-                         __UpcastInfo& info) const;
-
-  protected:
-    bool self_class_type_match(const __class_type_info* base_type,
-                               void*& adjustedPtr,
-                               __UpcastInfo& info) const;
-  };
-
-  // Typeinfo for classes containing only a single, public, non-virtual base at
-  // offset zero.
-  class __si_class_type_info : public __class_type_info
-  {
-  public:
-    virtual ~__si_class_type_info();
-    const __class_type_info *__base_type;
-
-    virtual __class_type_info::class_type_info_code
-      code() const { return SI_CLASS_TYPE_INFO_CODE; }
-
-    virtual bool walk_to(const __class_type_info* base_type,
-                         void*& adjustedPtr,
-                         __UpcastInfo& info) const;
-  };
-
-
-  // Typeinfo for classes with bases that do not satisfy the
-  // __si_class_type_info constraints.
-  class __vmi_class_type_info : public __class_type_info
-  {
-  public:
-    virtual ~__vmi_class_type_info();
-    unsigned int __flags;
-    unsigned int __base_count;
-    __base_class_type_info __base_info[1];
-
-    enum __flags_masks {
-      __non_diamond_repeat_mask = 0x1,
-      __diamond_shaped_mask = 0x2,
-    };
-
-    virtual __class_type_info::class_type_info_code
-      code() const { return VMI_CLASS_TYPE_INFO_CODE; }
-
-    virtual bool walk_to(const __class_type_info* base_type,
-                         void*& adjustedPtr,
-                         __UpcastInfo& info) const;
-  };
-
-  class __pbase_type_info : public __shim_type_info
-  {
-  public:
-    virtual ~__pbase_type_info();
-    virtual bool can_catch(const __shim_type_info* thrown_type,
-                           void*& adjustedPtr) const;
-    unsigned int __flags;
-    const __shim_type_info* __pointee;
-
-    enum __masks {
-      __const_mask = 0x1,
-      __volatile_mask = 0x2,
-      __restrict_mask = 0x4,
-      __incomplete_mask = 0x8,
-      __incomplete_class_mask = 0x10
-    };
-
-
-    virtual bool can_catch_typeinfo_wrapper(const __shim_type_info* thrown_type,
-                                            void*& adjustedPtr,
-                                            unsigned tracker) const;
-
-  protected:
-    enum __constness_tracker_status {
-      first_time_init = 0x1,
-      keep_constness = 0x2,
-      after_gap = 0x4         // after one non-const qualified,
-                              // we cannot face const again in future
-    };
-
-  private:
-    bool can_catch_ptr(const __pbase_type_info *thrown_type,
-                       void *&adjustedPtr,
-                       unsigned tracker) const;
-
-    // Return true if making decision done.
-    virtual bool do_can_catch_ptr(const __pbase_type_info* thrown_type,
-                                  void*& adjustedPtr,
-                                  unsigned tracker,
-                                  bool& result) const = 0;
-  };
-
-  class __pointer_type_info : public __pbase_type_info
-  {
-  public:
-    virtual ~__pointer_type_info();
-
-  private:
-    virtual bool do_can_catch_ptr(const __pbase_type_info* thrown_type,
-                                  void*& adjustedPtr,
-                                  unsigned tracker,
-                                  bool& result) const;
-  };
-
-  class __pointer_to_member_type_info : public __pbase_type_info
-  {
-  public:
-    __class_type_info* __context;
-
-    virtual ~__pointer_to_member_type_info();
-
-  private:
-    virtual bool do_can_catch_ptr(const __pbase_type_info* thrown_type,
-                                  void*& adjustedPtr,
-                                  unsigned tracker,
-                                  bool& result) const;
-  };
-
-
   extern "C" {
 
-    // Compatible with GNU C++
-    const uint64_t __gxx_exception_class = 0x474E5543432B2B00LL; // GNUCC++\0
-
     // TODO: Support dependent exception
     // TODO: Support C++0x exception propagation
     // http://sourcery.mentor.com/archives/cxx-abi-dev/msg01924.html
-    struct __cxa_exception {
-      size_t referenceCount;
+    struct __cxa_exception;
+    struct __cxa_eh_globals;
 
-      std::type_info* exceptionType;
-      void (*exceptionDestructor)(void*);
-      std::unexpected_handler unexpectedHandler;
-      std::terminate_handler terminateHandler;
-      __cxa_exception* nextException;
+    __cxa_eh_globals* __cxa_get_globals() _GABIXX_NOEXCEPT ;
+    __cxa_eh_globals* __cxa_get_globals_fast() _GABIXX_NOEXCEPT;
 
-      int handlerCount;
+    void* __cxa_allocate_exception(size_t thrown_size) _GABIXX_NOEXCEPT;
+    void __cxa_free_exception(void* thrown_exception) _GABIXX_NOEXCEPT;
+
+    void __cxa_throw(void* thrown_exception,
+                     std::type_info* tinfo,
+                     void (*dest)(void*)) _GABIXX_NORETURN;
+
+    void __cxa_rethrow() _GABIXX_NORETURN;
+
+    void* __cxa_begin_catch(void* exceptionObject) _GABIXX_NOEXCEPT;
+    void __cxa_end_catch() _GABIXX_NOEXCEPT;
+
 #ifdef __arm__
-      /**
-       * ARM EHABI requires the unwind library to keep track of exceptions
-       * during cleanups.  These support nesting, so we need to keep a list of
-       * them.
-       */
-      __cxa_exception* nextCleanup;
-      int cleanupCount;
-#endif
-      int handlerSwitchValue;
-      const uint8_t* actionRecord;
-      const uint8_t* languageSpecificData;
-      void* catchTemp;
-      void* adjustedPtr;
-
-      _Unwind_Exception unwindHeader; // must be last
-    };
-
-    struct __cxa_eh_globals {
-      __cxa_exception* caughtExceptions;
-      unsigned int uncaughtExceptions;
-#ifdef __arm__
-      __cxa_exception* cleanupExceptions;
-#endif
-    };
-
-    struct __cxa_thread_info {
-      std::unexpected_handler unexpectedHandler;
-      std::terminate_handler terminateHandler;
-      _Unwind_Exception* currentCleanup;
-
-      __cxa_eh_globals globals;
-    };
-
-    __cxa_eh_globals* __cxa_get_globals();
-    __cxa_eh_globals* __cxa_get_globals_fast();
-
-    void* __cxa_allocate_exception(size_t thrown_size);
-    void __cxa_free_exception(void* thrown_exception);
-
-    void __cxa_throw(void* thrown_exception, std::type_info* tinfo, void (*dest)(void*));
-    void __cxa_rethrow();
-
-    void* __cxa_begin_catch(void* exceptionObject);
-    void __cxa_end_catch();
-
     bool __cxa_begin_cleanup(_Unwind_Exception*);
     void __cxa_end_cleanup();
+#endif
 
-    void __cxa_bad_cast();
-    void __cxa_bad_typeid();
+    void __cxa_bad_cast() _GABIXX_NORETURN;
+    void __cxa_bad_typeid() _GABIXX_NORETURN;
 
-    void* __cxa_get_exception_ptr(void* exceptionObject);
+    void* __cxa_get_exception_ptr(void* exceptionObject) _GABIXX_NOEXCEPT;
 
-    void __cxa_pure_virtual();
+    void __cxa_pure_virtual() _GABIXX_NORETURN;
+    void __cxa_deleted_virtual() _GABIXX_NORETURN;
 
     // Missing libcxxabi functions.
-    bool __cxa_uncaught_exception() throw();
-    void __cxa_decrement_exception_refcount(void* exceptionObject) throw();
-    void __cxa_increment_exception_refcount(void* exceptionObject) throw();
+    bool __cxa_uncaught_exception() _GABIXX_NOEXCEPT;
+
+    void __cxa_decrement_exception_refcount(void* exceptionObject)
+        _GABIXX_NOEXCEPT;
+
+    void __cxa_increment_exception_refcount(void* exceptionObject)
+        _GABIXX_NOEXCEPT;
+
     void __cxa_rethrow_primary_exception(void* exceptionObject);
-    void* __cxa_current_primary_exception() throw();
+
+    void* __cxa_current_primary_exception() _GABIXX_NOEXCEPT;
+
+    // The ARM ABI mandates that constructors and destructors
+    // must return 'this', i.e. their first parameter. This is
+    // also true for __cxa_vec_ctor and __cxa_vec_cctor.
+#ifdef __arm__
+    typedef void* __cxa_vec_ctor_return_type;
+#else
+    typedef void __cxa_vec_ctor_return_type;
+#endif
+
+    typedef __cxa_vec_ctor_return_type
+        (*__cxa_vec_constructor)(void *);
+
+    typedef __cxa_vec_constructor __cxa_vec_destructor;
+
+    typedef __cxa_vec_ctor_return_type
+        (*__cxa_vec_copy_constructor)(void*, void*);
+
+    void* __cxa_vec_new(size_t element_count,
+                        size_t element_size,
+                        size_t padding_size,
+                        __cxa_vec_constructor constructor,
+                        __cxa_vec_destructor destructor);
+
+    void* __cxa_vec_new2(size_t element_count,
+                         size_t element_size,
+                         size_t padding_size,
+                         __cxa_vec_constructor constructor,
+                         __cxa_vec_destructor destructor,
+                         void* (*alloc)(size_t),
+                         void  (*dealloc)(void*));
+
+    void* __cxa_vec_new3(size_t element_count,
+                         size_t element_size,
+                         size_t padding_size,
+                         __cxa_vec_constructor constructor,
+                         __cxa_vec_destructor destructor,
+                         void* (*alloc)(size_t),
+                         void  (*dealloc)(void*, size_t));
+
+    __cxa_vec_ctor_return_type
+    __cxa_vec_ctor(void*  array_address,
+                   size_t element_count,
+                   size_t element_size,
+                   __cxa_vec_constructor constructor,
+                   __cxa_vec_destructor destructor);
+
+    void __cxa_vec_dtor(void*  array_address,
+                        size_t element_count,
+                        size_t element_size,
+                        __cxa_vec_destructor destructor);
+
+    void __cxa_vec_cleanup(void* array_address,
+                           size_t element_count,
+                           size_t element_size,
+                           __cxa_vec_destructor destructor);
+
+    void __cxa_vec_delete(void*  array_address,
+                          size_t element_size,
+                          size_t padding_size,
+                          __cxa_vec_destructor destructor);
+
+    void __cxa_vec_delete2(void* array_address,
+                           size_t element_size,
+                           size_t padding_size,
+                           __cxa_vec_destructor destructor,
+                           void  (*dealloc)(void*));
+
+    void __cxa_vec_delete3(void* array_address,
+                           size_t element_size,
+                           size_t padding_size,
+                           __cxa_vec_destructor destructor,
+                           void  (*dealloc) (void*, size_t));
+
+    __cxa_vec_ctor_return_type
+    __cxa_vec_cctor(void*  dest_array,
+                    void*  src_array,
+                    size_t element_count,
+                    size_t element_size,
+                    __cxa_vec_copy_constructor constructor,
+                    __cxa_vec_destructor destructor );
 
   } // extern "C"
 
@@ -358,5 +218,75 @@
 
 namespace abi = __cxxabiv1;
 
+#if _GABIXX_ARM_ABI
+// ARM-specific ABI additions. They  must be provided by the
+// C++ runtime to simplify calling code generated by the compiler.
+// Note that neither GCC nor Clang seem to use these, but this can
+// happen when using machine code generated with other ocmpilers
+// like RCVT.
+
+namespace __aeabiv1 {
+extern "C" {
+
+using __cxxabiv1::__cxa_vec_constructor;
+using __cxxabiv1::__cxa_vec_copy_constructor;
+using __cxxabiv1::__cxa_vec_destructor;
+
+void* __aeabi_vec_ctor_nocookie_nodtor(void* array_address,
+                                       __cxa_vec_constructor constructor,
+                                       size_t element_size,
+                                       size_t element_count);
+
+void* __aeabi_vec_ctor_cookie_nodtor(void* array_address,
+                                     __cxa_vec_constructor constructor,
+                                     size_t element_size,
+                                     size_t element_count);
+
+void* __aeabi_vec_cctor_nocookie_nodtor(
+    void* dst_array,
+    void* src_array,
+    size_t element_size,
+    size_t element_count,
+    __cxa_vec_copy_constructor constructor);
+
+void* __aeabi_vec_new_nocookie_noctor(size_t element_size,
+                                      size_t element_count);
+
+void* __aeabi_vec_new_nocookie(size_t element_size,
+                               size_t element_count,
+                               __cxa_vec_constructor constructor);
+
+void* __aeabi_vec_new_cookie_nodtor(size_t element_size,
+                                    size_t element_count,
+                                    __cxa_vec_constructor constructor);
+
+void* __aeabi_vec_new_cookie(size_t element_size,
+                             size_t element_count,
+                             __cxa_vec_constructor constructor,
+                             __cxa_vec_destructor destructor);
+
+void* __aeabi_vec_dtor(void* array_address,
+                       __cxa_vec_destructor destructor,
+                       size_t element_size,
+                       size_t element_count);
+  
+void* __aeabi_vec_dtor_cookie(void* array_address,
+                              __cxa_vec_destructor destructor);
+
+void __aeabi_vec_delete(void* array_address,
+                        __cxa_vec_destructor destructor);
+
+void __aeabi_vec_delete3(void* array_address,
+                         __cxa_vec_destructor destructor,
+                         void (*dealloc)(void*, size_t));
+
+void __aeabi_vec_delete3_nodtor(void* array_address,
+                                void (*dealloc)(void*, size_t));
+
+}  // extern "C"
+}  // namespace __
+
+#endif  // _GABIXX_ARM_ABI == 1
+
 #endif /* defined(__GABIXX_CXXABI_H__) */
 
diff --git a/9/sources/cxx-stl/EH/gabi++/include/exception b/9/sources/cxx-stl/EH/gabi++/include/exception
index d4019ce..7c18c57 100644
--- a/9/sources/cxx-stl/EH/gabi++/include/exception
+++ b/9/sources/cxx-stl/EH/gabi++/include/exception
@@ -28,38 +28,40 @@
 #ifndef __GABIXX_EXCEPTION__
 #define __GABIXX_EXCEPTION__
 
-#if !defined(GABIXX_LIBCXX)
+#include "gabixx_config.h"
+
+#if !defined(LIBCXXABI)
 
 namespace std {
 
   class exception {
   public:
-    exception() throw();
-    virtual ~exception() throw();
-    virtual const char* what() const throw();
+    exception() _GABIXX_NOEXCEPT;
+    virtual ~exception() _GABIXX_NOEXCEPT;
+    virtual const char* what() const _GABIXX_NOEXCEPT;
   };
 
   class bad_exception : public exception {
   public:
-    bad_exception() throw();
-    virtual ~bad_exception() throw();
-    virtual const char* what() const throw();
+    bad_exception() _GABIXX_NOEXCEPT;
+    virtual ~bad_exception() _GABIXX_NOEXCEPT;
+    virtual const char* what() const _GABIXX_NOEXCEPT;
   };
 
   typedef void (*terminate_handler)();
-  terminate_handler get_terminate();
-  terminate_handler set_terminate(terminate_handler f);
-  void terminate();
+  terminate_handler get_terminate() _GABIXX_NOEXCEPT;
+  terminate_handler set_terminate(terminate_handler f) _GABIXX_NOEXCEPT;
+  void terminate() _GABIXX_NOEXCEPT_CXX11_ONLY _GABIXX_NORETURN;
 
   typedef void (*unexpected_handler)();
-  unexpected_handler get_unexpected();
-  unexpected_handler set_unexpected(unexpected_handler f);
-  void unexpected();
+  unexpected_handler get_unexpected() _GABIXX_NOEXCEPT;
+  unexpected_handler set_unexpected(unexpected_handler f) _GABIXX_NOEXCEPT;
+  void unexpected() _GABIXX_NORETURN;
 
-  bool uncaught_exception() throw();
+  bool uncaught_exception() _GABIXX_NOEXCEPT;
 
 } // namespace std
 
-#endif  // !defined(GABIXX_LIBCXX)
+#endif  // !defined(LIBCXXABI)
 
 #endif // __GABIXX_EXCEPTION__
diff --git a/9/sources/cxx-stl/EH/gabi++/include/gabixx_config.h b/9/sources/cxx-stl/EH/gabi++/include/gabixx_config.h
new file mode 100644
index 0000000..718b919
--- /dev/null
+++ b/9/sources/cxx-stl/EH/gabi++/include/gabixx_config.h
@@ -0,0 +1,97 @@
+// Copyright (C) 2013 The Android Open Source Project
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// 1. Redistributions of source code must retain the above copyright
+//    notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+//    notice, this list of conditions and the following disclaimer in the
+//    documentation and/or other materials provided with the distribution.
+// 3. Neither the name of the project nor the names of its contributors
+//    may be used to endorse or promote products derived from this software
+//    without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+// SUCH DAMAGE.
+
+#ifndef __GABIXX_CONFIG_H__
+#define __GABIXX_CONFIG_H__
+
+// Used to tag functions that never return.
+// IMPORTANT: This must appear at the left of function definitions,
+// as in:
+//  _GABIXX_NORETURN <return-type> <name>(....) { ... }
+#define _GABIXX_NORETURN  __attribute__((__noreturn__))
+
+// Use _GABIXX_NOEXCEPT to use the equivalent of the C++11 noexcept
+// qualifier at the end of function declarations.
+//
+// _GABIXX_NOEXCEPT_() only in C++11 mode to use the noexcept() operator.
+// _GABIXX_NOEXCEPT_CXX11_ONLY uses noexcept in C++11, nothing otherwise.
+#if __cplusplus >= 201103L
+#  define _GABIXX_NOEXCEPT noexcept
+#  define _GABIXX_NOEXCEPT_(x) noexcept(x)
+#  define _GABIXX_NOEXCEPT_CXX11_ONLY noexcept
+#else
+#  define _GABIXX_NOEXCEPT throw()
+#  define _GABIXX_NOEXCEPT_(x) /* nothing */
+#  define _GABIXX_NOEXCEPT_CXX11_ONLY /* nothing */
+#endif
+
+// Use _GABIXX_HIDDEN to declare internal functions of GAbi++ that should
+// never be exposed to client code.
+#define _GABIXX_HIDDEN  __attribute__((__visibility__("hidden")))
+
+// Use _GABIXX_WEAK to define a symbol with weak linkage.
+#define _GABIXX_WEAK  __attribute__((__weak__))
+
+// Use _GABIXX_ALWAYS_INLINE to declare a function that shall always be
+// inlined. Note that the always_inline doesn't make a function inline
+// per se.
+#define _GABIXX_ALWAYS_INLINE \
+  inline __attribute__((__always_inline__))
+
+// _GABIXX_HAS_EXCEPTIONS will be 1 if the current source file is compiled
+// with exceptions support, or 0 otherwise.
+#if !defined(__clang__) && !defined(__has_feature)
+#define __has_feature(x) 0
+#endif
+
+#if (defined(__clang__) && __has_feature(cxx_exceptions)) || \
+    (defined(__GNUC__) && defined(__EXCEPTIONS))
+#define _GABIXX_HAS_EXCEPTIONS 1
+#else
+#define _GABIXX_HAS_EXCEPTIONS 0
+#endif
+
+// TODO(digit): Use __atomic_load_acq_rel when available.
+#define __gabixx_sync_load(address)  \
+    __sync_fetch_and_add((address), (__typeof__(*(address)))0)
+
+// Clang provides __sync_swap(), but GCC does not.
+// IMPORTANT: For GCC, __sync_lock_test_and_set has acquire semantics only
+// so an explicit __sync_synchronize is needed to ensure a full barrier.
+// TODO(digit): Use __atomic_swap_acq_rel when available.
+#if defined(__clang__)
+#  define __gabixx_sync_swap(address,value)  __sync_swap((address),(value))
+#else
+#  define __gabixx_sync_swap(address, value)  \
+  __extension__ ({ \
+    __typeof__(*(address)) __ret = __sync_lock_test_and_set((address),(value)); \
+    __sync_synchronize(); \
+    __ret; \
+  })
+#endif
+
+#endif  // __GABIXX_CONFIG_H__
diff --git a/9/sources/cxx-stl/EH/gabi++/include/new b/9/sources/cxx-stl/EH/gabi++/include/new
index d66fef7..1643e01 100644
--- a/9/sources/cxx-stl/EH/gabi++/include/new
+++ b/9/sources/cxx-stl/EH/gabi++/include/new
@@ -30,7 +30,7 @@
 #ifndef __GABIXX_NEW__
 #define __GABIXX_NEW__
 
-#if !defined(GABIXX_LIBCXX)
+#if !defined(LIBCXXABI)
 
 #include <cstddef>
 #include <exception>
@@ -50,6 +50,7 @@
 
 typedef void (*new_handler)();
 new_handler set_new_handler(new_handler) throw();
+new_handler get_new_handler() throw();
 
 }
 
@@ -68,6 +69,6 @@
 inline void  operator delete(void*, void*) throw() {}
 inline void  operator delete[](void*, void*) throw() {}
 
-#endif // !defined(GABIXX_LIBCXX)
+#endif // !defined(LIBCXXABI)
 
 #endif // __GABIXX_NEW__
diff --git a/9/sources/cxx-stl/EH/gabi++/include/typeinfo b/9/sources/cxx-stl/EH/gabi++/include/typeinfo
index 486eb40..8dcc9dd 100644
--- a/9/sources/cxx-stl/EH/gabi++/include/typeinfo
+++ b/9/sources/cxx-stl/EH/gabi++/include/typeinfo
@@ -35,7 +35,7 @@
 #ifndef __GABIXX_TYPEINFO__
 #define __GABIXX_TYPEINFO__
 
-#if  !defined(GABIXX_LIBCXX)
+#if  !defined(LIBCXXABI)
 
 #include <exception>
 
@@ -93,6 +93,6 @@
 
 } // namespace std
 
-#endif  // !defined(GABIXX_LIBCXX)
+#endif  // !defined(LIBCXXABI)
 
 #endif // _GABIXX_TYPEINFO_
diff --git a/9/sources/cxx-stl/EH/gabi++/include/unwind-arm.h b/9/sources/cxx-stl/EH/gabi++/include/unwind-arm.h
index d3f697e..d248979 100644
--- a/9/sources/cxx-stl/EH/gabi++/include/unwind-arm.h
+++ b/9/sources/cxx-stl/EH/gabi++/include/unwind-arm.h
@@ -51,6 +51,7 @@
 static const _Unwind_State _US_VIRTUAL_UNWIND_FRAME   = 0;
 static const _Unwind_State _US_UNWIND_FRAME_STARTING  = 1;
 static const _Unwind_State _US_UNWIND_FRAME_RESUME    = 2;
+static const _Unwind_State _US_ACTION_MASK            = 3;
 
 typedef struct _Unwind_Control_Block _Unwind_Control_Block;
 typedef struct _Unwind_Context _Unwind_Context;
diff --git a/9/sources/cxx-stl/EH/gabi++/libs/arm64/libgabi++_shared.so b/9/sources/cxx-stl/EH/gabi++/libs/arm64/libgabi++_shared.so
new file mode 100755
index 0000000..e3fce3d
--- /dev/null
+++ b/9/sources/cxx-stl/EH/gabi++/libs/arm64/libgabi++_shared.so
Binary files differ
diff --git a/9/sources/cxx-stl/EH/gabi++/libs/arm64/libgabi++_static.a b/9/sources/cxx-stl/EH/gabi++/libs/arm64/libgabi++_static.a
new file mode 100644
index 0000000..5f6f285
--- /dev/null
+++ b/9/sources/cxx-stl/EH/gabi++/libs/arm64/libgabi++_static.a
Binary files differ
diff --git a/9/sources/cxx-stl/EH/gabi++/libs/armeabi-v7a/libgabi++_shared.so b/9/sources/cxx-stl/EH/gabi++/libs/armeabi-v7a/libgabi++_shared.so
index a6c42c7..0a2ab96 100755
--- a/9/sources/cxx-stl/EH/gabi++/libs/armeabi-v7a/libgabi++_shared.so
+++ b/9/sources/cxx-stl/EH/gabi++/libs/armeabi-v7a/libgabi++_shared.so
Binary files differ
diff --git a/9/sources/cxx-stl/EH/gabi++/libs/armeabi-v7a/libgabi++_static.a b/9/sources/cxx-stl/EH/gabi++/libs/armeabi-v7a/libgabi++_static.a
index 4a378ae..c3cc91a 100644
--- a/9/sources/cxx-stl/EH/gabi++/libs/armeabi-v7a/libgabi++_static.a
+++ b/9/sources/cxx-stl/EH/gabi++/libs/armeabi-v7a/libgabi++_static.a
Binary files differ
diff --git a/9/sources/cxx-stl/EH/gabi++/libs/armeabi/libgabi++_shared.so b/9/sources/cxx-stl/EH/gabi++/libs/armeabi/libgabi++_shared.so
index 9f2c7cb..db1ec08 100755
--- a/9/sources/cxx-stl/EH/gabi++/libs/armeabi/libgabi++_shared.so
+++ b/9/sources/cxx-stl/EH/gabi++/libs/armeabi/libgabi++_shared.so
Binary files differ
diff --git a/9/sources/cxx-stl/EH/gabi++/libs/armeabi/libgabi++_static.a b/9/sources/cxx-stl/EH/gabi++/libs/armeabi/libgabi++_static.a
index a4570ff..5c11732 100644
--- a/9/sources/cxx-stl/EH/gabi++/libs/armeabi/libgabi++_static.a
+++ b/9/sources/cxx-stl/EH/gabi++/libs/armeabi/libgabi++_static.a
Binary files differ
diff --git a/9/sources/cxx-stl/EH/gabi++/libs/mips/libgabi++_shared.so b/9/sources/cxx-stl/EH/gabi++/libs/mips/libgabi++_shared.so
index 535bcb6..2bb1c76 100755
--- a/9/sources/cxx-stl/EH/gabi++/libs/mips/libgabi++_shared.so
+++ b/9/sources/cxx-stl/EH/gabi++/libs/mips/libgabi++_shared.so
Binary files differ
diff --git a/9/sources/cxx-stl/EH/gabi++/libs/mips/libgabi++_static.a b/9/sources/cxx-stl/EH/gabi++/libs/mips/libgabi++_static.a
index 8c5b87d..4e851c7 100644
--- a/9/sources/cxx-stl/EH/gabi++/libs/mips/libgabi++_static.a
+++ b/9/sources/cxx-stl/EH/gabi++/libs/mips/libgabi++_static.a
Binary files differ
diff --git a/9/sources/cxx-stl/EH/gabi++/libs/mips64/libgabi++_shared.so b/9/sources/cxx-stl/EH/gabi++/libs/mips64/libgabi++_shared.so
new file mode 100755
index 0000000..35747d3
--- /dev/null
+++ b/9/sources/cxx-stl/EH/gabi++/libs/mips64/libgabi++_shared.so
Binary files differ
diff --git a/9/sources/cxx-stl/EH/gabi++/libs/mips64/libgabi++_static.a b/9/sources/cxx-stl/EH/gabi++/libs/mips64/libgabi++_static.a
new file mode 100644
index 0000000..63523de
--- /dev/null
+++ b/9/sources/cxx-stl/EH/gabi++/libs/mips64/libgabi++_static.a
Binary files differ
diff --git a/9/sources/cxx-stl/EH/gabi++/libs/x86/libgabi++_shared.so b/9/sources/cxx-stl/EH/gabi++/libs/x86/libgabi++_shared.so
index 034ca3c..d2029d4 100755
--- a/9/sources/cxx-stl/EH/gabi++/libs/x86/libgabi++_shared.so
+++ b/9/sources/cxx-stl/EH/gabi++/libs/x86/libgabi++_shared.so
Binary files differ
diff --git a/9/sources/cxx-stl/EH/gabi++/libs/x86/libgabi++_static.a b/9/sources/cxx-stl/EH/gabi++/libs/x86/libgabi++_static.a
index 64e87b5..11f3cd3 100644
--- a/9/sources/cxx-stl/EH/gabi++/libs/x86/libgabi++_static.a
+++ b/9/sources/cxx-stl/EH/gabi++/libs/x86/libgabi++_static.a
Binary files differ
diff --git a/9/sources/cxx-stl/EH/gabi++/libs/x86_64/libgabi++_shared.so b/9/sources/cxx-stl/EH/gabi++/libs/x86_64/libgabi++_shared.so
new file mode 100755
index 0000000..236ae2c
--- /dev/null
+++ b/9/sources/cxx-stl/EH/gabi++/libs/x86_64/libgabi++_shared.so
Binary files differ
diff --git a/9/sources/cxx-stl/EH/gabi++/libs/x86_64/libgabi++_static.a b/9/sources/cxx-stl/EH/gabi++/libs/x86_64/libgabi++_static.a
new file mode 100644
index 0000000..fcd7cca
--- /dev/null
+++ b/9/sources/cxx-stl/EH/gabi++/libs/x86_64/libgabi++_static.a
Binary files differ
diff --git a/9/sources/cxx-stl/EH/stlport/libs/arm64/libstlport_shared.so b/9/sources/cxx-stl/EH/stlport/libs/arm64/libstlport_shared.so
new file mode 100755
index 0000000..97993fb
--- /dev/null
+++ b/9/sources/cxx-stl/EH/stlport/libs/arm64/libstlport_shared.so
Binary files differ
diff --git a/9/sources/cxx-stl/EH/stlport/libs/arm64/libstlport_static.a b/9/sources/cxx-stl/EH/stlport/libs/arm64/libstlport_static.a
new file mode 100644
index 0000000..a0f36cf
--- /dev/null
+++ b/9/sources/cxx-stl/EH/stlport/libs/arm64/libstlport_static.a
Binary files differ
diff --git a/9/sources/cxx-stl/EH/stlport/libs/armeabi-v7a/libstlport_shared.so b/9/sources/cxx-stl/EH/stlport/libs/armeabi-v7a/libstlport_shared.so
index 76c405e..ea96aec 100755
--- a/9/sources/cxx-stl/EH/stlport/libs/armeabi-v7a/libstlport_shared.so
+++ b/9/sources/cxx-stl/EH/stlport/libs/armeabi-v7a/libstlport_shared.so
Binary files differ
diff --git a/9/sources/cxx-stl/EH/stlport/libs/armeabi-v7a/libstlport_static.a b/9/sources/cxx-stl/EH/stlport/libs/armeabi-v7a/libstlport_static.a
index d832182..fe9fb0f 100644
--- a/9/sources/cxx-stl/EH/stlport/libs/armeabi-v7a/libstlport_static.a
+++ b/9/sources/cxx-stl/EH/stlport/libs/armeabi-v7a/libstlport_static.a
Binary files differ
diff --git a/9/sources/cxx-stl/EH/stlport/libs/armeabi/libstlport_shared.so b/9/sources/cxx-stl/EH/stlport/libs/armeabi/libstlport_shared.so
index 47b587f..15d2dbd 100755
--- a/9/sources/cxx-stl/EH/stlport/libs/armeabi/libstlport_shared.so
+++ b/9/sources/cxx-stl/EH/stlport/libs/armeabi/libstlport_shared.so
Binary files differ
diff --git a/9/sources/cxx-stl/EH/stlport/libs/armeabi/libstlport_static.a b/9/sources/cxx-stl/EH/stlport/libs/armeabi/libstlport_static.a
index 5b32b76..af09bf4 100644
--- a/9/sources/cxx-stl/EH/stlport/libs/armeabi/libstlport_static.a
+++ b/9/sources/cxx-stl/EH/stlport/libs/armeabi/libstlport_static.a
Binary files differ
diff --git a/9/sources/cxx-stl/EH/stlport/libs/mips/libstlport_shared.so b/9/sources/cxx-stl/EH/stlport/libs/mips/libstlport_shared.so
index 5166cd0..536cb61 100755
--- a/9/sources/cxx-stl/EH/stlport/libs/mips/libstlport_shared.so
+++ b/9/sources/cxx-stl/EH/stlport/libs/mips/libstlport_shared.so
Binary files differ
diff --git a/9/sources/cxx-stl/EH/stlport/libs/mips/libstlport_static.a b/9/sources/cxx-stl/EH/stlport/libs/mips/libstlport_static.a
index 2d0832a..5144f21 100644
--- a/9/sources/cxx-stl/EH/stlport/libs/mips/libstlport_static.a
+++ b/9/sources/cxx-stl/EH/stlport/libs/mips/libstlport_static.a
Binary files differ
diff --git a/9/sources/cxx-stl/EH/stlport/libs/mips64/libstlport_shared.so b/9/sources/cxx-stl/EH/stlport/libs/mips64/libstlport_shared.so
new file mode 100755
index 0000000..35f9e4d
--- /dev/null
+++ b/9/sources/cxx-stl/EH/stlport/libs/mips64/libstlport_shared.so
Binary files differ
diff --git a/9/sources/cxx-stl/EH/stlport/libs/mips64/libstlport_static.a b/9/sources/cxx-stl/EH/stlport/libs/mips64/libstlport_static.a
new file mode 100644
index 0000000..d3b7354
--- /dev/null
+++ b/9/sources/cxx-stl/EH/stlport/libs/mips64/libstlport_static.a
Binary files differ
diff --git a/9/sources/cxx-stl/EH/stlport/libs/x86/libstlport_shared.so b/9/sources/cxx-stl/EH/stlport/libs/x86/libstlport_shared.so
index 089a8dd..3a24efe 100755
--- a/9/sources/cxx-stl/EH/stlport/libs/x86/libstlport_shared.so
+++ b/9/sources/cxx-stl/EH/stlport/libs/x86/libstlport_shared.so
Binary files differ
diff --git a/9/sources/cxx-stl/EH/stlport/libs/x86/libstlport_static.a b/9/sources/cxx-stl/EH/stlport/libs/x86/libstlport_static.a
index 861dcd6..9e06ae0 100644
--- a/9/sources/cxx-stl/EH/stlport/libs/x86/libstlport_static.a
+++ b/9/sources/cxx-stl/EH/stlport/libs/x86/libstlport_static.a
Binary files differ
diff --git a/9/sources/cxx-stl/EH/stlport/libs/x86_64/libstlport_shared.so b/9/sources/cxx-stl/EH/stlport/libs/x86_64/libstlport_shared.so
new file mode 100755
index 0000000..1732a66
--- /dev/null
+++ b/9/sources/cxx-stl/EH/stlport/libs/x86_64/libstlport_shared.so
Binary files differ
diff --git a/9/sources/cxx-stl/EH/stlport/libs/x86_64/libstlport_static.a b/9/sources/cxx-stl/EH/stlport/libs/x86_64/libstlport_static.a
new file mode 100644
index 0000000..bca5998
--- /dev/null
+++ b/9/sources/cxx-stl/EH/stlport/libs/x86_64/libstlport_static.a
Binary files differ
diff --git a/9/sources/cxx-stl/EH/stlport/stlport/stl/_hashtable.h b/9/sources/cxx-stl/EH/stlport/stlport/stl/_hashtable.h
index 1c8e2f5..aac0937 100644
--- a/9/sources/cxx-stl/EH/stlport/stlport/stl/_hashtable.h
+++ b/9/sources/cxx-stl/EH/stlport/stlport/stl/_hashtable.h
@@ -189,7 +189,7 @@
 template <class _Dummy>
 class _Stl_prime {
   // Returns begining of primes list and size by reference.
-  static const size_t* _S_primes(size_t&);
+  static const size_t* _STLP_CALL _S_primes(size_t&);
 public:
   //Returns the maximum number of buckets handled by the hashtable implementation
   static size_t _STLP_CALL _S_max_nb_buckets();
diff --git a/9/sources/cxx-stl/EH/stlport/stlport/stl/_limits.h b/9/sources/cxx-stl/EH/stlport/stlport/stl/_limits.h
index c0091f6..80b6a66 100644
--- a/9/sources/cxx-stl/EH/stlport/stlport/stl/_limits.h
+++ b/9/sources/cxx-stl/EH/stlport/stlport/stl/_limits.h
@@ -59,8 +59,13 @@
 class _Numeric_limits_base {
 public:
 
+#if !defined(__ANDROID__)
   static __number (_STLP_CALL min)() _STLP_NOTHROW { return __number(); }
   static __number (_STLP_CALL max)() _STLP_NOTHROW { return __number(); }
+#else
+  static __number _STLP_CALL (min)() _STLP_NOTHROW { return __number(); }
+  static __number _STLP_CALL (max)() _STLP_NOTHROW { return __number(); }
+#endif
 
   _STLP_STATIC_CONSTANT(int, digits = 0);
   _STLP_STATIC_CONSTANT(int, digits10 = 0);
@@ -118,9 +123,13 @@
 class _Integer_limits : public _Numeric_limits_base<_Int> {
 public:
 
+#if !defined(__ANDROID__)
   static _Int (_STLP_CALL min) () _STLP_NOTHROW { return (_Int)__imin; }
   static _Int (_STLP_CALL max) () _STLP_NOTHROW { return (_Int)__imax; }
-
+#else
+  static _Int _STLP_CALL (min) () _STLP_NOTHROW { return (_Int)__imin; }
+  static _Int _STLP_CALL (max) () _STLP_NOTHROW { return (_Int)__imax; }
+#endif
   _STLP_STATIC_CONSTANT(int, digits = (__idigits < 0) ? ((int)((sizeof(_Int) * (CHAR_BIT))) - ((__imin == 0) ? 0 : 1)) : (__idigits));
   _STLP_STATIC_CONSTANT(int, digits10 = (digits * 301UL) / 1000);
   _STLP_STATIC_CONSTANT(int, radix = 2);
diff --git a/9/sources/cxx-stl/EH/stlport/stlport/stl/_slist.c b/9/sources/cxx-stl/EH/stlport/stlport/stl/_slist.c
index ba158d0..107b600 100644
--- a/9/sources/cxx-stl/EH/stlport/stlport/stl/_slist.c
+++ b/9/sources/cxx-stl/EH/stlport/stlport/stl/_slist.c
@@ -148,7 +148,6 @@
 void _Slist_merge(slist<_Tp, _Alloc>& __that, slist<_Tp, _Alloc>& __x,
                   _StrictWeakOrdering __comp) {
   typedef _Slist_node<_Tp> _Node;
-  typedef _STLP_PRIV _Slist_node_base _Node_base;
   if (__that.get_allocator() == __x.get_allocator()) {
     typename slist<_Tp, _Alloc>::iterator __ite(__that.before_begin());
     while (__ite._M_node->_M_next && !__x.empty()) {
diff --git a/9/sources/cxx-stl/EH/stlport/stlport/stl/_stdexcept_base.c b/9/sources/cxx-stl/EH/stlport/stlport/stl/_stdexcept_base.c
index deb7056..3ff3c66 100644
--- a/9/sources/cxx-stl/EH/stlport/stlport/stl/_stdexcept_base.c
+++ b/9/sources/cxx-stl/EH/stlport/stlport/stl/_stdexcept_base.c
@@ -64,7 +64,7 @@
 
 __Named_exception& __Named_exception::operator = (const __Named_exception& __x) {
   size_t __size = strlen(__x._M_name) + 1;
-  size_t __buf_size = _M_name != _M_static_name ? *(__REINTERPRET_CAST(size_t*, &_M_static_name[0])) : _S_bufsize;
+  size_t __buf_size = _M_name != _M_static_name ? *(__REINTERPRET_CAST(size_t*, &_M_static_name[0])) : static_cast<size_t>(_S_bufsize);
   if (__size > __buf_size) {
     // Being here necessarily mean that we need to allocate a buffer:
     if (_M_name != _M_static_name) free(_M_name);
diff --git a/9/sources/cxx-stl/EH/stlport/stlport/stl/_time_facets.c b/9/sources/cxx-stl/EH/stlport/stlport/stl/_time_facets.c
index f403817..a907ad5 100644
--- a/9/sources/cxx-stl/EH/stlport/stlport/stl/_time_facets.c
+++ b/9/sources/cxx-stl/EH/stlport/stlport/stl/_time_facets.c
@@ -151,7 +151,6 @@
                                  _Ch*, const _TimeInfo& __table,
                                  const ios_base& __s, ios_base::iostate& __err, tm* __t) {
   const ctype<_Ch>& __ct = use_facet<ctype<_Ch> >(__s.getloc());
-  typedef basic_string<_Ch, char_traits<_Ch>, allocator<_Ch> > string_type;
   size_t offset;
 
   while (__first != __last && __format != __format_end) {
diff --git a/9/sources/cxx-stl/EH/stlport/stlport/stl/config/_android.h b/9/sources/cxx-stl/EH/stlport/stlport/stl/config/_android.h
index e94133f..09406aa 100644
--- a/9/sources/cxx-stl/EH/stlport/stlport/stl/config/_android.h
+++ b/9/sources/cxx-stl/EH/stlport/stlport/stl/config/_android.h
@@ -3,6 +3,9 @@
 
 #define _STLP_PLATFORM "Android"
 
+#include <sys/cdefs.h>
+#define _STLP_CALL __NDK_FPABI__
+
 // Mostly Unix-like.
 #define _STLP_UNIX 1
 
diff --git a/9/sources/cxx-stl/EH/stlport/stlport/stl/config/features.h b/9/sources/cxx-stl/EH/stlport/stlport/stl/config/features.h
index 8524cb8..dc30ecc 100644
--- a/9/sources/cxx-stl/EH/stlport/stlport/stl/config/features.h
+++ b/9/sources/cxx-stl/EH/stlport/stlport/stl/config/features.h
@@ -1052,7 +1052,7 @@
 #define _STLP_ARRAY_AND_SIZE(A) A, sizeof(A) / sizeof(A[0])
 
 #if !defined (_STLP_MARK_PARAMETER_AS_UNUSED)
-#  define _STLP_MARK_PARAMETER_AS_UNUSED(X) (void*)X;
+#  define _STLP_MARK_PARAMETER_AS_UNUSED(X) (void)X;
 #endif
 
 #if defined (_STLP_CHECK_RUNTIME_COMPATIBILITY)