首页 关于 微信公众号
欢迎关注我的微信公众号

下载WebRTC最新源码并编译动态库

下载源码的时候,要用到 depot_tools 工具包,这是 Chromium 官方推荐的工具包,具备下载、同步、编译、上传代码等功能。depot_tools 的详细介绍见 Using depot_tools

depot_tools 源码属于 Google 的服务,即墙外资源,在获取 depot_tools 源码前,先需要开启 VPN 服务,然后在终端执行命令。

  1. git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git

如果依然出现连接失败的话,那就需要检查一下你的电脑是否真正能访问google服务。

  1. curl www.google.com

如果发现不能访问,则需要额外配置一下。 我翻墙使用的是ShadowSocksX,可以通过以下步骤查看ShadowSocksX的Socks5配置信息。

在终端中执行一下命令:

  1. ethan-wifi:webrtc zhangqi$ export http_proxy=socks5://127.0.0.1:10808
  2. ethan-wifi:webrtc zhangqi$ export https_proxy=socks5://127.0.0.1:10808
  3. ethan-wifi:webrtc zhangqi$ export all_proxy=socks5://127.0.0.1:10808

执行后,只对当前终端起作用。重启终端后,默认失效。

然后再curl一下google检测是否能访问。

接着在终端执行命令:

  1. ethan-wifi:webrtc zhangqi$ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
  2. Cloning into 'depot_tools'...
  3. remote: Sending approximately 29.75 MiB ...
  4. remote: Total 36912 (delta 25530), reused 36912 (delta 25530)
  5. Receiving objects: 100% (36912/36912), 29.75 MiB | 246.00 KiB/s, done.
  6. Resolving deltas: 100% (25530/25530), done.

添加环境变量,命令格式为:

  1. export PATH=$PATH:/path/depot_tools

其中,path 为上一步通过 pwd 命令获取的 depot_tools 文件夹所在目录。

在终端执行命令:

  1. export PATH=$PATH:/Users/zhangqi/Desktop/google/webrtc/depot_tools

在终端执行命令:

  1. fetch --help

首先要预留足够大磁盘空间,最好超过10G。 然后再终端组还行一下命令:

  1. fetch --nohooks webrtc_ios

这条命令会执行很长时间,耐心等待后结果如下:

  1. ethan-wifi:webrtc zhangqi$ fetch --nohooks webrtc_ios
  2. Running: gclient root
  3. Traceback (most recent call last):
  4. File "/Users/zhangqi/Desktop/google/webrtc/depot_tools/gclient.py", line 2031, in <module>
  5. @metrics.collector.collect_metrics('gclient recurse')
  6. File "/Users/zhangqi/Desktop/google/webrtc/depot_tools/metrics.py", line 246, in _decorator
  7. if not self.config.should_collect_metrics:
  8. File "/Users/zhangqi/Desktop/google/webrtc/depot_tools/metrics.py", line 122, in should_collect_metrics
  9. if not self.is_googler:
  10. File "/Users/zhangqi/Desktop/google/webrtc/depot_tools/metrics.py", line 98, in is_googler
  11. self._ensure_initialized()
  12. File "/Users/zhangqi/Desktop/google/webrtc/depot_tools/metrics.py", line 67, in _ensure_initialized
  13. req = urllib.urlopen(metrics_utils.APP_URL + '/should-upload')
  14. File "/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 154, in urlopen
  15. return opener.open(url, data, timeout)
  16. File "/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 429, in open
  17. response = self._open(req, data)
  18. File "/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 447, in _open
  19. '_open', req)
  20. File "/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 407, in _call_chain
  21. result = func(*args)
  22. File "/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1241, in https_open
  23. context=self._context)
  24. File "/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1195, in do_open
  25. h.request(req.get_method(), req.get_selector(), req.data, headers)
  26. File "/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1042, in request
  27. self._send_request(method, url, body, headers)
  28. File "/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1082, in _send_request
  29. self.endheaders(body)
  30. File "/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1038, in endheaders
  31. self._send_output(message_body)
  32. File "/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 882, in _send_output
  33. self.send(msg)
  34. File "/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 844, in send
  35. self.connect()
  36. File "/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1255, in connect
  37. HTTPConnection.connect(self)
  38. File "/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 824, in connect
  39. self._tunnel()
  40. File "/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 796, in _tunnel
  41. (version, code, message) = response._read_status()
  42. File "/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 402, in _read_status
  43. raise BadStatusLine(line)
  44. httplib.BadStatusLine: ''
  45. Running: gclient config --spec 'solutions = [
  46. {
  47. "url": "https://webrtc.googlesource.com/src.git",
  48. "managed": False,
  49. "name": "src",
  50. "deps_file": "DEPS",
  51. "custom_deps": {},
  52. },
  53. ]
  54. target_os = ["ios", "mac"]
  55. '
  56. WARNING: Your metrics.cfg file was invalid or nonexistent. A new one will be created.
  57. Running: gclient sync --nohooks --with_branch_heads
  58. 1>________ running 'git -c core.deltaBaseCacheLimit=2g clone --no-checkout --progress https://webrtc.googlesource.com/src.git /Users/zhangqi/Desktop/google/webrtc/_gclient_src_liH3Oz' in '/Users/zhangqi/Desktop/google/webrtc'
  59. 1>Cloning into '/Users/zhangqi/Desktop/google/webrtc/_gclient_src_liH3Oz'...
  60. 1>remote: Sending approximately 283.24 MiB ...
  61. 1>remote: Total 348023 (delta 261273), reused 348023 (delta 261273)
  62. 1>Receiving objects: 100% (348023/348023), 283.24 MiB | 936.00 KiB/s, done.
  63. 1>Resolving deltas: 100% (261273/261273), done.
  64. [0:06:00] Still working on:
  65. [0:06:00] src
  66. 1>Syncing projects: 0% ( 0/ 2)
  67. [0:06:03] Still working on:
  68. [0:06:03] src
  69. Syncing projects: 15% ( 6/38) src/buildtools/third_party/libunwind/trunk
  70. [0:07:34] Still working on:
  71. [0:07:34] src/base
  72. [0:07:34] src/build
  73. [0:07:34] src/ios
  74. [0:07:34] src/testing
  75. [0:07:34] src/third_party
  76. [0:07:34] src/tools
  77. [0:07:34] src/buildtools/third_party/libc++/trunk
  78. [0:07:44] Still working on:
  79. [0:07:44] src/base
  80. [0:07:44] src/build
  81. [0:07:44] src/ios
  82. [0:07:44] src/testing
  83. [0:07:44] src/third_party
  84. [0:07:44] src/tools
  85. [0:07:44] src/buildtools/third_party/libc++/trunk
  86. [0:07:54] Still working on:
  87. [0:07:54] src/base
  88. [0:07:54] src/build
  89. [0:07:54] src/ios
  90. [0:07:54] src/testing
  91. [0:07:54] src/third_party
  92. [0:07:54] src/tools
  93. [0:07:54] src/buildtools/third_party/libc++/trunk
  94. [0:07:58] Still working on:
  95. [0:07:58] src/base
  96. [0:07:58] src/build
  97. [0:07:58] src/ios
  98. [0:07:58] src/testing
  99. [0:07:58] src/third_party
  100. [0:07:58] src/tools
  101. [0:07:58] src/buildtools/third_party/libc++/trunk
  102. Syncing projects: 21% ( 8/38) src/testing
  103. [0:09:54] Still working on:
  104. [0:09:54] src/base
  105. [0:09:54] src/build
  106. [0:09:54] src/ios
  107. [0:09:54] src/third_party
  108. [0:09:54] src/tools
  109. ………………
  110. [2:05:44] Still working on:
  111. [2:05:44] src/third_party/catapult
  112. [2:05:44] src/third_party/icu
  113. Syncing projects: 100% (38/38), done.
  114. Running: git submodule foreach 'git config -f $toplevel/.git/config submodule.$name.ignore all'
  115. Running: git config --add remote.origin.fetch '+refs/tags/*:refs/tags/*'
  116. Running: git config diff.ignoreSubmodules all
  117. ethan-wifi:webrtc zhangqi$ ls
  118. depot_tools src
  119. ethan-wifi:webrtc zhangqi$
  120. ethan-wifi:webrtc zhangqi$

