概要
ソースコード取得とビルド
GoogleのLinux版の手順通りに進めていくとx86
に依存した問題があちこちから出てくるので一つ一つ解決していく
ビルド環境
種類 | 内容 |
---|---|
デバイス | M1 MacBook Pro 2021 (Apple M1 Pro: 高効率8 + 2) |
VM | UTM v3.0.4 (QEMU) (GPU support:disable) |
VM上のOS | Ubuntu20.04 |
割り当てたCPU | 6 core |
割り当てたRAM | 16GB |
コンパイル中の状況をみると16GBは使い切っている。もう少し割り当てたほうが早くコンパイルが終わりそうだ
コンパイル時間
約5時間
時間の種類 | かかった時間 | 説明 |
---|---|---|
real | 305m35.239s | 指定したコマンドを実行するためにかかった時間 |
user | 1745m29.346s | 指定したコマンドを実行するため使用したユーザーCPU時間 |
sys | 81m21.569s | 指定したコマンドを実行するために使ったシステムCPU時間 |
ARM版Ubuntuでコンパイルするために修正概要
修正箇所 | 不具合内容 | 修正内容 |
---|---|---|
install-build-deps.sh |
x86 のみサポート |
Arm64 に対応 |
gn |
x86 版がダウンロードされる |
Arm64 版を利用するようにDEPS を書き換え |
ninja |
aarch64 に未対応 |
ソースからコンパイルして利用 |
clang |
x86 版を利用する |
Arm64 版に設定変更 |
NodeJS |
x86 版がダウンロードされる |
Arm64 版で置き換え |
JDK(JRE) |
x86 版がダウンロードされる |
Arm64 版で置き換え |
clang-format |
x86 版がダウンロードされる |
Arm64 版で置き換え |
eu-strip |
x86 版がダウンロードされる |
システムのArm64 版で置き換え |
libxkbcommon-dev |
v1.0.0 以上が必要 |
v1.0.3 版で置き換え |
無視した不具合
不具合箇所 | 不具合内容 | 無視の理由 |
---|---|---|
gclient runhooks | NaCl関連でAsssertionError
|
NaCl は無効にするので無視 |
v8_context_snapshot |
histogram.cc でエラー |
動作はするので無視 |
作業内容
install-buid-deps.sh の問題解決
install-buid-deps.sh はArm64を未サポートのためエラー発生
$ ./build/install-build-deps.sh
Only x86 architectures are currently supported
x86
依存箇所を解決してArm64
で動作させたい
./build/install-build-deps-aarch64.sh
を作成してそのファイルを修正していく
$ cp ./build/install-build-deps.sh ./build/install-build-deps-aarch64.sh
最初の修正箇所
aarch64
を追加してx86
以外でエラーでストップしないように修正
if ! uname -m | egrep -q "i686|x86_64|aarch64"; then
echo "Only x86 architectures are currently supported" >&2
exit
fi
aarch64
を認識させて実行する
$ bash -x ./build/install-build-deps-aarch64.sh
++ apt-get --just-print install apache2-bin binutils binutils-aarch64-linux-gnu binutils-arm-linux-gnueabihf binutils-mips64el-linux-gnuabi64 binutils-mipsel-linux-gnu bison bzip2 cdbs curl dbus-x11 devscripts dpkg-dev elfutils fakeroot flex git-core gperf lib32stdc++6 libapache2-mod-php7.4 libasound2 libasound2-dev libatk1.0-0 libatspi2.0-0 libatspi2.0-dev libbluetooth-dev libbrlapi0.7 libbrlapi-dev libbz2-1.0 libbz2-dev libc6 libc6-dev libc6-i386 libcairo2 libcairo2-dev libcap2 libcap-dev libcups2 libcups2-dev libcurl4-gnutls-dev libdrm2 libdrm-dev libelf-dev libevdev2 libevdev-dev libexpat1 libffi7 libffi-dev libfontconfig1 libfreetype6 libgbm1 libgbm-dev libglib2.0-0 libglib2.0-dev libglu1-mesa-dev libgtk-3-0 libgtk-3-dev libinput10 libinput-dev libjpeg-dev libkrb5-dev libnspr4 libnspr4-dev libnss3 libnss3-dev libpam0g libpam0g-dev libpango-1.0-0 libpci3 libpci-dev libpcre3 libpixman-1-0 libpng16-16 libpulse0 libpulse-dev libsctp-dev libspeechd2 libspeechd-dev libsqlite3-0 libsqlite3-dev libssl-dev libstdc++6 libudev1 libudev-dev libuuid1 libva-dev libvulkan1 libvulkan-dev libwayland-egl1-mesa libwww-perl libx11-6 libx11-xcb1 libxau6 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxdmcp6 libxext6 libxfixes3 libxi6 libxinerama1 libxkbcommon-dev libxrandr2 libxrender1 libxshmfence-dev libxslt1-dev libxss-dev libxt-dev libxtst6 libxtst-dev locales mesa-common-dev openbox p7zip patch perl php7.4-cgi pkg-config python2-dev python-crypto python-is-python2 python-numpy python-openssl python-psutil python-setuptools python-yaml rpm ruby snapcraft subversion uuid-dev wdiff x11-utils xcompmgr xz-utils zip zlib1g
E: Unable to locate package lib32stdc++6
E: Couldn't find any package by regex 'lib32stdc++6'
E: Unable to locate package libc6-i386
x86(x64)に依存したパッケージでエラー
NaCl
関連のようなので--no-nacl
とし、その他の必要ないパッケージも切って実行
$ bash -x ./build/install-build-deps-aarch64.sh --no-arm --no-chromeos-fonts --no-nacl --no-backwards-compatible 2> ../error2
++ apt-get --just-print install apache2-bin binutils binutils-aarch64-linux-gnu binutils-arm-linux-gnueabihf binutils-mips64el-linux-gnuabi64 binutils-mipsel-linux-gnu bison bzip2 cdbs curl dbus-x11 devscripts dpkg-dev elfutils fakeroot flex git-core gperf lib32stdc++6 libapache2-mod-php7.4 libasound2 libasound2-dev libatk1.0-0 libatspi2.0-0 libatspi2.0-dev libbluetooth-dev libbrlapi0.7 libbrlapi-dev libbz2-1.0 libbz2-dev libc6 libc6-dev libc6-i386 libcairo2 libcairo2-dev libcap2 libcap-dev libcups2 libcups2-dev libcurl4-gnutls-dev libdrm2 libdrm-dev libelf-dev libevdev2 libevdev-dev libexpat1 libffi7 libffi-dev libfontconfig1 libfreetype6 libgbm1 libgbm-dev libglib2.0-0 libglib2.0-dev libglu1-mesa-dev libgtk-3-0 libgtk-3-dev libinput10 libinput-dev libjpeg-dev libkrb5-dev libnspr4 libnspr4-dev libnss3 libnss3-dev libpam0g libpam0g-dev libpango-1.0-0 libpci3 libpci-dev libpcre3 libpixman-1-0 libpng16-16 libpulse0 libpulse-dev libsctp-dev libspeechd2 libspeechd-dev libsqlite3-0 libsqlite3-dev libssl-dev libstdc++6 libudev1 libudev-dev libuuid1 libva-dev libvulkan1 libvulkan-dev libwayland-egl1-mesa libwww-perl libx11-6 libx11-xcb1 libxau6 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxdmcp6 libxext6 libxfixes3 libxi6 libxinerama1 libxkbcommon-dev libxrandr2 libxrender1 libxshmfence-dev libxslt1-dev libxss-dev libxt-dev libxtst6 libxtst-dev locales mesa-common-dev openbox p7zip patch perl php7.4-cgi pkg-config python2-dev python-crypto python-is-python2 python-numpy python-openssl python-psutil python-setuptools python-yaml rpm ruby snapcraft subversion uuid-dev wdiff x11-utils xcompmgr xz-utils zip zlib1g
E: Unable to locate package lib32stdc++6
E: Couldn't find any package by regex 'lib32stdc++6'
E: Unable to locate package libc6-i386
同じパッケージでエラーが発生
64bit
か否かのチェックはしているがx64
かArm64
の確認をしておらずエラーになる
真面目に修正するのが面倒なのでとりあえず動けば良いという方針で修正
# if file -L /sbin/init | grep -q 'ELF 64-bit'; then
if 0; then
これでどうにか動作するようになった
$ bash -x ./build/install-build-deps-aarch64.sh --no-arm --no-chromeos-fonts --no-nacl --no-backwards-compatible
修正ファイルの差分
$ diff -u ./build/install-build-deps.sh ./build/install-build-deps-aarch64.sh
--- ./build/install-build-deps.sh 2022-02-17 15:01:03.989997756 +0000
+++ ./build/install-build-deps-aarch64.sh 2022-02-18 08:54:27.433185436 +0000
@@ -114,7 +114,7 @@
exit 1
fi
- if ! uname -m | egrep -q "i686|x86_64"; then
+ if ! uname -m | egrep -q "i686|x86_64|aarch64"; then
echo "Only x86 architectures are currently supported" >&2
exit
fi
@@ -220,16 +220,16 @@
# 64-bit systems need a minimum set of 32-bit compat packages for the pre-built
# NaCl binaries.
-if file -L /sbin/init | grep -q 'ELF 64-bit'; then
- dev_list="${dev_list} libc6-i386 lib32stdc++6"
-
+# if file -L /sbin/init | grep -q 'ELF 64-bit'; then
+# dev_list="${dev_list} libc6-i386 lib32stdc++6"
+#
# lib32gcc-s1 used to be called lib32gcc1 in older distros.
- if package_exists lib32gcc-s1; then
- dev_list="${dev_list} lib32gcc-s1"
- elif package_exists lib32gcc1; then
- dev_list="${dev_list} lib32gcc1"
- fi
-fi
+# if package_exists lib32gcc-s1; then
+# dev_list="${dev_list} lib32gcc-s1"
+# elif package_exists lib32gcc1; then
+# dev_list="${dev_list} lib32gcc1"
+# fi
+# fi
# Run-time libraries required by chromeos only
chromeos_lib_list="libpulse0 libbz2-1.0"
@@ -659,6 +659,10 @@
sort -u | sort -r -s -t: -k2 | tr "\n" " "
)"
+echo "${dev_list} ${lib_list} ${dbg_list} ${lib32_list} ${arm_list}" \
+ "${nacl_list}" ${filtered_backwards_compatible_list} | tr " " "\n" | \
+ sort -u | sort -r -s -t: -k2 | tr "\n" " "
+
if [ 1 -eq "${do_quick_check-0}" ] ; then
if ! missing_packages="$(dpkg-query -W -f ' ' ${packages} 2>&1)"; then
# Distinguish between packages that actually aren't available to the
gclient runhooks の問題は無視
$ gclient runhooks
Hook 'vpython -vpython-spec src/.vpython -vpython-tool install' took 14.78 secs
Hook 'vpython3 -vpython-spec src/.vpython3 -vpython-tool install' took 23.38 secs
Running hooks: 5% ( 7/121) nacltools
________ running 'python3 src/build/download_nacl_toolchains.py --mode nacl_core_sdk sync --extract' in '/home/rai/work/chromium'
Traceback (most recent call last):
File "src/build/download_nacl_toolchains.py", line 56, in <module>
sys.exit(Main(sys.argv[1:]))
File "src/build/download_nacl_toolchains.py", line 52, in Main
return package_version.main(args)
File "/home/rai/work/chromium/src/native_client/build/package_version/package_version.py", line 1290, in main
arguments = ParseArgs(args)
File "/home/rai/work/chromium/src/native_client/build/package_version/package_version.py", line 1118, in ParseArgs
host_arch = pynacl.platform.GetArch3264()
File "/home/rai/work/chromium/src/native_client/pynacl/platform.py", line 133, in GetArch3264
assert machine in ARCH3264_DICT, "Unrecognized arch machine: %s" % machine
AssertionError: Unrecognized arch machine: aarch64
Error: Command 'python3 src/build/download_nacl_toolchains.py --mode nacl_core_sdk sync --extract' returned non-zero exit status 1 in /home/rai/work/chromium
Traceback (most recent call last):
File "src/build/download_nacl_toolchains.py", line 56, in <module>
sys.exit(Main(sys.argv[1:]))
File "src/build/download_nacl_toolchains.py", line 52, in Main
return package_version.main(args)
File "/home/rai/work/chromium/src/native_client/build/package_version/package_version.py", line 1290, in main
arguments = ParseArgs(args)
File "/home/rai/work/chromium/src/native_client/build/package_version/package_version.py", line 1118, in ParseArgs
host_arch = pynacl.platform.GetArch3264()
File "/home/rai/work/chromium/src/native_client/pynacl/platform.py", line 133, in GetArch3264
assert machine in ARCH3264_DICT, "Unrecognized arch machine: %s" % machine
AssertionError: Unrecognized arch machine: aarch64
aarch64
に未対応だとのエラーがでているが、AssertionError
でありNaCl
関係のエラーのようだ。今回はNaCl
を disable
すれば良いだろうということでAssertionError
を無視して進める。
gn の問題解決
gnはx86実行形式ファイルのためエラーとなる
$ gn gen out/Default
Traceback (most recent call last):
File "/home/rai/depot_tools/gn.py", line 74, in <module>
sys.exit(main(sys.argv))
File "/home/rai/depot_tools/gn.py", line 69, in main
return subprocess.call([gn_path] + args[1:])
File "/usr/lib/python3.8/subprocess.py", line 340, in call
with Popen(*popenargs, **kwargs) as p:
File "/usr/lib/python3.8/subprocess.py", line 858, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/lib/python3.8/subprocess.py", line 1704, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
OSError: [Errno 8] Exec format error: '/home/rai/work/chromium/src/buildtools/linux64/gn'
$ file /home/rai/work/chromium/src/buildtools/linux64/gn
/home/rai/work/chromium/src/buildtools/linux64/gn: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[xxHash]=8e3face38c436111, with debug_info, not stripped
gn
はリポジトリに最初から存在しているわけではなく、gclient sync
でダウンロードしてきている。
Arm64版
をどこからか調達して置き換えたい
Google
でgn linux-arm64
を検索しダウンロード先を見つける
DEPS
ファイルを修正 (DEPS
ファイルは chromium/src
に存在)
$ git diff DEPS
diff --git a/DEPS b/DEPS
index bfa84e162e..1ff9312431 100644
--- a/DEPS
+++ b/DEPS
@@ -463,7 +463,7 @@ deps = {
'src/buildtools/linux64': {
'packages': [
{
- 'package': 'gn/gn/linux-amd64',
+ 'package': 'gn/gn/linux-arm64',
'version': Var('gn_version'),
}
],
ダウンロードするバイナリをArm64版
へ変更する
$ mv ./buildtools/linux64/gn ./buildtools/linux64/gn.old
$ gclient sync
$ file ./buildtools/linux64/gn
./buildtools/linux64/gn: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, for GNU/Linux 3.7.0, BuildID[xxHash]=bca2f2f50b449b21, with debug_info, not stripped
gn を実行
$ gn gen out/Default --args='is_debug=false symbol_level=0 enable_nacl=false blink_symbol_level=0 v8_symbol_level=0 target_cpu="arm64" v8_target_cpu="arm64"'
必要のない機能を切りターゲットCPUをArm64に設定
ninja の問題解決
autoninjaはaarch64をサポートしていない
エラーでninja
のインストール方法を表示する
指示通りにninja
をコンパイルしてインストールする
$ autoninja -C out/Default unit_tests
Unknown architecture (aarch64) -- unable to run ninja.
No prebuilt ninja binary was found for this system.
Try building your own binary by doing:
cd ~
git clone https://github.com/ninja-build/ninja.git -b v1.8.2
cd ninja && ./configure.py --bootstrap
Then add ~/ninja/ to your PATH.
インストールしたninjaのパスをdepot_toolsより優先する形でPATHを設定すること
clang の問題解決
Chromium付属のclangがx86実行形式のためエラーとなる
$ ninja -C out/Default chrome
/bin/sh: 1: ../../third_party/llvm-build/Release+Asserts/bin/clang++: Exec format error
Ubuntu
のclang
を利用するように変更
変更方法はChromiumのclang設定のページを確認
$ sudo apt install clang
$ gn gen out/Default --args='is_debug=false symbol_level=0 enable_nacl=false blink_symbol_level=0 v8_symbol_level=0 target_cpu="arm64" clang_base_path="/usr" clang_use_chrome_plugins=false is_component_build=true'
Ubuntu
のclang
でコンパイル
$ ninja -C out/Default chrome
clang が -ffile-compilation-dir を未サポート
Ubuntu20.10で標準インストールのclang
はバージョン10
-ffile-compilation-dir
のサポートはバージョン14以上
最新のclang
をインストール
llvmのページに従って最新のclang
をインストールする
$ sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
clang-14
を使ってコンパイルを再開
$ gn gen out/Default --args='is_debug=false symbol_level=0 enable_nacl=false blink_symbol_level=0 v8_symbol_level=0 target_cpu="arm64" clang_base_path="/lib/llvm-14" clang_use_chrome_plugins=false is_component_build=true v8_target_cpu="arm64"'
Done. Made 16853 targets from 2969 files in 1746ms
$ cat out/Default/args.gn
is_debug = false
symbol_level = 0
enable_nacl = false
blink_symbol_level = 0
v8_symbol_level = 0
target_cpu = "arm64"
clang_base_path = "/lib/llvm-14"
clang_use_chrome_plugins = false
is_component_build = true
v8_target_cpu = "arm64"
$ ninja -C out/Default chrome
NodeJSの問題を解決する
NodeJSがx86実行形式のためエラーとなる
OSError: [Errno 8] Exec format error: '/home/rai/work/chromium/src/out/Default/../../third_party/node/linux/node-linux-x64/bin/node'
[1636/86441] ACTION //chrome/browser/metrics:expired_histograms_array(//build/toolchain/linux:clang_arm64)
ninja: build stopped: subcommand failed.
NodeJSをArm64版で置き換え
ダウンロードサイト: https://nodejs.org/ja/download/
~Download にarm64版を保存
$ cd ~Download
$ unxz node-v16.14.0-linux-arm64.tar.xz
$ tar xvf node-v16.14.0-linux-arm64.tar
$ file ./node-v16.14.0-linux-arm64/bin/node
./node-v16.14.0-linux-arm64/bin/node: ELF 64-bit LSB executable, ARM aarch64, version 1 (GNU/Linux), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, for GNU/Linux 3.7.0, BuildID[sha1]=de8279f86fdfbb27665343afb853f036059cc39d, with debug_info, not stripped
NodeJS
をArm64版
に置き換える
$ cd ~/work/chromium/src/third_party/node/linux/node-linux-x64/bin
$ mv node node.old
$ ln -s ~/Downloads/node-v16.14.0-linux-arm64/bin/node node
JDKの問題解決
JDKがx86実行形式のためエラーとなる
/bin/sh: 1: /home/rai/work/chromium/src/third_party/closure_compiler/../jdk/current/bin/java: Exec format error
[2063/84644] CXX obj/third_party/angle/angle_common/PackedEnums.o
ninja: build stopped: subcommand failed.
JDK
の説明を読むとArm64版
のJRE
に置き換えてやれば動きそう
How to update:
For the `jdk` directory:
1. Find the specific version you want to update from
https://wiki.openjdk.java.net/display/JDKUpdates/JDK11u#JDK11u-Releases
2. Click the link "[Binaries]" for the specific version.
3. Copy the link address of the asset "OpenJDK11U-jre_x64_linux_<specific_version>.tar.gz"
4. Update the "download_url" and "version" in 3pp/3pp.pb with the desired values.
5. Upload and land the CL.
6. Wait for the 3pp packager (https://ci.chromium.org/p/chromium/builders/ci/3pp-linux-amd64-packager)
to create the new instance at https://chrome-infra-packages.appspot.com/p/chromium/third_party/jdk/+/
7. Update instance ID in //DEPS
For the `jdk/extras` subdirectory:
1. Find the specific version you want to update from
https://wiki.openjdk.java.net/display/jdk8u#Main-Releases
2. Click the link "[Binaries]" for the specific version.
3. Copy the link address of the asset "OpenJDK8U-jdk_x64_linux_<specific_version>.tar.gz"
4. Update the "download_url" and "version" in 3pp/3pp.pb with the desired values.
5. Upload and land the CL.
6. Wait for the 3pp packager (https://ci.chromium.org/p/chromium/builders/ci/3pp-linux-amd64-packager)
to create the new instance at https://chrome-infra-packages.appspot.com/p/chromium/third_party/jdk/extras/+/
7. Update instance ID in //DEPS
JREをArm64版で置き換える
GitHubからArm64版のJREを ~/Download にダウンロードする
https://github.com/adoptium/temurin11-binaries/releases/tag/jdk-11.0.14%2B9
OpenJDK11U-jre_aarch64_linux_hotspot_11.0.14_9.tar.gz
$ cd ~Download
$ tar zxvf OpenJDK11U-jre_aarch64_linux_hotspot_11.0.14_9.tar.gz
$ cd ~work/chromium/src/third_party/jdk/current
$ cp -Rf ~/Downloads/jdk-11.0.14+9-jre/* .
clang-format の問題解決
clang-formatがx86実行形式のためエラーとなる
OSError: [Errno 8] Exec format error: '/home/rai/work/chromium/src/buildtools/linux64/clang-format'
$ file buildtools/linux64/clang-format
buildtools/linux64/clang-format: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, stripped
src/DEPS
ファイルを確認する
ハッシュ指定でclang-format
をダウンロードしてきているようだ
# Pull clang-format binaries using checked-in hashes.
{
'name': 'clang_format_linux',
'pattern': '.',
'condition': 'host_os == "linux"',
'action': [ 'python3',
'src/third_party/depot_tools/download_from_google_storage.py',
'--no_resume',
'--no_auth',
'--bucket', 'chromium-clang-format',
'-s', 'src/buildtools/linux64/clang-format.sha1',
],
},
DEPS
ファイルを書き換えが面倒そうなので直接置き換えた
$ sudo apt-get install clang-format-14
$ cd buildtools/linux64
$ mv clang-format clang-format.old
$ ln -s /lib/llvm-14/bin/clang-14 clang-format
eu-strip の問題解決
eu-stripがx86実行形式のためエラーとなる
OSError: [Errno 8] Exec format error: '../../buildtools/third_party/eu-strip/bin/eu-strip'
[42737/67249] ACTION //v8:run_mksnapshot_default(//build/toolchain/linux:clang_arm64)
$ file buildtools/third_party/eu-strip/bin/eu-strip
buildtools/third_party/eu-strip/bin/eu-strip: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.24, stripped
eu-strip
関連のファイルを確認するとelfutils
に含まれているらしいことが分かる
# !/bin/sh -xe
rm -rf elfutils
git clone git://sourceware.org/git/elfutils.git
cd elfutils
git checkout elfutils-0.170
autoheader
aclocal
autoconf
automake --add-missing
patch -p1 < ../fix-elf-size.patch
mkdir build
cd build
../configure --enable-maintainer-mode
make -j40
gcc -std=gnu99 -Wall -Wshadow -Wunused -Wextra -fgnu89-inline \
-Wformat=2 -Werror -g -O2 -Wl,-rpath-link,libelf:libdw -Wl,--build-id=none -o eu-strip \
src/strip.o libebl/libebl.a libelf/libelf.a lib/libeu.a libdw/libdw.a -ldl -lz
./eu-strip -o ../../bin/eu-strip eu-strip
elfutils
なら標準でインストールされいそうなので確認する
$ which eu-strip
/usr/bin/eu-strip
eu-strip
をシステムのeu-strip
で置き換える
$ cd bin
$ mv eu-strip eu-strip.old
$ ln -s /usr/bin/eu-strip eu-strip
残りの x86 実行形式のファイルの確認
src/buildtools
gn
,clang-format
とeu-strip
が解決できていれば大丈夫そうだ
$ cd ./buildtools
$ for i in `find .`; do file $i | grep x86-64; done
./linux64/clang-format.old: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, stripped
./third_party/eu-strip/bin/eu-strip.old: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.24, stripped
rai@rai:~/work/ch
v8_context_snapshot_generatorの問題解決
v8_context_snapshot_generator でエラー発生
//tools/v8_context_snapshot:g...text_snapshot(//build/toolchain/linux:clang_arm64)
FAILED: v8_context_snapshot.bin
python3 ../../build/gn_run_binary.py ./v8_context_snapshot_generator --output_file=v8_context_snapshot.bin
././v8_context_snapshot_generator: /lib/aarch64-linux-gnu/libxkbcommon.so.0: version `V_1.0.0' not found (required by /home/rai/work/chromium/src/out/Default/libevents_ozone_layout.so)
./v8_context_snapshot_generator failed with exit code 1
libxkbcommon-dev の v1.0.3 を用意
Ubuntu20.04のlibxkbcommon-devのバージョンが0.10.0であることが問題と思われる
$ ls -l /lib/aarch64-linux-gnu/libxkbcommon*
lrwxrwxrwx 1 root root 17 Feb 6 2020 /lib/aarch64-linux-gnu/libxkbcommon.so -> libxkbcommon.so.0
lrwxrwxrwx 1 root root 21 Feb 6 2020 /lib/aarch64-linux-gnu/libxkbcommon.so.0 -> libxkbcommon.so.0.0.0
-rw-r--r-- 1 root root 256344 Feb 6 2020 /lib/aarch64-linux-gnu/libxkbcommon.so.0.0.0
lrwxrwxrwx 1 root root 25 Feb 6 2020 /lib/aarch64-linux-gnu/libxkbcommon-x11.so.0 -> libxkbcommon-x11.so.0.0.0
-rw-r--r-- 1 root root 31464 Feb 6 2020 /lib/aarch64-linux-gnu/libxkbcommon-x11.so.0.0.0
libxkbcommon0(v1.0.3)のソースコードをUbuntuのサイトからダウンロードする
$ cd Downloads/
$ unxz libxkbcommon_1.0.3.orig.tar.xz
$ tar xvf libxkbcommon_1.0.3.orig.tar
$ cd libxkbcommon-1.0.3/
$ sudo apt-get install meson
$ sudo apt-get install cmake
$ sudo apt-get install libxcb-xkb*
$ sudo apt-get install valgrind doxygen
$ meson setup build
$ ninja -C build/
$ ls -l ./build/libxkbcommon*
lrwxrwxrwx 1 rai rai 17 Feb 22 13:23 ./build/libxkbcommon.so -> libxkbcommon.so.0
lrwxrwxrwx 1 rai rai 21 Feb 22 13:23 ./build/libxkbcommon.so.0 -> libxkbcommon.so.0.0.0
-rwxrwxr-x 1 rai rai 693960 Feb 22 13:23 ./build/libxkbcommon.so.0.0.0
-rw-rw-r-- 1 rai rai 1327270 Feb 22 13:23 ./build/libxkbcommon-test-internal.a
-rw-rw-r-- 1 rai rai 220910 Feb 22 13:23 ./build/libxkbcommon-x11-internal.a
lrwxrwxrwx 1 rai rai 21 Feb 22 13:23 ./build/libxkbcommon-x11.so -> libxkbcommon-x11.so.0
lrwxrwxrwx 1 rai rai 25 Feb 22 13:23 ./build/libxkbcommon-x11.so.0 -> libxkbcommon-x11.so.0.0.0
-rwxrwxr-x 1 rai rai 126136 Feb 22 13:23 ./build/libxkbcommon-x11.so.0.0.0
$ sudo mv /lib/aarch64-linux-gnu/libxkbcommon.so.0 /lib/aarch64-linux-gnu/libxkbcommon.so.0.old
$ sudo ln -s /home/rai/Downloads/libxkbcommon-1.0.3/build/libxkbcommon.so.0.0.0 /lib/aarch64-linux-gnu/libxkbcommon.so.0
$ ls -l /lib/aarch64-linux-gnu/libxkbcommon*
lrwxrwxrwx 1 root root 17 Feb 6 2020 /lib/aarch64-linux-gnu/libxkbcommon.so -> libxkbcommon.so.0
lrwxrwxrwx 1 root root 66 Feb 22 13:28 /lib/aarch64-linux-gnu/libxkbcommon.so.0 -> /home/rai/Downloads/libxkbcommon-1.0.3/build/libxkbcommon.so.0.0.0
-rw-r--r-- 1 root root 256344 Feb 6 2020 /lib/aarch64-linux-gnu/libxkbcommon.so.0.0.0
lrwxrwxrwx 1 root root 21 Feb 6 2020 /lib/aarch64-linux-gnu/libxkbcommon.so.0.old -> libxkbcommon.so.0.0.0
lrwxrwxrwx 1 root root 25 Feb 6 2020 /lib/aarch64-linux-gnu/libxkbcommon-x11.so.0 -> libxkbcommon-x11.so.0.0.0
-rw-r--r-- 1 root root 31464 Feb 6 2020 /lib/aarch64-linux-gnu/libxkbcommon-x11.so.0.0.0
上記の内容を全て適応した後にコンパイル
エラーが1つ発生したがchrome
の実行バイナリは作成された
$ time ninja -C out/Default
ninja: Entering directory `out/Default'
[85735/86609] ACTION //tools/v8_context_snapshot:g...text_snapshot(//build/toolchain/linux:clang_arm64)
[0223/054106.523178:ERROR:histogram.cc(445)] Histogram: V8.GC.Cycle.CollectionRate.Full.Cpp has bad minimum: 0
[86609/86609] STAMP obj/gn_all.stamp
real 305m35.239s
user 1745m29.346s
sys 81m21.569s
Chromiumの実行
エラーログを吐きつつも実行は可能
$ ./out/Default/chrome
[1839466:1839466:0222/233226.407985:ERROR:power_monitor_device_source_stub.cc(11)] Not implemented reached in virtual bool base::PowerMonitorDeviceSource::IsOnBatteryPower()
[1839466:1839495:0222/233226.621578:ERROR:histogram.cc(445)] Histogram: SimpleCache.Code.IndexNumEntriesOnInit has bad minimum: 0
[1839507:1839507:0222/233226.682671:ERROR:viz_main_impl.cc(188)] Exiting GPU process due to errors during initialization
[1839508:1839541:0222/233226.855055:ERROR:histogram.cc(445)] Histogram: SimpleCache.Http.IndexNumEntriesOnInit has bad minimum: 0
[1839548:1:0222/233226.870357:ERROR:histogram.cc(445)] Histogram: Style.RecalcTime has bad minimum: 0
[1839548:1:0222/233226.871384:ERROR:histogram.cc(445)] Histogram: Style.RebuildLayoutTreeTime has bad minimum: 0
[1839574:1839574:0222/233226.998910:ERROR:viz_main_impl.cc(188)] Exiting GPU process due to errors during initialization
[1839593:1839593:0222/233227.086728:ERROR:sandbox_linux.cc(377)] InitializeSandbox() called with multiple threads in process gpu-process.
[1839593:1839593:0222/233227.102454:ERROR:gpu_memory_buffer_support_x11.cc(44)] dri3 extension not supported.
[1839466:1839466:0222/233227.106389:ERROR:histogram.cc(445)] Histogram: GPU.AcceleratedSurfaceRefreshRate has bad minimum: 0
[1839548:1:0222/233227.111299:ERROR:histogram.cc(445)] Histogram: DocumentEventTiming.PageHideDuration has bad minimum: 0
[1839548:1:0222/233227.111603:ERROR:histogram.cc(445)] Histogram: DocumentEventTiming.PageVibilityHiddenDuration has bad minimum: 0
[1839548:8:0222/233227.111638:ERROR:command_buffer_proxy_impl.cc(125)] ContextResult::kTransientFailure: Failed to send GpuControl.CreateCommandBuffer.
無事Chromiumが起動
YouTubeで動画再生もOK
音声も再生している