Last Comment Bug 670315 - Add option to use GNU libstdc++ under Android NDK5
: Add option to use GNU libstdc++ under Android NDK5
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Build Config (show other bugs)
: Trunk
: ARM Android
: -- normal (vote)
: mozilla8
Assigned To: Jim Chen [:jchen] [:darchons]
:
: Gregory Szorc [:gps]
Mentors:
Depends on: 617115
Blocks:
  Show dependency treegraph
 
Reported: 2011-07-08 23:34 PDT by Jim Chen [:jchen] [:darchons]
Modified: 2011-07-25 05:50 PDT (History)
4 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch to add MOZ_USE_GNU_LIBSTDCXX flag (v1) (5.79 KB, patch)
2011-07-08 23:34 PDT, Jim Chen [:jchen] [:darchons]
no flags Details | Diff | Splinter Review
Patch to add --enable-android-libstdcxx option (v2) (7.40 KB, patch)
2011-07-11 16:10 PDT, Jim Chen [:jchen] [:darchons]
khuey: review+
Details | Diff | Splinter Review
Patch to add --enable-android-libstdcxx option (v2.1) (7.34 KB, patch)
2011-07-14 17:27 PDT, Jim Chen [:jchen] [:darchons]
nchen: review+
Details | Diff | Splinter Review
Patch to add --enable-android-libstdcxx option (v3) (8.53 KB, patch)
2011-07-18 11:49 PDT, Jim Chen [:jchen] [:darchons]
khuey: review+
Details | Diff | Splinter Review

Description Jim Chen [:jchen] [:darchons] 2011-07-08 23:34:11 PDT
Created attachment 544951 [details] [diff] [review]
Patch to add MOZ_USE_GNU_LIBSTDCXX flag (v1)

Currently we use STLPort under NDK5, but it's possible to use libstdc++ as well. NDK5 actually includes a copy of libstdc++ but it was compiled without wchar_t support and apparently IPC code requires it. So it's necessary to replace NDK5's copy of libstdc++ if we want to use it. A version with wchar_t support is available at http://people.mozilla.org/~nchen/gnu-libstdc++.tar.bz2

The attached patch checks if MOZ_USE_GNU_LIBSTDCXX is set and switches to using libstdc++ instead of STLPort. It also fixes some problems with the build flags. I don't know how to add a proper config option, so this patch may need some major rework.
Comment 1 Brad Lassey [:blassey] (use needinfo?) 2011-07-08 23:58:40 PDT
adding a configure flag is pretty strait forward. You probably want a boolean, so --enable-profiling is a good one to mimic:
http://mxr.mozilla.org/mozilla-central/source/configure.in#1804
Comment 2 Jim Chen [:jchen] [:darchons] 2011-07-11 16:10:10 PDT
Created attachment 545281 [details] [diff] [review]
Patch to add --enable-android-libstdcxx option (v2)

Renamed flag to --enable-android-libstdcxx because it's only applicable to Android
Comment 3 Kyle Huey [:khuey] (Exited; not receiving bugmail, email if necessary) 2011-07-14 08:56:26 PDT
Comment on attachment 545281 [details] [diff] [review]
Patch to add --enable-android-libstdcxx option (v2)

Review of attachment 545281 [details] [diff] [review]:
-----------------------------------------------------------------

This looks fine, I'm just assuming the paths are right though ....

::: configure.in
@@ +326,5 @@
> +          STL_LIBS="-lstdc++"
> +          STL_LDFLAGS="-L$android_ndk/sources/cxx-stl/gnu-libstdc++/libs/armeabi-v7a"
> +       fi
> +    else
> +       if test -e "$android_ndk/sources/cxx-stl/stlport/libs/armeabi-v7a/libstlport_static.a" ; then

nit: elif

::: js/src/configure.in
@@ +317,5 @@
> +          STL_LIBS="-lstdc++"
> +          STL_LDFLAGS="-L$android_ndk/sources/cxx-stl/gnu-libstdc++/libs/armeabi-v7a"
> +       fi
> +    else
> +       if test -e "$android_ndk/sources/cxx-stl/stlport/libs/armeabi-v7a/libstlport_static.a" ; then

nit elif
Comment 4 Jim Chen [:jchen] [:darchons] 2011-07-14 17:27:11 PDT
Created attachment 546051 [details] [diff] [review]
Patch to add --enable-android-libstdcxx option (v2.1)

Carry over khuey's r+
Comment 5 :Ms2ger (⌚ UTC+1/+2) 2011-07-17 03:04:19 PDT
Patch conflicts with bug 671346.
Comment 6 Jim Chen [:jchen] [:darchons] 2011-07-18 11:49:56 PDT
Created attachment 546590 [details] [diff] [review]
Patch to add --enable-android-libstdcxx option (v3)

Requesting review again because of additional change to accommodate bug 671346. Thanks!
Comment 8 Marco Bonardo [::mak] 2011-07-25 05:50:39 PDT
http://hg.mozilla.org/mozilla-central/rev/f06039afefb9

Note You need to log in before you can comment on or make changes to this bug.