Building WebRTC with libstdc++

748 views
Skip to first unread message

Luca Carlon

unread,
Mar 29, 2016, 7:13:00 PM3/29/16
to discuss-webrtc
Hello,
is it possible to build WebRTC with gcc linking to libstdc++ instead of libc++ for Android? I need to mix WebRTC to libraries that are using libstdc++ and link fails. I noticed that my WebRTC build for linux include this symbol:

0000000000000000 T _ZN6webrtc24CreateSessionDescriptionERKSsS1_PNS_13SdpParseErrorE

while my WebRTC Android build includes this:

00000001 T _ZN6webrtc24CreateSessionDescriptionERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEES8_PNS_13SdpParseErrorE

Why this difference? When I build my application, my object file contains:

U _ZN6webrtc24CreateSessionDescriptionERKSsS1_PNS_13SdpParseErrorE

which means my application will never link properly to WebRTC. Any way to build WebRTC so that it is compatible with my application which is using libstdc++ and which is built using gcc?
Thanks!

Luca

Christoffer Jansson

unread,
Apr 1, 2016, 2:48:52 AM4/1/16
to discuss-webrtc, pb...@google.com
+Peter Boström do you know?

--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/3e5d2faf-4d21-47b7-8657-b217ce93ba57%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
/Chris

Andrew MacDonald

unread,
Apr 1, 2016, 3:21:17 AM4/1/16
to discuss-webrtc, pb...@google.com
You could try overriding `android_libcpp_library`:

but honestly, I'm betting it's easier to fix your other dependencies to link against libc++.

Luca Carlon

