STL with the NDK r5

587 views
Skip to first unread message

Jyaif

unread,
Dec 6, 2010, 1:16:15 PM12/6/10
to android-ndk
Hi,
from what I understood, to use the stl with the NDK r5 one must simply
add the line "APP_STL := stlport_static" to the Android.mk.
However, by doing so, "#include "vector"" still yields the error
"error: vector: No such file or directory". My question is: what am I
supposed to do to compile code that uses the STL?

David Turner

unread,
Dec 6, 2010, 2:26:28 PM12/6/10
to andro...@googlegroups.com

You're supposed to add it to Application.mk, not Android.mk

> --
> 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.
>

Jyaif

unread,
Dec 6, 2010, 5:48:39 PM12/6/10
to android-ndk
Thanks, it now works.

On Dec 6, 8:26 pm, David Turner <di...@android.com> wrote:
> You're supposed to add it to Application.mk, not Android.mk
> Le 6 déc. 2010 20:10, "Jyaif" <jfgeye...@gmail.com> a écrit :> Hi,
> > from what I understood, to use the stl with the NDK r5 one must simply
> > add the line "APP_STL := stlport_static" to the Android.mk.
> > However, by doing so, "#include "vector"" still yields the error
> > "error: vector: No such file or directory". My question is: what am I
> > supposed to do to compile code that uses the STL?
>
> > --
> > 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<android-ndk%2Bunsubscribe@googlegr oups.com>
> .> For more options, visit this group at
>
> http://groups.google.com/group/android-ndk?hl=en.
>
>
>
>
>
>
>
>

alan

unread,
Dec 7, 2010, 6:31:14 AM12/7/10
to android-ndk
CPLUSPLUS-SUPPORT.html doesn't mention "gnustl_static" as a valid
option for APP_STL, is it supported? Does it support exceptions and
rtti

mic _

unread,
Dec 7, 2010, 6:38:15 AM12/7/10
to andro...@googlegroups.com
"Provides a default C++ STL implementation (based on STLport) as a helper module. It can be used either as a static or shared library (details and usage examples are in sources/android/stlport/README). Prebuilt binaries for STLport (static or shared) and GNU libstdc++ (static only) are also provided if you choose to compile against those libraries instead of the default C++ STL implementation. C++ Exceptions and RTTI are not supported in the default STL implementation. For more information, see docs/CPLUSPLUS-SUPPORT.HTML."


To unsubscribe from this group, send email to android-ndk...@googlegroups.com.

alan

unread,
Dec 7, 2010, 6:44:19 AM12/7/10
to android-ndk
Yes but docs/CPLUSPLUS-SUPPORT.HTML states:

"Value APP_STL values are the following:

system -> Use the default minimal C++ runtime library.
stlport_static -> Use STLport built as a static library.
stlport_shared -> Use STLport built as a shared library."


On Dec 7, 11:38 am, mic _ <micol...@gmail.com> wrote:
> *"Provides a default C++ STL implementation (based on STLport) as a helper
> module. It can be used either as a static or shared library (details and
> usage examples are in sources/android/stlport/README). Prebuilt binaries for
> STLport (static or shared) and GNU libstdc++ (static only) are also provided
> if you choose to compile against those libraries instead of the default C++
> STL implementation. C++ Exceptions and RTTI are not supported in the default
> STL implementation. For more information, see docs/CPLUSPLUS-SUPPORT.HTML.*"
>
> On Tue, Dec 7, 2010 at 12:31 PM, alan <a...@birtles.org.uk> wrote:
> > CPLUSPLUS-SUPPORT.html doesn't mention "gnustl_static" as a valid
> > option for APP_STL, is it supported? Does it support exceptions and
> > rtti
>
> > On Dec 6, 10:48 pm, Jyaif <jfgeye...@gmail.com> wrote:
> > > Thanks, it now works.
>
> > > On Dec 6, 8:26 pm, David Turner <di...@android.com> wrote:
>
> > > > You're supposed to add it to Application.mk, not Android.mk
> > > > Le 6 déc. 2010 20:10, "Jyaif" <jfgeye...@gmail.com> a écrit :> Hi,
> > > > > from what I understood, to use the stl with the NDK r5 one must
> > simply
> > > > > add the line "APP_STL := stlport_static" to the Android.mk.
> > > > > However, by doing so, "#include "vector"" still yields the error
> > > > > "error: vector: No such file or directory". My question is: what am I
> > > > > supposed to do to compile code that uses the STL?
>
> > > > > --
> > > > > 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<android-ndk%2Bunsu...@googlegroups.com>
> > <android-ndk%2Bunsubscribe@googlegr oups.com>
> > > > .> For more options, visit this group at
>
> > > >http://groups.google.com/group/android-ndk?hl=en.
>
> > --
> > 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<android-ndk%2Bunsu...@googlegroups.com>

