Closed Bug 556839 Opened 14 years ago Closed 14 years ago

STL: How to use it on android?

Categories

(Core :: XPCOM, enhancement)

All
Android
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
Tracking Status
fennec 2.0+ ---

People

(Reporter: cjones, Unassigned)

References

(Blocks 1 open bug)

Details

According to mwu, the native android apps are built with gcc 4.4, but only the bare minimum standard C++ headers are provided to compile C++ code (no STL).  The problem is that android uses bionic instead of glibc (does it use libstdc++ at all?  Guessing not.).  I would hate it if android kept mozilla code perpetually in C+ idiom land, so ideally we'd like to figure out a way to use the STL on android.  I think we have two choices

 (1) Import the gcc STL headers we need and sort out missing runtime functions in bionic.  I'm pretty sure that with the patch in bug 551254, the STL containers (<vector> et al.) don't require any symbols from glibc or libstdc++.  However, I know that <string> and <wstring> (used by chromium/ code) do.  We could list these dependencies and implement them as hidden libxul symbols, like we do for the __throw_[exception]() symbols.  (In fact, chromium/ already implemented some of these for a related reason.)
 (2) Import a cross-platform STL library such as STLport.  This has other potential benefits, but it's also a potentially large-ish maintenance burden.

I'd like to figure out what's needed for (1) before we decide.

Also, everyone agrees that sorting this out shouldn't block android v1 release, but at the same time we can't use multi-process code in android until it is sorted.
Chris:  Having e10s for Android will be a blocker for our first alpha (not for our first public builds though)
At one point we looked at using uclibcxx for android; I actually got things building that way.  But Gecko's usage of STL was so minimal it wasn't worth it.  For e10s though, that might be the way to go; importing the headers/etc. is going to be a big pain, I'd rather just pull in a full complete implementation, especially if we can stick it in our own private namespace.
Update: uClibc++ is out because of licensing issues.  SGI's is out because it's ancient and depends on the compiler providing headers that android-g++ doesn't.  Apache STL is out because of licensing issues (until MPL.next).  Waiting to hear back about STLport's license.
Can't we just LART the Android people until they start shipping a complete C++ standard library?
Blocks: 554520
tracking-fennec: --- → 2.0+
Still blocking?
we're using the stl from our custom ndk
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Did legal decide that was ok for final ship?  I thought that decision got punted...
You need to log in before you can comment on or make changes to this bug.