I've spent the last couple of days trying to cross compile CEF for ARM. The Endgame is to run CefPython on the Raspberry Pi. But at the moment I'm stuck getting CEF to build.
I tried to follow the Linux Step-by-Step guide from the CEF Wiki plus the the comments by Marshall Greenblatt from the Issue# 1990 - Linux: Add ARM build support in bold. I noticed that the Issue# 1990 dates back to September 2016 whereas the Wiki Page was last edited this year, perhaps there are some discrepancies now? Anyway, I'm pretty sure the build doesn't select the cross compiler
I'm on Ubuntu Linux 4.13.0-38-generic #43-Ubuntu SMP Wed Mar 14 15:20:44 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
So here goes
1. Create the following directories.
mkdir ~/code/automate
mkdir ~/code/chromium_git
2. Download and run "~/code/install-build-deps.sh"
cd ~/code
curl 'https://chromium.googlesource.com/chromium/src/+/master/build/install-build-deps.sh?format=TEXT' | base64 -d > install-build-deps.sh
chmod 755 install-build-deps.sh
sudo ./install-build-deps.sh [Question: shouldn't I specify --arm here?]
At this point the install script warns me about missing chromeOS fonts which I ignore
No missing packages, and the packages are up to date.
Installing Chrome OS fonts.
sudo: ./linux/install-chromeos-fonts.py: command not found
ERROR: The installation of the Chrome OS default fonts failed.
This is expected if your repo is installed on a remote file system.
It is recommended to install your repo on a local file system.
You can skip the installation of the Chrome OS default founts with
3. Install the "libgtkglext1-dev" package required by the cefclient sample application.
sudo apt-get install libgtkglext1-dev
4. Download "~/code/depot_tools" using Git.
cd ~/code
git clone https://chromium.googlesource.com/chrom ... _tools.git
5. Add the "~/code/depot_tools" directory to your PATH. Note the use of an absolute path here.
export PATH=/home/rando/code/depot_tools:$PATH
6. Download the "~/automate/automate-git.py" script.
cd ~/code/automate
wget https://bitbucket.org/chromiumembedded/ ... ate-git.py
7. Create the "~/code/chromium_git/update.sh" script with the following contents.
#!/bin/bash
export CEF_USE_GN=1
export GYP_DEFINES=target_arch=arm
export GN_DEFINES="is_official_build=true use_sysroot=true use_allocator=none symbol_level=1 arm_float_abi=hard"
python ../automate/automate-git.py --download-dir=/home/rando/code/chromium_git --depot-tools-dir=/home/rando/code/depot_tools --no-distrib --no-build --arm-build [Question: --no-build and --arm-build is, is that right?]
Give it executable permissions.
cd ~/code/chromium_git
chmod +x update.sh
./update.sh
8. Create the "~/code/chromium_git/chromium/src/cef/create.sh" script with the following contents.
#!/bin/bash
export CEF_USE_GN=1
export GYP_DEFINES=target_arch=arm
export GN_DEFINES="is_official_build=true use_sysroot=true use_allocator=none symbol_level=1 arm_float_abi=hard enable_vr=false"
./cef_create_projects.sh
Give it executable permissions.
cd ~/code/chromium_git/chromium/src/cef
chmod +x create.sh
./create.sh
It it seems to create an output directory for the wrong platform (x86 instead of arm) "gn gen out/Debug_GN_x86":
...
Generating CEF project files...
NOTE: Not generating arm configuration due to missing sysroot directory
________ running 'gn gen out/Debug_GN_x86' in '/home/rando/code/chromium_git/chromium/src'
Done. Made 7829 targets from 1480 files in 4002ms
________ running 'gn gen out/Release_GN_x86' in '/home/rando/code/chromium_git/chromium/src'
Done. Made 7829 targets from 1480 files in 3604ms
________ running 'gn gen out/Release_GN_x64' in '/home/rando/code/chromium_git/chromium/src'
Done. Made 7803 targets from 1482 files in 3507ms
________ running 'gn gen out/Debug_GN_x64' in '/home/rando/code/chromium_git/chromium/src'
Done. Made 7803 targets from 1482 files in 3502ms
That doesn't seem right to me.
9. If I continue to doing a Debug build of CEF/Chromium using Ninja
cd ~/code/chromium_git/chromium/src
ninja -C out/Debug_GN_x64 cef chrome_sandbox
At this point it would compile (for hours), yet fail to link complaining about missing crashpad symbols:
ninja: Entering directory `out/Debug_GN_x64/'
[7055/7059] SOLINK ./libcef.so
FAILED: libcef.so libcef.so.TOC
python "../../build/toolchain/gcc_solink_wrapper.py" --readelf="readelf" --nm="nm" --sofile="./libcef.so" --tocfile="./libcef.so.TOC" --output="./libcef.so" -- ../../third_party/llvm-build/Release+Asserts/bin/clang++ -shared -fPIC -Wl,-z,noexecstack -Wl,-z,now -Wl,-z,relro -Wl,-z,defs -Wl,--no-as-needed -lpthread -Wl,--as-needed -fuse-ld=lld -Wl,--icf=all -m64 -Werror -Wl,--gdb-index -nostdlib++ -Wl,--export-dynamic -o "./libcef.so" -Wl,-soname="libcef.so" @"./libcef.so.rsp"
/home/rando/code/chromium_git/chromium/src/out/Debug_GN_x64/../../third_party/llvm-build/Release+Asserts/bin/ld.lld: error: undefined symbol: crashpad::Annotation::kValueMaxSize
>>> referenced by string:896 (../../buildtools/third_party/libc++/trunk/include/string:896)
>>> crash_reporter_client.o:(CefCrashReporterClient::ReadCrashConfigFile()) in archive obj/cef/libcef_static.a
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
But I presume that's another, unrelated problem further down the road. So ignore step 9 for now.
Right now I'm only interested in getting the build set up correctly to cross compile the project. Any other problems, I'll address later.
I'd be grateful for any inputs. I'm unfamiliar with Ninja buildtool and it's difficult for me to see what is awry.