David Turner

unread,
Dec 7, 2010, 8:24:51 AM12/7/10
to andro...@googlegroups.com
On Tue, Dec 7, 2010 at 12:44 PM, alan <al...@birtles.org.uk> wrote:
Yes but docs/CPLUSPLUS-SUPPORT.HTML states:

"Value APP_STL values are the following:

  system              -> Use the default minimal C++ runtime library.
  stlport_static      -> Use STLport built as a static library.
  stlport_shared      -> Use STLport built as a shared library."


What? This is clearly outdated, gnustl_static should be listed here. And it supports exceptions and rtti too.
Will look into it.
 
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.

Android dev

unread,
Dec 7, 2010, 12:36:19 PM12/7/10
to android-ndk
I compiled my libraries with the STL of NDKr5 without problems and
they are working fine on the 2.3 emulator.
However they don't load on 2.2 or lower versions of the SDK... Why?

On Dec 7, 11:24 am, David Turner <di...@android.com> wrote:
> > <android-ndk%2Bunsu...@googlegroups.com<android-ndk%252Buns...@googlegroups.com>
>
> > > > <android-ndk%2Bunsubscribe@googlegr oups.com>
> > > > > > .> For more options, visit this group at
>
> > > > > >http://groups.google.com/group/android-ndk?hl=en.
>
> > > > --
> > > > 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<android-ndk%2Bunsu...@googlegroups.com>
> > <android-ndk%2Bunsu...@googlegroups.com<android-ndk%252Buns...@googlegroups.com>

alan

unread,
Dec 8, 2010, 5:20:25 AM12/8/10
to android-ndk
Should I need to add libstdc++.a to the end of LOCAL_LDFLAGS when
linking against static libraries which are linked against
gnustl_static? Both the static libraries and the shared library
specify "APP_STL := gnustl_static" in their Application.mk. Would
using the new modules system add this for me?

David Turner

unread,
Dec 8, 2010, 7:50:43 AM12/8/10
to andro...@googlegroups.com
On Wed, Dec 8, 2010 at 11:20 AM, alan <al...@birtles.org.uk> wrote:
Should I need to add libstdc++.a to the end of LOCAL_LDFLAGS when
linking against static libraries which are linked against
gnustl_static?

Now, you should not need that at all, this is handled by the STL implementations.

Both the static libraries and the shared library
specify "APP_STL := gnustl_static" in their Application.mk. Would
using the new modules system add this for me?


The STL implementations are really modules (though consider this an implementation detail), which export the right compiler/linker options for you.
 
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.

alan

unread,
Dec 8, 2010, 7:55:24 AM12/8/10
to android-ndk
I am linking in prebuilt static libraries using LOCAL_LDFLAGS,
LOCAL_LDFLAGS get added at the end of the link command so is after
libstdc++.a and any libraries in LOCAL_LDFLAGS which depend on libstdc+
+ will fail to link. Is the only option to convert my static libraries
into modules?

On Dec 8, 12:50 pm, David Turner <di...@android.com> wrote:
> > > > > <android-ndk%2Bunsu...@googlegroups.com<android-ndk%252Buns...@googlegroups.com>
> > <android-ndk%252Buns...@googlegroups.com<android-ndk%25252Bun...@googlegroups.com>
>
> > > > > > > <android-ndk%2Bunsubscribe@googlegr oups.com>
> > > > > > > > > .> For more options, visit this group at
>
> > > > > > > > >http://groups.google.com/group/android-ndk?hl=en.
>
> > > > > > > --
> > > > > > > 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<android-ndk%2Bunsu...@googlegroups.com>
> > <android-ndk%2Bunsu...@googlegroups.com<android-ndk%252Buns...@googlegroups.com>
>
> > > > > <android-ndk%2Bunsu...@googlegroups.com<android-ndk%252Buns...@googlegroups.com>
> > <android-ndk%252Buns...@googlegroups.com<android-ndk%25252Bun...@googlegroups.com>

