简体   繁体   English

从 x_64 为 ARM 交叉编译铬时出错

[英]Error while cross-compiling chromium for ARM from x_64

I am trying to build chromium from source code following instructions at https://chromium.googlesource.com/chromium/src/+/master/docs/linux/build_instructions.md我正在尝试按照https://chromium.googlesource.com/chromium/src/+/master/docs/linux/build_instructions.md的说明从源代码构建铬

I have successfully built and tested chromium for amd device, Now I am trying to cross-compile it for arm device, However when I set the flag我已经成功地为 AMD 设备构建和测试了铬,现在我正在尝试为 arm 设备交叉编译它,但是当我设置标志时

target_cpu = "arm" using gn gen out/Debug --args='target_cpu="arm"' I get the following error target_cpu = "arm" using gn gen out/Debug --args='target_cpu="arm"' 我收到以下错误

ERROR at //build/config/linux/atk/BUILD.gn:13:1 (//build/toolchain/linux:clang_x86_v8_arm): Assertion failed.
assert(current_toolchain == default_toolchain)
^-----
See //ui/accessibility/BUILD.gn:294:20: which caused the file to be included.
      configs += [ "//build/config/linux/atk" ]

Any leads would be appreciated任何线索将不胜感激

I have had the same issue where I tried building chromium on my Linux x64 server for an ARM based device, I was able to get past the issue by commenting the assert function out (as the function assert is usually for sanity checking based on my understanding). I have had the same issue where I tried building chromium on my Linux x64 server for an ARM based device, I was able to get past the issue by commenting the assert function out (as the function assert is usually for sanity checking based on my understanding )。 You can achieve this by modifying the file build/config/linux/atk/BUILD.gn and adding a # to the following code assert(current_toolchain == default_toolchain) .您可以通过修改文件build/config/linux/atk/BUILD.gn并在以下代码中添加#来实现此目的assert(current_toolchain == default_toolchain)

I followed the guidance on the webpage suggested by Asesh (followed Recipe 2) but the issue we are facing is to do with different current_toolchain and default_toolchain being set and would cause assert() to fail, the instructions given on the webpage doesn't seem to relate to out problem.( https://chromium.googlesource.com/chromium/src/+/master/docs/linux/chromium_arm.md )我遵循 Asesh 建议的网页上的指导(遵循配方 2),但我们面临的问题是设置了不同的 current_toolchain 和 default_toolchain 并会导致assert()失败,网页上给出的说明似乎没有与出问题有关。( https://chromium.googlesource.com/chromium/src/+/master/docs/linux/chromium_arm.md

To explain why I commented out the assert() code, reading https://www.chromium.org/developers/gn-build-configuration I found the following section: Snip of section "Overriding the CPU architecture" .为了解释为什么我注释掉了 assert() 代码,阅读https://www.chromium.org/developers/gn-build-configuration我找到了以下部分: Snip of section "Overriding the CPU architecture"

As we both are configuring target_cpu="arm" , this should be enough to configure and build chromium for our ARM devices (this would cause current_toolchain to be set to a different toolchain then default_toolchain , hence why assert() is giving us this error).由于我们都在配置target_cpu="arm" ,这应该足以为我们的 ARM 设备配置和构建 chromium(这将导致current_toolchain设置为与default_toolchain不同的工具链,因此为什么assert()会给我们这个错误) .

After commenting out the assert() I was successfully able to run gn gen out/xxx , gn args out/xxx and run autoninja to build chromium.在注释掉 assert() 之后,我成功地运行了 gn gen out/xxxgn args out/xxx并运行autoninja来构建 chromium。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM