Building webrtc for Linux ARM

6,398 views
Skip to first unread message

Edouard Lafargue

unread,
May 12, 2014, 11:00:50 AM5/12/14
to discuss...@googlegroups.com
I have been trying to build webrtc for a Beaglebone Black target, with no success so far: it looks like some parts of the build system assume that an ARM target automatically means that we are doing an Android build - namely, openmax_dl.

My build system is an Ubuntu machine that I am using for cross compilation.

What I did so far, was install all dependencies for arm crossbuilding (install-build-deps.sh --arm), then install the arm sysroot with ./build/linux/install-arm-sysroot.py

Then I have defined the following settings:

export GYP_DEFINES="target_arch=arm arm_float_abi=hard"
export CC=arm-linux-gnueabihf-gcc
export CXX=arm-linux-gnueabihf-g++
export AR=arm-linux-gnueabihf-ar
export CC_host=gcc
export CXX_host=g++

gclient sync works fine, but as soon as I run gclient runhooks, gyp complains about a missing android NDK (gyp: undefined variable android_nkd_root in trunk/third_party/openmap_dl/dl/dl.gyp)

-> Is there another configuration to tweak to indicate that the intended target is ARM Linux, but not Android ?

Any help very much appreciated!

Ed

Edouard Lafargue

unread,
May 13, 2014, 12:58:37 PM5/13/14
to discuss...@googlegroups.com

  No replies? Is there any extra info I could add that can help? The goal is to compile webrtc for a Linux (Ubuntu) ARM target... 

Thanks,

Ed

tsel...@gmail.com

unread,
May 16, 2014, 4:03:42 AM5/16/14
to discuss...@googlegroups.com

Hello Ed!

I've been struggling with similar issues for many-many days and I'm getting quite disappointed... my target is iMX53 (ARMv7).

I have a checkout of 'trunk' dated on 2014-Apr-18 which I've managed to compile both to x86 and ARMv7. This version doesn't have that "gyp: undefined variable android_nkd_root in trunk/third_party/openmap_dl/dl/dl.gyp" issue yet. I wrote my test applications using the native API in C/C++. App A calls app B, app A's microphone signals are transmitted to app B which play it back. Works like a charm - on x86.

However, I could successfully compile to many ARM versions (ARMv6, ARMv7 hfp, ARMv7 sfp, with and without NEON) including the dependencies (there are a lot!), neither of the ARM versions were capable of performing the same task as the x86 version. More precisely, my ARM versions keep on freezing. Using gdb/valgrind to locate the root of the issue I only know that it corrupts the stack for some reason; the source of SIGSEGV is not constant, sometimes Opus, sometimes NetEQ, sometimes something completely different. I'm really not in the mood to debug such a big source code. By the way, I believe it's rather a configuration/compilation issue, but I was still unable to figure it out.

I can also imagine that this project just supports Android and x86 targets and this specific "ARM Linux" is not really maintained, therefore the reasons for the runtime issues. The codebase appears to be under heavy development.

I also would be very happy to get some help. At least a WebRTC developer may tell us an exact version number/stable release we can rely on. Or a WebRTC developer may share the details with us how to correctly compile for Linux (not Android!) ARM target.

Regards,

Tamas


Pau Ceano

unread,
May 16, 2014, 7:33:19 AM5/16/14
to discuss...@googlegroups.com
Hi,

I am a bit busy today to do a full tutorial but these are the keys to do it with RPi:

export GYP_DEFINES="target_arch=arm arm_version=6 arm_neon=0 arm_float_abi=hard"

export CC=arm-linux-gnueabihf-gcc
export CXX=arm-linux-gnueabihf-g++
export AR=arm-linux-gnueabihf-ar
export CC_host=gcc
export CXX_host=g++

RPi uses armversin=6 and no neon. Please check if is some version with BB.

This are small changes in gyps (I use crosscompiling and I have webrtc for RPI in ~/webrtcpi):

Index: talk/libjingle.gyp
===================================================================
--- talk/libjingle.gyp    (revision 5965)
+++ talk/libjingle.gyp    (working copy)
@@ -1,4 +1,4 @@
-#
+
 # libjingle
 # Copyright 2012, Google Inc.
 #
@@ -32,7 +32,7 @@
      'conditions': [
        ['sysroot!=""', {
          'variables': {
-           'pkg-config': '../../../build/linux/pkg-config-wrapper "<(sysroot)" "<(target_arch)"',
+           'pkg-config': '~/webrtcrpi/trunk/build/linux/pkg-config-wrapper "<(sysroot)" "<(target_arch)"',
          },
        }, {
          'variables': {

________ running 'svn diff' in '/home/pau/webrtcrpi/trunk/build'
Index: linux/libgcrypt-config-wrapper
===================================================================
--- linux/libgcrypt-config-wrapper    (revision 260462)
+++ linux/libgcrypt-config-wrapper    (working copy)
@@ -14,4 +14,6 @@
 
 config_path=$sysroot/usr/bin/libgcrypt-config
 set -e
+
+
 echo `$config_path "$@" | sed -e 's|/|'$sysroot'/|'`
Index: common.gypi
===================================================================
--- common.gypi    (revision 260462)
+++ common.gypi    (working copy)
@@ -306,7 +306,8 @@
       'arm_neon_optional%': 0,
 
       # The system libdir used for this ABI.
-      'system_libdir%': 'lib',
+ #     'system_libdir%': 'lib',
+       'system_libdir%': '~/webrtcrpi/trunk/arm-sysroot/lib',
 
       # Use libjpeg-turbo as the JPEG codec used by Chromium.
       'use_libjpeg_turbo%': 1,

please do not hesitate to ask anything. I do not have an organized documentation, but I guess I can help.

best,

Pau

Pau Ceano

unread,
May 16, 2014, 7:36:02 AM5/16/14
to discuss...@googlegroups.com
And to get rid of NDK:
in trunk/build/common.gypi: 'use_openssl%': 1,

Edouard Lafargue

unread,
May 17, 2014, 12:07:22 PM5/17/14
to discuss...@googlegroups.com
  Thanks for your replies ! I will restart a build and report results. We'll get there.

   I'm surprised there is so little literature on using embedded devices to stream audio/video using WebRTC: there are tons of applications, from web phones to intercom systems, etc...

Ed

On Monday, May 12, 2014 8:00:50 AM UTC-7, Edouard Lafargue wrote:

Edouard Lafargue

unread,
May 17, 2014, 12:29:20 PM5/17/14
to discuss...@googlegroups.com
   Hmm, looks like the below is not enough, on a current build tree, runhooks still fails at openmap_dl/dl/dl/gyp with android_ndk_root not defined...

    Any idea ?

Ed

Edouard Lafargue

unread,
May 17, 2014, 1:14:35 PM5/17/14
to discuss...@googlegroups.com
   OK, last update unless I find a solution myself: it really looks like the core of the problem for Linux ARM is that openmax does not compile for Linux ARM, because it relies on the Android NDK. It is possible to exclude openmax from the build altogether (comment it out in all.gyp), so that compilation can be launched.

   Unfortunately, compilation fails at:

../../webrtc/common_audio/signal_processing/spl_init.c:107: error: undefined reference to 'WebRtc_GetCPUFeaturesARM'

    -> webrtc needs WebRtc_GetCPUFeaturesARM which apparently is not available unless we compile for Android, if I understand well? Have any of you gotten to that stage?

   I agree with one of the previous posters: it would be super helpful to understand from the webrtc developers whether Linux ARM is supposed to be a supported target or not.

Ed


On Monday, May 12, 2014 8:00:50 AM UTC-7, Edouard Lafargue wrote:

Edouard Lafargue

unread,
May 17, 2014, 10:58:31 PM5/17/14
to discuss...@googlegroups.com
  I really don't like to leave a problem open: after creating a stub for WebRtc_GetCPUFeaturesARM (I know my target, it's straightforward to return a hardcoded value), then everything compiles - at least peerconnection_client/server compile, which is what I need. Now I am moving forward to making sure my headless peerconnection_client fork works on the latest webrtc codebase, more fun in perspective :)

   In other words, It does look like at the moment webrtc's codebase does not support the linux/ARMv7 target platform out of the box.

Hoping this will help others!

Ed

tsel...@gmail.com

unread,
May 18, 2014, 2:07:02 AM5/18/14
to discuss...@googlegroups.com
Nice progress. I used to compile the version from ~Apr-18 and it also had an issue with the mentioned function. I also fixed it the similar way you did it now.

As I stated above, I have runtime problems with WebRTC on ARM. I'm curious whether your app or even the test apps will work correctly on your ARM device. My app crashes when SetRemoteDescription or SetLocalDescription (I can't recall it now exactly) is called. Perhaps there's an issue with that <scoped_refptr> and similar stuff since when the crash occurs the stack is usually corrupted.

Pau Ceano

unread,
May 18, 2014, 5:22:41 AM5/18/14
to discuss...@googlegroups.com
It is interesting, the problem with openmax does not apear with arm_version=6 (RPi). Probably there is a bug for ARMv7.

With ARMv6 everything compiles quite smoothly (actually other problems appeared but possible to solve)


On Sun, May 18, 2014 at 8:07 AM, <tsel...@gmail.com> wrote:
Nice progress. I used to compile the version from ~Apr-18 and it also had an issue with the mentioned function. I also fixed it the similar way you did it now.

As I stated above, I have runtime problems with WebRTC on ARM. I'm curious whether your app or even the test apps will work correctly on your ARM device. My app crashes when SetRemoteDescription or SetLocalDescription (I can't recall it now exactly) is called. Perhaps there's an issue with that <scoped_refptr> and similar stuff since when the crash occurs the stack is usually corrupted.

