site  contact  subhomenews

Chromium compiled for 15 hours before failing

September 25, 2021 — BarryK

Ha ha, the saga continues! Yesterday's post:

https://bkhome.org/news/202109/chromium-compiled-for-12-hours-before-failing.html

This time, using Chromium version 93.0.4577.82. Running EasyOS 3.0pre, Lenovo PC with Intel i3 CPU and 8GB RAM. The build is happening on an external USB3 500GB SSD. There is a swap partition, 24GB internal HDD.

Failure point looks like the same place. It is trying to create 'libblink_platform.so'.

Normally, the build is configured to create static libraries and there is a massive final link creating a huge single binary. However, I have used the "is_component_build=true" configure option, which causes a smaller final binary with lots of shared libraries.

Again, unable to download from github, but success from https://commondatastorage.googleapis.com/chromium-browser-official/, but that site only has limited versions.

Here are my notes:

'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"

gentoo site:
https://gitweb.gentoo.org/repo/gentoo.git/tree/www-client/chromium

get chromium source (linked from gentoo site):
# P="chromium-93.0.4577.82"
# wget --tries=1 --no-clobber https://commondatastorage.googleapis.com/chromium-browser-official/${P}.tar.xz

patchset for gcc and libstdc++
for chromium 93.0.4577.8
https://github.com/stha09/chromium-patches/releases/tag/chromium-93-patchset-6
NO# wget https://github.com/stha09/chromium-patches/archive/refs/tags/chromium-93-patchset-6.tar.gz
# wget https://github.com/stha09/chromium-patches/releases/download/chromium-93-patchset-6/chromium-93-patchset-6.tar.xz

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

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

my script apply-patches:

#!/bin/sh
#run from within chromium source.
#firstly, the patchset for building with gcc instead of clang...
for aP in chromium-78-protobuf-RepeatedPtrField-export.patch chromium-90-ruy-include.patch chromium-91-compiler.patch chromium-91-libyuv-aarch64.patch chromium-93-BluetoothLowEnergyScanFilter-include.patch chromium-93-ClassProperty-include.patch chromium-93-ContextSet-permissive.patch chromium-93-DevToolsEmbedderMessageDispatcher-include.patch chromium-93-FormForest-constexpr.patch chromium-93-HashPasswordManager-include.patch chromium-93-pdfium-include.patch chromium-93-ScopedTestDialogAutoConfirm-include.patch
do
patch -p1 --dry-run < ../patchset/${aP}
if [ $? -ne 0 ];then
echo "FAIL: ${aP}"
else
patch -p1 < ../patchset/${aP}
fi
done
sync
#next, gentoo patches...
#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
#this one failed: chromium-95-maldoca-zlib.patch
for aP in chromium-93-EnumTable-crash.patch chromium-93-InkDropHost-crash.patch chromium-shim_headers.patch
do
patch -p1 --dry-run < ../patches-gentoo/${aP}
if [ $? -ne 0 ];then
echo "FAIL: ${aP}"
else
patch -p1 < ../patches-gentoo/${aP}
fi
done
###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

force to use system libs:
NO# ../libs-inbuilt-2-system

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
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_zlib=true
use_viz_debugger=false
use_custom_libcxx=false
link_pulseaudio=false
ozone_platform_wayland=false
enable_platform_hevc=false
ffmpeg_branding="Chrome"
is_component_ffmpeg=true
proprietary_codecs=true
use_allocator="none"
use_bundled_fontconfig=false
use_cfi_icall=false
use_ozone=false
use_xkbcommon=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"

stupid things needs jdk hack:
# cp -a -f --remove-destination /opt/jdk-11.0.13/bin/* third_party/jdk/current/bin/
# cp -a -f --remove-destination /opt/jdk-11.0.13/lib/* third_party/jdk/current/lib/

pdfium compile fails, get it from 95.x...
i got it out of 95.x source, made it into a tarball...
# cd third_party
# mv -f pdfium pdfiumHIDE
# tar -xf ../../pdfium-95.0.4638.10.tar.gz
# sync
# mv -f pdfium-95.0.4638.10 pdfium
# cd ..

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

...after about 15 hours, fail...

[41835/42281] SOLINK ./libblink_platform.so
FAILED: libblink_platform.so libblink_platform.so.TOC
python3 "../../build/toolchain/gcc_solink_wrapper.py" --readelf="readelf" --nm="nm" --sofile="./libblink_platform.so" --tocfile="./libblink_platform.so.TOC" --output="./libblink_platform.so" -- g++ -shared -Wl,-soname="libblink_platform.so" -Wl,--build-id -fPIC -Wl,-z,noexecstack -Wl,-z,relro -rdynamic -Wl,-z,defs -Wl,--as-needed -Wl,-rpath=\$ORIGIN -o "./libblink_platform.so" @"./libblink_platform.so.rsp"
/usr/lib/gcc/x86_64-poky-linux/9.3.0/../../../../x86_64-poky-linux/bin/ld: obj/third_party/blink/renderer/platform/platform/rtc_peer_connection_handler_client.o: in function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > cricket::ToStringIfSet<bool>(char const*, absl::optional<bool> const&)':
rtc_peer_connection_handler_client.cc:(.text+0x12a): undefined reference to `rtc::ToString[abi:cxx11](bool)'
....
rtc_stats.cc:(.text+0x1579): undefined reference to `webrtc::RTCStatsMember<std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, unsigned long, 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, unsigned long> > > >::operator*() const'
/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+0x1697): 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
ninja: build stopped: subcommand failed.

...so close to success!     

Tags: easy