David Turner

unread,
Dec 8, 2010, 8:05:10 AM12/8/10
to andro...@googlegroups.com
On Wed, Dec 8, 2010 at 1:55 PM, alan <al...@birtles.org.uk> wrote:
I am linking in prebuilt static libraries using LOCAL_LDFLAGS,
LOCAL_LDFLAGS get added at the end of the link command so is after
libstdc++.a and any libraries in LOCAL_LDFLAGS which depend on libstdc+
+ will fail to link. Is the only option to convert my static libraries
into modules?

LOCAL_LDFLAGS is not really documented, it's a remnant from past experimentation. Oops.

But yes, the solution to your problem is to define a module with PREBUILT_STATIC_LIBRARY that was introduced in r5.
You can then use LOCAL_EXPORT_LDLIBS to add relevant linker flags to be exported by your module.
 
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.

alan

unread,
Dec 8, 2010, 11:56:42 AM12/8/10
to android-ndk
I can confirm that converting to precompiled modules solves the
problem (and is much nicer than manually including libs with
LOCAL_LDFLAGS)

On Dec 8, 1:05 pm, David Turner <di...@android.com> wrote:
> > > > > > > <android-ndk%2Bunsu...@googlegroups.com<android-ndk%252Buns...@googlegroups.com>
> > <android-ndk%252Buns...@googlegroups.com<android-ndk%25252Bun...@googlegroups.com>
>
> > > > <android-ndk%252Buns...@googlegroups.com<android-ndk%25252Bun...@googlegroups.com>
> > <android-ndk%25252Bun...@googlegroups.com<android-ndk%2525252Bu...@googlegroups.com>
>
> > > > > > > > > <android-ndk%2Bunsubscribe@googlegr oups.com>
> > > > > > > > > > > .> For more options, visit this group at
>
> > > > > > > > > > >http://groups.google.com/group/android-ndk?hl=en.
>
> > > > > > > > > --
> > > > > > > > > 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<android-ndk%2Bunsu...@googlegroups.com>
> > <android-ndk%2Bunsu...@googlegroups.com<android-ndk%252Buns...@googlegroups.com>
>
> > > > <android-ndk%2Bunsu...@googlegroups.com<android-ndk%252Buns...@googlegroups.com>
> > <android-ndk%252Buns...@googlegroups.com<android-ndk%25252Bun...@googlegroups.com>
>
> > > > > > > <android-ndk%2Bunsu...@googlegroups.com<android-ndk%252Buns...@googlegroups.com>
> > <android-ndk%252Buns...@googlegroups.com<android-ndk%25252Bun...@googlegroups.com>
>
> > > > <android-ndk%252Buns...@googlegroups.com<android-ndk%25252Bun...@googlegroups.com>
> > <android-ndk%25252Bun...@googlegroups.com<android-ndk%2525252Bu...@googlegroups.com>

Android dev

unread,
Dec 8, 2010, 12:47:29 PM12/8/10
to android-ndk
does my code compiled with the "gnustl_static" works on platforms
lower than 2.3?

alan

unread,
Dec 8, 2010, 1:27:06 PM12/8/10
to android-ndk
i've managed to run code on the 2.2 emulator

David Turner

unread,
Dec 8, 2010, 2:19:02 PM12/8/10
to andro...@googlegroups.com

It should unless you expect working wchar_t support.

Let me know if you find something specific that doesn't work.

> To unsubscribe from this group, send email to android-ndk...@googlegroups.com.

Android dev

unread,
Dec 10, 2010, 10:20:16 AM12/10/10
to android-ndk
When I compile my native code with the NDKr4-cristax, it loads on all
platforms (2.0.1 to 2.3).
When I compile my native code with the NDKr5 using the "gnustl_static"
option, it loads on 2.3 and 2.2 emulator, but not on 2.1 and 2.0.1
emulator and not on 2.0.1 device, where I get this error:

D/dalvikvm( 286): Trying to load lib /data/data/com.example.myapp/lib/
mynativelib.so 0x43cf9820
I/DEBUG ( 27): *** *** *** *** *** *** *** *** *** *** *** *** ***
*** *** ***
I/DEBUG ( 27): Build fingerprint: 'generic/sdk/generic/:2.0.1/
ESD54/20723:eng/test-keys'
I/DEBUG ( 27): pid: 286, tid: 286 >>> com.example.myapp <<<
I/DEBUG ( 27): signal 4 (SIGILL), fault addr 80d00000
I/DEBUG ( 27): r0 80d48288 r1 80d30e3d r2 afe0fa18 r3 afe0fa18
I/DEBUG ( 27): r4 80d42df4 r5 be85170c r6 00000000 r7 00000001
I/DEBUG ( 27): r8 ad00f380 r9 0000bd00 10 4104bc3c fp 00000000
I/DEBUG ( 27): ip 80d42e60 sp be8516f0 lr 80d30ec9 pc
80d00000 cpsr a0000010
I/DEBUG ( 27): #00 pc 00000000 /data/data/
com.example.myapp/lib/mynativelib.so
I/DEBUG ( 27): #01 pc 00030ec6 /data/data/
com.example.myapp/lib/mynativelib.so
I/DEBUG ( 27):
I/DEBUG ( 27): code around lr:
I/DEBUG ( 27): 80d30eb8 d0052b00 49124811 44794478 eb00f7ed
I/DEBUG ( 27): 80d30ec8 447b4b10 4b0c6818 2b0058e3 f7edd010
I/DEBUG ( 27): 80d30ed8 2800eae6 2004d00c ffa4f7fe 58e34b0a

On Dec 8, 5:19 pm, David Turner <di...@android.com> wrote:
> It should unless you expect working wchar_t support.
>
> Let me know if you find something specific that doesn't work.
> >> > > > > <android-ndk%252Buns...@googlegroups.com<android-ndk%25252Bun...@googlegroups.com>
>
> <android-ndk%25252Bun...@googlegroups.com<android-ndk%2525252Bu...@googlegroups.com>
>
> >> > > <android-ndk%25252Bun...@googlegroups.com<android-ndk%2525252Bu...@googlegroups.com>
>
> <android-ndk%2525252Bu...@googlegroups.com<android-ndk%252525252B...@googlegroups.com>
>
>
>
> >> > > > > > > > > > <android-ndk%2Bunsubscribe@googlegr oups.com>
> >> > > > > > > > > > > > .> For more options, visit this group at
>
> >> > > > > > > > > > > >http://groups.google.com/group/android-ndk?hl=en.
>
> >> > > > > > > > > > --
> >> > > > > > > > > > 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<android-ndk%2Bunsu...@googlegroups.com>
>
> <android-ndk%2Bunsu...@googlegroups.com<android-ndk%252Buns...@googlegroups.com>
>
> >> > > <android-ndk%2Bunsu...@googlegroups.com<android-ndk%252Buns...@googlegroups.com>
>
> <android-ndk%252Buns...@googlegroups.com<android-ndk%25252Bun...@googlegroups.com>
>
> >> > > > > <android-ndk%2Bunsu...@googlegroups.com<android-ndk%252Buns...@googlegroups.com>
>
> <android-ndk%252Buns...@googlegroups.com<android-ndk%25252Bun...@googlegroups.com>
>
> >> > > <android-ndk%252Buns...@googlegroups.com<android-ndk%25252Bun...@googlegroups.com>
>
> <android-ndk%25252Bun...@googlegroups.com<android-ndk%2525252Bu...@googlegroups.com>
>
> >> > > > > > > > <android-ndk%2Bunsu...@googlegroups.com<android-ndk%252Buns...@googlegroups.com>
>
> <android-ndk%252Buns...@googlegroups.com<android-ndk%25252Bun...@googlegroups.com>
>
> >> > > <android-ndk%252Buns...@googlegroups.com<android-ndk%25252Bun...@googlegroups.com>
>
> <android-ndk%25252Bun...@googlegroups.com<android-ndk%2525252Bu...@googlegroups.com>
>
> >> > > > > <android-ndk%252Buns...@googlegroups.com<android-ndk%25252Bun...@googlegroups.com>
>
> <android-ndk%25252Bun...@googlegroups.com<android-ndk%2525252Bu...@googlegroups.com>
>
> >> > > <android-ndk%25252Bun...@googlegroups.com<android-ndk%2525252Bu...@googlegroups.com>
>
> <android-ndk%2525252Bu...@googlegroups.com<android-ndk%252525252B...@googlegroups.com>
>
>
>
> >> > > > > > > > > > .
> >> > > > > > > > > > For more options, visit this group at
> >> > > > > > > > > >http://groups.google.com/group/android-ndk?hl=en.
>
> >> > > > > > > > --
> >> > > > > > > > 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
>
> ...
>
> read more »