执行以下命令:

  1. gclient sync

执行结果如下:

  1. ethan-wifi:src zhangqi$ gclient sync
  2. Syncing projects: 100% (38/38), done.
  3. Running hooks: 45% (10/22) mac_toolchain
  4. ________ running 'vpython src/build/mac_toolchain.py' in '/Users/zhangqi/Desktop/google/webrtc'
  5. Skipping Mac toolchain installation for mac
  6. Running hooks: 54% (12/22) clang
  7. ________ running 'vpython src/tools/clang/scripts/update.py' in '/Users/zhangqi/Desktop/google/webrtc'
  8. Downloading https://commondatastorage.googleapis.com/chromium-browser-clang/Mac/clang-n341867-c2900381-1.tgz Traceback (most recent call last):
  9. File "src/tools/clang/scripts/update.py", line 383, in <module>
  10. sys.exit(main())
  11. File "src/tools/clang/scripts/update.py", line 379, in main
  12. return UpdatePackage(args.package)
  13. File "src/tools/clang/scripts/update.py", line 309, in UpdatePackage
  14. DownloadAndUnpackPackage(package_file, LLVM_BUILD_DIR)
  15. File "src/tools/clang/scripts/update.py", line 176, in DownloadAndUnpackPackage
  16. DownloadAndUnpack(cds_full_url, output_dir)
  17. File "src/tools/clang/scripts/update.py", line 148, in DownloadAndUnpack
  18. DownloadUrl(url, f)
  19. File "src/tools/clang/scripts/update.py", line 107, in DownloadUrl
  20. response = urlopen(url)
  21. File "/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 154, in urlopen
  22. return opener.open(url, data, timeout)
  23. File "/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 429, in open
  24. response = self._open(req, data)
  25. File "/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 447, in _open
  26. '_open', req)
  27. File "/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 407, in _call_chain
  28. result = func(*args)
  29. File "/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1241, in https_open
  30. context=self._context)
  31. File "/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1195, in do_open
  32. h.request(req.get_method(), req.get_selector(), req.data, headers)
  33. File "/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1042, in request
  34. self._send_request(method, url, body, headers)
  35. File "/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1082, in _send_request
  36. self.endheaders(body)
  37. File "/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1038, in endheaders
  38. self._send_output(message_body)
  39. File "/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 882, in _send_output
  40. self.send(msg)
  41. File "/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 844, in send
  42. self.connect()
  43. File "/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1255, in connect
  44. HTTPConnection.connect(self)
  45. File "/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 824, in connect
  46. self._tunnel()
  47. File "/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 796, in _tunnel
  48. (version, code, message) = response._read_status()
  49. File "/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 402, in _read_status
  50. raise BadStatusLine(line)
  51. httplib.BadStatusLine: ''
  52. Error: Command 'vpython src/tools/clang/scripts/update.py' returned non-zero exit status 1 in /Users/zhangqi/Desktop/google/webrtc

