/usr/local/google/home/robertm/nacl-gclient2/native_client/pnacl/git/gcc /usr/local/google/home/robertm/nacl-gclient2/native_client
diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
index c321e76..8c6584c 100755
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
@@ -10780,6 +10780,13 @@ linux*oldld* | linux*aout* | linux*coff*)
   dynamic_linker=no
   ;;
 
+#@ LOCALMOD
+linux-gnueabi)
+  dynamic_linker=no
+  hardcode_direct=no
+  hardcode_shlibpath_var=no
+  ;;
+
 # This must be Linux ELF.
 linux* | k*bsd*-gnu | kopensolaris*-gnu)
   version_type=linux
@@ -11201,6 +11208,11 @@ else
     lt_cv_dlopen_self=yes
     ;;
 
+  #@ LOCALMOD
+  linux-gnueabi)
+      lt_cv_dlopen=no
+      lt_cv_dlopen_libs=
+      ;;
   mingw* | pw32* | cegcc*)
     lt_cv_dlopen="LoadLibrary"
     lt_cv_dlopen_libs=
@@ -14463,6 +14475,11 @@ linux*oldld* | linux*aout* | linux*coff*)
   dynamic_linker=no
   ;;
 
+# @LOCALMOD
+linux-gnueabi)
+  dynamic_linker=no
+  ;;
+
 # This must be Linux ELF.
 linux* | k*bsd*-gnu | kopensolaris*-gnu)
   version_type=linux
@@ -44854,6 +44871,8 @@ $as_echo "$ac_ld_relro" >&6; }
 
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sin in -lm" >&5
 $as_echo_n "checking for sin in -lm... " >&6; }
+
+
 if test "${ac_cv_lib_m_sin+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
diff --git a/libstdc++-v3/include/bits/atomic_base.h b/libstdc++-v3/include/bits/atomic_base.h
index 272a4cd..11764ab 100644
--- a/libstdc++-v3/include/bits/atomic_base.h
+++ b/libstdc++-v3/include/bits/atomic_base.h
@@ -161,8 +161,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 #define ATOMIC_LONG_LOCK_FREE _GLIBCXX_ATOMIC_PROPERTY
 #define ATOMIC_LLONG_LOCK_FREE _GLIBCXX_ATOMIC_PROPERTY
 
-  inline namespace _GLIBCXX_ATOMIC_NAMESPACE { }
-
+  // @LOCALMOD
+  //  inline namespace _GLIBCXX_ATOMIC_NAMESPACE { }
+  using namespace _GLIBCXX_ATOMIC_NAMESPACE;
 
   /// atomic_char
   typedef __atomic_base<char>  	       		atomic_char;
diff --git a/libstdc++-v3/include/bits/regex_constants.h b/libstdc++-v3/include/bits/regex_constants.h
index bddef3a..76ffdb3 100644
--- a/libstdc++-v3/include/bits/regex_constants.h
+++ b/libstdc++-v3/include/bits/regex_constants.h
@@ -30,6 +30,9 @@
  *  Do not attempt to use it directly. @headername{regex}
  */
 
