WebRTC building for hand

I want to build a webrtc for my little machine with arm926ej processor.
After installing depot_tools, I followed these steps:

gclient config http://webrtc.googlecode.com/svn/trunk
gclient sync --force
cd trunk
ninja -C out/Debug

      

Everything works fine and I can run some binaries that I get after compiling.
Now I want to compile my manual machine. I am doing the following:

rm -rf out
export GYP_CROSSCOMPILE=1
export GYP_DEFINES="target_arch=arm arm_float_abi=hard"
export CC=/path/to/my/gcc
export CXX=/path/to/my/g++
export AR=/path/to/my/ar
export CC_host=gcc 
export CXX_host=g++ 
gclient runhooks --force 

      

Still smooth ...
But when I try to compile it with the command:

ninja -C out/Debug

      

I got a lot of errors like:

CC obj/chromium/src/third_par...p/srtp/crypto/cipher/libsrtp.aes_cbc.o
FAILED: /opt/virt2real-sdk/codesourcery/arm-2013.05/bin/arm-none-linux-gnueabi-gcc -MMD -MF obj/chromium/src/third_party/libsrtp/srtp/crypto/cipher/libsrtp.aes_cbc.o.d -DHAVE_STDLIB_H -DHAVE_STRING_H -DV8_DEPRECATION_WARNINGS -D_FILE_OFFSET_BITS=64 -DHAVE_INT16_T -DHAVE_INT32_T -DHAVE_INT8_T -DHAVE_UINT16_T -DHAVE_UINT32_T -DHAVE_UINT64_T -DHAVE_UINT8_T -DHAVE_STDINT_H -DHAVE_INTTYPES_H -DHAVE_NETINET_IN_H -DINLINE=inline -DCPU_CISC -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 -DUSE_NSS=1 -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DWTF_USE_DYNAMIC_ANNOTATIONS=1 -D_DEBUG -D_GLIBCXX_DEBUG=1 -I../../chromium/src/third_party/libsrtp/config -I../../chromium/src/third_party/libsrtp/srtp/include -I../../chromium/src/third_party/libsrtp/srtp/crypto/include -Igen -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/footniko/my/webrtcnative/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 -target arm-linux-gnueabihf -march=armv7-a -no-integrated-as -mtune=generic-armv7-a -mfpu=neon -mfloat-abi=hard -mthumb --sysroot=/home/footniko/my/webrtcnative/trunk/arm-sysroot -O0 -g -funwind-tables -Wno-undefined-bool-conversion -Wno-tautological-undefined-compare   -c ../../chromium/src/third_party/libsrtp/srtp/crypto/cipher/aes_cbc.c -o obj/chromium/src/third_party/libsrtp/srtp/crypto/cipher/libsrtp.aes_cbc.o
arm-none-linux-gnueabi-gcc: error: unrecognized command line option '-Xclang'
arm-none-linux-gnueabi-gcc: error: unrecognized command line option '-Xclang'
arm-none-linux-gnueabi-gcc: error: unrecognized command line option '-Xclang'
arm-none-linux-gnueabi-gcc: error: unrecognized command line option '-add-plugin'
arm-none-linux-gnueabi-gcc: error: unrecognized command line option '-Xclang'
arm-none-linux-gnueabi-gcc: error: find-bad-constructs: No such file or directory
arm-none-linux-gnueabi-gcc: error: unrecognized command line option '-fcolor-diagnostics'
arm-none-linux-gnueabi-gcc: error: unrecognized command line option '-Wheader-hygiene'
arm-none-linux-gnueabi-gcc: error: unrecognized command line option '-Wstring-conversion'
arm-none-linux-gnueabi-gcc: error: unrecognized command line option '-target'
arm-none-linux-gnueabi-gcc: error: arm-linux-gnueabihf: No such file or directory
arm-none-linux-gnueabi-gcc: error: unrecognized command line option '-no-integrated-as'

      

