Dynamic .so vs so.NUMBER libraries loading on Android/Linux

0

I was compiling gstreamer 1.4.4 from source, by using configure --host=arm-linux-androideabi flag to get the ARM .so and .a binaries. Then I used gst-android 0.10 build tools to link libraries into gstreamer_android.so. That works fine. The problem is that I don't know how to deploy the gst-rtsp-server.so on Android. All the libraries are embedded into .so files but this one doesn't depend on gstreamer_andorid.so but:

0x00000001 (NEEDED)                     Shared library: [libgstreamer-1.0.so.0]
0x00000001 (NEEDED)                     Shared library: [libgio-2.0.so.0]
0x00000001 (NEEDED)                     Shared library: [libgobject-2.0.so.0]
0x00000001 (NEEDED)                     Shared library: [libglib-2.0.so.0]
0x00000001 (NEEDED)                     Shared library: [libintl.so.8]
0x00000001 (NEEDED)                     Shared library: [libm.so]
0x00000001 (NEEDED)                     Shared library: [libc.so]
0x00000001 (NEEDED)                     Shared library: [libdl.so]
0x0000000e (SONAME)                     Library soname: [libgstrtsp-1.0.so.0]

(even if I create custom Android.mk and point LOCAL_SHARED_LIBRARIES to gstreamer_android.so)

So I don't know how to either "register" those libgstreamer-1.0.so.0 from gstreamer_android.so or append gstrtspserver.so into gstreamer_android.so. I tried later by adding into gst-android's Android.mk but then I get this error:

gst-build-armeabi/gstreamer_android.o:gstreamer_android.c:function gst_android_register_static_plugins: error: undefined reference to 'gst_plugin_rtspserver_register'

So I am cleary doing something wrong, can anyone point me to the right direction? Thanks.

android
linux
gcc
shared-libraries
asked on Stack Overflow Dec 17, 2014 by kometonja • edited Jan 5, 2015 by kometonja

2 Answers

0

First, you need to understand external library versioning. I found this document helpful.

Second, you need to realize that there may be a reason libintl.so is not named libintl.so.8 -- they are probably not ABI-compatible. Renaming (or creating a symlink) from libintl.so to libintl.so.8 will cause it to be found, but is likely to result in a runtime crash.

Last, the reason you depend on libintl.so.8 is likely that at link time you are using the wrong libintl.so (one that has SONAME of libintl.so.8 instead of libintl.so). Did you build this libintl.so yourself from gnulib? There may be a different version in the android tree.

answered on Stack Overflow Dec 25, 2014 by Employed Russian
0

Ok found a solution, It was enought to add something like this to gst-android/ndk-build/gstreamer-1.0.mk

GSTREAMER_RTSP_SERVER_LIBS := -Wl,--whole-archive /path/to/gst-rtsp-server-1.4.4/gst/rtsp-server/.libs/libgstrtspserver-1.0.a

and then append this flags to GSTREAMER_ANDROID_LIBS like this:

GSTREAMER_ANDROID_LIBS := $(GSTREAMER_RTSP_SERVER_LIBS) $(call fix-deps,-lgiognutls, -lhogweed)

If you need a custom Android.mk to build RTSP server here's one to start with

Android.mk

answered on Stack Overflow Jan 7, 2015 by kometonja

User contributions licensed under CC BY-SA 3.0