--

---
You received this message because you are subscribed to a topic in the Google Groups "discuss-webrtc" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/discuss-webrtc/yzuk8wATMU8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to discuss-webrt...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

tsel...@gmail.com

unread,
May 19, 2014, 2:29:30 AM5/19/14
to discuss...@googlegroups.com

Guys, the big deal is not to compile WebRTC, but to get it running on ARMv6/ARMv7 :)

Would you be so kind and share with me the results of execution? WebRTC on my machine crashes when reaches SetLocalDescription or SetRemoteDescription call and the stack is totally corrupted. The location of crash is also not constant. Very suspicious...


Pau Ceano

unread,
May 19, 2014, 5:29:28 AM5/19/14
to discuss...@googlegroups.com
On ArmV6 (RPi) I have it running for a while without big issues. And I don't remember big problems, once everything was compile, except the fact that everything tended to block using Vp8, but because lack of processor. Now I do all tests with only data channel but SetLocalDescription or SetRemoteDescription are of course called the same.



On Mon, May 19, 2014 at 8:29 AM, <tsel...@gmail.com> wrote:

Guys, the big deal is not to compile WebRTC, but to get it running on ARMv6/ARMv7 :)

Would you be so kind and share with me the results of execution? WebRTC on my machine crashes when reaches SetLocalDescription or SetRemoteDescription call and the stack is totally corrupted. The location of crash is also not constant. Very suspicious...


dhruv jain

unread,
May 19, 2014, 7:56:25 AM5/19/14
to discuss...@googlegroups.com
Dear sir,

I am trying to build Webrtc on my linux machine using its official guide.gclient sync works fine and trunk folder us created but gclient runhooks --force gave error:
 Command /usr/bin/python trunk/webrtc/build/gyp_webrtc -Dextra_gyp_flag=0 returned non-zero exit status 1.How to resolve it?

Thanks.

On Monday, May 12, 2014 8:30:50 PM UTC+5:30, Edouard Lafargue wrote:
I have been trying to build webrtc for a Beaglebone Black target, with no Command /usr/bin/python trunk/webrtc/build/gyp_webrtc -Dextra_gyp_flag=0 returned non-zero exit status success so far: it looks like some parts of the build system assume that an ARM target automatically means that we are doing an Android build - namely, openmax_dl.

Kamil Ciecierski

unread,
May 29, 2014, 3:42:14 PM5/29/14
to discuss...@googlegroups.com
Hi everyone,
Im also trying to cross compile webrtc for arm7 architecture. These are steps I did (on Ubuntu 13.10):

1. Instaling prerequistences for Webrtc (depot tools etc)

2. Running install-build-deps.sh --arm from chromium cross compiling tutorial

3. Exporting mentioned by you env variables:

export GYP_DEFINES="target_arch=arm arm_version=6 arm_neon=0 arm_float_abi=hard"
export CC=arm-linux-gnueabihf-gcc
export CXX=arm-linux-gnueabihf-g++
export AR=arm-linux-gnueabihf-ar
export CC_host=gcc
export CXX_host=g++

4. Setting up the stable version of webrtc:
gclient config --name=trunk http://webrtc.googlecode.com/svn/stable

5. gclient sync --force

6. Fixing bug related to pkg-config-wrapper in libgingle.gyp

7. Then I'm trying command ninja out/Debug  in trunk and gets compilation errors like: 

"third_party/gflags/gen/posix/include/gflags/gflags.h:82:18: fatal error: No such file or directory"
 
Could somebody who cross compiled webrtc to arm  tell me if I missing some step?   

tsel...@gmail.com

unread,
May 30, 2014, 1:58:49 AM5/30/14
to discuss...@googlegroups.com

If I can recall it correctly then I also used to attempt to compile the stable branch, with no success. You'd better avoid using trunk, since I believe it's simply broken and outdated.

Many people would appreciate if there were (at least) partially stable and (fully) compilable releases of WebRTC...


Kamil Ciecierski

unread,
May 30, 2014, 4:52:50 AM5/30/14
to discuss...@googlegroups.com
Thanks for reply. The trunk is quite stable but only for x86 architecture as the arm linux'es are not suported officially... It seems that this is not working for current version. Pau Ceano, maybe you can provide the revision number of your webrtc version? 

Pau Ceano

unread,
May 30, 2014, 6:15:12 AM5/30/14
to discuss...@googlegroups.com
Hi,


I see you talk about Arm7 and in GYP_DEFINES you define 6. Also check neon usage. In reality I haven't compiled for Arm7 only 6, previous mails explain the problems and how someone solved it.
My experience with trunk is good so far.
I would say you need to run gclient runhooks to execute gyp files, sync only downloads files as I understand.
Also you need to define a sysroot of your target system and specify it in common.gypi:
'system_libdir%': '~/webrtcrpi/trunk/arm-sysroot/lib'
where ~/webrtcrpi/trunk/arm-sysroot is the sysroot of your target system.
check previous mails.


Pau Ceano

unread,
May 30, 2014, 6:23:12 AM5/30/14
to discuss...@googlegroups.com
I guess the revision is the one you find in DEPS:

"chromium_revision": "260462"

To be honest, up to now, I have synched every once in a while withot worring very much with no problems. I am still not sure if the number I gave you is the webrtc revision (please correct me if necessary).

As said it is ok for me with RPi (Armv6) Armv7 has other speciallists around ;-)


On Fri, May 30, 2014 at 10:52 AM, Kamil Ciecierski <kami...@gmail.com> wrote:

Kamil Ciecierski

unread,
May 30, 2014, 6:32:56 AM5/30/14
to discuss...@googlegroups.com
Hi,
many thanks for answer. I copied GYP_DEFINES step from your previous post, I used arm version 7 ;). I skipped the step 'system_libdir%': '~/webrtcrpi/trunk/arm-sysroot/lib' because I was getting some another errors. However I'll apply your tips today and investigate this further. And will use gclient runhooks of course... I let you know about the progress.

KC

Kamil Ciecierski

unread,
Jun 2, 2014, 3:10:45 PM6/2/14
to discuss...@googlegroups.com
Ok, small update from me in armv7 version compiling. 
I resolved the missing android_ndk_root by pulling android_tools from web and replacing this variable to /android_tools/ndk folder. 
Then I needed to get arm-sysroot from stable version of webrtc to trunk version - it was missing there. 
After this, when the gclient runhooks finished I started ninja -C out/Debug command. 
It failed many times and I had to add in out/Debug/build.ninja file include -I/usr/arm-linux-gnueabihf/include/c++/4.8.1 to rule cxx. 
I also needed to fix some references in arm-linux-gnueabihf (I was so desperated on this step...) 
Finally I stucked on the problem for rule link: 
/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/libstdc++.so: error: undefined reference to 'clock_gettime', version 'GLIBC_2.17'

I found some solution related to adding -lrt next to libs, however this is not solving the error.

Kamil Ciecierski

tsel...@gmail.com

unread,
Jun 3, 2014, 1:42:10 AM6/3/14
to discuss...@googlegroups.com

clock_gettime(...) is implemented in librt.so*, that's true, so in principle the solution would be just simply adding "-lrt" to linker flags and it's done.

Unfortunately the situation is not that simple, I've also followed the similar way for the first attempt like you. When you downloaded the precompiled ARM sysroot from Chromium build you did it in order to save on manually recompiling the huge amount of dependencies (libraries (*.so)) needed by WebRTC (glib, xorg packages etc.). The problem is that your cross compiler is not the exact same as the one which was used to compile Chromium sysroot. Apparently the libc version also differs in your toolchain and in the Chromium sysroot. So now you have a couple of precompiled binaries which tie to glibc-x.y, while your compiler attempts to tie to glibc-x.z. There are runtime linking dependencies in Chromium libs as well (like clock_gettime), your compiler wants to satisfy them by linking to your libs and it causes problems.

In many cases using this precompiled Chromium sysroot can work, but it has a lot of pitfalls and you have to be quite prepared developer to overcome these.

I've finally chosen to compile all the dependencies. It took ~1.5 days to collect the packages, find the correct configuration options, compile etc but the issues described by you have gone away.



Kamil Ciecierski

unread,
Jun 3, 2014, 3:23:10 AM6/3/14
to discuss...@googlegroups.com
Ok, I see the problem now. Is it worth to do all this stuff? I mean that you mentioned that you compiled this finally but it isn't working quite well?


Pau Ceano