unread,
Apr 1, 2016, 9:59:46 PM4/1/16
to discuss-webrtc, pb...@google.com
Thank you for your help. I tried already to change that but it fails the build. However I started from there, I set all the include paths, flags, linked libstdc++, fixed many build errors, added patches etc... at the end what seems to be a proper build comes out. The symbols inside seem to confirm that it is built using libstdc++. Link to my app now succeeds and it starts. However unfortunately I get a segfault as soon as I try to create a peerconnection from the factory:

 D  [  870] CrashAnrDetector Build: samsung/kltexx/klte:5.0/LRX21T/G900FXXS1BPC3:user/release-keys

 D  [  870] CrashAnrDetector Hardware: MSM8974

 D  [  870] CrashAnrDetector Revision: 14

 D  [  870] CrashAnrDetector Bootloader: G900FXXS1BPC3

 D  [  870] CrashAnrDetector Radio: unknown

 D  [  870] CrashAnrDetector Kernel: Linux version 3.4.0-5508620 (dpi@SWDD3016) (gcc version 4.8 (GCC) ) #1 SMP PREEMPT Fri Mar 4 19:03:06 KST 2016

 D  [  870] CrashAnrDetector 

 D  [  870] CrashAnrDetector *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***

 D  [  870] CrashAnrDetector Build fingerprint: 'samsung/kltexx/klte:5.0/LRX21T/G900FXXS1BPC3:user/release-keys'

 D  [  870] CrashAnrDetector Revision: '14'

 D  [  870] CrashAnrDetector ABI: 'arm'

 D  [  870] CrashAnrDetector pid: 13726, tid: 13760, name: Thread 0x0x9ecd  >>> org.qtproject.example.qtwebrtc_customer <<<

 D  [  870] CrashAnrDetector signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x4

 D  [  870] CrashAnrDetector     r0 9e9ff654  r1 0000008e  r2 0000005c  r3 00000000

 D  [  870] CrashAnrDetector     r4 9e9ff654  r5 00000000  r6 a1646101  r7 a1646100

 D  [  870] CrashAnrDetector     r8 a0c46358  r9 a1618000  sl ffffffff  fp 09899356

 D  [  870] CrashAnrDetector     ip a0d0aa5c  sp 9e9ff650  lr a0934dd8  pc a0b0d4c4  cpsr 80070030

 D  [  870] CrashAnrDetector     d0  7543686361747441  d1  726854746e657272

 D  [  870] CrashAnrDetector     d2  65654e6649646165  d3  6f74633a3a646564

 D  [  870] CrashAnrDetector     d4  0000000000000000  d5  0000000200000004

 D  [  870] CrashAnrDetector     d6  0000000000000000  d7  ffffffff00000000

 D  [  870] CrashAnrDetector     d8  407a607ae0000000  d9  407a811aa0000000

 D  [  870] CrashAnrDetector     d10 4008000000000000  d11 4008000000000000

 D  [  870] CrashAnrDetector     d12 4008000000000000  d13 0000000000000000

 D  [  870] CrashAnrDetector     d14 0000000000000000  d15 0000000000000000

 D  [  870] CrashAnrDetector     d16 7663747262657728  d17 69676e656563696f

 D  [  870] CrashAnrDetector     d18 30313a63632e656e  d19 626577203a293631

 D  [  870] CrashAnrDetector     d20 657243203a637472  d21 6674616c50657461

 D  [  870] CrashAnrDetector     d22 69636570536d726f  d23 63656a624f636966

 D  [  870] CrashAnrDetector     d24 0000000000000000  d25 0000000000000000

 D  [  870] CrashAnrDetector     d26 0001000100010001  d27 0002000200010001

 D  [  870] CrashAnrDetector     d28 0080008000800080  d29 0080008000800080

 D  [  870] CrashAnrDetector     d30 0800080008000800  d31 0800080008000800

 D  [  870] CrashAnrDetector     scr 60000011

 D  [  870] CrashAnrDetector 

 D  [  870] CrashAnrDetector backtrace:

 D  [  870] CrashAnrDetector     #00 pc 0021e4c4  /data/app/org.qtproject.example.qtwebrtc_customer-2/lib/arm/libqtwebrtc_customer.so

 D  [  870] CrashAnrDetector     #01 pc 0012e879  /data/app/org.qtproject.example.qtwebrtc_customer-2/lib/arm/libqtwebrtc_customer.so

 D  [  870] CrashAnrDetector     #02 pc 0012e413  /data/app/org.qtproject.example.qtwebrtc_customer-2/lib/arm/libqtwebrtc_customer.so

 D  [  870] CrashAnrDetector     #03 pc 0012e569  /data/app/org.qtproject.example.qtwebrtc_customer-2/lib/arm/libqtwebrtc_customer.so

 D  [  870] CrashAnrDetector     #04 pc 000fbfb1  /data/app/org.qtproject.example.qtwebrtc_customer-2/lib/arm/libqtwebrtc_customer.so

 D  [  870] CrashAnrDetector     #05 pc 0015969f  /data/app/org.qtproject.example.qtwebrtc_customer-2/lib/arm/libqtwebrtc_customer.so

 D  [  870] CrashAnrDetector     #06 pc 00159911  /data/app/org.qtproject.example.qtwebrtc_customer-2/lib/arm/libqtwebrtc_customer.so

 D  [  870] CrashAnrDetector     #07 pc 0014ab89  /data/app/org.qtproject.example.qtwebrtc_customer-2/lib/arm/libqtwebrtc_customer.so

 D  [  870] CrashAnrDetector     #08 pc 0009fd4d  /data/app/org.qtproject.example.qtwebrtc_customer-2/lib/arm/libqtwebrtc_customer.so

 D  [  870] CrashAnrDetector     #09 pc 0005ecf5  /data/app/org.qtproject.example.qtwebrtc_customer-2/lib/arm/libqtwebrtc_customer.so

 D  [  870] CrashAnrDetector     #10 pc 00060097  /data/app/org.qtproject.example.qtwebrtc_customer-2/lib/arm/libqtwebrtc_customer.so

 D  [  870] CrashAnrDetector     #11 pc 0005ee03  /data/app/org.qtproject.example.qtwebrtc_customer-2/lib/arm/libqtwebrtc_customer.so

 D  [  870] CrashAnrDetector     #12 pc 0005f275  /data/app/org.qtproject.example.qtwebrtc_customer-2/lib/arm/libqtwebrtc_customer.so

 D  [  870] CrashAnrDetector     #13 pc 000137b3  /system/lib/libc.so (__pthread_start(void*)+30)

 D  [  870] CrashAnrDetector     #14 pc 00011893  /system/lib/libc.so (__start_thread+6)

 D  [  870] CrashAnrDetector 

 D  [  870] CrashAnrDetector stack:

 D  [  870] CrashAnrDetector          9e9ff610  a16091c8  

 D  [  870] CrashAnrDetector          9e9ff614  00000000  

 D  [  870] CrashAnrDetector          9e9ff618  9e9ff62c  [stack:13760]

 D  [  870] CrashAnrDetector          9e9ff61c  a0935b3c  /data/app/org.qtproject.example.qtwebrtc_customer-2/lib/arm/libqtwebrtc_customer.so (std::string::_Rep::_M_dispose(std::allocator<char> const&)+132)

 D  [  870] CrashAnrDetector          9e9ff620  9e9ff63c  [stack:13760]

 D  [  870] CrashAnrDetector          9e9ff624  9e9ff654  [stack:13760]

 D  [  870] CrashAnrDetector          9e9ff628  9e9ff64c  [stack:13760]

 D  [  870] CrashAnrDetector          9e9ff62c  a0934e40  /data/app/org.qtproject.example.qtwebrtc_customer-2/lib/arm/libqtwebrtc_customer.so (std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()+84)

 D  [  870] CrashAnrDetector          9e9ff630  a0d10280  /data/app/org.qtproject.example.qtwebrtc_customer-2/lib/arm/libqtwebrtc_customer.so

 D  [  870] CrashAnrDetector          9e9ff634  9e9ff654  [stack:13760]

 D  [  870] CrashAnrDetector          9e9ff638  00000000  

 D  [  870] CrashAnrDetector          9e9ff63c  a1646101  

 D  [  870] CrashAnrDetector          9e9ff640  a1646100  

 D  [  870] CrashAnrDetector          9e9ff644  9e9ff654  [stack:13760]

 D  [  870] CrashAnrDetector          9e9ff648  09899356  

 D  [  870] CrashAnrDetector          9e9ff6


Too few info probably but if you have any advice please let me know.

Thank you for your help.


Luca

py z

unread,
Jun 19, 2019, 10:44:01 PM6/19/19
to discuss-webrtc
hello,

build with libstdc++ is ok?how to do it?

Thank you。

在 2016年3月30日星期三 UTC+8上午7:13:00,Luca Carlon写道:

abhinay kartik Reddyreddy

unread,
Mar 3, 2020, 4:14:04 AM3/3/20
to discuss-webrtc
Any updates on this? Has anyone succeeded building libwebrtc with libstdc++??
Reply all
Reply to author
Forward
0 new messages