编译WebRTC for Linux可以使用WebRTC for android的代码.
在WebRTC的编译脚本中已经预留了对交叉编译的支持,只需要执行
./build/linux/sysroot_scripts/install-sysroot.py --arch=arm
安装依赖需要编译机能够科学上网
编译arm linux库
指定编译目标系统和cpu架构
1. gn gen 'target_os="linux" target_cpu="arm"'
2. ninja -C out/default
可能出现的报错
File "../../build/toolchain/gcc_ar_wrapper.py", line66, in
sys.exit(main())
File "../../build/toolchain/gcc_ar_wrapper.py", line62, in main
return subprocess.call(wrapper_utils.CommandToRun(command))
File "/usr/lib/python2.7/subprocess.py", line522, in call
return Popen(*popenargs, **kwargs).wait()
File "/usr/lib/python2.7/subprocess.py", line710, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line1327, in_execute_child
raise child_exception
这是由于没有指明交叉编译工具链的路径导致的,编译要求安装arm-linux-gnueabihf-系列的工具链
安装编译器:
ubuntu 14.04: apt-get install gcc-arm-linux-gnueabihf
重新执行ninja -C out/default