LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := Mylib1
LOCAL_SRC_FILES := lib/libMylib1.a
include $(PREBUILT_STATIC_LIBRARY)
....
....
....
LOCAL_MODULE := DisplayDriver
LOCAL_SRC_FILES := \
file1.c \
file2.c \
file3.c
LOCAL_STATIC_LIBRARIES := -Wl,--start-group \
Mylib1 \
Mylib2 \
Mylib3 \
Mylib4 \
-Wl,--end-group
LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/include \
$(LOCAL_PATH)/examples
LOCAL_CFLAGS := -x c -DHAVE_STDINT -DHAVE_SETENV -DNDEBUG -c
LOCAL_LDLIBS += -llog
APP_ABI := armeabi-v7a
include $(BUILD_SHARED_LIBRARY)When I give the ndk-build V=1 I can see in the output that clearly -Wl,--start-group and -Wl,--end-group is removed from the compilation when it is going to create the shared library. So is there any other flags which is obvious and I am missing the same?On the other side if I will give it in LOCAL_LDLIBS like -Wl,--start-group $(LOCAL_STATIC_LIBRARIES) -Wl,--end-group, I am able to create the shared library but seeing the following warning:
Android NDK: WARNING:jni/Android.mk:BasicClient: non-system libraries in linker flags: jni/lib/libA.a jni/lib/libB.a jni/lib/libB.a jni/lib/libC.aAndroid NDK: This is likely to result in incorrect builds. Try using LOCAL_STATIC_LIBRARIES
Android NDK: or LOCAL_SHARED_LIBRARIES instead to list the library dependencies of the
. I am using NDK R9, ARM arch.Thanks in Advance for any inputs!!
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at http://groups.google.com/group/android-ndk.
For more options, visit https://groups.google.com/groups/opt_out.
Thanks Digit for your input, I tried using LOCAL_WHOLE_STATIC_LIBRARIES but it gives some undefined reference issue, so using the LOCAL_ALLOW_UNDEFINED_SYMBOLS := true I am able suppress them to create the .so but while loading the same it give the undefined reference error.It seems they have added this warning in NDK R9 only before with NDK 8 and all -Wl,--start-group and -Wl,--end-group was working as usual.
Thanks Digit for your input, I tried using LOCAL_WHOLE_STATIC_LIBRARIES but it gives some undefined reference issue, so using the LOCAL_ALLOW_UNDEFINED_SYMBOLS := true I am able suppress them to create the .so but while loading the same it give the undefined reference error.It seems they have added this warning in NDK R9 only before with NDK 8 and all -Wl,--start-group and -Wl,--end-group was working as usual.
The undefined symbols are coming from one of the library in LOCAL_WHOLE_STATIC_LIBRARIES. Yep, it seems like a bug, will need to look in the -fvisibility options while creating the shared library. As well as also need to see if we can club multiple static libs in to a single lib.