unread,
Jun 3, 2014, 4:25:28 AM6/3/14
to discuss...@googlegroups.com
What I normally do is to copy the folders from the target device (RPi in my case) to the sysroot folder in the compiler machine. This are the notes I wrote to myself:

Copy from Raspberry to ~/webrtcrpi/trunk/arm-sysroot folders:

lib/

include/
usr/bin/
usr/lib/
usr/include/
usr/local/lib/
usr/local/include
and probably all others (not sure)


Where ~/webrtcrpi is the folder I use to crosscompile in the copiler machine.

This way I only have to crosscompile webrtc.


alexandre benoit

unread,
Sep 4, 2014, 11:16:20 AM9/4/14
to discuss...@googlegroups.com
Hi, i am currently on the same problem.
It would be Nice To make an up To date guide on the topic.

Here is mine but unfortunately i have a build problem at the final step ninja build...

If people know the solution and/or want To complete the proposed procedure, let s share!

From host Ubuntu 14.04 64bit :
# basic preliminary setup... supposing that no variables discussed later have already been exported
mkdir WebRTC
cd WebRTC
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
export PATH=>location of depot_tools>:"$PATH"
export JAVA_HOME=<location of Java SE 6 - JDK>
gclient config http://webrtc.googlecode.com/svn/trunk
gclient sync --force

#prepare cross compile for Odroid U3 (armv7a based)
cd trunk
./build/install-build-deps.sh --arm
./build/linux/install-arm-sysroot.py
./build/install-build-deps-android.sh /* it seems that it is required even if willing to compile for target linux on arm platform. I did it since ndk is asked somewhere later. If this step is required, can it be inserted into official guide ?*/
export GYP_CROSSCOMPILE=1 /* seems to be no more required since automatic declaration is performed later on. Update official doc if required */
export GYP_DEFINES="OS=linux target_arch=arm arm_version=7 arm_use_neon=1 arm_fpu=vfpv3-d16 arm_float_abi=softfp"
export CC=arm-linux-gnueabihf-gcc
export CXX=arm-linux-gnueabihf-g++
export AR=arm-linux-gnueabihf-ar
export CC_host=gcc
export CXX_host=g++
cd ..
gclient runhooks --force
cd trunk/

/* NOTE 1 : the install process automatically installs/removes/forgets some packages so that you have to ensure the following packages are installed during the different attempts :
sudo apt-get install g++-arm-linux-gnueabihf
sudo apt-get install gcc-arm-linux-gnueabihf
*/

/* ERROR 1 , Solved
The following error appears first :
=> gyp: Undefined variable android_ndk_root in chromium/src/third_party/openmax_dl/dl/dl.gyp
I googled and found the following instructions to add at this step :
=>creating file trunk/.gclient with content :
solutions = [
{ "name" : "src",
"url" : "http://webrtc.googlecode.com/svn/trunk",
"deps_file" : "DEPS",
"managed" : False,
"custom_deps" : {
"src/third_party/WebKit": None,
},
"safesync_url": "",
},
];target_os = ['android', 'linux'];
==> it seems that build/gyp_webrtc activates cross compile if 'android' or 'ios' is detected within target_os so 'export GYP_CROSSCOMPILE=1' as actually no effect ?

let's continue with :
gclient sync --force or gclient runhooks
=> it fed folder src/third_party/android_tools, sounds good !
=> finally add the required variable android_ndk_root by defining it inside chromium/src/third_party/openmax_dl/dl/dl.gyp in the 'variables' section at the beginning of the file:
'android_ndk_root':'<WebRTCfolder>/trunk/third_party/android_tools/ndk/',
*/