drodin

unread,
Dec 12, 2010, 5:26:26 AM12/12/10
to android-ndk
same problem here

just use crystax's libstdc++

can't manage to run my app on pre 2.2 devices using one from new ndk
> > >> > > > > > > > > > > > android-ndk...@googlegroups.com<android-ndk%2Bunsubscribe@googlegr oups.com>
>
> > <android-ndk%2Bunsu...@googlegroups.com<android-ndk%252Bunsubscribe@goo glegroups.com>
>
> > >> > > <android-ndk%2Bunsu...@googlegroups.com<android-ndk%252Bunsubscribe@goo glegroups.com>
>
> > <android-ndk%252Buns...@googlegroups.com<android-ndk%25252Bunsubscribe @googlegroups.com>
>
> > >> > > > > <android-ndk%2Bunsu...@googlegroups.com<android-ndk%252Bunsubscribe@goo glegroups.com>
>
> > <android-ndk%252Buns...@googlegroups.com<android-ndk%25252Bunsubscribe @googlegroups.com>
>
> > >> > > <android-ndk%252Buns...@googlegroups.com<android-ndk%25252Bunsubscribe @googlegroups.com>
>
> > <android-ndk%25252Bun...@googlegroups.com<android-ndk%2525252Bunsubsc ri...@googlegroups.com>
>
> > >> > > > > > > > <android-ndk%2Bunsu...@googlegroups.com<android-ndk%252Bunsubscribe@goo glegroups.com>
>
> > <android-ndk%252Buns...@googlegroups.com<android-ndk%25252Bunsubscribe @googlegroups.com>
>
> > >> > > <android-ndk%252Buns...@googlegroups.com<android-ndk%25252Bunsubscribe @googlegroups.com>
>
> > <android-ndk%25252Bun...@googlegroups.com<android-ndk%2525252Bunsubsc ri...@googlegroups.com>
>
> > >> > > > > <android-ndk%252Buns...@googlegroups.com<android-ndk%25252Bunsubscribe @googlegroups.com>
>
> > <android-ndk%25252Bun...@googlegroups.com<android-ndk%2525252Bunsubsc ri...@googlegroups.com>
>
> > >> > > <android-ndk%25252Bun...@googlegroups.com<android-ndk%2525252Bunsubsc ri...@googlegroups.com>
>
> > <android-ndk%2525252Bu...@googlegroups.com<android-ndk%252525252Buns ubsc...@googlegroups.com>
>
> > >> > > > > > > > > > <android-ndk%2Bunsubscribe@googlegr oups.com>
> > >> > > > > > > > > > > > .> For more options, visit this group at
>
> > >> > > > > > > > > > > >http://groups.google.com/group/android-ndk?hl=en.
>
> > >> > > > > > > > > > --
> > >> > > > > > > > > > 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
>
> ...
>
> read more »

alan

unread,
Dec 13, 2010, 4:41:57 AM12/13/10
to android-ndk
Have you tried looking up the "00030ec6" address? this might help
debug the problem
> ...
>
> read more »

David Turner

unread,
Dec 13, 2010, 5:36:48 AM12/13/10
to andro...@googlegroups.com
On Fri, Dec 10, 2010 at 4:20 PM, Android dev <gian...@gmail.com> wrote:
When I compile my native code with the NDKr4-cristax, it loads on all
platforms (2.0.1 to 2.3).
When I compile my native code with the NDKr5 using the "gnustl_static"
option, it loads on 2.3 and 2.2 emulator, but not on 2.1 and 2.0.1
emulator and not on 2.0.1 device, where I get this error:

Unfortunately, that doesn't tell us much. Can you provide a small source example that reproduce the problem?
 
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.

drodin

unread,
Dec 13, 2010, 2:53:54 PM12/13/10
to android-ndk
Here is log and some assumptions...

14a386 is somewhere in the middle of ...mutex_wrapper... (libsdtc++)

see this linker errors?

made diff of undefined symbols in libapp compiled with crystax's
libstdc++ and one from the new ndk
so the main difference is that in the ndk's version some symbols:
pthread_cond_wait, pthread_cond_broadcast,
etc. are "weak undefined" ('w' in nm output)

