STL porting

62 views
Skip to first unread message

Vanraj

unread,
Sep 9, 2009, 4:40:47 AM9/9/09
to android-ndk
Hello Everyone ,

My native code depends on STL lib which is not avaialble as of now i
think. So is there any other way to make it work native code which is
using STL Lib.

Is there any plan in Android to have STL lib ??

Thanks.
Vanraj

Eric Chen

unread,
Sep 9, 2009, 9:53:29 PM9/9/09
to andro...@googlegroups.com
It heard someone porting the STL to Android , I think you can find it at this group.


Best Regards

Eric Chen

Richard Zhao

unread,
Sep 9, 2009, 10:54:48 PM9/9/09
to andro...@googlegroups.com
I ever sent out a stl port patch for android. You can google for it.

Thanks
Richard

Yongchao Lao

unread,
Jan 25, 2010, 9:34:40 PM1/25/10
to andro...@googlegroups.com
I've tried, but find nothing. 

Can you please post the url here? Thank you very much. 
 

Thanks
Richard

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to andro...@googlegroups.com
To unsubscribe from this group, send email to android-ndk...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en
-~----------~----~----~----~------~----~------~--~---




--
Yours,
 fluke
flu...@gmail.com
http://algo-field.com

Vytautas Šaltenis

unread,
Jan 26, 2010, 6:51:10 AM1/26/10
to andro...@googlegroups.com

On Jan 26, 2010, at 4:34 AM, Yongchao Lao wrote:
> I've tried, but find nothing.
>
> Can you please post the url here? Thank you very much.

That's not the URL you were asking for, but I'm using advice from this
guy:
http://sseyod.blogspot.com/2009/08/android-ndk-getting-stlport-up-and.html
So far, works like a charm.

Yongchao Lao

unread,
Jan 26, 2010, 10:41:58 AM1/26/10
to andro...@googlegroups.com
2010/1/26 Vytautas Šaltenis <vyta...@unity3d.com>
 
and worked. have to make some change ( path and cflags ) to compiled under NDK.
 
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.

Martins Mozeiko

unread,
Jan 26, 2010, 10:52:52 AM1/26/10
to andro...@googlegroups.com
I needed STL & RTTI support for building LLVM under Android.
So I rebuilt gcc toolchain for Android with libstd++ and RTTI support.
Get it here: http://www.box.net/shared/vvppcf7g4y
Use it instead of android-ndk-1.6_r1-windows.zip file. It is based on same version.
Add also -lstdc++ to your LOCAL_LDLIBS in Android.mk file.

--
Martins Mozeiko

> --

> You received this message because you are subscribed to the Google Groups "android-ndk" group.

> To post to this group, send email to andro...@googlegroups.com.
> To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
>

Dmitry Moskalchuk

unread,
Jan 27, 2010, 5:23:11 AM1/27/10
to andro...@googlegroups.com, Martins Mozeiko
Hi Martins,

It's very interesting, I'll try that. Are you have only windows version
of toolkit? I'm interesting in Linux and MacOSX versions too. Maybe you
will share your knowledge what to do to build the same toolchain from
sources?

Dmitry Moskalchuk


26.01.2010 18:52, Martins Mozeiko пишет:
> I needed STL& RTTI support for building LLVM under Android.

Martins Mozeiko

unread,
Jan 27, 2010, 8:00:55 AM1/27/10
to Dmitry Moskalchuk, andro...@googlegroups.com
Well, I did that on cygwin. Its definitely possible also in linux or macox.
What I did was - I run build\tools\build-toolchain.sh script. I waited for it to download and unpack android-ndk-toolcainh-20090323.tar.bz2 file.
Then I edited gcc-4.2.1\gcc\config\arm\eabi.h file. In it I changed:
#define ANDROID_CC1PLUS_SPEC "%{!frtti:-fno-rtti}"
to
#define ANDROID_CC1PLUS_SPEC ""
This enabled RTTI support

Also I removed "%{!fexceptions:-fno-exceptions} " \ string from it.
This enabled C++ exception suppor

Then I added --enable-libstc__-v3 to build\tools\build-toolchain.sh script to $TOOLCHAIN_SRC/configure line (around line 373).
THis enabled STL support.

Then I commented out downloading/unpacking sources (download_package and unpack_package lines around line 353).
After that I edited build\toolchains\arm-eabi-4.2.1\setup.mk file. From it I removed -fno-exceptions and -fno-rtti

Then I run build-toolchain.sh script again.
There was some errors about redeclaration functions but those I solved by simply commenting out second function declaration in gcc sources.