/* ERROR 2, solved
a relative link problem appears when trying to target trunk/build/linux/pkg-config-wrapper, you can get something similar to this :
Updating projects from gyp files...
/bin/sh: ../../../build/linux/pkg-config-wrapper: No such file or directory
gyp: Call to '../../../build/linux/pkg-config-wrapper "/media/workspace/lib/webrtc/trunk/arm-sysroot" "arm" --libs-only-L --libs-only-other nss' returned exit status 127. while loading dependencies of trunk/all.gyp while trying to load trunk/all.gyp
Error: Command /usr/bin/python trunk/build/gyp_chromium --depth=trunk trunk/all.gyp -Dextra_gyp_flag=0 returned non-zero exit status 1 in /media/workspace/lib/webrtc
=> if you want to solve this problem for all files having this error, look for wrong files with :
grep -Ir --exclude=\*.{c,h} "../../../build/linux/pkg-config-wrapper" *
and replace related relative path portion in pkg config line (at the beginning of each of the found files :
'pkg-config': '<absolutePathTo>trunk/build/linux/pkg-config-wrapper "<(sysroot)" "<(target_arch)"',

gclient runhooks --force
#this time it succeeded ! Now ending by compilation

#compile
cd trunk
ninja -C out/Release/
ninja -C out/Debug/

/* ERROR 3, not solved
when compiling, you got :
gcc: error: unrecognized command line option ‘-Xclang’
and many others, where is the problem ?
Detailled report error :
///////////////////////////////////////////////////////////////////////
testing@testing:~/WebRTC/trunk$ ninja -C out/Release/
ninja: Entering directory `out/Release/'
[3/2702] CXX obj.host/chromium/src/third_party/protobuf/src/g...obuf/io/protobuf_full_do_not_use.zero_copy_stream_impl_lite.o
FAILED: g++ -MMD -MF obj.host/chromium/src/third_party/protobuf/src/google/protobuf/io/protobuf_full_do_not_use.zero_copy_stream_impl_lite.o.d -DV8_DEPRECATION_WARNINGS -D_FILE_OFFSET_BITS=64 -DCHROMIUM_BUILD -DCR_CLANG_REVISION=214024 -DTOOLKIT_VIEWS=1 -DUI_COMPOSITOR_IMAGE_TRANSPORT -DUSE_AURA=1 -DUSE_ASH=1 -DUSE_PANGO=1 -DUSE_CAIRO=1 -DUSE_GLIB=1 -DUSE_DEFAULT_RENDER_THEME=1 -DUSE_LIBJPEG_TURBO=1 -DUSE_X11=1 -DUSE_CLIPBOARD_AURAX11=1 -DENABLE_ONE_CLICK_SIGNIN -DENABLE_PRE_SYNC_BACKUP -DUSE_XI2_MT=2 -DENABLE_REMOTING=1 -DENABLE_WEBRTC=1 -DENABLE_PEPPER_CDMS -DENABLE_CONFIGURATION_POLICY -DENABLE_NOTIFICATIONS -DUSE_UDEV -DENABLE_EGLIMAGE=1 -DENABLE_TASK_MANAGER=1 -DENABLE_EXTENSIONS=1 -DENABLE_PLUGINS=1 -DENABLE_SESSION_SERVICE=1 -DENABLE_THEMES=1 -DENABLE_AUTOFILL_DIALOG=1 -DENABLE_BACKGROUND=1 -DENABLE_GOOGLE_NOW=1 -DCLD_VERSION=2 -DCLD2_DATA_SOURCE=static -DENABLE_FULL_PRINTING=1 -DENABLE_PRINTING=1 -DENABLE_SPELLCHECK=1 -DENABLE_CAPTIVE_PORTAL_DETECTION=1 -DENABLE_APP_LIST=1 -DENABLE_SETTINGS_APP=1 -DENABLE_MANAGED_USERS=1 -DENABLE_MDNS=1 -DENABLE_SERVICE_DISCOVERY=1 -DGOOGLE_PROTOBUF_NO_RTTI -DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER -DUSE_NSS=1 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -Igen -I../../chromium/src/third_party/protobuf -I../../chromium/src/third_party/protobuf/src -fstack-protector --param=ssp-buffer-size=4 -Werror -pthread -fno-exceptions -fno-strict-aliasing -Wno-unused-parameter -Wno-missing-field-initializers -fvisibility=hidden -pipe -fPIC -Wno-reserved-user-defined-literal -Xclang -load -Xclang /home/testing/WebRTC/trunk/tools/clang/scripts/../../../third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.so -Xclang -add-plugin -Xclang find-bad-constructs -fcolor-diagnostics -Wheader-hygiene -Wno-char-subscripts -Wno-unneeded-internal-declaration -Wno-covered-switch-default -Wstring-conversion -Wno-c++11-narrowing -Wno-deprecated-register -Wno-format -Wno-unused-result -O2 -fdata-sections -ffunction-sections -fno-slp-vectorize -funwind-tables -fno-rtti -fno-threadsafe-statics -fvisibility-inlines-hidden -std=gnu++11 -Wno-deprecated -c ../../chromium/src/third_party/protobuf/src/google/protobuf/io/zero_copy_stream_impl_lite.cc -o obj.host/chromium/src/third_party/protobuf/src/google/protobuf/io/protobuf_full_do_not_use.zero_copy_stream_impl_lite.o
g++: error: find-bad-constructs: Aucun fichier ou dossier de ce type
g++: error: unrecognized command line option ‘-Xclang’
g++: error: unrecognized command line option ‘-Xclang’
g++: error: unrecognized command line option ‘-Xclang’
g++: error: unrecognized command line option ‘-add-plugin’
g++: error: unrecognized command line option ‘-Xclang’
g++: error: unrecognized command line option ‘-fcolor-diagnostics’
g++: error: unrecognized command line option ‘-Wheader-hygiene’
g++: error: unrecognized command line option ‘-Wstring-conversion’
g++: error: unrecognized command line option ‘-fno-slp-vectorize’
[3/2702] CXX obj.host/chromium/src/third_party/protobuf/src/google/protobuf/io/protobuf_full_do_not_use.coded_stream.o
FAILED: g++ -MMD -MF obj.host/chromium/src/third_party/protobuf/src/google/protobuf/io/protobuf_full_do_not_use.coded_stream.o.d -DV8_DEPRECATION_WARNINGS -D_FILE_OFFSET_BITS=64 -DCHROMIUM_BUILD -DCR_CLANG_REVISION=214024 -DTOOLKIT_VIEWS=1 -DUI_COMPOSITOR_IMAGE_TRANSPORT -DUSE_AURA=1 -DUSE_ASH=1 -DUSE_PANGO=1 -DUSE_CAIRO=1 -DUSE_GLIB=1 -DUSE_DEFAULT_RENDER_THEME=1 -DUSE_LIBJPEG_TURBO=1 -DUSE_X11=1 -DUSE_CLIPBOARD_AURAX11=1 -DENABLE_ONE_CLICK_SIGNIN -DENABLE_PRE_SYNC_BACKUP -DUSE_XI2_MT=2 -DENABLE_REMOTING=1 -DENABLE_WEBRTC=1 -DENABLE_PEPPER_CDMS -DENABLE_CONFIGURATION_POLICY -DENABLE_NOTIFICATIONS -DUSE_UDEV -DENABLE_EGLIMAGE=1 -DENABLE_TASK_MANAGER=1 -DENABLE_EXTENSIONS=1 -DENABLE_PLUGINS=1 -DENABLE_SESSION_SERVICE=1 -DENABLE_THEMES=1 -DENABLE_AUTOFILL_DIALOG=1 -DENABLE_BACKGROUND=1 -DENABLE_GOOGLE_NOW=1 -DCLD_VERSION=2 -DCLD2_DATA_SOURCE=static -DENABLE_FULL_PRINTING=1 -DENABLE_PRINTING=1 -DENABLE_SPELLCHECK=1 -DENABLE_CAPTIVE_PORTAL_DETECTION=1 -DENABLE_APP_LIST=1 -DENABLE_SETTINGS_APP=1 -DENABLE_MANAGED_USERS=1 -DENABLE_MDNS=1 -DENABLE_SERVICE_DISCOVERY=1 -DGOOGLE_PROTOBUF_NO_RTTI -DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER -DUSE_NSS=1 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -Igen -I../../chromium/src/third_party/protobuf -I../../chromium/src/third_party/protobuf/src -fstack-protector --param=ssp-buffer-size=4 -Werror -pthread -fno-exceptions -fno-strict-aliasing -Wno-unused-parameter -Wno-missing-field-initializers -fvisibility=hidden -pipe -fPIC -Wno-reserved-user-defined-literal -Xclang -load -Xclang /home/testing/WebRTC/trunk/tools/clang/scripts/../../../third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.so -Xclang -add-plugin -Xclang find-bad-constructs -fcolor-diagnostics -Wheader-hygiene -Wno-char-subscripts -Wno-unneeded-internal-declaration -Wno-covered-switch-default -Wstring-conversion -Wno-c++11-narrowing -Wno-deprecated-register -Wno-format -Wno-unused-result -O2 -fdata-sections -ffunction-sections -fno-slp-vectorize -funwind-tables -fno-rtti -fno-threadsafe-statics -fvisibility-inlines-hidden -std=gnu++11 -Wno-deprecated -c ../../chromium/src/third_party/protobuf/src/google/protobuf/io/coded_stream.cc -o obj.host/chromium/src/third_party/protobuf/src/google/protobuf/io/protobuf_full_do_not_use.coded_stream.o
g++: error: find-bad-constructs: Aucun fichier ou dossier de ce type
g++: error: unrecognized command line option ‘-Xclang’
g++: error: unrecognized command line option ‘-Xclang’
g++: error: unrecognized command line option ‘-Xclang’
g++: error: unrecognized command line option ‘-add-plugin’
g++: error: unrecognized command line option ‘-Xclang’
g++: error: unrecognized command line option ‘-fcolor-diagnostics’
g++: error: unrecognized command line option ‘-Wheader-hygiene’
g++: error: unrecognized command line option ‘-Wstring-conversion’
g++: error: unrecognized command line option ‘-fno-slp-vectorize’
[3/2702] CXX obj.host/chromium/src/third_party/protobuf/src/google/protobuf/io/protobuf_full_do_not_use.zero_copy_stream.o
FAILED: g++ -MMD -MF obj.host/chromium/src/third_party/protobuf/src/google/protobuf/io/protobuf_full_do_not_use.zero_copy_stream.o.d -DV8_DEPRECATION_WARNINGS -D_FILE_OFFSET_BITS=64 -DCHROMIUM_BUILD -DCR_CLANG_REVISION=214024 -DTOOLKIT_VIEWS=1 -DUI_COMPOSITOR_IMAGE_TRANSPORT -DUSE_AURA=1 -DUSE_ASH=1 -DUSE_PANGO=1 -DUSE_CAIRO=1 -DUSE_GLIB=1 -DUSE_DEFAULT_RENDER_THEME=1 -DUSE_LIBJPEG_TURBO=1 -DUSE_X11=1 -DUSE_CLIPBOARD_AURAX11=1 -DENABLE_ONE_CLICK_SIGNIN -DENABLE_PRE_SYNC_BACKUP -DUSE_XI2_MT=2 -DENABLE_REMOTING=1 -DENABLE_WEBRTC=1 -DENABLE_PEPPER_CDMS -DENABLE_CONFIGURATION_POLICY -DENABLE_NOTIFICATIONS -DUSE_UDEV -DENABLE_EGLIMAGE=1 -DENABLE_TASK_MANAGER=1 -DENABLE_EXTENSIONS=1 -DENABLE_PLUGINS=1 -DENABLE_SESSION_SERVICE=1 -DENABLE_THEMES=1 -DENABLE_AUTOFILL_DIALOG=1 -DENABLE_BACKGROUND=1 -DENABLE_GOOGLE_NOW=1 -DCLD_VERSION=2 -DCLD2_DATA_SOURCE=static -DENABLE_FULL_PRINTING=1 -DENABLE_PRINTING=1 -DENABLE_SPELLCHECK=1 -DENABLE_CAPTIVE_PORTAL_DETECTION=1 -DENABLE_APP_LIST=1 -DENABLE_SETTINGS_APP=1 -DENABLE_MANAGED_USERS=1 -DENABLE_MDNS=1 -DENABLE_SERVICE_DISCOVERY=1 -DGOOGLE_PROTOBUF_NO_RTTI -DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER -DUSE_NSS=1 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -Igen -I../../chromium/src/third_party/protobuf -I../../chromium/src/third_party/protobuf/src -fstack-protector --param=ssp-buffer-size=4 -Werror -pthread -fno-exceptions -fno-strict-aliasing -Wno-unused-parameter -Wno-missing-field-initializers -fvisibility=hidden -pipe -fPIC -Wno-reserved-user-defined-literal -Xclang -load -Xclang /home/testing/WebRTC/trunk/tools/clang/scripts/../../../third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.so -Xclang -add-plugin -Xclang find-bad-constructs -fcolor-diagnostics -Wheader-hygiene -Wno-char-subscripts -Wno-unneeded-internal-declaration -Wno-covered-switch-default -Wstring-conversion -Wno-c++11-narrowing -Wno-deprecated-register -Wno-format -Wno-unused-result -O2 -fdata-sections -ffunction-sections -fno-slp-vectorize -funwind-tables -fno-rtti -fno-threadsafe-statics -fvisibility-inlines-hidden -std=gnu++11 -Wno-deprecated -c ../../chromium/src/third_party/protobuf/src/google/protobuf/io/zero_copy_stream.cc -o obj.host/chromium/src/third_party/protobuf/src/google/protobuf/io/protobuf_full_do_not_use.zero_copy_stream.o
g++: error: find-bad-constructs: Aucun fichier ou dossier de ce type
g++: error: unrecognized command line option ‘-Xclang’
g++: error: unrecognized command line option ‘-Xclang’
g++: error: unrecognized command line option ‘-Xclang’
g++: error: unrecognized command line option ‘-add-plugin’
g++: error: unrecognized command line option ‘-Xclang’
g++: error: unrecognized command line option ‘-fcolor-diagnostics’
g++: error: unrecognized command line option ‘-Wheader-hygiene’
g++: error: unrecognized command line option ‘-Wstring-conversion’
g++: error: unrecognized command line option ‘-fno-slp-vectorize’
ninja: build stopped: subcommand failed

Seems to be so close to the end...
If somebody knows thé solution, thanks in advance.
Alex

Andy Savage

unread,
Sep 5, 2014, 11:06:19 AM9/5/14
to discuss...@googlegroups.com
Any updates on solving your last issue?


--

---
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.

alexandre benoit

unread,
Sep 5, 2014, 3:20:26 PM9/5/14
to discuss...@googlegroups.com
Hi,
not yet unfortunately.
However, the path error may have been solved on trunk. The last "gclient sync --force" i did only reported the android_ndk_root.

But the unrecognized flags problem still appears.
It seems to be related to system software installation, maybe version compatibility on the cross compilers vs webrtc flags.

If anybody knows a solution to this point...

I may add some recommendations on the system used for cross compiling :
prefer a virtualized Lubuntu14.04 64bit on at least 20Gb virtual drive space :
_Lubuntu is fast to use when virtualized and it is based on ubuntu which is necessary since installation scripts rely on ubuntu software packages names
_64bit is necessary since scripts like install-build-deps.sh expect 64bit system and install specific 32bit libraries
_20Gb at least because standard (non cross compiling) webrtc requires at least 10Gb but when adding all cross compiling stuff, drive space explodes !

Hope it starts to help.
Anyone can complete the last step ?

Regards.

Mykola Popko

unread,
Sep 10, 2014, 9:27:20 AM9/10/14
to discuss...@googlegroups.com
Have the same problem. Anybody can tell as in what way we can build for arm?

Четвер, 4 вересня 2014 р. 18:16:20 UTC+3 користувач alexandre benoit написав:
Message has been deleted

alexandre benoit

unread,
Sep 14, 2014, 2:14:55 PM9/14/14
to discuss...@googlegroups.com
Hi,

i found some solutions but now, it seems that webrtc trunk brings new errors like 'do not fetch android ndk with this method'. However, the -Xclang errors are now solved. Actualy, you should not export compiler flags (CXX, etc.) since it is properly done automatically within the scripts.

Here is an updated version of the process :

Here is a summary of the install process.
Prefer a virtualized Lubuntu14.04 64bit on at least 20Gb virtual drive space :

_Lubuntu is fast to use when virtualized and it is based on ubuntu which is necessary since installation scripts rely on ubuntu software packages names
_64bit is necessary since scripts like install-build-deps.sh expect 64bit system and install specific 32bit libraries
_20Gb at least because standard (non cross compiling) webrtc requires at least 10Gb but when adding all cross compiling stuff, drive space explodes !

Then, from this host, here is the install process:

# basic preliminary setup... supposing that no variables discussed later have already been exported
mkdir WebRTC
cd WebRTC
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
export PATH=<location of depot_tools>:"$PATH"
export JAVA_HOME=<location of Java SE 6 - JDK>
gclient config http://webrtc.googlecode.com/svn/trunk
gclient sync --force

/* Note 0: sometime it fails saying gcc, pkg-config, etc have not been found. Fortunately a script should have already been downloaded :
trunk/built/install-build-deps.sh
Run it to install all required packages  and rerun gclient sync --force*/

