diff -urN android-ndk-1.6_r1/apps/hello-jni/project/jni/Android.mk android-ndk-r2-crystax/apps/hello-jni/project/jni/Android.mk
--- android-ndk-1.6_r1/apps/hello-jni/project/jni/Android.mk	2009-07-29 21:04:19.000000000 +0400
+++ android-ndk-r2-crystax/apps/hello-jni/project/jni/Android.mk	2010-03-10 19:40:58.000000000 +0300
@@ -16,7 +16,8 @@
 
 include $(CLEAR_VARS)
 
+LOCAL_CPP_EXTENSION := cc
 LOCAL_MODULE    := hello-jni
-LOCAL_SRC_FILES := hello-jni.c
+LOCAL_SRC_FILES := hello-jni.cc
 
 include $(BUILD_SHARED_LIBRARY)
diff -urN android-ndk-1.6_r1/apps/hello-jni/project/jni/hello-jni.c android-ndk-r2-crystax/apps/hello-jni/project/jni/hello-jni.c
--- android-ndk-1.6_r1/apps/hello-jni/project/jni/hello-jni.c	2009-07-29 21:04:19.000000000 +0400
+++ android-ndk-r2-crystax/apps/hello-jni/project/jni/hello-jni.c	1970-01-01 03:00:00.000000000 +0300
@@ -1,31 +0,0 @@
-/*
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-#include <string.h>
-#include <jni.h>
-
-/* This is a trivial JNI example where we use a native method
- * to return a new VM String. See the corresponding Java source
- * file located at:
- *
- *   apps/samples/hello-jni/project/src/com/example/HelloJni/HelloJni.java
- */
-jstring
-Java_com_example_hellojni_HelloJni_stringFromJNI( JNIEnv* env,
-                                                  jobject thiz )
-{
-    return (*env)->NewStringUTF(env, "Hello from JNI !");
-}
diff -urN android-ndk-1.6_r1/apps/hello-jni/project/jni/hello-jni.cc android-ndk-r2-crystax/apps/hello-jni/project/jni/hello-jni.cc
--- android-ndk-1.6_r1/apps/hello-jni/project/jni/hello-jni.cc	1970-01-01 03:00:00.000000000 +0300
+++ android-ndk-r2-crystax/apps/hello-jni/project/jni/hello-jni.cc	2010-03-10 20:23:53.000000000 +0300
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2009 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+#include <jni.h>
+#include <iostream>
+#include <stdexcept>
+#include <string>
+#include <stdlib.h>
+
+/* This is a trivial JNI example where we use a native method
+ * to return a new VM String. See the corresponding Java source
+ * file located at:
+ *
+ *   apps/samples/hello-jni/project/src/com/example/HelloJni/HelloJni.java
+ */
+extern "C"
+jstring
+Java_com_example_hellojni_HelloJni_stringFromJNI( JNIEnv* env,
+                                                  jobject thiz )
+{
+    std::string s = "Hello from JNI !";
+    try
+    {
+        if (::getenv("NON_EXISTENT_ENVIRONMENT_VARIABLE") == NULL)
+            throw std::runtime_error("Hello from JNI with full C++ support !");
+    }
+    catch (std::exception &ex)
+    {
+        s = ex.what();
+        std::cout << "Exception catched: " << ex.what() << std::endl;
+    }
+    return env->NewStringUTF(s.c_str());
+}
diff -urN android-ndk-1.6_r1/build/core/ndk-common.sh android-ndk-r2-crystax/build/core/ndk-common.sh
--- android-ndk-1.6_r1/build/core/ndk-common.sh	2009-07-21 18:53:49.000000000 +0400
+++ android-ndk-r2-crystax/build/core/ndk-common.sh	2010-03-10 19:40:58.000000000 +0300
@@ -135,8 +135,8 @@
         HOST_EXE=.exe
         if [ "x$OSTYPE" = xcygwin ] ; then
             HOST_OS=cygwin
-            HOST_CFLAGS="$CFLAGS -mno-cygwin"
-            HOST_LDFLAGS="$LDFLAGS -mno-cygwin"
+            HOST_CFLAGS="$CFLAGS"
+            HOST_LDFLAGS="$LDFLAGS"
         fi
         ;;
 esac