这个问题在网上查了很久,发现无论什么样的网络环境,在mac下总会报以上错误。后来查到说可以先不用管这个错误,update.py这个文件就是下载clang编译器的,你自己下载下来把它解压到该放的目录即可。后面会有介绍。

使用GN来产生Ninja工程文件,在终端执行以下命令:

  1. gn gen out/ios --args='target_os="ios" target_cpu="arm64" is_debug=true'

执行结果如下:

  1. ethan-wifi:src zhangqi$ gn gen out/ios --args='target_os="ios" target_cpu="arm64" is_debug=true'
  2. Warning: Multiple codesigning identities match "iPhone Developer"
  3. Warning: - 8A2570C5A4A2BF6131545B5623B4624C91B1AB73 (selected)
  4. Warning: - 5299CE872045A0DAC778A53856ADADBAF8FDE7E9
  5. Warning: - B134FFD7977C6CBA8C91EBEB8D578EDE17730BFA
  6. Warning: - 5944447BB7E22557538CCD253025E4160F16FB07
  7. Warning: - 1A869721D19303050E958ACD91B34E1786AD61BE
  8. Warning: - 8FA8015DC902333F208FE13925D6EE244F517A1C
  9. Warning: Please use either ios_code_signing_identity or
  10. Warning: ios_code_signing_identity_description variable to
  11. Warning: control which identity is selected.
  12. ERROR at //build/timestamp.gni:31:19: Script returned non-zero exit code.
  13. build_timestamp = exec_script(compute_build_timestamp,
  14. ^----------
  15. Current dir: /Users/zhangqi/Desktop/google/webrtc/src/out/ios/
  16. Command: python /Users/zhangqi/Desktop/google/webrtc/src/build/compute_build_timestamp.py default
  17. Returned 1.
  18. stderr:
  19. Traceback (most recent call last):
  20. File "/Users/zhangqi/Desktop/google/webrtc/src/build/compute_build_timestamp.py", line 127, in <module>
  21. sys.exit(main())
  22. File "/Users/zhangqi/Desktop/google/webrtc/src/build/compute_build_timestamp.py", line 113, in main
  23. last_commit_timestamp = int(open(lastchange_file).read())
  24. IOError: [Errno 2] No such file or directory: '/Users/zhangqi/Desktop/google/webrtc/src/build/util/LASTCHANGE.committime'
  25. See //base/BUILD.gn:34:1: whence it was imported.
  26. import("//build/timestamp.gni")
  27. ^-----------------------------
  28. See //third_party/opus/BUILD.gn:623:7: which caused the file to be included.
  29. "//base",
  30. ^-------

我这边遇到了上面的错误,然后执行以下命令:

  1. ./build/util/lastchange.py  build/util/LASTCHANGE

前提是确保build/util这个目录存在,所以要先查看以下这个目录是否存在。

由于上面报的update.py错误,导致lc++错误。 解决此问题的具体命令如下:

  1. ethan-wifi:src zhangqi$ curl https://commondatastorage.googleapis.com/chromium-browser-clang/Mac/clang-359912-2.tgz -o third_party/llvm-build/clang.tgz
  2. % Total % Received % Xferd Average Speed Time Time Time Current
  3. Dload Upload Total Spent Left Speed
  4. 100 27.9M 100 27.9M 0 0 916k 0 0:00:31 0:00:31 --:--:-- 929k
  5. ethan-wifi:src zhangqi$ ls third_party/llvm-build/
  6. clang.tgz
  7. ethan-wifi:src zhangqi$ mkdir third_party/llvm-build/Release+Asserts
  8. ethan-wifi:src zhangqi$ tar zxvf third_party/llvm-build/clang.tgz -C third_party/llvm-build/Release+Asserts
  9. x bin/
  10. x bin/clang
  11. x bin/clang++
  12. x bin/clang-cl
  13. x bin/llvm-pdbutil
  14. x bin/llvm-symbolizer
  15. x bin/llvm-undname
  16. x lib/
  17. x lib/clang/
  18. x lib/clang/9.0.0/
  19. x lib/clang/9.0.0/aarch64-fuchsia/
  20. x lib/clang/9.0.0/aarch64-fuchsia/lib/
  21. x lib/clang/9.0.0/aarch64-fuchsia/lib/libclang_rt.builtins.a
  22. x lib/clang/9.0.0/include/
  23. x lib/clang/9.0.0/include/__clang_cuda_builtin_vars.h
  24. x lib/clang/9.0.0/include/__clang_cuda_cmath.h
  25. x lib/clang/9.0.0/include/__clang_cuda_complex_builtins.h
  26. x lib/clang/9.0.0/include/__clang_cuda_device_functions.h
  27. x lib/clang/9.0.0/include/__clang_cuda_intrinsics.h
  28. x lib/clang/9.0.0/include/__clang_cuda_libdevice_declares.h
  29. x lib/clang/9.0.0/include/__clang_cuda_math_forward_declares.h
  30. x lib/clang/9.0.0/include/__clang_cuda_runtime_wrapper.h
  31. x lib/clang/9.0.0/include/__stddef_max_align_t.h
  32. x lib/clang/9.0.0/include/__wmmintrin_aes.h
  33. x lib/clang/9.0.0/include/__wmmintrin_pclmul.h
  34. x lib/clang/9.0.0/include/adxintrin.h
  35. x lib/clang/9.0.0/include/altivec.h
  36. x lib/clang/9.0.0/include/ammintrin.h
  37. x lib/clang/9.0.0/include/arm64intr.h
  38. x lib/clang/9.0.0/include/arm_acle.h
  39. x lib/clang/9.0.0/include/arm_fp16.h
  40. x lib/clang/9.0.0/include/arm_neon.h
  41. x lib/clang/9.0.0/include/armintr.h
  42. x lib/clang/9.0.0/include/avx2intrin.h
  43. x lib/clang/9.0.0/include/avx512bitalgintrin.h
  44. x lib/clang/9.0.0/include/avx512bwintrin.h
  45. x lib/clang/9.0.0/include/avx512cdintrin.h
  46. x lib/clang/9.0.0/include/avx512dqintrin.h
  47. x lib/clang/9.0.0/include/avx512erintrin.h
  48. x lib/clang/9.0.0/include/avx512fintrin.h
  49. x lib/clang/9.0.0/include/avx512ifmaintrin.h
  50. x lib/clang/9.0.0/include/avx512ifmavlintrin.h
  51. x lib/clang/9.0.0/include/avx512pfintrin.h
  52. x lib/clang/9.0.0/include/avx512vbmi2intrin.h
  53. x lib/clang/9.0.0/include/avx512vbmiintrin.h
  54. x lib/clang/9.0.0/include/avx512vbmivlintrin.h
  55. x lib/clang/9.0.0/include/avx512vlbitalgintrin.h
  56. x lib/clang/9.0.0/include/avx512vlbwintrin.h
  57. x lib/clang/9.0.0/include/avx512vlcdintrin.h
  58. x lib/clang/9.0.0/include/avx512vldqintrin.h
  59. x lib/clang/9.0.0/include/avx512vlintrin.h
  60. x lib/clang/9.0.0/include/avx512vlvbmi2intrin.h
  61. x lib/clang/9.0.0/include/avx512vlvnniintrin.h
  62. x lib/clang/9.0.0/include/avx512vnniintrin.h
  63. x lib/clang/9.0.0/include/avx512vpopcntdqintrin.h
  64. x lib/clang/9.0.0/include/avx512vpopcntdqvlintrin.h
  65. x lib/clang/9.0.0/include/avxintrin.h
  66. x lib/clang/9.0.0/include/bmi2intrin.h
  67. x lib/clang/9.0.0/include/bmiintrin.h
  68. x lib/clang/9.0.0/include/cetintrin.h
  69. x lib/clang/9.0.0/include/cldemoteintrin.h
  70. x lib/clang/9.0.0/include/clflushoptintrin.h
  71. x lib/clang/9.0.0/include/clwbintrin.h
  72. x lib/clang/9.0.0/include/clzerointrin.h
  73. x lib/clang/9.0.0/include/cpuid.h
  74. x lib/clang/9.0.0/include/cuda_wrappers/
  75. x lib/clang/9.0.0/include/cuda_wrappers/algorithm
  76. x lib/clang/9.0.0/include/cuda_wrappers/complex
  77. x lib/clang/9.0.0/include/cuda_wrappers/new
  78. x lib/clang/9.0.0/include/emmintrin.h
  79. x lib/clang/9.0.0/include/f16cintrin.h
  80. x lib/clang/9.0.0/include/float.h
  81. x lib/clang/9.0.0/include/fma4intrin.h
  82. x lib/clang/9.0.0/include/fmaintrin.h
  83. x lib/clang/9.0.0/include/fxsrintrin.h
  84. x lib/clang/9.0.0/include/gfniintrin.h
  85. x lib/clang/9.0.0/include/htmintrin.h
  86. x lib/clang/9.0.0/include/htmxlintrin.h
  87. x lib/clang/9.0.0/include/ia32intrin.h
  88. x lib/clang/9.0.0/include/immintrin.h
  89. x lib/clang/9.0.0/include/intrin.h
  90. x lib/clang/9.0.0/include/inttypes.h
  91. x lib/clang/9.0.0/include/invpcidintrin.h
  92. x lib/clang/9.0.0/include/iso646.h
  93. x lib/clang/9.0.0/include/limits.h
  94. x lib/clang/9.0.0/include/lwpintrin.h
  95. x lib/clang/9.0.0/include/lzcntintrin.h
  96. x lib/clang/9.0.0/include/mm3dnow.h
  97. x lib/clang/9.0.0/include/mm_malloc.h
  98. x lib/clang/9.0.0/include/mmintrin.h
  99. x lib/clang/9.0.0/include/module.modulemap
  100. x lib/clang/9.0.0/include/movdirintrin.h
  101. x lib/clang/9.0.0/include/msa.h
  102. x lib/clang/9.0.0/include/mwaitxintrin.h
  103. x lib/clang/9.0.0/include/nmmintrin.h
  104. x lib/clang/9.0.0/include/opencl-c.h
  105. x lib/clang/9.0.0/include/pconfigintrin.h
  106. x lib/clang/9.0.0/include/pkuintrin.h
  107. x lib/clang/9.0.0/include/pmmintrin.h
  108. x lib/clang/9.0.0/include/popcntintrin.h
  109. x lib/clang/9.0.0/include/ppc_wrappers/
  110. x lib/clang/9.0.0/include/ppc_wrappers/mmintrin.h
  111. x lib/clang/9.0.0/include/prfchwintrin.h
  112. x lib/clang/9.0.0/include/ptwriteintrin.h
  113. x lib/clang/9.0.0/include/rdseedintrin.h
  114. x lib/clang/9.0.0/include/rtmintrin.h
  115. x lib/clang/9.0.0/include/s390intrin.h
  116. x lib/clang/9.0.0/include/sanitizer/
  117. x lib/clang/9.0.0/include/sanitizer/allocator_interface.h
  118. x lib/clang/9.0.0/include/sanitizer/asan_interface.h
  119. x lib/clang/9.0.0/include/sanitizer/common_interface_defs.h
  120. x lib/clang/9.0.0/include/sanitizer/coverage_interface.h
  121. x lib/clang/9.0.0/include/sanitizer/dfsan_interface.h
  122. x lib/clang/9.0.0/include/sanitizer/hwasan_interface.h
  123. x lib/clang/9.0.0/include/sanitizer/linux_syscall_hooks.h
  124. x lib/clang/9.0.0/include/sanitizer/lsan_interface.h
  125. x lib/clang/9.0.0/include/sanitizer/msan_interface.h
  126. x lib/clang/9.0.0/include/sanitizer/netbsd_syscall_hooks.h
  127. x lib/clang/9.0.0/include/sanitizer/scudo_interface.h
  128. x lib/clang/9.0.0/include/sanitizer/tsan_interface.h
  129. x lib/clang/9.0.0/include/sanitizer/tsan_interface_atomic.h
  130. x lib/clang/9.0.0/include/sgxintrin.h
  131. x lib/clang/9.0.0/include/shaintrin.h
  132. x lib/clang/9.0.0/include/smmintrin.h
  133. x lib/clang/9.0.0/include/stdalign.h
  134. x lib/clang/9.0.0/include/stdarg.h
  135. x lib/clang/9.0.0/include/stdatomic.h
  136. x lib/clang/9.0.0/include/stdbool.h
  137. x lib/clang/9.0.0/include/stddef.h
  138. x lib/clang/9.0.0/include/stdint.h
  139. x lib/clang/9.0.0/include/stdnoreturn.h
  140. x lib/clang/9.0.0/include/tbmintrin.h
  141. x lib/clang/9.0.0/include/tgmath.h
  142. x lib/clang/9.0.0/include/tmmintrin.h
  143. x lib/clang/9.0.0/include/unwind.h
  144. x lib/clang/9.0.0/include/vadefs.h
  145. x lib/clang/9.0.0/include/vaesintrin.h
  146. x lib/clang/9.0.0/include/varargs.h
  147. x lib/clang/9.0.0/include/vecintrin.h
  148. x lib/clang/9.0.0/include/vpclmulqdqintrin.h
  149. x lib/clang/9.0.0/include/waitpkgintrin.h
  150. x lib/clang/9.0.0/include/wbnoinvdintrin.h
  151. x lib/clang/9.0.0/include/wmmintrin.h
  152. x lib/clang/9.0.0/include/x86intrin.h
  153. x lib/clang/9.0.0/include/xmmintrin.h
  154. x lib/clang/9.0.0/include/xopintrin.h
  155. x lib/clang/9.0.0/include/xray/
  156. x lib/clang/9.0.0/include/xray/xray_interface.h
  157. x lib/clang/9.0.0/include/xray/xray_log_interface.h
  158. x lib/clang/9.0.0/include/xray/xray_records.h
  159. x lib/clang/9.0.0/include/xsavecintrin.h
  160. x lib/clang/9.0.0/include/xsaveintrin.h
  161. x lib/clang/9.0.0/include/xsaveoptintrin.h
  162. x lib/clang/9.0.0/include/xsavesintrin.h
  163. x lib/clang/9.0.0/include/xtestintrin.h
  164. x lib/clang/9.0.0/lib/
  165. x lib/clang/9.0.0/lib/darwin/
  166. x lib/clang/9.0.0/lib/darwin/libclang_rt.asan_iossim_dynamic.dylib
  167. x lib/clang/9.0.0/lib/darwin/libclang_rt.asan_osx_dynamic.dylib
  168. x lib/clang/9.0.0/lib/darwin/libclang_rt.fuzzer_no_main_osx.a
  169. x lib/clang/9.0.0/lib/darwin/libclang_rt.ios.a
  170. x lib/clang/9.0.0/lib/darwin/libclang_rt.osx.a
  171. x lib/clang/9.0.0/lib/darwin/libclang_rt.profile_iossim.a
  172. x lib/clang/9.0.0/lib/darwin/libclang_rt.profile_osx.a
  173. x lib/clang/9.0.0/share/
  174. x lib/clang/9.0.0/share/asan_blacklist.txt
  175. x lib/clang/9.0.0/share/cfi_blacklist.txt
  176. x lib/clang/9.0.0/x86_64-fuchsia/
  177. x lib/clang/9.0.0/x86_64-fuchsia/lib/
  178. x lib/clang/9.0.0/x86_64-fuchsia/lib/libclang_rt.builtins.a
  179. x buildlog.txt
  180. x include/
  181. x include/c++/
  182. x include/c++/v1/
  183. x include/c++/v1/__bit_reference
  184. x include/c++/v1/__bsd_locale_defaults.h
  185. x include/c++/v1/__bsd_locale_fallbacks.h
  186. x include/c++/v1/__config
  187. x include/c++/v1/__debug
  188. x include/c++/v1/__errc
  189. x include/c++/v1/__functional_03
  190. x include/c++/v1/__functional_base
  191. x include/c++/v1/__functional_base_03
  192. x include/c++/v1/__hash_table
  193. x include/c++/v1/__libcpp_version
  194. x include/c++/v1/__locale
  195. x include/c++/v1/__mutex_base
  196. x include/c++/v1/__node_handle
  197. x include/c++/v1/__nullptr
  198. x include/c++/v1/__split_buffer
  199. x include/c++/v1/__sso_allocator
  200. x include/c++/v1/__std_stream
  201. x include/c++/v1/__string
  202. x include/c++/v1/__threading_support
  203. x include/c++/v1/__tree
  204. x include/c++/v1/__tuple
  205. x include/c++/v1/__undef_macros
  206. x include/c++/v1/algorithm
  207. x include/c++/v1/any
  208. x include/c++/v1/array
  209. x include/c++/v1/atomic
  210. x include/c++/v1/bit
  211. x include/c++/v1/bitset
  212. x include/c++/v1/cassert
  213. x include/c++/v1/ccomplex
  214. x include/c++/v1/cctype
  215. x include/c++/v1/cerrno
  216. x include/c++/v1/cfenv
  217. x include/c++/v1/cfloat
  218. x include/c++/v1/charconv
  219. x include/c++/v1/chrono
  220. x include/c++/v1/cinttypes
  221. x include/c++/v1/ciso646
  222. x include/c++/v1/climits
  223. x include/c++/v1/clocale
  224. x include/c++/v1/cmath
  225. x include/c++/v1/codecvt
  226. x include/c++/v1/compare
  227. x include/c++/v1/complex
  228. x include/c++/v1/complex.h
  229. x include/c++/v1/condition_variable
  230. x include/c++/v1/csetjmp
  231. x include/c++/v1/csignal
  232. x include/c++/v1/cstdarg
  233. x include/c++/v1/cstdbool
  234. x include/c++/v1/cstddef
  235. x include/c++/v1/cstdint
  236. x include/c++/v1/cstdio
  237. x include/c++/v1/cstdlib
  238. x include/c++/v1/cstring
  239. x include/c++/v1/ctgmath
  240. x include/c++/v1/ctime
  241. x include/c++/v1/ctype.h
  242. x include/c++/v1/cwchar
  243. x include/c++/v1/cwctype
  244. x include/c++/v1/deque
  245. x include/c++/v1/errno.h
  246. x include/c++/v1/exception
  247. x include/c++/v1/experimental/
  248. x include/c++/v1/experimental/__config
  249. x include/c++/v1/experimental/__memory
  250. x include/c++/v1/experimental/algorithm
  251. x include/c++/v1/experimental/any
  252. x include/c++/v1/experimental/chrono
  253. x include/c++/v1/experimental/coroutine
  254. x include/c++/v1/experimental/deque
  255. x include/c++/v1/experimental/filesystem
  256. x include/c++/v1/experimental/forward_list
  257. x include/c++/v1/experimental/functional
  258. x include/c++/v1/experimental/iterator
  259. x include/c++/v1/experimental/list
  260. x include/c++/v1/experimental/map
  261. x include/c++/v1/experimental/memory_resource
  262. x include/c++/v1/experimental/numeric
  263. x include/c++/v1/experimental/optional
  264. x include/c++/v1/experimental/propagate_const
  265. x include/c++/v1/experimental/ratio
  266. x include/c++/v1/experimental/regex
  267. x include/c++/v1/experimental/set
  268. x include/c++/v1/experimental/simd
  269. x include/c++/v1/experimental/string
  270. x include/c++/v1/experimental/string_view
  271. x include/c++/v1/experimental/system_error
  272. x include/c++/v1/experimental/tuple
  273. x include/c++/v1/experimental/type_traits
  274. x include/c++/v1/experimental/unordered_map
  275. x include/c++/v1/experimental/unordered_set
  276. x include/c++/v1/experimental/utility
  277. x include/c++/v1/experimental/vector
  278. x include/c++/v1/ext/
  279. x include/c++/v1/ext/__hash
  280. x include/c++/v1/ext/hash_map
  281. x include/c++/v1/ext/hash_set
  282. x include/c++/v1/fenv.h
  283. x include/c++/v1/filesystem
  284. x include/c++/v1/float.h
  285. x include/c++/v1/forward_list
  286. x include/c++/v1/fstream
  287. x include/c++/v1/functional
  288. x include/c++/v1/future
  289. x include/c++/v1/initializer_list
  290. x include/c++/v1/inttypes.h
  291. x include/c++/v1/iomanip
  292. x include/c++/v1/ios
  293. x include/c++/v1/iosfwd
  294. x include/c++/v1/iostream
  295. x include/c++/v1/istream
  296. x include/c++/v1/iterator
  297. x include/c++/v1/limits
  298. x include/c++/v1/limits.h
  299. x include/c++/v1/list
  300. x include/c++/v1/locale
  301. x include/c++/v1/locale.h
  302. x include/c++/v1/map
  303. x include/c++/v1/math.h
  304. x include/c++/v1/memory
  305. x include/c++/v1/module.modulemap
  306. x include/c++/v1/mutex
  307. x include/c++/v1/new
  308. x include/c++/v1/numeric
  309. x include/c++/v1/optional
  310. x include/c++/v1/ostream
  311. x include/c++/v1/queue
  312. x include/c++/v1/random
  313. x include/c++/v1/ratio
  314. x include/c++/v1/regex
  315. x include/c++/v1/scoped_allocator
  316. x include/c++/v1/set
  317. x include/c++/v1/setjmp.h
  318. x include/c++/v1/shared_mutex
  319. x include/c++/v1/span
  320. x include/c++/v1/sstream
  321. x include/c++/v1/stack
  322. x include/c++/v1/stdbool.h
  323. x include/c++/v1/stddef.h
  324. x include/c++/v1/stdexcept
  325. x include/c++/v1/stdint.h
  326. x include/c++/v1/stdio.h
  327. x include/c++/v1/stdlib.h
  328. x include/c++/v1/streambuf
  329. x include/c++/v1/string
  330. x include/c++/v1/string.h
  331. x include/c++/v1/string_view
  332. x include/c++/v1/strstream
  333. x include/c++/v1/support/
  334. x include/c++/v1/support/android/
  335. x include/c++/v1/support/android/locale_bionic.h
  336. x include/c++/v1/support/fuchsia/
  337. x include/c++/v1/support/fuchsia/xlocale.h
  338. x include/c++/v1/support/ibm/
  339. x include/c++/v1/support/ibm/limits.h
  340. x include/c++/v1/support/ibm/locale_mgmt_aix.h
  341. x include/c++/v1/support/ibm/support.h
  342. x include/c++/v1/support/ibm/xlocale.h
  343. x include/c++/v1/support/musl/
  344. x include/c++/v1/support/musl/xlocale.h
  345. x include/c++/v1/support/newlib/
  346. x include/c++/v1/support/newlib/xlocale.h
  347. x include/c++/v1/support/solaris/
  348. x include/c++/v1/support/solaris/floatingpoint.h
  349. x include/c++/v1/support/solaris/wchar.h
  350. x include/c++/v1/support/solaris/xlocale.h
  351. x include/c++/v1/support/win32/
  352. x include/c++/v1/support/win32/limits_msvc_win32.h
  353. x include/c++/v1/support/win32/locale_win32.h
  354. x include/c++/v1/support/xlocale/
  355. x include/c++/v1/support/xlocale/__nop_locale_mgmt.h
  356. x include/c++/v1/support/xlocale/__posix_l_fallback.h
  357. x include/c++/v1/support/xlocale/__strtonum_fallback.h
  358. x include/c++/v1/system_error
  359. x include/c++/v1/tgmath.h
  360. x include/c++/v1/thread
  361. x include/c++/v1/tuple
  362. x include/c++/v1/type_traits
  363. x include/c++/v1/typeindex
  364. x include/c++/v1/typeinfo
  365. x include/c++/v1/unordered_map
  366. x include/c++/v1/unordered_set
  367. x include/c++/v1/utility
  368. x include/c++/v1/valarray
  369. x include/c++/v1/variant
  370. x include/c++/v1/vector
  371. x include/c++/v1/version
  372. x include/c++/v1/wchar.h
  373. x include/c++/v1/wctype.h

前提设置:

  1. ethan-wifi:src zhangqi$ python tools_webrtc/ios/build_ios_libs.py --bitcode
  2. INFO:root:Building WebRTC with args: target_os="ios" ios_enable_code_signing=false use_xcode_clang=true is_component_build=false is_debug=false target_cpu="arm64" ios_deployment_target="8.0" rtc_libvpx_build_vp9=false enable_ios_bitcode=true use_goma=false enable_stripping=true
  3. Done. Made 1521 targets from 229 files in 2479ms
  4. INFO:root:Building target: framework_objc
  5. ninja: Entering directory `/Users/zhangqi/Desktop/google/webrtc/src/out_ios_libs/arm64_libs'
  6. [927/2642] CXX clang_x64/obj/buildtools/third_party/libc++/libc++/stdexcept.o
  7. FAILED: clang_x64/obj/buildtools/third_party/libc++/libc++/stdexcept.o
  8. ../../third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF clang_x64/obj/buildtools/third_party/libc++/libc++/stdexcept.o.d -D_LIBCPP_BUILDING_LIBRARY -DLIBCXX_BUILDING_LIBCXXABI -D_LIBCPP_HAS_NO_ALIGNED_ALLOCATION -DCR_XCODE_VERSION=1121 -DCR_CLANG_REVISION=\"n341867-c2900381-1\" -D_LIBCPP_ABI_UNSTABLE -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCPP_ENABLE_NODISCARD -DCR_LIBCXX_REVISION=375504 -D__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES=0 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -I../.. -Iclang_x64/gen -fvisibility-global-new-delete-hidden -fno-strict-aliasing -fstack-protector -fcolor-diagnostics -fmerge-all-constants -arch x86_64 -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -Xclang -fdebug-compilation-dir -Xclang . -no-canonical-prefixes -O2 -fno-omit-frame-pointer -gdwarf-4 -g2 -isysroot ../../../../../../../../Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -mmacosx-version-min=10.10.0 -fvisibility=hidden -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -fstrict-aliasing -fPIC -Werror -Wall -Wno-unused-variable -Wno-misleading-indentation -Wunguarded-availability -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-unneeded-internal-declaration -Wno-undefined-var-template -Wno-ignored-pragma-optimize -Wno-implicit-int-float-conversion -Wno-final-dtor-non-final-class -Wno-builtin-assume-aligned-alignment -Wno-deprecated-copy -Wno-range-loop-analysis -std=c++14 -stdlib=libc++ -nostdinc++ -isystem../../buildtools/third_party/libc++/trunk/include -isystem../../buildtools/third_party/libc++abi/trunk/include -fvisibility-inlines-hidden -fexceptions -frtti -c ../../buildtools/third_party/libc++/trunk/src/stdexcept.cpp -o clang_x64/obj/buildtools/third_party/libc++/libc++/stdexcept.o
  9. error: unknown warning option '-Wno-misleading-indentation'; did you mean '-Wno-binding-in-condition'? [-Werror,-Wunknown-warning-option]
  10. error: unknown warning option '-Wno-implicit-int-float-conversion'; did you mean '-Wno-implicit-float-conversion'? [-Werror,-Wunknown-warning-option]
  11. error: unknown warning option '-Wno-final-dtor-non-final-class'; did you mean '-Wno-abstract-final-class'? [-Werror,-Wunknown-warning-option]
  12. error: unknown warning option '-Wno-builtin-assume-aligned-alignment' [-Werror,-Wunknown-warning-option]
  13. error: unknown warning option '-Wno-deprecated-copy'; did you mean '-Wno-deprecated'? [-Werror,-Wunknown-warning-option]
  14. [928/2642] CXX clang_x64/obj/buildtools/third_party/libc++/libc++/string.o
  15. FAILED: clang_x64/obj/buildtools/third_party/libc++/libc++/string.o
  16. ../../third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF clang_x64/obj/buildtools/third_party/libc++/libc++/string.o.d -D_LIBCPP_BUILDING_LIBRARY -DLIBCXX_BUILDING_LIBCXXABI -D_LIBCPP_HAS_NO_ALIGNED_ALLOCATION -DCR_XCODE_VERSION=1121 -DCR_CLANG_REVISION=\"n341867-c2900381-1\" -D_LIBCPP_ABI_UNSTABLE -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCPP_ENABLE_NODISCARD -DCR_LIBCXX_REVISION=375504 -D__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES=0 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -I../.. -Iclang_x64/gen -fvisibility-global-new-delete-hidden -fno-strict-aliasing -fstack-protector -fcolor-diagnostics -fmerge-all-constants -arch x86_64 -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -Xclang -fdebug-compilation-dir -Xclang . -no-canonical-prefixes -O2 -fno-omit-frame-pointer -gdwarf-4 -g2 -isysroot ../../../../../../../../Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -mmacosx-version-min=10.10.0 -fvisibility=hidden -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -fstrict-aliasing -fPIC -Werror -Wall -Wno-unused-variable -Wno-misleading-indentation -Wunguarded-availability -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-unneeded-internal-declaration -Wno-undefined-var-template -Wno-ignored-pragma-optimize -Wno-implicit-int-float-conversion -Wno-final-dtor-non-final-class -Wno-builtin-assume-aligned-alignment -Wno-deprecated-copy -Wno-range-loop-analysis -std=c++14 -stdlib=libc++ -nostdinc++ -isystem../../buildtools/third_party/libc++/trunk/include -isystem../../buildtools/third_party/libc++abi/trunk/include -fvisibility-inlines-hidden -fexceptions -frtti -c ../../buildtools/third_party/libc++/trunk/src/string.cpp -o clang_x64/obj/buildtools/third_party/libc++/libc++/string.o
  17. error: unknown warning option '-Wno-misleading-indentation'; did you mean '-Wno-binding-in-condition'? [-Werror,-Wunknown-warning-option]
  18. error: unknown warning option '-Wno-implicit-int-float-conversion'; did you mean '-Wno-implicit-float-conversion'? [-Werror,-Wunknown-warning-option]
  19. error: unknown warning option '-Wno-final-dtor-non-final-class'; did you mean '-Wno-abstract-final-class'? [-Werror,-Wunknown-warning-option]
  20. error: unknown warning option '-Wno-builtin-assume-aligned-alignment' [-Werror,-Wunknown-warning-option]
  21. error: unknown warning option '-Wno-deprecated-copy'; did you mean '-Wno-deprecated'? [-Werror,-Wunknown-warning-option]
  22. [932/2642] CXX obj/modules/video_coding/webrtc_vp8_temporal_layers/default_temporal_layers.o
  23. ninja: build stopped: subcommand failed.
  24. Traceback (most recent call last):
  25. File "tools_webrtc/ios/build_ios_libs.py", line 239, in <module>
  26. sys.exit(main())
  27. File "tools_webrtc/ios/build_ios_libs.py", line 170, in main
  28. args.use_goma, gn_args)
  29. File "tools_webrtc/ios/build_ios_libs.py", line 142, in BuildWebRTC
  30. _RunCommand(cmd)
  31. File "tools_webrtc/ios/build_ios_libs.py", line 77, in _RunCommand
  32. subprocess.check_call(cmd, cwd=SRC_DIR)
  33. File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 540, in check_call
  34. raise CalledProcessError(retcode, cmd)
  35. subprocess.CalledProcessError: Command '['/Users/zhangqi/Desktop/google/webrtc/src/third_party/depot_tools/ninja', '-C', '/Users/zhangqi/Desktop/google/webrtc/src/out_ios_libs/arm64_libs', 'framework_objc']' returned non-zero exit status 1

-Wno-misleading-indentation,-Wno-implicit-int-float-conversion,-Wno-final-dtor-non-final-class,-Wno-builtin-assume-aligned-alignment,-Wno-deprecated-copy设置注释掉之后,编译就会成功,具体执行过程如下:

  1. ethan-wifi:src zhangqi$ python tools_webrtc/ios/build_ios_libs.py --bitcode
  2. INFO:root:Building WebRTC with args: target_os="ios" ios_enable_code_signing=false use_xcode_clang=true is_component_build=false is_debug=false target_cpu="arm64" ios_deployment_target="9.0" rtc_libvpx_build_vp9=false enable_ios_bitcode=true use_goma=false enable_stripping=true
  3. Done. Made 1521 targets from 229 files in 2337ms
  4. INFO:root:Building target: framework_objc
  5. ninja: Entering directory `/Users/zhangqi/Desktop/google/webrtc/src/out_ios_libs/arm64_libs'
  6. [2642/2642] STAMP obj/sdk/framework_objc.stamp
  7. INFO:root:Merging framework slices.
  8. INFO:root:Done.

查看其支持的cpu架构:

  1. ethan-wifi:src zhangqi$ lipo -info out_ios_libs/WebRTC.framework/WebRTC
  2. Architectures in the fat file: out_ios_libs/WebRTC.framework/WebRTC are: arm64

Blog

Opinion

Project