Cross compile webrtc for ARM - sukinull/libwebrtc GitHub Wiki
-
The original
-
The original guide is here Cross compile WebRTC for Raspberry Pi
-
The environment
You know, Linux distributions are conflict. Even Ubuntu(Especially Ubuntu), version to version may result in building complex software Success or Fail. Here are the validated distributions:
lsb_release -a
No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 15.04 Release: 15.04 Codename: vivid
or
lsb_release -a
LSB Version: :core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch Distributor ID: CentOS Description: CentOS Linux release 7.1.1503 (Core) Release: 7.1.1503 Codename: Core
-
Install Toolchain : *3
sudo git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git /opt/depot_tools echo "export PATH=/opt/depot_tools:\$PATH" | sudo tee /etc/profile.d/depot_tools.sh sudo git clone https://github.com/raspberrypi/tools.git /opt/rpi_tools echo "export PATH=/opt/rpi_tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin:\$PATH" | sudo tee /etc/profile.d/rpi_tools.sh source /etc/profile -
Build sysroot : *2
sudo apt-get install qemu-user-static debootstrap sudo debootstrap --arch armhf --foreign --include=g++,libasound2-dev,libpulse-dev,libudev-dev,libexpat1-dev,libnss3-dev,libgtk2.0-dev wheezy rootfs sudo cp /usr/bin/qemu-arm-static rootfs/usr/bin/ sudo chroot rootfs /debootstrap/debootstrap --second-stage find rootfs/usr/lib/arm-linux-gnueabihf -lname '/*' -printf '%p %l\n' | while read link target do sudo ln -snfv "../../..${target}" "${link}" done find rootfs/usr/lib/arm-linux-gnueabihf/pkgconfig -printf "%f\n" | while read target do sudo ln -snfv "../../lib/arm-linux-gnueabihf/pkgconfig/${target}" rootfs/usr/share/pkgconfig/${target} done -
Build : *1
export GYP_CROSSCOMPILE=1 export GYP_DEFINES="target_arch=arm arm_float_abi=hard clang=1 include_tests=0 sysroot=$(pwd)/rootfs werror=" export GYP_GENERATOR_OUTPUT='arm' fetch --no-history webrtc ninja -C src/$GYP_GENERATOR_OUTPUT/out/Release
Notes
*1) Use shipped clang
*2) Use qemu-arm to chroot arm distribution
*3) rpi_tools provides arm-linux-gnueabihf-as, this is most important