# add all necessay android sdk&ndk that are required to target arm systems
echo "target_os = ['android', 'unix']" >> .gclient
gclient sync
cd trunk
source ./build/android/envsetup.sh
export GYP_DEFINES="$GYP_DEFINES OS=android"
gclient runhooks
/* NOTE 1: the android tools should be available from this step... but recently it does not fetch anymore
*/

#prepare cross compile for armv7a based platform
cd trunk
./build/install-build-deps-android.sh /* => after different experiment, i used the above command, but i guess it is not absolutely necessary from a very clean install. Anycase, if done, command "./build/install-build-deps.sh --arm" should be used after in order to exchange some cross compiler packages
(mainly in order to keep g++-arm-linux-gnueabihf and gcc-arm-linux-gnueabihf installed)
*/
./build/install-build-deps.sh --arm
./build/linux/install-arm-sysroot.py
export GYP_CROSSCOMPILE=1 /* => i used it but i ask myself if it is still necessary since an automatic declaration is performed later on.*/

export GYP_DEFINES="OS=linux target_arch=arm arm_version=7 arm_use_neon=1  arm_fpu=vfpv3-d16 arm_float_abi=softfp" /* This is important since it explicitely shows the target architecture. However, note that in the 'target_arch=arm' use case, it seems that all the following options are already set by default so it not necessary to write it all*/

/* NOTE 2 : the following exports are often reported on guides and tutorials. However, when used, they bring several problems (unrecognized -Xclang flag, etc.). It seems that they are no more usefull since gyp files automatically adjust those setup ! For me, avoiding them was the only way to get configuration and beginning of compilation work.

export CC=arm-linux-gnueabihf-gcc
export CXX=arm-linux-gnueabihf-g++
export AR=arm-linux-gnueabihf-ar
export CC_host=gcc
export CXX_host=g++
*/


cd ..
gclient runhooks --force
 cd trunk/

/* ERROR 1 , Solved
The following error appears first :
=> gyp: Undefined variable android_ndk_root in chromium/src/third_party/openmax_dl/dl/dl.gyp
=> Since SDK and NDK has been downloaded at the beginning of the procedure, add the required variable android_ndk_root by defining it inside chromium/src/third_party/openmax_dl/dl/dl.gyp in the 'variables'  section at the beginning of the file:

'android_ndk_root':'<WebRTCfolder>/trunk/third_party/android_tools/ndk/',
*/