curious, is there is a bug in pre 2.2 linker?

12-14 02:23:29.276: INFO/DEBUG(28): *** *** *** *** *** *** *** ***
*** *** *** *** *** *** *** ***
12-14 02:23:29.276: INFO/DEBUG(28): Build fingerprint: 'generic/sdk/
generic/:2.1-update1/ECLAIR/35983:eng/test-keys'
12-14 02:23:29.276: INFO/DEBUG(28): pid: 264, tid: 264 >>>
com.example.app <<<
12-14 02:23:29.286: INFO/DEBUG(28): signal 4 (SIGILL), fault addr
80c00000
12-14 02:23:29.286: INFO/DEBUG(28): r0 80f0c440 r1 80d4a2fd r2
afe0fa18 r3 afe0fa18
12-14 02:23:29.286: INFO/DEBUG(28): r4 80d8a6cc r5 bed6874c r6
00000000 r7 00000001
12-14 02:23:29.286: INFO/DEBUG(28): r8 ad00f380 r9 0000bd00 10
4104bc3c fp 00000000
12-14 02:23:29.286: INFO/DEBUG(28): ip 80d8a7c8 sp bed68730 lr
80d4a389 pc 80c00000 cpsr a0000010
12-14 02:23:29.436: INFO/DEBUG(28): #00 pc 00000000 /data/
data/com.example.app/lib/libapplication.so
12-14 02:23:29.436: INFO/DEBUG(28): #01 pc 0014a386 /data/
data/com.example.app/lib/libapplication.so
12-14 02:23:29.436: INFO/DEBUG(28): code around lr:
12-14 02:23:29.446: INFO/DEBUG(28): 80d4a378 d0052b00 49124811
44794478 ee28f70e
12-14 02:23:29.446: INFO/DEBUG(28): 80d4a388 447b4b10 4b0c6818
2b0058e3 f70ed010
12-14 02:23:29.446: INFO/DEBUG(28): 80d4a398 2800edf6 2004d00c
ffa4f7fe 58e34b0a
12-14 02:23:29.446: INFO/DEBUG(28): stack:
12-14 02:23:29.446: INFO/DEBUG(28): bed686f0 bed68800 [stack]
12-14 02:23:29.456: INFO/DEBUG(28): bed686f4 b000f448 /system/
bin/linker
12-14 02:23:29.456: INFO/DEBUG(28): bed686f8 b000fd00 /system/
bin/linker
12-14 02:23:29.456: INFO/DEBUG(28): bed686fc 80d8a5e4 /data/data/
com.example.app/lib/libapplication.so
12-14 02:23:29.456: INFO/DEBUG(28): bed68700 00000000
12-14 02:23:29.456: INFO/DEBUG(28): bed68704 b00004ef /system/
bin/linker
12-14 02:23:29.456: INFO/DEBUG(28): bed68708 b00163d0
12-14 02:23:29.466: INFO/DEBUG(28): bed6870c b000f448 /system/
bin/linker
12-14 02:23:29.466: INFO/DEBUG(28): bed68710 b000fd00 /system/
bin/linker
12-14 02:23:29.466: INFO/DEBUG(28): bed68714 80d8a5e4 /data/data/
com.example.app/lib/libapplication.so
12-14 02:23:29.466: INFO/DEBUG(28): bed68718 00000000
12-14 02:23:29.466: INFO/DEBUG(28): bed6871c b0000559 /system/
bin/linker
12-14 02:23:29.466: INFO/DEBUG(28): bed68720 00000000
12-14 02:23:29.476: INFO/DEBUG(28): bed68724 00000000
12-14 02:23:29.476: INFO/DEBUG(28): bed68728 df002777
12-14 02:23:29.476: INFO/DEBUG(28): bed6872c e3a070ad
12-14 02:23:29.476: INFO/DEBUG(28): #01 bed68730 80f07514
12-14 02:23:29.476: INFO/DEBUG(28): bed68734 80d8a6cc /data/data/
com.example.app/lib/libapplication.so
12-14 02:23:29.486: INFO/DEBUG(28): bed68738 00000000
12-14 02:23:29.486: INFO/DEBUG(28): bed6873c 80d4a573 /data/data/
com.example.app/lib/libapplication.so
12-14 02:23:29.486: INFO/DEBUG(28): bed68740 00000000
12-14 02:23:29.486: INFO/DEBUG(28): bed68744 afe0f2c0 /system/
lib/libc.so
12-14 02:23:29.486: INFO/DEBUG(28): bed68748 00000000
12-14 02:23:29.496: INFO/DEBUG(28): bed6874c 00000001
12-14 02:23:29.496: INFO/DEBUG(28): bed68750 00001000
12-14 02:23:29.496: INFO/DEBUG(28): bed68754 80d8a6cc /data/data/
com.example.app/lib/libapplication.so
12-14 02:23:29.496: INFO/DEBUG(28): bed68758 80f06f58
12-14 02:23:29.496: INFO/DEBUG(28): bed6875c 00000000
12-14 02:23:29.496: INFO/DEBUG(28): bed68760 00000001
12-14 02:23:29.506: INFO/DEBUG(28): bed68764 80d48101 /data/data/
com.example.app/lib/libapplication.so
12-14 02:23:29.506: INFO/DEBUG(28): bed68768 00000000
12-14 02:23:29.506: INFO/DEBUG(28): bed6876c 80c695b1 /data/data/
com.example.app/lib/libapplication.so
12-14 02:23:29.506: INFO/DEBUG(28): bed68770 80d8c098
12-14 02:23:29.506: INFO/DEBUG(28): bed68774 80d8a6cc /data/data/
com.example.app/lib/libapplication.so