diff -urN android-ndk-1.6_r1/build/core/setup-toolchain.mk android-ndk-r2-crystax/build/core/setup-toolchain.mk
--- android-ndk-1.6_r1/build/core/setup-toolchain.mk	2009-07-29 21:04:19.000000000 +0400
+++ android-ndk-r2-crystax/build/core/setup-toolchain.mk	2010-03-10 19:42:07.000000000 +0300
@@ -33,7 +33,7 @@
 TARGET_CRTBEGIN_DYNAMIC_O := $(SYSROOT)/usr/lib/crtbegin_dynamic.o
 TARGET_CRTEND_O           := $(SYSROOT)/usr/lib/crtend_android.o
 
-TARGET_PREBUILT_SHARED_LIBRARIES := libc libstdc++ libm
+TARGET_PREBUILT_SHARED_LIBRARIES := libc libm
 TARGET_PREBUILT_SHARED_LIBRARIES := $(TARGET_PREBUILT_SHARED_LIBRARIES:%=$(SYSROOT)/usr/lib/%.so)
 
 # now call the toolchain-specific setup script
diff -urN android-ndk-1.6_r1/build/toolchains/arm-eabi-4.2.1/setup.mk android-ndk-r2-crystax/build/toolchains/arm-eabi-4.2.1/setup.mk
--- android-ndk-1.6_r1/build/toolchains/arm-eabi-4.2.1/setup.mk	2009-06-29 14:23:10.000000000 +0400
+++ android-ndk-r2-crystax/build/toolchains/arm-eabi-4.2.1/setup.mk	2010-03-10 21:10:52.000000000 +0300
@@ -65,7 +65,7 @@
 
 
 TARGET_CXX      := $(TOOLCHAIN_PREFIX)g++
-TARGET_CXXFLAGS := $(TARGET_CFLAGS.common) -fno-exceptions -fno-rtti
+TARGET_CXXFLAGS := $(TARGET_CFLAGS.common)
 
 TARGET_LD      := $(TOOLCHAIN_PREFIX)ld
 TARGET_LDFLAGS :=
@@ -76,6 +76,9 @@
 TARGET_LIBGCC := $(shell $(TARGET_CC) -mthumb-interwork -print-libgcc-file-name)
 TARGET_LDLIBS := -Wl,-rpath-link=$(SYSROOT)/usr/lib $(TARGET_LIBGCC)
 
+TARGET_CXXLIBS := $(shell $(TARGET_CXX) -print-file-name=libstdc++.a)
+TARGET_CXXLIBS += $(shell $(TARGET_CXX) -print-file-name=libsupc++.a)
+
 # These flags are used to ensure that a binary doesn't reference undefined
 # flags.
 TARGET_NO_UNDEFINED_LDFLAGS := -Wl,--no-undefined
@@ -92,8 +95,10 @@
     -Wl,--whole-archive \
     $(PRIVATE_WHOLE_STATIC_LIBRARIES) \
     -Wl,--no-whole-archive \
+    $(TARGET_CXXLIBS) \
     $(PRIVATE_STATIC_LIBRARIES) \
     $(PRIVATE_SHARED_LIBRARIES) \
+    $(TARGET_CXXLIBS) \
     $(PRIVATE_LDFLAGS) \
     $(PRIVATE_LDLIBS) \
     -o $@
@@ -105,10 +110,12 @@
     -Wl,-dynamic-linker,/system/bin/linker \
     -Wl,--gc-sections \
     -Wl,-z,nocopyreloc \
+    $(TARGET_CXXLIBS) \
     $(PRIVATE_SHARED_LIBRARIES) \
     $(TARGET_CRTBEGIN_DYNAMIC_O) \
     $(PRIVATE_OBJECTS) \
     $(PRIVATE_STATIC_LIBRARIES) \
+    $(TARGET_CXXLIBS) \
     $(PRIVATE_LDFLAGS) \
     $(PRIVATE_LDLIBS) \
     $(TARGET_CRTEND_O) \
diff -urN android-ndk-1.6_r1/build/tools/build-toolchain.sh android-ndk-r2-crystax/build/tools/build-toolchain.sh
--- android-ndk-1.6_r1/build/tools/build-toolchain.sh	2009-07-27 15:01:08.000000000 +0400
+++ android-ndk-r2-crystax/build/tools/build-toolchain.sh	2010-03-10 19:41:41.000000000 +0300
@@ -326,6 +326,11 @@
             echo "ERROR: Could not unpack $1, See $TMPLOG"
             exit 1
         fi
