How to rebuilt libgstreamer_android.so with libc++ instead of gnustl?
Hi there!
I'm building a simple app basing on GStreamer's Android tutorial 2. I was trying to link tutorial-2.so with a static gst plugin which is built with libc++.
Building with ndk-build was fine. However, at runtime when the pipeline is set to be playing, I've encountered an error:
APP_ABI = armeabi-v7a APP_STL = c++_static
02-25 10:02:03.316 2391 2411 F libc : /usr/local/google/buildbot/src/android/ndk-release-r17/external/libcxx/../../external/libcxxabi/src/abort_message.cpp:73: abort_message: assertion "terminating with uncaught exception of type std::runtime_error: " failed
02-25 10:02:03.316 2391 2411 F libc : Fatal signal 6 (SIGABRT), code -6 in tid 2411 (Thread-3)
02-25 10:02:03.317 488 488 W : debuggerd: handling request: pid=2391 uid=10950 gid=10950 tid=2411
02-25 10:02:03.380 2412 2412 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
02-25 10:02:03.380 2412 2412 F DEBUG : Build fingerprint: 'lge/h1_global_com/h1:7.0/NRD90U/17100183200f0:user/release-keys'
02-25 10:02:03.380 2412 2412 F DEBUG : Revision: '13'
02-25 10:02:03.380 2412 2412 F DEBUG : ABI: 'arm'
02-25 10:02:03.380 2412 2412 F DEBUG : pid: 2391, tid: 2411, name: Thread-3 >>> org.freedesktop.gstreamer.tutorials.tutorial_2 <<<
02-25 10:02:03.380 2412 2412 F DEBUG : signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
02-25 10:02:03.382 2412 2412 F DEBUG : Abort message: '/usr/local/google/buildbot/src/android/ndk-release-r17/external/libcxx/../../external/libcxxabi/src/abort_message.cpp:73: abort_message: assertion "terminating with uncaught exception of type std::runtime_error: " failed'
02-25 10:02:03.382 2412 2412 F DEBUG : r0 00000000 r1 0000096b r2 00000006 r3 00000008
02-25 10:02:03.382 2412 2412 F DEBUG : r4 eb87f978 r5 00000006 r6 eb87f920 r7 0000010c
02-25 10:02:03.382 2412 2412 F DEBUG : r8 d3c791d5 r9 00000030 sl 0000000a fp eb87ee68
02-25 10:02:03.382 2412 2412 F DEBUG : ip 00000002 sp eb87e948 lr f4213b97 pc f4216418 cpsr 280f0010
02-25 10:02:03.390 2412 2412 F DEBUG :
02-25 10:02:03.390 2412 2412 F DEBUG : backtrace:
02-25 10:02:03.390 2412 2412 F DEBUG : #00 pc 0004a418 /system/lib/libc.so (tgkill+12)
02-25 10:02:03.390 2412 2412 F DEBUG : #01 pc 00047b93 /system/lib/libc.so (pthread_kill+34)
02-25 10:02:03.390 2412 2412 F DEBUG : #02 pc 0001d88d /system/lib/libc.so (raise+10)
02-25 10:02:03.390 2412 2412 F DEBUG : #03 pc 00019385 /system/lib/libc.so (__libc_android_abort+34)
02-25 10:02:03.390 2412 2412 F DEBUG : #04 pc 000173f8 /system/lib/libc.so (abort+4)
02-25 10:02:03.390 2412 2412 F DEBUG : #05 pc 0001b887 /system/lib/libc.so (__libc_fatal+22)
02-25 10:02:03.390 2412 2412 F DEBUG : #06 pc 0001957f /system/lib/libc.so (__assert2+18)
02-25 10:02:03.390 2412 2412 F DEBUG : #07 pc 0027d355 /data/app/org.freedesktop.gstreamer.tutorials.tutorial_2-1/lib/arm/libtutorial-2.so
02-25 10:02:03.390 2412 2412 F DEBUG : #08 pc 0027d479 /data/app/org.freedesktop.gstreamer.tutorials.tutorial_2-1/lib/arm/libtutorial-2.so
02-25 10:02:03.390 2412 2412 F DEBUG : #09 pc 0027b425 /data/app/org.freedesktop.gstreamer.tutorials.tutorial_2-1/lib/arm/libtutorial-2.so
02-25 10:02:03.390 2412 2412 F DEBUG : #10 pc 0027adbd /data/app/org.freedesktop.gstreamer.tutorials.tutorial_2-1/lib/arm/libtutorial-2.so
02-25 10:02:03.390 2412 2412 F DEBUG : #11 pc 0027ad8b /data/app/org.freedesktop.gstreamer.tutorials.tutorial_2-1/lib/arm/libtutorial-2.so (__cxa_throw+86)
02-25 10:02:03.390 2412 2412 F DEBUG : #12 pc 000f1d58 /data/app/org.freedesktop.gstreamer.tutorials.tutorial_2-1/lib/arm/libtutorial-2.so (_ZN5L18FatalMessageLoggerD1Ev+144)
02-25 10:02:03.390 2412 2412 F DEBUG : #13 pc 000f6cdc /data/app/org.freedesktop.gstreamer.tutorials.tutorial_2-1/lib/arm/libtutorial-2.so (_ZN5L5InputC1ERKNSt6__ndk112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEPb+472)
02-25 10:02:03.390 2412 2412 F DEBUG : #14 pc 000b63e4 /data/app/org.freedesktop.gstreamer.tutorials.tutorial_2-1/lib/arm/libtutorial-2.so
02-25 10:02:03.390 2412 2412 F DEBUG : #15 pc 00cd6ed5 /data/app/org.freedesktop.gstreamer.tutorials.tutorial_2-1/lib/arm/libgstreamer_android.so (gst_element_change_state+40)
02-25 10:02:03.390 2412 2412 F DEBUG : #16 pc 00cd734f /data/app/org.freedesktop.gstreamer.tutorials.tutorial_2-1/lib/arm/libgstreamer_android.so
02-25 10:02:03.390 2412 2412 F DEBUG : #17 pc 00cbf0bb /data/app/org.freedesktop.gstreamer.tutorials.tutorial_2-1/lib/arm/libgstreamer_android.so
02-25 10:02:03.390 2412 2412 F DEBUG : #18 pc 00cf223f /data/app/org.freedesktop.gstreamer.tutorials.tutorial_2-1/lib/arm/libgstreamer_android.so
02-25 10:02:03.390 2412 2412 F DEBUG : #19 pc 00cd6ed5 /data/app/org.freedesktop.gstreamer.tutorials.tutorial_2-1/lib/arm/libgstreamer_android.so (gst_element_change_state+40)
02-25 10:02:03.390 2412 2412 F DEBUG : #20 pc 00cd734f /data/app/org.freedesktop.gstreamer.tutorials.tutorial_2-1/lib/arm/libgstreamer_android.so
02-25 10:02:03.390 2412 2412 F DEBUG : #21 pc 000b25ab /data/app/org.freedesktop.gstreamer.tutorials.tutorial_2-1/lib/arm/libtutorial-2.so
02-25 10:02:03.390 2412 2412 F DEBUG : #22 pc 002fe307 /data/app/org.freedesktop.gstreamer.tutorials.tutorial_2-1/oat/arm/base.odex (offset 0x228000)
APP_ABI = armeabi-v7a APP_STL = c++_shared
02-26 08:38:26.461 5875 5902 I GStreamer: Gst initialized. Restoring state, playing:false
02-26 08:38:26.462 5875 5902 F libc : Fatal signal 11 (SIGSEGV), code 1, fault addr 0x23 in tid 5902 (Thread-3)
02-26 08:38:26.462 488 488 W : debuggerd: handling request: pid=5875 uid=10950 gid=10950 tid=5902
02-26 08:38:26.527 5903 5903 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
02-26 08:38:26.527 5903 5903 F DEBUG : Build fingerprint: 'lge/h1_global_com/h1:7.0/NRD90U/17100183200f0:user/release-keys'
02-26 08:38:26.527 5903 5903 F DEBUG : Revision: '13'
02-26 08:38:26.527 5903 5903 F DEBUG : ABI: 'arm'
02-26 08:38:26.527 5903 5903 F DEBUG : pid: 5875, tid: 5902, name: Thread-3 >>> org.freedesktop.gstreamer.tutorials.tutorial_2 <<<
02-26 08:38:26.527 5903 5903 F DEBUG : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x23
02-26 08:38:26.527 5903 5903 F DEBUG : r0 eb7febe8 r1 ffffffff r2 00000018 r3 eb7febb8
02-26 08:38:26.527 5903 5903 F DEBUG : r4 eb7feafc r5 eb7feba0 r6 437f6504 r7 eb7feaf0
02-26 08:38:26.527 5903 5903 F DEBUG : r8 eb7febe8 r9 e6286d68 sl 00000001 fp 00000001
02-26 08:38:26.527 5903 5903 F DEBUG : ip 00000000 sp eb7feae8 lr f19df24b pc f19df4aa cpsr 480f0030
02-26 08:38:26.530 5903 5903 F DEBUG :
02-26 08:38:26.530 5903 5903 F DEBUG : backtrace:
02-26 08:38:26.530 5903 5903 F DEBUG : #00 pc 000824aa /data/app/org.freedesktop.gstreamer.tutorials.tutorial_2-1/lib/arm/libc++_shared.so
02-26 08:38:26.530 5903 5903 F DEBUG : #01 pc 00082247 /data/app/org.freedesktop.gstreamer.tutorials.tutorial_2-1/lib/arm/libc++_shared.so
02-26 08:38:26.530 5903 5903 F DEBUG : #02 pc 0007e877 /data/app/org.freedesktop.gstreamer.tutorials.tutorial_2-1/lib/arm/libc++_shared.so
02-26 08:38:26.530 5903 5903 F DEBUG : #03 pc 0007e6d3 /data/app/org.freedesktop.gstreamer.tutorials.tutorial_2-1/lib/arm/libc++_shared.so (__gxx_personality_v0+114)
02-26 08:38:26.530 5903 5903 F DEBUG : #04 pc 00ece6e4 /data/app/org.freedesktop.gstreamer.tutorials.tutorial_2-1/lib/arm/libgstreamer_android.so (__gnu_Unwind_RaiseException+108)
02-26 08:38:26.530 5903 5903 F DEBUG : #05 pc 00ecf228 /data/app/org.freedesktop.gstreamer.tutorials.tutorial_2-1/lib/arm/libgstreamer_android.so (_Unwind_RaiseException+20)
Later I found out that most libraries in gstreamer-android were built using gnustl, which supports less functionalities than libc++, and also cause a conflict with my gst plugin which was built upon libc++
I'd like to ask if there's any way I could rebuilt gstream-android upon libc++? I've been struggling with Cerbero configurations but haven't found any way through.
Thanks a lot!