Building WebRTC for Android using gnustl instead of (llvm) libc++

301 views
Skip to first unread message

Eran

unread,
Jul 28, 2015, 4:09:24 AM7/28/15
to discuss-webrtc
I managed to build WebRTC for Android using 

It seems as though by default the created libraries are linked against llvm-libc++.  Is there a way to build WebRTC linked against gnustl instead?

I need this because the Android library I am creating uses both WebRTC and boost, and the boost libraries I am using (from CrystaX) are themselves linked against gnustl.  I have seen others ask similar questions in the past, but did not see any answers.

If all else fails (including attempts to build boost on llvm-libc++), I am considering creating a wrapper around WebRTC which statically links to llvm-libc++ and exposes a C-style API to the rest of my codebase which will use gnustl.  Is this a reasonable option?

Thanks.

Dmitry Sobinov

unread,
Jul 29, 2015, 1:16:59 AM7/29/15
to discuss-webrtc, eran.gu...@gmail.com
Actually libwebrtc is linked against stlport. There are plans to move Chrome to libc++ (https://code.google.com/p/chromium/issues/detail?id=427718). And since webrtc project is a subproject for Chrome, I'm pretty sure it will be switched to libc++ too. It would be great to have comments from actual Google dev though.

The simplest way for you is probably to build your own boost version against stlport. It is not trivial but totally possible.

Regards,
Dmitry

Eran

unread,
Jul 29, 2015, 7:45:23 AM7/29/15
to discuss-webrtc, sobi...@gmail.com
Hmmm...  When I look at the verbose output for compiling, say, webrtc/base/rtc/thread.cc, I see the following output below, which only mentions llvm-libc++ and not stlport.  Again this is based on https://github.com/pristineio/webrtc-build-scripts which I believe obtains the latest version of webrtc.
I tried building the latest boost with llvm-libc++ and encountered some issues so I gave up.  Maybe I will need to push on that again.  

[1/19] /home/vagrant/mybuild/webrtc/src/third_party/android_tools/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++ -MMD -MF obj/webrtc/base/rtc_base.thread.o.d -DV8_DEPRECATION_WARNINGS -D_FILE_OFFSET_BITS=64 -DNO_TCMALLOC -DDISABLE_NACL -DCHROMIUM_BUILD -DCR_CLANG_REVISION=239765-1 -DUSE_LIBJPEG_TURBO=1 -DENABLE_WEBRTC=1 -DUSE_PROPRIETARY_CODECS -DENABLE_BROWSER_CDMS -DENABLE_CONFIGURATION_POLICY -DENABLE_NOTIFICATIONS -DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE -DDONT_EMBED_BUILD_METADATA -DENABLE_AUTOFILL_DIALOG=1 -DCLD_VERSION=1 -DENABLE_PRINTING=1 -DENABLE_BASIC_PRINTING=1 -DENABLE_SUPERVISED_USERS=1 -DVIDEO_HOLE=1 -DV8_USE_EXTERNAL_STARTUP_DATA -DMOBILE_SAFE_BROWSING -DSAFE_BROWSING_SERVICE -DWEBRTC_RESTRICT_LOGGING -DEXPAT_RELATIVE_PATH -DWEBRTC_ARCH_ARM -DWEBRTC_ARCH_ARM_V7 -DWEBRTC_DETECT_NEON -DWEBRTC_POSIX -DWEBRTC_LINUX -DWEBRTC_ANDROID -DWEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE -DFEATURE_ENABLE_SSL -DLOGGING=1 -DSSL_USE_OPENSSL -DHAVE_OPENSSL_SSL_H -DUSE_LIBPCI=1 -DUSE_OPENSSL=1 -DUSE_OPENSSL_CERTS=1 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DANDROID -D__GNU_SOURCE=1 '-DCHROME_BUILD_ID=""' -DHAVE_SYS_UIO_H -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DWTF_USE_DYNAMIC_ANNOTATIONS=1 -D_DEBUG -Igen -I../.. -I../../third_party/jsoncpp/overrides/include -I../../third_party/jsoncpp/source/include -I../../chromium/src/third_party/jsoncpp/overrides/include -I../../chromium/src/third_party/jsoncpp/source/include -I../../chromium/src/third_party/boringssl/src/include -fstack-protector --param=ssp-buffer-size=4 -Werror -fno-strict-aliasing -Wno-unused-parameter -Wno-missing-field-initializers -fvisibility=hidden -pipe -fPIC -Wno-unused-local-typedefs -Wno-unused-parameter -Wno-missing-field-initializers -Wno-strict-overflow -fno-builtin-cos -fno-builtin-sin -fno-builtin-cosf -fno-builtin-sinf -march=armv7-a -mtune=generic-armv7-a -mfpu=vfpv3-d16 -mfloat-abi=softfp -mthumb -fno-tree-sra -fno-caller-saves -Wno-psabi -mthumb-interwork -ffunction-sections -funwind-tables -g -fstack-protector -fno-short-enums -finline-limit=64 --sysroot=../../third_party/android_tools/ndk//platforms/android-16/arch-arm -isystem../../third_party/android_tools/ndk//sources/cxx-stl/llvm-libc++/libcxx/include -isystem../../third_party/android_tools/ndk//sources/cxx-stl/llvm-libc++abi/libcxxabi/include -isystem../../third_party/android_tools/ndk//sources/android/support/include -Os -g -fdata-sections -ffunction-sections -fomit-frame-pointer -funwind-tables -fno-exceptions -fno-rtti -fno-threadsafe-statics -fvisibility-inlines-hidden -Wsign-compare -Woverloaded-virtual -Wno-abi -std=gnu++11 -Wno-narrowing -Wno-literal-suffix  -c ../../webrtc/base/thread.cc -o obj/webrtc/base/rtc_base.thread.o
Reply all
Reply to author
Forward
0 new messages