+        run patch -d $SRCDIR -p 1 <$SRCDIR/../src.diff
+        if [ $? != 0 ] ; then
+            echo "ERROR: Could not patch $SRCDIR, See $TMPLOG"
+            exit 1
+        fi
         timestamp_set   $1 unpack
         timestamp_force $1 configure
     fi
@@ -370,7 +375,8 @@
     $TOOLCHAIN_SRC/configure --target=arm-eabi \
                              --disable-nls \
                              --prefix=$TOOLCHAIN_PREFIX \
-                             --with-sysroot=$ANDROID_SYSROOT
+                             --with-sysroot=$ANDROID_SYSROOT \
+                             --enable-libstdc__-v3
 
     if [ $? != 0 ] ; then
         echo "Error while trying to configure toolchain build. See $TMPLOG"
@@ -415,6 +421,12 @@
     strip $TOOLCHAIN_PREFIX/libexec/gcc/*/*/cc1
     strip $TOOLCHAIN_PREFIX/libexec/gcc/*/*/cc1plus
     strip $TOOLCHAIN_PREFIX/libexec/gcc/*/*/collect2
+    # CrystaX: replace android libstdc++ simulation to GCC's (full) version
+    for i in cstddef new stl_pair.h typeinfo utility libstdc++.a libstdc++.so
+    do
+        find $ANDROID_PLATFORMS_ROOT -name $i -exec rm -f '{}' \;
+    done
+    # CrystaX END
     timestamp_set   toolchain install
     timestamp_force gdbserver configure
 fi
diff -urN android-ndk-1.6_r1/out/arm-eabi-4.2.1/toolchain/src.diff android-ndk-r2-crystax/out/arm-eabi-4.2.1/toolchain/src.diff
--- android-ndk-1.6_r1/out/arm-eabi-4.2.1/toolchain/src.diff	1970-01-01 03:00:00.000000000 +0300
+++ android-ndk-r2-crystax/out/arm-eabi-4.2.1/toolchain/src.diff	2010-03-10 19:40:58.000000000 +0300
@@ -0,0 +1,41 @@
+diff -urN src/gcc-4.2.1/gcc/config/arm/eabi.h src.fix/gcc-4.2.1/gcc/config/arm/eabi.h
+--- src/gcc-4.2.1/gcc/config/arm/eabi.h	2009-03-19 16:02:21.000000000 +0300
++++ src.fix/gcc-4.2.1/gcc/config/arm/eabi.h	2010-01-28 23:02:34.000000000 +0300
+@@ -68,7 +68,6 @@
+    default. */
+ #undef ANDROID_CC1_SPEC
+ #define ANDROID_CC1_SPEC \
+-"%{!fexceptions:-fno-exceptions} " \
+ "%{!fno-pic:%{!fno-PIC:-fpic}} " \
+ "%{!fshort-enums:-fno-short-enums} " \
+ "%{!mno-thumb-interwork:-mthumb-interwork}"
+@@ -84,7 +83,7 @@
+ 
+ /* Android uses -fno-rtti by default. */
+ #undef ANDROID_CC1PLUS_SPEC
+-#define ANDROID_CC1PLUS_SPEC "%{!frtti:-fno-rtti}"
++#define ANDROID_CC1PLUS_SPEC ""
+ 
+ /* Default CC1PLUS_SPEC as in gcc.c. */
+ #undef CC1PLUS_DEFAULT_SPEC
+diff -urN src/gcc-4.2.1/libiberty/getpagesize.c src.fix/gcc-4.2.1/libiberty/getpagesize.c
+--- src/gcc-4.2.1/libiberty/getpagesize.c	2009-03-02 19:48:36.000000000 +0300
++++ src.fix/gcc-4.2.1/libiberty/getpagesize.c	2010-01-28 23:08:08.000000000 +0300
+@@ -60,17 +60,6 @@
+ # endif /* PAGESIZE */
+ #endif /* GNU_OUR_PAGESIZE */
+ 
+-/* ANDROID LOCAL BEGIN */
+-/* ANDROID FIXME: The declaration of getpagesize in Bionic's unistd.h
+-   is a static inline is different from one below.  */
+-#ifndef __ANDROID__ 
+-/* ANDROID LOCAL END */
+-int
+-getpagesize (void)
+-{
+-  return (GNU_OUR_PAGESIZE);
+-}
+-#endif /* ANDROID LOCAL */
+ 
+ #else /* VMS */
+ 
