Using Android NDK r18b
(with clang
tool chain) and Android Studio 3.2.1
.
Relevant part of my mylib.gradle
:
task ndkBuild(type: Exec) {
commandLine "${ndkDir}/ndk-build${ndkExt}"
}
My Application.mk
:
APP_PLATFORM := android-17
APP_ABI := armeabi-v7a
# APP_OPTIM := release
APP_CFLAGS += -D_BSD_SOURCE
And relevant part of my Android.mk
:
include $(CLEAR_VARS)
LOCAL_PATH := $(BASE_PATH)
LOCAL_MODULE := mylib_jni
LOCAL_STATIC_LIBRARIES := \
lib1 \
lib2
LOCAL_WHOLE_STATIC_LIBRARIES := \
mylib_wrap \
other_wrap
include $(BUILD_SHARED_LIBRARY)
The static library mylib_jni.so
is successfully built. I then run the following command (from the NDK):
arm-linux-androideabi-readelf -a mylib_jni.so
Symbols not stripped
In the output I can see the names of all non-static methods in lib1
and lib2
(not whole libraries as can be seen above). How is this possible? How can I get some outputs from the ndk-build
command with information about why the symbols are not stripped? (I cannot find the options.txt
for my NDK build step.)