Skip to content
Advertisement

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

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

target_cpu = “arm” using gn gen out/Debug –args=’target_cpu=”arm”‘ I get the following error

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

Advertisement

Answer

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).

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)

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”.

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).

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.

Advertisement