dev
dev

Reputation: 2200

NOT strip debug symbols ndk-build

Seems like ndk-build strips debug symbols when it copies .so from obj to lib folder. Is there a way to tell ndk-build not to strip the debug symbols?

Upvotes: 10

Views: 9014

Answers (3)

Sunbreak
Sunbreak

Reputation: 491

According to https://github.com/android/ndk/wiki/Changelog-r18-beta2

  • Use APP_STRIP_MODE in Application.mk of your NDK application
ifeq ($(NDK_DEBUG),1)
  APP_STRIP_MODE := none
endif
  • OR LOCAL_STRIP_MODE in Android.mk of your NDK module
ifeq ($(NDK_DEBUG),1)
  LOCAL_STRIP_MODE := none
endif

Upvotes: 1

vesperto
vesperto

Reputation: 883

Adding this to Application.mk solved it for me:

APP_STRIP_MODE := none

So, taking suggestions from @Michael and @gmetal:

ifeq ($(NDK_DEBUG),1)
  APP_STRIP_MODE := none
endif

Upvotes: 2

Michael
Michael

Reputation: 58447

In your Android.mk you could override cmd-strip to do what you want, e.g. nothing:

# Don't strip debug builds
ifeq ($(APP_OPTIM),debug)
    cmd-strip := 
endif

Upvotes: 17

Related Questions