debug builds and strip --strip-unneeded

6,539 views
Skip to first unread message

Gregory Pakosz

unread,
Apr 1, 2011, 5:27:29 AM4/1/11
to android-ndk
Hello,

I'm building shared libraries for Android by having a Makefile
invoking ndk-build the following way: (for some legacy and practical
reasons regarding how our repo is structured)

$(NDK_ROOT)/ndk-build NDK_APPLICATION_MK=$(srcdir)/Application.mk
NDK_PROJECT_PATH=$(srcdir)/build/$(platform)-$(arch)-$(configuration)
APP_OPTIM=$(configuration) APP_ABI=$(arch)

$(configuration) expands to either debug or release
$(arch) expands to armeabi-v7a

Also, I'm using LOCAL_LDFLAGS to specify a version script so that only
entry points of our library are visible to the client code:
LOCAL_LDFLAGS += -Wl,--version-script=$(call host-path,$
(NDK_APP_PROJECT_PATH)/$(LOCAL_MODULE).map)

When building with V=1, I noticed that strip --strip-unneeded is
always called, this is in build-binary.mk line 308. I suspsect this
call to strip removes debugging symbols from my debug builds.

As part of the build process, non stripped libFoo.so is created in my
build/android-armeabi-v7a-debug/obj/local/armeabi folder. This one
contains debugging symbols
Then, this file is copied to build/android-armeabi-v7a-debug/libs/
libFoo.so and gets stripped (build-binary.mk lines 307 and 308).

Is this normal ndk-build does strip --strip-unneeded always? even when
APP_OPTIM is set to debug? I don't use NDK_DEBUG=1 but as far as I can
see, NDK_APP_DEBUGGABLE being true has no influence on strip
invocation anyway.

What's the workaround for this situation? Is redefining cmd-strip when
doing a debug build acceptable?

Regards,
Gregory

Gregory Pakosz

unread,
Apr 7, 2011, 6:30:33 AM4/7/11
to android-ndk
anyone?

thank you

Philippe Simons

unread,
Apr 7, 2011, 6:35:15 AM4/7/11
to andro...@googlegroups.com, Gregory Pakosz
yes, the library which get installed on the device is always stripped
but ndk-gdb use the version in the obj/local/arch folder

anyone?

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


Gregory Pakosz

unread,
Apr 7, 2011, 6:38:31 AM4/7/11
to android-ndk
I see.

To give more context, our Android build does stuff after having
invoked ndk-build like moving debug and release builds to other
directories. This is what gets shipped to internal teams and to
customers (customers don't get the debug builds though).

Hence I'll hack either hack in cmd-strip or go pick the debug version
in obj/local/arch.

Thank you.
Gregory

On Apr 7, 12:35 pm, Philippe Simons <simons.phili...@gmail.com> wrote:
> yes, the library which get installed on the device is always stripped
> but ndk-gdb use the version in the obj/local/arch folder
>

Philippe Simons

unread,
Apr 7, 2011, 6:41:06 AM4/7/11
to andro...@googlegroups.com, Gregory Pakosz
btw: if ndk-build script bother you,
use a standalone toolchain with a standard Makefile
Reply all
Reply to author
Forward
0 new messages