/* ERROR 2, solved
a relative link problem appears when trying to target trunk/build/linux/pkg-config-wrapper, you can get something similar to this :
Updating projects from gyp files...
/bin/sh: ../../../build/linux/pkg-config-wrapper: No such file or directory
gyp: Call to '../../../build/linux/pkg-config-wrapper "/media/workspace/lib/webrtc/trunk/arm-sysroot" "arm" --libs-only-L --libs-only-other nss' returned exit status 127. while loading dependencies of trunk/all.gyp while trying to load trunk/all.gyp
Error: Command /usr/bin/python trunk/build/gyp_chromium --depth=trunk trunk/all.gyp -Dextra_gyp_flag=0 returned non-zero exit status 1 in /media/workspace/lib/webrtc
=> if you want to solve this problem for all files having this error, look for wrong files with : 
grep -Ir --exclude=\*.{c,h} "../../../build/linux/pkg-config-wrapper" *
and replace related relative path portion in pkg config line (at the beginning of each of the found files :
'pkg-config': '<absolutePathTo>trunk/build/linux/pkg-config-wrapper "<(sysroot)" "<(target_arch)"',

gclient runhooks --force
#this time it succeeded ! Now ending by compilation

#compile
cd trunk
ninja -C out/Release/
ninja -C out/Debug/

// if having problems with clang, it can be desactivated with this additionnal option (rerun gclien runhooks after)
export GYP_DEFINES="$GYP_DEFINES clang=0"

alexandre benoit

unread,
Sep 16, 2014, 4:58:56 AM9/16/14
to discuss...@googlegroups.com
Hi all,
webrtc members answered the non fetching android-tools problem :

"Now we don't fetch android_tools alone any more, but using the one under chromium. You should notice that there is a entire chromium tree synced down.
I suppose if you could build chrome for Linux ARM, then you should probably be able to build webrtc android on it too.  But apparently nobody here is working on it, so you are mainly on your own. Try discuss-webrtc to check if there is anyone else having experience."

Let's investigate !

Message has been deleted

alexandre benoit

unread,
Sep 17, 2014, 6:23:41 AM9/17/14
to discuss...@googlegroups.com
Hi all,

it appears that cloning android tools in trunk/third_party is enough

    git clone https://chromium.googlesource.com/android_tools

However, you still have to update chromium/src/third_party/openmax_dl/dl/dl.gyp as i showed in my previous post to target the ndk

I will post an updated install procedure when complete.
Currently i face the following problem during ninja compilation:
    file not found on <sys/system_properties.h>
while the file is present in 
     trunk/third_party/android_tools/ndk/platforms/android-XXX/arch-arm/usr/include/sys/system_properties.h
i must have missed an export or something like that.

Regards

Slim Sayadi

unread,
Sep 17, 2014, 10:41:39 AM9/17/14
to discuss...@googlegroups.com
Hi Alexandre, 

I just wonder if you come across the following error as well

 ~/cj/trunk$ ninja -C out/Release peerconnection_client
ninja: Entering directory `out/Release'
[2/385] RULE Generate assembly offsets ../../../../out/Release/obj/chromium/src/third_party/libvpx/gen_asm_offsets_vpx_scale.gen/vpx_scale_asm_offsets.o
FAILED: cd ../../chromium/src/third_party/libvpx; python ../../../../third_party/libvpx/obj_int_extract.py -e ../../../../out/Release/libvpx_obj_int_extract -f gas -b "../../../../out/Release/obj/chromium/src/third_party/libvpx/gen_asm_offsets_vpx_scale.gen/vpx_scale_asm_offsets.o" -o "../../../../out/Release/gen/third_party/libvpx/vpx_scale_asm_offsets.asm"
Traceback (most recent call last):
  File "../../../../third_party/libvpx/obj_int_extract.py", line 29, in <module>
    stdout=fh)
  File "/usr/lib/python2.7/subprocess.py", line 506, in check_call
    retcode = call(*popenargs, **kwargs)
  File "/usr/lib/python2.7/subprocess.py", line 493, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1249, in _execute_child
    raise child_exception
OSError: [Errno 8] Exec format error
[2/385] LINK protoc
FAILED: /usr/bin/arm-linux-gnueabihf-g++ -Wl,-z,now -Wl,-z,relro -Wl,--fatal-warnings -pthread -Wl,-z,noexecstack -fPIC -B/home/aljaith/cj/trunk/third_party/binutils/Linux_x64/Release/bin --sysroot=/home/aljaith/cj/trunk/arm-sysroot -L/home/aljaith/cj/trunk/arm-sysroot/lib/arm-linux-gnueabihf -Wl,-rpath-link=/home/aljaith/cj/trunk/arm-sysroot/lib/arm-linux-gnueabihf -L/home/aljaith/cj/trunk/arm-sysroot/usr/lib/arm-linux-gnueabihf -Wl,-rpath-link=/home/aljaith/cj/trunk/arm-sysroot/usr/lib/arm-linux-gnueabihf -Wl,-O1 -Wl,--as-needed -Wl,--gc-sections -o protoc -Wl,--start-group obj/chromium/src/third_party/protobuf/src/google/protobuf/compiler/protoc.code_generator.o obj/chromium/src/third_party/protobuf/src/google/protobuf/compiler/protoc.command_line_interface.o obj/chromium/src/third_party/protobuf/src/google/protobuf/compiler/protoc.plugin.o obj/chromium/src/third_party/protobuf/src/google/protobuf/compiler/protoc.plugin.pb.o obj/chromium/src/third_party/protobuf/src/google/protobuf/compiler/protoc.subprocess.o obj/chromium/src/third_party/protobuf/src/google/protobuf/compiler/protoc.zip_writer.o obj/chromium/src/third_party/protobuf/src/google/protobuf/compiler/cpp/protoc.cpp_enum.o obj/chromium/src/third_party/protobuf/src/google/protobuf/compiler/protoc.main.o obj/chromium/src/third_party/protobuf/libprotobuf_full_do_not_use.a -Wl,--end-group  

.........

obj/chromium/src/third_party/protobuf/src/google/protobuf/compiler/protoc.subprocess.o:subprocess.cc:function google::protobuf::compiler::Subprocess::Communicate(google::protobuf::Message const&, google::protobuf::Message*, std::basic_string<char, std::char_traits<char>, std::allocator<char> >*): error: undefined reference to '__fdelt_chk'
obj/chromium/src/third_party/protobuf/src/google/protobuf/compiler/protoc.subprocess.o:subprocess.cc:function google::protobuf::compiler::Subprocess::Communicate(google::protobuf::Message const&, google::protobuf::Message*, std::basic_string<char, std::char_traits<char>, std::allocator<char> >*): error: undefined reference to '__fdelt_chk'
obj/chromium/src/third_party/protobuf/src/google/protobuf/compiler/protoc.subprocess.o:subprocess.cc:function google::protobuf::compiler::Subprocess::Communicate(google::protobuf::Message const&, google::protobuf::Message*, std::basic_string<char, std::char_traits<char>, std::allocator<char> >*): error: undefined reference to '__fdelt_chk'
obj/chromium/src/third_party/protobuf/src/google/protobuf/compiler/protoc.subprocess.o:subprocess.cc:function google::protobuf::compiler::Subprocess::Communicate(google::protobuf::Message const&, google::protobuf::Message*, std::basic_string<char, std::char_traits<char>, std::allocator<char> >*): error: undefined reference to '__fdelt_chk'
collect2: ld returned 1 exit status
ninja: build stopped: subcommand failed.

Thanks

alexandre benoit

unread,
Sep 18, 2014, 2:06:24 AM9/18/14
to discuss...@googlegroups.com
Hi Salim,

no, i did not see this error before. But maybe try this : remove " arm_fpu=vfpv3-d16 arm_float_abi=softfp" in the GYP_DEFINES. This brought me errors... even if they seem to be correct.
Since these where default values, they are used anyway during compile... but without error.

My current problem is related to the missing include file.
I will post when i got an answer.

Regards.
  alex 

Mykola Popko

unread,
Sep 18, 2014, 9:25:47 AM9/18/14
to discuss...@googlegroups.com
Thaks, alexandre for your guide. Now, I be able to build for armv7. Also I can build for armv6. But when i try to build for armv5, i got following error:
gyp: name 'arm_arch' is not defined while evaluating condition 'clang==1 and arm_arch!="" and OS!="android"' in all.gyp

The error appears when i override 
GYP_DEFINES to: 
export GYP_DEFINES="OS=linux target_arch=arm arm_version=5"

Afterwards i invoke gclient runhooks --force and got this error.
Is it possible to build webrtc for armv5? What i should change to achieve this goal?

Slim Sayadi

unread,
Sep 18, 2014, 10:20:43 AM9/18/14
to discuss...@googlegroups.com
Thanks I think part of my problem is coming from using the host compiler <4.8 ... The host compiler is needed to generate the required tools for libvfx ...
With regrad to the missing header, I think in your sequence you enable android; while this step is needed to get the prerequisites i think you shoul remove it and sync runhooks again ... At least, if i remember correctly this helped me to go beyound that missing header ....

On my side i will switch to ubuntu 14.04 for the cross compilation and i m sort of confident that it will work ...

Message has been deleted

alexandre benoit

unread,
Sep 20, 2014, 5:42:10 AM9/20/14
to discuss...@googlegroups.com
Hi,

Well, i tried different things but i still have some' not found includes problems(maps, inttypes.h)' when starting compilation (ninja -C out/Release).
i tried to remove 'android' from trunk/.gclient, only keeping target_os=['linux'], same thing

i tried to switch between

    install-build-deps.sh --arm
and
    install-build-deps-android.sh

which do not exactly install the same cross compiler tools
but i still have those include problems.

Here is the updated install process, please share hints if needed :

/////////////////////////////////////////
# System requirements:

Prefer a virtualized Lubuntu14.04 64bit on at least 30Gb virtual drive space and 8GbRAM :

    _Lubuntu is fast to use when virtualized and it is based on ubuntu which is necessary since installation scripts rely on ubuntu software packages names
    _64bit is necessary since scripts like install-build-deps.sh expect 64bit system and install specific 32bit libraries
    _30Gb at least because standard (non cross compiling) webrtc requires at least 10Gb but when adding all cross compiling stuff, drive space explodes !
    _8GbRAM to be able to compile and link everything

Then, from this host, here is the install process:

# basic preliminary setup... supposing that no variables discussed later have already been exported
  
First install the essential packages to be able to fetch data and play with java :

    // ensure all required depot are ready
    sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) main universe restricted multiverse"
    // install most essential packages prior to fetching
    sudo apt-get install openjdk-7-jdk git subversion

# initial Webrtc fetch

Create a directory to fetch and go

    mkdir WebRTC
    cd WebRTC
    export PATH=<location of depot_tools>:"$PATH" // example : export PATH=/home/testing/WebRTC/depot_tools:"$PATH"
    export JAVA_HOME=<location of Java SE 6 - JDK>  // example : export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64/
    gclient sync --force

Note 0: sometime it fails saying gcc, pkg-config, etc have not been found. This often occurs on a fresh install where plenty of packages are missing.
Fortunately a script should have already been downloaded :

    trunk/built/install-build-deps.sh 

Run it to install all required packages  and rerun 
 
    gclient sync --force

# add all necessay android sdk&ndk that are required to target arm systems

official Webrtc guidelines :

    echo "target_os = ['android', 'unix']" >> .gclient
    gclient sync
    cd trunk
    source ./build/android/envsetup.sh
    export GYP_DEFINES="$GYP_DEFINES OS=android"
    gclient runhooks

Note 1: the android tools are no more directly available with webrtc. It is recommended to use the one from chromium.
then, in Webrtc folder or another one (example, the original location : trunk/third_party/).

    cd myTaretDirectory // example cd trunk/third_party/

Once android_tools are fetched, configure project to see it. Edit :
     
    trunk/chromium/src/third_party/openmax_dl/dl/dl.gyp

and add the required variable android_ndk_root by adding the following line in the 'variables'  section at the beginning of the file:

    'android_ndk_root':'<WebRTCfolder>/trunk/third_party/android_tools/ndk/',
    example   'android_ndk_root':'/home/testing/WebRTC/trunk/third_party/android_tools/ndk/',

you can also export ANDROID_NDK_ROOT in your .bashrc

    export ANDROID_NDK_ROOT=<WebRTCfolder>/trunk/third_party/android_tools/ndk/
    example export ANDROID_NDK_ROOT=/home/testing/WebRTC/trunk/third_party/android_tools/ndk/

#prepare cross compile for armv7a based platform

    // install all necessary packages
    cd trunk
    ./build/install-build-deps.sh --arm
    ./build/install-build-deps-android.sh

/* => after different experiment, i used the above command, but i guess it is not absolutely necessary from a very clean install. Anycase, if done, command "./build/install-build-deps.sh --arm" should be used after in order to exchange some cross compiler packages
(mainly in order to keep g++-arm-linux-gnueabihf and gcc-arm-linux-gnueabihf installed)
*/

    ./build/linux/install-arm-sysroot.py
    export GYP_CROSSCOMPILE=1 /* => i used it but i ask myself if it is still necessary since an automatic declaration is performed later on.*/

    export GYP_DEFINES="OS=linux target_arch=arm arm_version=7 arm_use_neon=1"
    // other options like  arm_fpu=vfpv3-d16 arm_float_abi=softfp are set by default, actually, even arm_vervion=7 and use_neon=1 */

