Build STL with -g

To make ndk-stack work better across STL function calls.
The final stripped binaries shouldn't be affected.

Change-Id: I0ad7df7a6c2b004f16bcac6befec7939f4625f35
diff --git a/build/tools/build-cxx-stl.sh b/build/tools/build-cxx-stl.sh
index 6a41279..00e9f21 100755
--- a/build/tools/build-cxx-stl.sh
+++ b/build/tools/build-cxx-stl.sh
@@ -148,7 +148,7 @@
 
 LIBCXX_INCLUDES="-I$LIBCXX_SRCDIR/libcxx/include -I$ANDROID_NDK_ROOT/sources/android/support/include -I$GABIXX_SRCDIR/include"
 
-COMMON_CFLAGS="-fPIC -O2 -ffunction-sections -fdata-sections"
+COMMON_CFLAGS="-fPIC -O2 -g -ffunction-sections -fdata-sections"
 COMMON_CXXFLAGS="-fexceptions -frtti -fuse-cxa-atexit"
 
 # Determine GAbi++ build parameters. Note that GAbi++ is also built as part
diff --git a/build/tools/build-gnu-libstdc++.sh b/build/tools/build-gnu-libstdc++.sh
index a6b0c62..cbb85ba 100755
--- a/build/tools/build-gnu-libstdc++.sh
+++ b/build/tools/build-gnu-libstdc++.sh
@@ -163,8 +163,8 @@
     if [ -n "$THUMB" ] ; then
         EXTRA_FLAGS="-mthumb"
     fi
-    export CFLAGS="-fPIC $CFLAGS --sysroot=$SYSROOT -fexceptions -funwind-tables -D__BIONIC__ -O2 $EXTRA_FLAGS"
-    export CXXFLAGS="-fPIC $CXXFLAGS --sysroot=$SYSROOT -fexceptions -frtti -funwind-tables -D__BIONIC__ -O2 $EXTRA_FLAGS"
+    export CFLAGS="-fPIC $CFLAGS --sysroot=$SYSROOT -fexceptions -funwind-tables -D__BIONIC__ -O2 -g $EXTRA_FLAGS"
+    export CXXFLAGS="-fPIC $CXXFLAGS --sysroot=$SYSROOT -fexceptions -frtti -funwind-tables -D__BIONIC__ -O2 -g $EXTRA_FLAGS"
     export CPPFLAGS="$CPPFLAGS --sysroot=$SYSROOT"
 
     export CC=${BINPREFIX}gcc