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