After that I got tar.bz2 file with working android ndk with RTTI, exception and STL support. I unpacked it into build\prebuild directory after removing what was inside it.

Before using it you will need to remove files new/typeinfo/utility from platforms\android-3/4/common/include directory. They now are provided with STL.
You can always add -fno-exceptions and -fno-rtti flags to LOCAL_CFLAGS to get executable build without rtti/exceptions.

Maybe I have forgotten something small details. But I think that covers main things I did.

--
Martins Mozeiko

Dmitry Moskalchuk

unread,
Jan 27, 2010, 6:39:48 AM1/27/10
to Martins Mozeiko, andro...@googlegroups.com
Thank you very much, Martins! I'll try that soon and inform if it
would help. One more question - did you tested result using gcc unit
tests or something other?


Dmitry Moskalchuk

27.01.2010, в 16:00, Martins Mozeiko написал(а):

Martins Mozeiko

unread,
Jan 27, 2010, 9:04:02 AM1/27/10
to Dmitry Moskalchuk, andro...@googlegroups.com
No, I have not run any gcc unit tests.
But I have used this custom build gcc to compile and successfully run LLVM on Android (in Interpreter mode).
It uses dynamic_cast and some parts of STL in it.

--
Martins Mozeiko


On Jan 27, 2010, at 13:39 , Dmitry Moskalchuk wrote:

> Thank you very much, Martins! I'll try that soon and inform if it would help. One more question - did you tested result using gcc unit tests or something other?
>
>
> Dmitry Moskalchuk
>
> 27.01.2010, в 16:00, Martins Mozeiko написал(а):
>
>> Well, I did that on cygwin. Its definitely possible also in linux or macox.

>> What I did was - I run build\tools\build-toolchain.sh script. I waited for it to download and unpack android-ndk-toolcainh-20090323.tar.bz2 file.

Dmitry Moskalchuk

unread,
Jan 28, 2010, 8:06:44 PM1/28/10
to Martins Mozeiko, andro...@googlegroups.com
Hi Martins,

Just want to inform that I've successfully created customized ndk for
linux and darwin using your instructions. See my post to details -
http://groups.google.com/group/android-ndk/msg/4de3dd6105eb26ce

Dmitry Moskalchuk


27.01.2010 17:04, Martins Mozeiko пишет:

ganesh srinivasan

unread,
Feb 11, 2010, 1:23:57 PM2/11/10
to android-ndk
Hi Dmitry,

I was able to build the customized sdk based on Martins instructions.
But I don't see the STL header files in the customized sdk.

In your customized sdk, I see that the STL headers are residing
under ...\arm-eabi\include\c++. How did you get the include files?
Do I need to enable some other setting in the build process.

Regards,
Ganesh


On Jan 28, 5:06 pm, Dmitry Moskalchuk <crys...@gmail.com> wrote:
> Hi Martins,
>
> Just want to inform that I've successfully created customized ndk for

> linux and darwin using your instructions. See my post to details -http://groups.google.com/group/android-ndk/msg/4de3dd6105eb26ce

> >>>>>>http://sseyod.blogspot.com/2009/08/android-ndk-getting-stlport-up-and...

Dmitry Moskalchuk

unread,
Feb 11, 2010, 9:42:46 PM2/11/10
to andro...@googlegroups.com, ganesh srinivasan
Hi,

Did you have specified '--enable-libstdc__-v3' parameter for configure
in build-toolchain.sh? I've created diff which need to be applied to
android-ndk-1.6_r1 and then all you need is to run (patched)
build-toolchain.sh. That's all. No additional steps required.
See diff here - http://www.crystax.net/data/android-ndk-1.6_r1-crystax.diff

Dmitry Moskalchuk

ganesh srinivasan

unread,
Feb 12, 2010, 1:56:49 AM2/12/10
to android-ndk
Hi,

Martins email has a d missing in "--enable-libstdc__-v3", so I guess I
never ran it with the correct settings in build-toolchain.sh.
I realized my mistake after looking at your diff file.

Thanks a lot for your response.

Regards,
Ganesh

On Feb 11, 6:42 pm, Dmitry Moskalchuk <crys...@gmail.com> wrote:
> Hi,
>
> Did you have specified '--enable-libstdc__-v3' parameter for configure
> in build-toolchain.sh? I've created diff which need to be applied to
> android-ndk-1.6_r1 and then all you need is to run (patched)
> build-toolchain.sh. That's all. No additional steps required.

> See diff here -http://www.crystax.net/data/android-ndk-1.6_r1-crystax.diff

Reply all
Reply to author
Forward
0 new messages