+// @LOCALMOD
+#define constexpr const
+
 namespace std _GLIBCXX_VISIBILITY(default)
 {
 /**
@@ -298,4 +301,3 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 _GLIBCXX_END_NAMESPACE_VERSION
 } // namespace regex_constants
 } // namespace
-
diff --git a/libstdc++-v3/include/ext/atomicity.h b/libstdc++-v3/include/ext/atomicity.h
index f0c7752..bb6a9f3 100644
--- a/libstdc++-v3/include/ext/atomicity.h
+++ b/libstdc++-v3/include/ext/atomicity.h
@@ -106,11 +106,23 @@ _GLIBCXX_END_NAMESPACE_VERSION
 // Even if the CPU doesn't need a memory barrier, we need to ensure
 // that the compiler doesn't reorder memory accesses across the
 // barriers.
+
+// @LOCALMOD
+void _llvm_mem_barrier(char ll, char ls, char sl, char ss, char device)
+  asm("llvm.memory.barrier");
+
 #ifndef _GLIBCXX_READ_MEM_BARRIER
-#define _GLIBCXX_READ_MEM_BARRIER __asm __volatile ("":::"memory")
+// @LOCALMOD
+// TODO(robertm): pick better arguments instead of worst-case
+#define _GLIBCXX_READ_MEM_BARRIER  _llvm_mem_barrier(1,1,1,1,1) 
+//#define _GLIBCXX_READ_MEM_BARRIER __asm __volatile ("":::"memory")
+
 #endif
 #ifndef _GLIBCXX_WRITE_MEM_BARRIER
-#define _GLIBCXX_WRITE_MEM_BARRIER __asm __volatile ("":::"memory")
+// @LOCALMOD
+// TODO(robertm): pick better arguments instead of worst-case
+#define _GLIBCXX_WRITE_MEM_BARRIER _llvm_mem_barrier(1,1,1,1,1) 
+//#define _GLIBCXX_WRITE_MEM_BARRIER __asm __volatile ("":::"memory")
 #endif
 
 #endif 
diff --git a/libstdc++-v3/include/ext/ropeimpl.h b/libstdc++-v3/include/ext/ropeimpl.h
index 467b8fd..883f0e5 100644
--- a/libstdc++-v3/include/ext/ropeimpl.h
+++ b/libstdc++-v3/include/ext/ropeimpl.h
@@ -430,7 +430,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     {
       size_t __old_len = __r->_M_size;
       _CharT* __new_data = (_CharT*)
-	_Data_allocate(_S_rounded_up_size(__old_len + __len));
+                           // @LOCALMOD
+	_Rope_rep_base<_CharT, _Alloc>::_Data_allocate(_S_rounded_up_size(__old_len + __len));
       _RopeLeaf* __result;
 
       uninitialized_copy_n(__r->_M_data, __old_len, __new_data);
@@ -814,7 +815,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 	    if (__result_len > __lazy_threshold)
 	      goto lazy;
 	    __section = (_CharT*)
-	      _Data_allocate(_S_rounded_up_size(__result_len));
+                        // @LOCALMOD
+	     _Rope_rep_base<_CharT, _Alloc>:: _Data_allocate(_S_rounded_up_size(__result_len));
 	    __try
 	      {	(*(__f->_M_fn))(__start, __result_len, __section); }
 	    __catch(...)
diff --git a/libstdc++-v3/include/std/atomic b/libstdc++-v3/include/std/atomic
index a19891d..b531fd7 100644
--- a/libstdc++-v3/include/std/atomic
+++ b/libstdc++-v3/include/std/atomic
@@ -42,6 +42,9 @@
 #include <bits/atomic_0.h>
 #include <bits/atomic_2.h>
 
+// @LOCALMOD
+#define constexpr const
+
 namespace std _GLIBCXX_VISIBILITY(default)
 {
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
diff --git a/libstdc++-v3/include/std/chrono b/libstdc++-v3/include/std/chrono
index 89ded2c..27f4516 100644
--- a/libstdc++-v3/include/std/chrono
+++ b/libstdc++-v3/include/std/chrono
@@ -664,10 +664,12 @@ _GLIBCXX_END_NAMESPACE_VERSION
       typedef duration::period 					period;
       typedef chrono::time_point<system_clock, duration> 	time_point;
 
+      // @LOCALMOD
+#if 0
       static_assert(system_clock::duration::min()
 		    < system_clock::duration::zero(),
 		    "a clock's minimum duration cannot be less than its epoch");
-
+#endif
       static constexpr bool is_monotonic = false;
 
       static time_point
diff --git a/libstdc++-v3/libsupc++/eh_arm.cc b/libstdc++-v3/libsupc++/eh_arm.cc
index f0acb70..b566ba4 100644
--- a/libstdc++-v3/libsupc++/eh_arm.cc
+++ b/libstdc++-v3/libsupc++/eh_arm.cc
@@ -26,6 +26,8 @@
 #include "unwind-cxx.h"
 
 #ifdef __ARM_EABI_UNWINDER__
+// @LOCALMOD
+#error "arm is not supported"
 
 using namespace __cxxabiv1;
 
diff --git a/libstdc++-v3/libsupc++/eh_call.cc b/libstdc++-v3/libsupc++/eh_call.cc
index f519f35..c768970 100644
--- a/libstdc++-v3/libsupc++/eh_call.cc
+++ b/libstdc++-v3/libsupc++/eh_call.cc
@@ -31,6 +31,11 @@
 
 using namespace __cxxabiv1;
 
+// @LOCALMOD-START
+typedef unsigned long _uleb128_t;
+typedef long _sleb128_t;
+// @LOCALMOD-END
+
 #include "unwind-pe.h"
 
 
diff --git a/libstdc++-v3/libsupc++/eh_personality.cc b/libstdc++-v3/libsupc++/eh_personality.cc
index 19c2044..ae1d96d 100644
--- a/libstdc++-v3/libsupc++/eh_personality.cc
+++ b/libstdc++-v3/libsupc++/eh_personality.cc
@@ -36,6 +36,14 @@ using namespace __cxxabiv1;
 #define NO_SIZE_OF_ENCODED_VALUE
 #endif
 
+// @LOCALMOD-START
+#ifdef __ARM_EABI_UNWINDER__
+#error "no arm unwinder please"
+#endif
+typedef unsigned long _uleb128_t;
+typedef long _sleb128_t;
+// @LOCALMOD-END
+
 #include "unwind-pe.h"
 
 
@@ -706,10 +714,16 @@ PERSONALITY_FUNCTION (int version,
 
   /* For targets with pointers smaller than the word size, we must extend the
      pointer, and this extension is target dependent.  */
+// @LOCALMOD
+#if 0
   _Unwind_SetGR (context, __builtin_eh_return_data_regno (0),
 		 __builtin_extend_pointer (ue_header));
   _Unwind_SetGR (context, __builtin_eh_return_data_regno (1),
 		 handler_switch_value);
+#else
+  _Unwind_PNaClSetResult0(context, __builtin_extend_pointer (ue_header));
+  _Unwind_PNaClSetResult1(context, handler_switch_value);
+#endif
   _Unwind_SetIP (context, landing_pad);
 #ifdef __ARM_EABI_UNWINDER__
   if (found_type == found_cleanup)
diff --git a/libstdc++-v3/libsupc++/exception_ptr.h b/libstdc++-v3/libsupc++/exception_ptr.h
index 26117cd..a8cea39 100644
--- a/libstdc++-v3/libsupc++/exception_ptr.h
+++ b/libstdc++-v3/libsupc++/exception_ptr.h
@@ -44,6 +44,8 @@ extern "C++" {
 
 namespace std 
 {
+  // @LOCALMOD
+  class type_info;
   /**
    * @addtogroup exceptions
    * @{
diff --git a/libstdc++-v3/libsupc++/vec.cc b/libstdc++-v3/libsupc++/vec.cc
index 700c5ef..2cb77ed 100644
--- a/libstdc++-v3/libsupc++/vec.cc
+++ b/libstdc++-v3/libsupc++/vec.cc
@@ -358,6 +358,21 @@ namespace __cxxabiv1
   }
 } // namespace __cxxabiv1
 
+// @LOCALMOD-START
+// http://code.google.com/p/nativeclient/issues/detail?id=865
+#if defined(__native_client__) 
+extern "C" int
+__aeabi_atexit (void *object, 
+                void (*destructor) (void *),
+                void *dso_handle)
+{
+  return abi::__cxa_atexit(destructor, object, dso_handle);
+}
+#undef __ARM_EABI__
+#endif
+// @LOCALMOD-END
+
+
 #if defined(__arm__) && defined(__ARM_EABI__)
 
 // The ARM C++ ABI requires that the library provide these additional
diff --git a/libstdc++-v3/src/locale-inst.cc b/libstdc++-v3/src/locale-inst.cc
index e77c5c9..eb0cf5f 100644
--- a/libstdc++-v3/src/locale-inst.cc
+++ b/libstdc++-v3/src/locale-inst.cc
@@ -175,7 +175,12 @@ _GLIBCXX_END_NAMESPACE_LDBL
   // messages
   template class messages<C>;
   template class messages_byname<C>;
-  
+
+
+// @LOCALMOD
+// NOTE: there is a proposed patch, but it does not seem to work:
+// http://people.freebsd.org/~rpaulo/clang-bootstrap-r211516-1-libstdc%2B%2B.dif
+#if 0
   // ctype
   inline template class __ctype_abstract_base<C>;
   template class ctype_byname<C>;
@@ -183,7 +188,7 @@ _GLIBCXX_END_NAMESPACE_LDBL
   // codecvt
   inline template class __codecvt_abstract_base<C, char, mbstate_t>;
   template class codecvt_byname<C, char, mbstate_t>;
-
+#endif
   // collate
   template class collate<C>;
   template class collate_byname<C>;
/usr/local/google/home/robertm/nacl-gclient2/native_client
