Skip to content

[scarthgap] chromium: Update to 136.0.7103.113 #904

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: scarthgap
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 35 additions & 6 deletions meta-chromium/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ This layer depends on:
- revision: HEAD

* URI: git://github.com/kraj/meta-clang
- branch: master
- branch: scarthgap-clang20
- revision: HEAD

## Contributing
Expand Down Expand Up @@ -82,20 +82,49 @@ host. clang-native from the meta-clang layer is used to build those binaries.
Additionally, make sure the machine being used to build Chromium is powerful
enough: a x86-64 machine with at least 16GB RAM is recommended.

### Troubleshooting Build Error: std::bad_alloc
If you encounter a build error similar to the following:

```
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
terminate called recursively
terminate called recursively
```
You might be experiencing what has been descibed in
[this issue](https://github.com/OSSystems/meta-browser/issues/845#issuecomment-2664769837).

You can try to increase the
[vm.max_map_count](https://docs.kernel.org/admin-guide/sysctl/vm.html#max-map-count)
value to allow your system to handle more memory mappings.

1. Temporarily Set vm.max_map_count:

```
# echo 1048576 > /proc/sys/vm/max_map_count
```
This change will only persist until the system is rebooted.

2. Permanently Set vm.max_map_count:
To make this change permanent, you need to modify `/etc/sysctl.conf` and add:
```bash
vm.max_map_count=1048576
```
A reboot may be required for the new value to get picked up (or run `sysconf -p`).

### scarthgap-specific requirements

The scarthgap OE/Yocto branch is an LTS release, which is often at odds with
Chromium's release model because it often requires recent versions of certain
recipes to build correctly.

This is particularly a problem for the toolchain (i.e. LLVM/clang and Rust).
Chromium needs a more recent version of Rust than OE Core provides for

* Chromium needs a more recent version of Rust than OE Core provides for
scarthgap, which is why we depend on meta-lts-mixins' `scarthgap/rust` branch.

**Side note: For now, clang 18 provided by meta-clang is recent enough, but at
some point during scarthgap's LTS lifetime Chromium won't be compilable with
that version, and we'll have to create e.g. a scarthgap-clang20 branch for
meta-clang and use that.**
* Clang 18 provided by meta-clang is no longer compatible with the current
Chromium release, thus we depend on meta-clang's `scarthgap-clang20` branch.

## PACKAGECONFIG knobs

Expand Down
34 changes: 28 additions & 6 deletions meta-chromium/recipes-browser/chromium/chromium-gn.inc
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,23 @@ SRC_URI += "\
file://0008-Use-the-correct-path-to-libclang_rt.builtins.a.patch \
file://0009-Adjust-the-Rust-build-to-our-needs.patch \
file://0010-Don-t-require-profiler_builtins.rlib.patch \
file://0011-Disable-crabbyavif-to-fix-build-errors.patch \
file://0012-Revert-Allow-and-use-std-hardware_destructive_interf.patch \
file://0013-Revert-Set-Rust-symbol-visibility-to-hidden-when-C-s.patch \
file://0014-pdfium-Fix-missing-PDFiumAPIStringBufferAdapter-temp.patch \
file://0015-Revert-Connect-the-Rust-log-crate-to-the-base-loggin.patch \
file://0011-Revert-Allow-and-use-std-hardware_destructive_interf.patch \
file://0012-Revert-Set-Rust-symbol-visibility-to-hidden-when-C-s.patch \
file://0013-pdfium-Fix-missing-PDFiumAPIStringBufferAdapter-temp.patch \
file://0014-Revert-Remove-libavif-based-AVIF-decoder.patch \
file://0015-Revert-Remove-third_party-libavif.patch \
file://0016-Disable-crabbyavif-to-fix-build-errors.patch \
file://0017-rust-Use-adler-instead-of-adler2.patch \
"

# Missing third_party sources.
SRC_URI += "\
git://chromium.googlesource.com/external/github.com/AOMediaCodec/libavif;protocol=https;branch=main;name=libavif;destsuffix=third_party/libavif/src \
"

SRCREV_FORMAT .= "_libavif"
SRCREV_libavif = "e7b34a1f5e9f7024d08311c7bae156061b889882"

# ARM/AArch64-specific patches.
SRC_URI:append:aarch64 = "${@bb.utils.contains('TUNE_FEATURES', 'crypto', '', ' file://arm/0001-Fix-AES-crypto-SIGILL-on-rpi4-64.patch', d)}"

Expand Down Expand Up @@ -112,7 +123,7 @@ BUILD_CC:toolchain-clang = "clang"
BUILD_CXX:toolchain-clang = "clang++"
BUILD_LD:toolchain-clang = "clang"

PACKAGECONFIG ??= "upower use-egl"
PACKAGECONFIG ??= "upower use-egl use-v4l2"

# this makes sure the dependencies for the EGL mode are present; otherwise, the configure scripts
# automatically and silently fall back to GLX
Expand Down Expand Up @@ -146,6 +157,10 @@ PACKAGECONFIG[upower] = ",,,upower"
# but remember to also use proprietary codecs so that H.264 is supported. Also note
# that not all the hardware configs might be supported.
PACKAGECONFIG[use-vaapi] = "use_vaapi=true use_libgav1_parser=true,use_vaapi=false,libva"
# Enable stateless V4L2 M2M video decoding support.
# This requires 'proprietary-codecs' PACKAGECONFIG
# to decode h264 streams on the V4L2 M2M device.
PACKAGECONFIG[use-v4l2] = "use_v4l2_codec=true,use_v4l2_codec=false"

# Base GN arguments, mostly related to features we want to enable or disable.
GN_ARGS = " \
Expand Down Expand Up @@ -363,6 +378,7 @@ CHROMIUM_EXTRA_ARGS ?= " \
${@bb.utils.contains('PACKAGECONFIG', 'use-egl', '--use-angle=gles-egl', '', d)} \
${@bb.utils.contains('PACKAGECONFIG', 'kiosk-mode', '--kiosk --no-first-run --incognito', '', d)} \
${@bb.utils.contains('PACKAGECONFIG', 'gtk4', '--gtk-version=4', '', d)} \
${@bb.utils.contains('PACKAGECONFIG', 'use-v4l2', '--ozone-platform-hint=wayland --enable-features=AcceleratedVideoDecoder,AcceleratedVideoDecodeLinuxGL,AcceleratedVideoDecodeLinuxZeroCopyGL', '', d)} \
"

# V8's JIT infrastructure requires binaries such as mksnapshot and
Expand Down Expand Up @@ -475,6 +491,12 @@ do_copy_target_rustlibs () {
}
addtask copy_target_rustlibs after do_configure before do_compile

do_copy_missing_third_party_sources () {
rm -rf ${S}/third_party/libavif/src
cp -r ${WORKDIR}/third_party/libavif/src/ ${S}/third_party/libavif/
}
addtask copy_missing_third_party_sources after do_patch before do_configure

do_configure() {
cd ${S}
python3 ./build/linux/unbundle/replace_gn_files.py --system-libraries ${GN_UNBUNDLE_LIBS}
Expand Down
Loading