Here, the target is linux arm so this should be enough but if targetting android, it may be necessary to define the following variables

    export ANDROID_SDK_VERSION=19
    export GYP_DEFINES="$GYP_DEFINES  android_sdk_version=19"

NOTE 2 : the following exports are often reported on guides and tutorials. However, when used, they bring several problems (unrecognized -Xclang flag, etc.). It seems that they are no more usefull since gyp files automatically adjust those setup ! For me, avoiding them was the only way to get configuration and beginning of compilation work.

    export CC=arm-linux-gnueabihf-gcc
    export CXX=arm-linux-gnueabihf-g++
    export AR=arm-linux-gnueabihf-ar
    export CC_host=gcc
    export CXX_host=g++

Finally, configure the system before moving to the final compile step

    cd ..
    gclient runhooks --force
     cd trunk/

# Potential error 1 , Solved

The following error appears first :
=> gyp: Undefined variable android_ndk_root in chromium/src/third_party/openmax_dl/dl/dl.gyp
=> come back to previous section, you certainly forgot to define android_ndk_root variable in the enlighted file:
'android_ndk_root':'<WebRTCfolder>/trunk/third_party/android_tools/ndk/',
*/

# Potential error 2, solved

a relative link problem appears when trying to target trunk/build/linux/pkg-config-wrapper, you can get something similar to this :
Updating projects from gyp files...
/bin/sh: ../../../build/linux/pkg-config-wrapper: No such file or directory
gyp: Call to '../../../build/linux/pkg-config-wrapper "/media/workspace/lib/webrtc/trunk/arm-sysroot" "arm" --libs-only-L --libs-only-other nss' returned exit status 127. while loading dependencies of trunk/all.gyp while trying to load trunk/all.gyp
Error: Command /usr/bin/python trunk/build/gyp_chromium --depth=trunk trunk/all.gyp -Dextra_gyp_flag=0 returned non-zero exit status 1 in /media/workspace/lib/webrtc
=> if you want to solve this problem for all files having this error, look for wrong files with :  

    grep -Ir --exclude=\*.{c,h} "../../../build/linux/pkg-config-wrapper" *