On Dec 13, 5:36 pm, David Turner <di...@android.com> wrote:
> > > >> > > > > > > > > > > > android-ndk...@googlegroups.com<android-ndk%2Bunsubscribe@googlegr oups.com>
> > <android-ndk%2Bunsu...@googlegroups.com<android-ndk%252Bunsubscribe@goo glegroups.com>
>
> > > <android-ndk%2Bunsu...@googlegroups.com<android-ndk%252Bunsubscribe@goo glegroups.com>
> > <android-ndk%252Buns...@googlegroups.com<android-ndk%25252Bunsubscribe @googlegroups.com>
>
> > > >> > > <android-ndk%2Bunsu...@googlegroups.com<android-ndk%252Bunsubscribe@goo glegroups.com>
> > <android-ndk%252Buns...@googlegroups.com<android-ndk%25252Bunsubscribe @googlegroups.com>
>
> > > <android-ndk%252Buns...@googlegroups.com<android-ndk%25252Bunsubscribe @googlegroups.com>
> > <android-ndk%25252Bun...@googlegroups.com<android-ndk%2525252Bunsubsc ri...@googlegroups.com>
>
> > > >> > > > > <android-ndk%2Bunsu...@googlegroups.com<android-ndk%252Bunsubscribe@goo glegroups.com>
> > <android-ndk%252Buns...@googlegroups.com<android-ndk%25252Bunsubscribe @googlegroups.com>
>
> > > <android-ndk%252Buns...@googlegroups.com<android-ndk%25252Bunsubscribe @googlegroups.com>
> > <android-ndk%25252Bun...@googlegroups.com<android-ndk%2525252Bunsubsc ri...@googlegroups.com>
>
> > > >> > > <android-ndk%252Buns...@googlegroups.com<android-ndk%25252Bunsubscribe @googlegroups.com>
> > <android-ndk%25252Bun...@googlegroups.com<android-ndk%2525252Bunsubsc ri...@googlegroups.com>
>
> > > <android-ndk%25252Bun...@googlegroups.com<android-ndk%2525252Bunsubsc ri...@googlegroups.com>
> > <android-ndk%2525252Bu...@googlegroups.com<android-ndk%252525252Buns ubsc...@googlegroups.com>
>
> > > >> > > > > > > > <android-ndk%2Bunsu...@googlegroups.com<android-ndk%252Bunsubscribe@goo glegroups.com>
> > <android-ndk%252Buns...@googlegroups.com<android-ndk%25252Bunsubscribe @googlegroups.com>
>
> ...
>
> read more »

Android dev

unread,
Dec 14, 2010, 1:08:15 PM12/14/10
to android-ndk
In my case too.
the problem seems to be related with pthreads.
Adress 00030ec6 is inside a
_ZNK9__gnu_cxx24__concurrence_wait_error4whatEv block and has a jump
to a mutex block.
But I couldn't reproduce this in a small source example...
> > > When I compile my native code with theNDKr5using the "gnustl_static"
> ...
>
> read more »

