Add option to use GNU libstdc++ under Android NDK5

RESOLVED FIXED in mozilla8

Status

()

Core
Build Config
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: jchen, Assigned: jchen)

Tracking

Trunk
mozilla8
ARM
Android
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 3 obsolete attachments)

(Assignee)

Description

6 years ago
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.
(Assignee)

Updated

6 years ago
Depends on: 617115
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
(Assignee)

Comment 2

6 years ago
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
Assignee: nobody → nchen
Attachment #544951 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #545281 - Flags: review?(khuey)
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
Attachment #545281 - Flags: review?(khuey) → review+
(Assignee)

Comment 4

6 years ago
Created attachment 546051 [details] [diff] [review]
Patch to add --enable-android-libstdcxx option (v2.1)

Carry over khuey's r+
Attachment #545281 - Attachment is obsolete: true
Attachment #546051 - Flags: review+
(Assignee)

Updated

6 years ago
Keywords: checkin-needed
Patch conflicts with bug 671346.
Keywords: checkin-needed
(Assignee)

Comment 6

6 years ago
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!
Attachment #546051 - Attachment is obsolete: true
Attachment #546590 - Flags: review?(khuey)
Attachment #546590 - Flags: review?(khuey) → review+

Updated

6 years ago
Keywords: checkin-needed

Comment 7

6 years ago
http://hg.mozilla.org/integration/mozilla-inbound/rev/f06039afefb9
Keywords: checkin-needed
http://hg.mozilla.org/mozilla-central/rev/f06039afefb9
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla8
You need to log in before you can comment on or make changes to this bug.