and replace related relative path portion in pkg config line (at the beginning of each of the found files :
'pkg-config': '<absolutePathTo>trunk/build/linux/pkg-config-wrapper "<(sysroot)" "<(target_arch)"',

gclient runhooks --force

#final compile step

    cd trunk
    ninja -C out/Release/
    ninja -C out/Debug/ // if required

/////////////////////////////////////////


Anyone has an idea ?
Regards

Le vendredi 19 septembre 2014 11:38:57 UTC+2, alexandre benoit a écrit :
Hi, as i understand your suggestion, target_os including 'android' is only usefull to fetch ndroid_tools (but now, we have to ger it separetely).
so, no more need to add it ?
then is

    source ./build/android/envsetup.sh

necessary too?

thanks, i now test from a clean install.
stay tuned and thanks



--

---

You received this message because you are subscribed to a topic in the Google Groups "discuss-webrtc" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/discuss-webrtc/yzuk8wATMU8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to discuss-webrtc+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Alexandre BENOIT,
Associate Professor / Maître de Conférence
Image processing and visual scene classification,
LISTIC Lab / IUT Annecy
https://sites.google.com/site/benoitalexandrevision/

Slim Sayadi

unread,
Sep 20, 2014, 2:26:44 PM9/20/14
to discuss...@googlegroups.com
Hi Alexandre, the situation looks like this for me:
  • clang is turned off by setting clang=0 in the GYP_DEFINES, and hence some specific flags have to be removed from common.gypi header-hygiene and string-conversion,
  • Two compilers are still required, the host compiler (defined by the env. variables CXX_host and CC_host) and the cross compiler (defined by the env. variables CXX, CC and AR)
  • Being in ubuntu 14.04, the cross compiler version is 4.8.2 while the arm-sysroot includes are all for an ubuntu 12.02 (gcc 4.6) and this explains the missing header that you mentioned; 
    • To work around this, I installed gcc 4.6 on ubuntu 14.04 and force the env. variables CXX, CC to point to arm-linux-gnueabi...4.6 this has fixed the missing header.
While the headers issue are gone, I got some linking errors due to the use of the 4.6 compiler while the code assume a 4.8. These linking errors are:
  • __fdelt_chk, to work around this just redefine the value of _FORTIFY_SOURCE=0 instead of =2 also make sure to add werror= to your GYP defines so the compilation will continue on warning
  • WebRtc_GetCPUFeaturesARM, I just alter the code to get rid of this method and setting the hardware of my arm hardware
  • clock_gettime, this is the only issue left but at the same time made me believe that the whole process of missing 4.8 and 4.6 is not really healthy
So What I have done is trying the same process but instead of using ubuntu 14.04 I decided to go with ubuntu 12.04 far away from 4.8 compilers. I had obviously some problems due to the assomption of c++11 but luckily not that much was depending on this new standard.
I managed to get it working (at least for the test that I was doing audio and data channel but I'm confident that the video will work as well)
Here are some of my settings on ubuntu 12.04:
Please note that I brought back the android option in the .gcclient otherwise the folder android_tools will be wiped out on each sync

target_os = ['android', 'linux']


GYP_DEFINES
=OS=linux target_arch=arm arm_version=7 arm_neon=0 arm_float_abi=hard clang=0 werror=


Hopefully this help you out progressing on your side .. and let me know If you will be getting any success working around the clock_gettime issue,

Thank you


To unsubscribe from this group and all its topics, send an email to discuss-webrt...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

alexandre benoit

unread,
Sep 20, 2014, 4:13:16 PM9/20/14
to discuss...@googlegroups.com
Hi,
in parallel, i noticed that the command

    source ./build/android/envsetup.sh

has no effect (on PATH update) if ANDROID_SDK_ROOT and/or ANDROID_NDK_ROOT are not defined. I added it to the guide however, it has no effect on the current problems.

I also deactivated clang ( clang=0 in the GYP_DEFINES) but compile also stops on some not found includes (very basics ones such as <string>... looks like a stupid mistake (forgot an export or config command?) and the compiler version problem you talk about.

In such conditions,
_if i do not export CXX, CC, etc. (i let gyp files defining it internally) then, i got those basic include errors.
_but strangely, if i define 
    export CC=arm-linux-gnueabihf-gcc
    export CXX=arm-linux-gnueabihf-g++
    export AR=arm-linux-gnueabihf-ar
    export CC_host=gcc
    export CXX_host=g++
then i come back to the include problems related to android (not found android/log.h and sys/system_properties.h... even if android is not my target...
Even if i play with gcc4.8 which is not appropriate as you mentionned, their are some non logical behaviors.

I have to investigate further on the gcc version, etc. tomorrow.

Thanks for sharing !

   Alex

alexandre benoit

unread,
Sep 29, 2014, 3:16:35 AM9/29/14
to discuss...@googlegroups.com
Hi Slim,
last week i did not have time to work on the Webrtc arm compilation problem.
Did you succeed on your side ?

I have to create a bigger VM to conduct more experiments. In your opinion, should we stay with Ubuntu precise or we can move to the latest stable 14.04 ?

By the time, if you have any hints to share, do not hesitate to complete the guide i began.
Thanks

--

---
You received this message because you are subscribed to a topic in the Google Groups "discuss-webrtc" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/discuss-webrtc/yzuk8wATMU8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to discuss-webrt...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Footniko

unread,
Oct 2, 2014, 7:57:46 AM10/2/14
to discuss...@googlegroups.com
Hi, Alexandre.
I think you could try to include missed files manually in build/common.gypi file. For example, i don't use clang and build for arm, hence i specify needed directories in corresponding section (at 3763 line in my case):
...
['clang==0', {
 
'include_dirs': [
 
'<(DEPTH)/arm-sysroot/usr/include',
 
'<(DEPTH)/arm-sysroot/usr/include/arm-linux-gnueabihf',
 
'<(DEPTH)/arm-sysroot/usr/lib/arm-linux-gnueabihf',
 
],
...

At least, it help me to solve similar problems when i try to compile for my armv5. At this moment i get another errors...(
I'm not use clang and i specify CC, CXX and AR variables to my own arm-none-linux-gnueabi compiler that compiles for my arm926ej-s processor natively.
I also tried build with makefile but no success (got the same issues).

P.S. It so grueling to compile webrtc for arm(... Hope, webrtc developers will give us some stable instructions soon.
P.P.S. Sorry for my horrible english.

alexandre benoit

unread,
Oct 8, 2014, 10:13:42 AM10/8/14
to discuss...@googlegroups.com
Hi,
well, finally, i used the download/config/build scripts available here :

It actually works really fine without path errors, etc. It is an automatic procedure hat is very close to the guide i was drawing.
But, it showed me some tiny stupid errors in my procedure such as wrong place of .gcleint file, etc. ;o).
It is a good basis to start with. Then, you can update the scripts to match you specific needs but by default it builds fr armv7, with neon.
Depending on the architecture, it can be good to enhance options such as arm_float_abi=hard, etc.

Thanks for such scripts, use it !
Best regards
   Alex

--

---
You received this message because you are subscribed to a topic in the Google Groups "discuss-webrtc" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/discuss-webrtc/yzuk8wATMU8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to discuss-webrt...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Slim Sayadi

unread,
Oct 16, 2014, 11:20:14 PM10/16/14
to discuss...@googlegroups.com
Hi Alex, Sorry for the late reply I've been dragged to all sort of other directions at work ... Yes as I mentioned in my earlier post  my two objectives (audio and datachannel) with webRTC are working on ARM Pc duino v3. I'm using 12.04 ubuntu as host OS for the cross compilation. I gave up temp. on 14.04 for the reasons mentioned in my latest post.  I'm doing the same setup for a colleague on a LapTop with ubuntu 12.04 and documenting each step that I will be sharing in this forum once done.

alexandre benoit

unread,
Oct 17, 2014, 3:53:16 AM10/17/14
to discuss...@googlegroups.com
Hi Slim, thank you for your reply, i am sure many persons are interested by your guide !
On my part, waiting for such linux solution, i am trying the Android OS way but java/jni/c++... coding on such plateform is less intuitive that pure c++ approach ;o)
So we are looking for your guide !
Thanks again !
   Alex

Slim Sayadi

unread,
Oct 23, 2014, 3:12:20 PM10/23/14
to discuss...@googlegroups.com
Hi Alex,

Configurations:

Host (Dell Latitude 64 bits)

ssy@cj:~$ lsb_release -irc; uname -or;
Distributor ID:    Ubuntu
Release:    12.04
Codename:    precise
3.11.0-26-generic GNU/Linux


Target (Pc-Duino V3):

ubuntu@ubuntu:~$ lsb_release -irc; uname -or;
Distributor ID:    Linaro
Release:    12.11
Codename:    precise
3.4.79+ GNU/Linux

Get source code. The following procedure is based on release 7244 (19 September 2014).
More likely it will not work with the current trunk as more and more checked-in codes rely on c++11 features.

ssy@cj:~/cj$ gclient config http://webrtc.googlecode.com/svn/trunk
ssy@cj
:~/cj$ echo "target_os = ['android', 'unix']" >> .gclient

Make sure your have Java installed and your path updated accordingly.
i.e Java download link
http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html

ssy@cj:~$ vi .bashrc
export JAVA_HOME=`pwd`/cj/jdk1.7.0_71
export PATH=`pwd`/cj/depot_tools:$JAVA_HOME/bin:"$PATH"

ssy@cj
:~/cj$ gclient sync --revision 7244
.....
Syncing projects: 100% (3/3), done.  

Install the dependencies.

ssy@cj:~/cj/trunk$ ./build/install-build-deps.sh

Prepare for compilation; Add the following (or whatever reflecting your ARM) to your build environment.

ssy@cj:~$ vi .bashrc
export GYP_DEFINES="OS=linux target_arch=arm arm_version=7 arm_neon=0 arm_float_abi=hard clang=0 werror="
export CC_host=gcc
export CXX_host=g++

Add the following softlink (to fix issue with pkg-config-wrapper: not found)

ssy@cj:~/cj$ ln -s trunk/build build

Tool chain install for cross compilation.

ssy@cj:~/cj/trunk$ ./build/linux/install-arm-sysroot.py
Installing ARM root image: /home/ssy/cj/trunk/arm-sysroot
######################################################################## 100.0%

Fix android_ndk_root missing variable.

ssy@cj:~/cj$ vi trunk/chromium/src/third_party/openmax_dl/dl/dl.gyp
{
 
'variables' : {
   
# Override this value to build with small float FFT tables
   
'android_ndk_root' : '/home/ssy/cj/trunk/third_party/android_tools/ndk',
   
'big_float_fft%' : 1,
 
},
 
'targets': [

Disable c++11 features, since the compiler on 12.02 (gcc 4.6) does not support them. (I copied the section that I've modified below)

ssy@cj:~/cj$ vi trunk/build/common.gypi

         
['clang==0 and host_clang==1', {
           
'target_conditions': [
             
['_toolset=="host"', {
               
'cflags_cc':  [ ], # [ '-std=gnu++11', ],
             
}],
           
],
         
}],


             
['chromium_code==1', {
               
# Non-chromium code is not guaranteed to compile cleanly
               
# with _FORTIFY_SOURCE. Also, fortified build may fail
               
# when optimizations are disabled, so only do that for Release
               
# build.
               
'defines': [
               
#  '_FORTIFY_SOURCE=2',
               
],

         
['OS=="linux" or OS=="android"', {
           
'target_conditions': [
             
['_toolset=="target"', {
               
'cflags': [
                 
'-U_FORTIFY_SOURCE',                  
                 
'<@(release_extra_cflags)',
               
],
               
'conditions': [
                 
['enable_resource_whitelist_generation==1', {
                   
'cflags': [
                     
'-Wunknown-pragmas -Wno-error=unknown-pragmas',


     
'clang_warning_flags': [
       
#'-Wheader-hygiene',

       
# Don't die on dtoa code that uses a char as an array index.
       
# This is required solely for base/third_party/dmg_fp/dtoa.cc.
       
'-Wno-char-subscripts',

       
# TODO(thakis): This used to be implied by -Wno-unused-function,
       
# which we no longer use. Check if it makes sense to remove
       
# this as well. http://crbug.com/316352
       
'-Wno-unneeded-internal-declaration',

       
# Warns on switches on enums that cover all enum values but
       
# also contain a default: branch. Chrome is full of that.
       
'-Wno-covered-switch-default',

       
# Warns when a const char[] is converted to bool.
       
#'-Wstring-conversion',

Add a stub for the missing WebRtc_GetCPUFeaturesARM symbol.

ssy@cj:~/cj/trunk/webrtc/system_wrappers/source$ vi cpu_features.cc

uint64_t
WebRtc_GetCPUFeaturesARM(void) {
 
return kCPUFeatureARMv7; // Or whatever reflects your hardware
}

Re-generate the build files.
 
ssy@cj:~/cj$ gclient runhooks --force

Build and have fun testing ...

ssy@cj:~/cj/trunk$ ninja -C out/Release peerconnection_server
ninja
: Entering directory `out/Release'
[168/168] LINK peerconnection_server
ssy@cj:~/cj/trunk$

ssy@cj:~/cj/trunk$ ninja -C out/Release peerconnection_client
ninja: Entering directory `
out/Release'
[1536/1536] LINK peerconnection_client

With the configuration and procedure above I tested successfully voice and bidirectional data-channel. Don't need the video for my use cases for now.

alexandre benoit

unread,
Oct 24, 2014, 5:07:56 AM10/24/14
to discuss...@googlegroups.com
Wow, thanks Slim,
i gonna test it very soon!
Good job !
   Alex

James Dash

unread,
Dec 3, 2014, 3:37:44 AM12/3/14
to discuss...@googlegroups.com
Hello,

This is a FYI, because that I have found another way to build WebRTC for ARM Linux. I have been watch this threads for a while, and at that time I had the same issue. What I did to compile it is to rewrite a CMake build script from scratch (with the help of some scripts.) The good part for this approach is we have control over some ARM CUP options like neon, soft fpu support etc. I am successfully using it in my project now. For details of these scripts please see here: How-to-cross-compile-WebRTC-for-ARM-linux (it is in Chinese, but the description is not long and easy - google translator should be good enough and the useful part are the scripts which do not need translation)

Wish this may help some struggling people.

Jim

alexandre benoit

unread,
Dec 3, 2014, 3:20:50 PM12/3/14
to discuss...@googlegroups.com
Hi James,

wow, this is an interesting approach, i gonna look at it.
Thanks !
   Alex

--

---
You received this message because you are subscribed to a topic in the Google Groups "discuss-webrtc" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/discuss-webrtc/yzuk8wATMU8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to discuss-webrt...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Footniko

unread,
Dec 3, 2014, 3:24:46 PM12/3/14
to discuss...@googlegroups.com
Hi, James! Thank you for sharing! Is it possible to crosscompile for armv5te with your approach?

Середа, 3 грудня 2014 р. 10:37:44 UTC+2 користувач James Dash написав:

Michael Zhang

unread,
Feb 24, 2015, 1:11:03 PM2/24/15
to discuss...@googlegroups.com
Hi James,

The link you mentioned below does not work any more. Is it possible you can share the scripts you used to cross compile WebRTC for ARM Linux?

Thanks,
-Michael
Reply all
Reply to author
Forward
0 new messages