taka-no-me / android-cmake

CMake toolchain file and other scripts for the Android NDK
1.22k stars 440 forks source link

AndroidNdkGdb debugging macros broken #41

Open ngaloppo opened 9 years ago

ngaloppo commented 9 years ago

I can't seem to get the debugging macros in AndroidNdkGdb working anymore. For one, it uses LIBRARY_OUTPUT_PATH, but that isn't being defined by the toolchain anymore (or I couldn't figure out how).

Also, when hardcoding the LIBRARY_OUTPUT_PATH, I ran into linking issues for executable targets depend on libraries that I have added with android_ndk_gdb_debuggable(libFoo). The linking stage fails due to missing symbols. It's almost like the stripping phase in AndroidNdkGdb has stripped the symbols out.

ngaloppo commented 9 years ago

Possibly related to #37

ngaloppo commented 9 years ago

The problem seems to be that AndroidNdkGdb copies the original lib to obj/local, and then strips the symbols in the lib in libs/local. When making a change to a source file that is unrelated to the lib, the linking phase obviously fails because it's trying to link to a stripped version in libs/local.

Instead, the LIBRARY_OUTPUT_PATH should be set to obj/local (like ndk-build does) and then the install phase should copy / strip libs/local.

taka-no-me commented 9 years ago

Please contribute if you are able to make a fix for AndroidNdkGdb. I personally have no plans for AndroidNdkGdb in any observable feature.