pelya

unread,
Dec 21, 2010, 1:07:26 PM12/21/10
to android-ndk
Hi

I've got the NDK r5 with stlport_shared STL implementation crashing on
a x5a/x6d Android 2.1 tablet, when trying to output anything to
std::cout.
The CrysaX NDK based on r4b with GNU STL implementation was crashing
on the SmartQ V7 device, also when trying to output anything to
std::cout.
I've ended up using my own STLPort implementation, which seems to work
okay, here's the file I've changed:
https://github.com/pelya/commandergenius/blob/sdl_android/project/jni/stlport/src/iostream.cpp

Hope that helps

suckho

unread,
Jan 14, 2011, 9:15:04 AM1/14/11
to android-ndk

On Dec 10 2010, 5:20 pm, Android dev <gian23...@gmail.com> wrote:
> When I compile my native code with the NDKr4-cristax, it loads on all
> platforms (2.0.1 to 2.3).
> When I compile my native code with the NDKr5 using the "gnustl_static"
> option, it loads on 2.3 and 2.2 emulator, but not on 2.1 and 2.0.1
> emulator and not on 2.0.1 device, where I get this error:

I bumped into this same problem.. Building the native part of the code
on NDK r5 with gnustl_static works OK and runs on 2.2, but not on 2.1
devices.

Easy way to re-produce this is to add a Application.mk file with only
APP_STL := gnustl_static to some simple sample app, e.g. hello-gl2.
Does
not work anymore on 2.1 devices.

Any known solution to this problem using official NDK?

I haven't tried with that crystax r4, I would rather use the latest
official release.
Message has been deleted

Mike Edenfield

unread,
Feb 1, 2011, 4:49:33 PM2/1/11
to andro...@googlegroups.com
On 1/31/2011 11:53 PM, deem wrote:
> Guys,
>
> Could you please help me what I'm doing wrong here?
>
> I have a few static libraries I need to combine into one shared with
> my own code:

To do this, you should use pre-built static libraries, instead of trying
to concoct a set of LDLIBS flags.

See docs/PREBUILTS.html for examples.

In short, you create one LOCAL_MODULE for each static library, pointing
at the .a file as the source. Then your final LOCAL_MODULE lists each
of those previous items in its LOCAL_STATIC_LIBRARIES list.

Also, specifically for the C++ support, you should check out:

docs/CPLUSPLUS-SUPPORT.html

in particular, selecting the correct stl implementation with the APP_STL
flag.

--Mike

alan

unread,
Feb 2, 2011, 4:32:46 AM2/2/11
to andro...@googlegroups.com
please don't post multiple times as it wastes peoples time by answering a question that has already been answered in another thread

Hugh

unread,
Feb 9, 2011, 3:44:00 AM2/9/11
to android-ndk
Thanks drodin, that did the trick!

I thought I was going to have to revert the whole system to crystax's,
but it is just the .a that needs to change.

I notice the one from crystax build/prebuilt/windows/arm-eabi-4.4.0/
arm-eabi/lib/libstdc++.a is 7246076 bytes, while the one from sources/
cxx-stl/gnu-libstdc++/libs/armeabi is only 5126102 bytes, so maybe
something has been dynamically linked and assumed to be on the target
platform, but is not on 2.1 devices.
> ...
>
> read more »

Cadu Silvestre

unread,
Feb 23, 2011, 12:04:58 PM2/23/11
to android-ndk
@suckho,

I'm experiencing the same issue here.

My library with exceptions works fine with 2.2 and 2.3, but it doesn't
load on 2.1.

Any news on that?

Thanks.

İsmail Dönmez

unread,
Feb 23, 2011, 12:07:26 PM2/23/11
to andro...@googlegroups.com, Cadu Silvestre
Fixed for the upcoming NDK, see https://review.source.android.com//#change,21309

ismail

--
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.

Cadu Silvestre

unread,
Feb 23, 2011, 12:45:18 PM2/23/11
to android-ndk
Thanks Ismail.

Any idea of the date for this new release?

Cheers!

On Feb 23, 2:07 pm, İsmail Dönmez <ism...@namtrac.org> wrote:
> Fixed for the upcoming NDK, seehttps://review.source.android.com//#change,21309
>
> ismail
Reply all
Reply to author
Forward
0 new messages