+3


source to share


1 answer


I also had this problem, but it was export related compiler choices (CC, CXX, etc.). This actually makes you out of order, since -Xclang is not recognized by gcc.

Here is the method I was trying to compile. However, it looks like the webrtc core is moving fast and hasn't been running anymore in recent days. The biggest change related to your problem and 9dan's suggestion: you need to say that you want to target android (and linux) and for that you need android_tools. But now it is not retrieved from webrtc, you should get it from chrome.

Here's a quick rundown of the installation process.

System requirements:

Prefer a virtualized Lubuntu14.04 64 bit on a virtual disk of at least 30 GB 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 that host, here is the installation process:

basic presetting ... assuming none of the variables discussed later have already been exported

First, install the required 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 sample Webrtc

Create a directory to checkout and go

mkdir WebRTC
cd WebRTC
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
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 config http://webrtc.googlecode.com/svn/trunk 
gclient sync --force

      

Note 0: Sometime this fails as gcc, pkg-config, etc. not found. This often happens on a new installation where many packages are missing. Fortunately, the script should already be loaded:

trunk/built/install-build-deps.sh 

      

Run it to install all required packages and repeat

gclient sync --force

      

add all the required androids sdk & ndk that are needed to target hand 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: Android tools are not directly available from webrtc. It is recommended to use one of chrome. then in the Webrtc folder or other (for example, original location: trunk / third_party /).

cd myTargetDirectory // example cd trunk/third_party/
git clone https://chromium.googlesource.com/android_tools

      

Once you select android_tools, tweak the project to see it. Edit:

trunk/chromium/src/third_party/openmax_dl/dl/dl.gyp

      

and add the required android_ndk_root variable by adding the following line to 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 to 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-compilation for armv7a based platform

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

      

/ * => after another experiment, I used the above command, but I think this is not entirely necessary from a very clean installation. Anycase, if done, command "./build/install-build-deps.sh -arm" should be used to swap some cross compiler packages (mainly for keeping g ++ - arm-linux-gnueabihf and gcc-arm-linux -gnueabihf) * /

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

      

The target here is linux arm, so that should be enough, but if you want to customize android, you might need 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 in tutorials and tutorials. However, they bring several problems when used (unrecognized -Xclang flag, etc.). They don't seem to be any more useful as the gyp files automatically configure these settings! For me, avoiding them was the only way to get the config and start compiling.

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, set up your system before proceeding to the final compilation step.

cd ..
gclient runhooks --force
 cd trunk/

      

Potential error 1 resolved

First the following error appears: => gyp: Undefined variable android_ndk_root in chromium / src / third_party / openmax_dl / dl / dl.gyp => back to the previous section, you of course forgot to define android_ndk_root variable in enlightened file: 'Android_ndk_root': ' / trunk / THIRD_PARTY / android_tools / NDK / ', * /

Potential error 2, resolved

there is a relative communication problem when trying to configure traffic / build / linux / pkg-config-wrapper, you may get something similar to this: Updating projects from gyp files ... /bin/sh:../../ .. / build / linux / pkg-config-wrapper: No such file or directory gyp: Call "../../../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 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 returns non-zero exit status 1 in / media / workspace / lib / webrtc => if you want to resolve this issue for all files having this error , find the wrong files with:

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

      

and replace the corresponding relative path part in the pkg config line (at the beginning of each file found: 'pkg-config': 'trunk / build / linux / pkg-config-wrapper' <(sysroot) "<(target_arch)",

gclient runhooks --force

final compilation stage

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

      

idea: sudo apt-get install gcc-arm-linux-androideabi you should configure third-party_packages / android_tools / ndk / platform / android-XXX / arch-arm / usr / include / sys /

// if there are problems with clang, it can be deactivated with this additional option (rerun gclien runhooks after)

export GYP_DEFINES="$GYP_DEFINES clang=0"

      

+3


source







All Articles