site  contact  subhomenews

Chromium compiled for 12 hours before failing

September 23, 2021 — BarryK

Ha ha, the saga continues. Not sure if I should plug away at this, or just give in and use the official binary package. This was the previous attempt:

https://bkhome.org/news/202109/another-attempt-to-compile-chromium.html

I learnt a lot from that, so applied some of that new knowledge and had another go. Started the compile at 10am this morning, has just now failed, at just on 10pm. There was one failure in the morning, that I caught just after it happened, and applied a hack to fix it. Here are my notes:

running easyos 3.0
------------------

'devx' sfs loaded.
have the jdk sfs loaded. (that i compiled myself, see input581)
sfs has /etc/profile.d/java:

export JAVA_HOME=/opt/jre-11.0.13
export PATH="${JAVA_HOME}/bin:${PATH}"

installed 'nodejs' and its deps, from package manager.

# git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
# pwd
/mnt/sdb1/0-chromium
# export PATH="${PATH}:/mnt/sdb1/0-chromium/depot_tools"

get chromium source:
# P="chromium-95.0.4638.10"
# wget --tries=1 --no-clobber https://commondatastorage.googleapis.com/chromium-browser-official/${P}.tar.xz

get patchset for compiling with gcc:
https://github.com/stha09/chromium-patches/releases
Patchset for chromium-95.0.4638.10
# wget https://github.com/stha09/chromium-patches/releases/download/chromium-95-patchset-4/chromium-95-patchset-4.tar.xz

gentoo patches from here:
https://gitweb.gentoo.org/repo/gentoo.git/tree/www-client/chromium

patch the chromium source:
# tar -xf chromium-95.0.4638.10.tar.xz
# cd chromium-95.0.4638.10
# ../apply-patches

my script apply-patches:

#!/bin/sh
#run from within chromium source.
#firstly, the patchset for building with gcc instead of clang...
patch -p1 < ../../chromium-95-patchset-4/patches/chromium-78-protobuf-RepeatedPtrField-export.patch
patch -p1 < ../../chromium-95-patchset-4/patches/chromium-95-BitstreamReader-namespace.patch
patch -p1 < ../../chromium-95-patchset-4/patches/chromium-95-compiler.patch
patch -p1 < ../../chromium-95-patchset-4/patches/chromium-95-libyuv-aarch64.patch
patch -p1 < ../../chromium-95-patchset-4/patches/chromium-95-quiche-include.patch
sync
#next, gentoo patches...
patch -p1 < ../files/chromium-93-EnumTable-crash.patch
patch -p1 < ../files/chromium-93-InkDropHost-crash.patch
patch -p1 < ../files/chromium-95-maldoca-zlib.patch
patch -p1 < ../files/chromium-shim_headers.patch
#have left this one out:
# chromium-use-oauth2-client-switches-as-default.patch
#easyos 3.0 has ffmpeg 4.3.1, libraries have major series 58. Only need this patch for <57:
# chromium-93-fix-build-with-system-ffmpeg.patch
sync
###end###

maybe need this:
# export CC=gcc
# export CXX=g++

chromium source needs 'node' binary executable in host system (from 'nodejs' pkg).
weird, needs this link:
# mkdir -p third_party/node/linux/node-linux-x64/bin
# ln -s /usr/bin/node third_party/node/linux/node-linux-x64/bin/node

do not want to use the debian sysroot, however next step wants it to exist:
# build/linux/sysroot_scripts/install-sysroot.py --arch=amd64
...downloads debian_sid_amd64_sysroot.tar.xz

create build folder:
# gn gen out/Default

create file out/Default/args.gn, with this:

enable_nacl=false
is_debug=false
treat_warnings_as_errors=false
is_component_build=true
symbol_level=0
blink_symbol_level=0
link_pulseaudio=false
v8_symbol_level=0
use_sysroot=false
is_clang=false
use_gnome_keyring=false
enable_hangout_services_extension=false
enable_widevine=false
use_cups=true
use_kerberos=false
use_pulseaudio=false
use_vaapi=false
disable_fieldtrial_testing_config=true
use_gold=false
use_lld=false
enable_pseudolocales=false
blink_enable_generated_code_formatting=false
fatal_linker_warnings=false
use_system_libdrm=true
use_system_lcms2=true
use_system_libjpeg=true
use_system_libpng=true
use_system_libwayland=false
use_system_zlib=true
use_viz_debugger=false
use_custom_libcxx=false

note, use_custom_libcxx=false i think will force use system libstdc++

edit the out/Default/args.gn file, this brings up the 'mp' text editor:
# gn args out/Default
...save and exit.

File third_party/closure_compiler/compiler.py", line 17, comment-out this line:
assert os.path.isfile(_JAVA_PATH), "java only allowed in android builds"

why can't it use the system jdk?
third_party/closure_compiler/../jdk/current/bin/ and current/lib
...copy everything from my jdk sfs, /opt/jdk-11.0.13/bin and lib

why does it want the jdk for a linux build?!!!

now start the build:
# autoninja -C out/Default chrome

...compiled for awhile...

FAILED: libozone.so libozone.so.TOC
python3 "../../build/toolchain/gcc_solink_wrapper.py" --readelf="readelf" --nm="nm" --sofile="./libozone.so" --tocfile="./libozone.so.TOC" --output="./libozone.so" -- g++ -shared -Wl,-soname="libozone.so" -Wl,--build-id -fPIC -Wl,-z,noexecstack -Wl,-z,relro -rdynamic -Wl,-z,defs -Wl,--as-needed -Wl,-rpath=\$ORIGIN -o "./libozone.so" @"./libozone.so.rsp"
/usr/lib/gcc/x86_64-poky-linux/9.3.0/../../../../x86_64-poky-linux/bin/ld: cannot find -l:libffi_pic.a

...quick hack, went to packages.debian.org and installed libffi-dev_3.3-6_amd64.deb

...after almost 12 hours compiling, stopped...

/usr/lib/gcc/x86_64-poky-linux/9.3.0/../../../../x86_64-poky-linux/bin/ld: obj/third_party/blink/renderer/platform/platform/rtc_stats.o: in function `blink::RTCStatsMember::ValueMapStringDouble() const':
rtc_stats.cc:(.text+0x20b4): undefined reference to `webrtc::RTCStatsMember<std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, double, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, double> > > >::operator*() const'
collect2: error: ld returned 1 exit status
That last error means nothing to me.    

Tags: easy