Skip to content

kirkstone: backport chromium from scarthgap #843

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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
7facbf6
chromium: Update to 121.0.6167.184 (#791)
MaxIhlenfeldt Mar 20, 2024
9269270
meta-browser: Update some README.md information (#797)
Mar 22, 2024
81d037b
chromium: Drop patches that are specific to clang < 17 (#801)
MaxIhlenfeldt Mar 23, 2024
d3a5f63
chromium: Update to 122.0.6261.128 (#803)
MaxIhlenfeldt Apr 15, 2024
ab76411
chromium: Fix gn build for Yocto master (#808)
MaxIhlenfeldt May 8, 2024
1dca432
chromium: Use STAGING_* dirs instead of RECIPE_SYSROOT(_NATIVE) (#810)
MaxIhlenfeldt May 10, 2024
24b4cdf
chromium: Fix build race condition (#812)
MaxIhlenfeldt May 13, 2024
d8bcd04
chromium: Depend on libstd-rs instead of rust (#809)
MaxIhlenfeldt May 13, 2024
68d56d5
chromium: Fix incremental build error after meta-clang update (#814)
MaxIhlenfeldt May 14, 2024
c3a84cc
chromium: Update to 123.0.6312.122 (#806)
MaxIhlenfeldt May 22, 2024
1ed2254
chromium: Backport missing dependency in NewTabPage (#816)
MaxIhlenfeldt May 22, 2024
40ef1d0
chromium: Update to 124.0.6367.207 (#819)
MaxIhlenfeldt Jun 17, 2024
718c798
chromium: Update to 125.0.6422.141 (#824)
MaxIhlenfeldt Jun 25, 2024
0a182ba
chromium: Merge interlinked compiler option patches (#825)
MaxIhlenfeldt Jun 25, 2024
83cb90c
chromium: Update to 126.0.6478.126 (#826)
MaxIhlenfeldt Jul 4, 2024
fd347dc
chromium: Update to 127.0.6533.99 (#828)
MaxIhlenfeldt Aug 20, 2024
e892cd6
chromium: fix do_copy_clang_library failed for multilib (#830)
hongxu-jia Aug 26, 2024
a722604
chromium: Update to 128.0.6613.84 (#832)
MaxIhlenfeldt Sep 3, 2024
7c0dcf7
chromium: Update to 128.0.6613.119 (#833)
MaxIhlenfeldt Sep 4, 2024
9a284a0
layer.conf: set LAYERSERIES_COMPAT to styhead
lumag Sep 6, 2024
608d411
chromium: Update to 128.0.6613.137 (#836)
MaxIhlenfeldt Sep 12, 2024
f7d3eac
layer.conf: Update to walnascar (5.2) layer/release series
kraj Oct 5, 2024
fbad39d
chromium: Update to 129.0.6668.70 (#838)
MaxIhlenfeldt Oct 9, 2024
f988d61
chromium: Update to 129.0.6668.100 (#840)
MaxIhlenfeldt Oct 10, 2024
3e97441
chromium: Update to 130.0.6723.58 (#844)
MaxIhlenfeldt Oct 29, 2024
a55e6f2
chromium: Update to 130.0.6723.91 (#846)
MaxIhlenfeldt Nov 4, 2024
68e8cbf
chromium: Update EGL CLI args (#850)
MaxIhlenfeldt Nov 20, 2024
0dad36d
chromium: Update to 131.0.6778.85 (#852)
MaxIhlenfeldt Dec 9, 2024
4eabfae
chromium: Update my email address in the repository (#856)
rakuco Dec 11, 2024
2a571a3
[scarthgap] chromium: Drop patch to decrease minimum Rust version (#858)
MaxIhlenfeldt Dec 17, 2024
0a8a866
[scarthgap] chromium: Update to 131.0.6778.139 (#860)
MaxIhlenfeldt Dec 18, 2024
0c43dd6
[scarthgap] chromium: Use correct Rust mixin layer dependency (#863)
MaxIhlenfeldt Dec 18, 2024
a857a94
Merge branch 'scarthgap' into kirkstone
adalessandro Dec 18, 2024
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
27 changes: 18 additions & 9 deletions meta-chromium/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ post to the list). Please cc the maintainers if you send your patches.
## Maintainers

* Fabio Berton <[email protected]>
* Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
* Raphael Kubo da Costa <kubo@igalia.com>
* Khem Raj <[email protected]>
* Otavio Salvador <[email protected]>
* Max Ihlenfeldt <[email protected]>
Expand All @@ -47,7 +47,7 @@ Chromium browser.

This recipe provides a package for the Chromium web browser. It strives to
always follow the latest stable Linux release as listed in
https://omahaproxy.appspot.com
https://chromiumdash.appspot.com/releases?platform=Linux

We refer to the web browser as Chromium, not Chrome, because "Chrome" is
Google's version of the web browser with proprietary content on top of the
Expand All @@ -60,6 +60,16 @@ peculiarities:
- Parts of the V8 (Chromium's JavaScript engine) build need to run binaries
built for the target, for which we use QEMU.

## Supported OE/Yocto releases

We only support the master branch and the current LTS releases of OE/Yocto,
using this repo's master branch for the former and separate branches for the
latter.

Recent non-LTS releases should still work with our master branch, and we'll
create branches capturing the last buildable version once they stop working with
the latest version.

## Build requirements

This recipe requires clang, and GCC is not supported. Upstream Chromium has not
Expand All @@ -79,13 +89,12 @@ 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).
Because meta-clang's kirkstone branch currently only provides clang 14, we are
unable to support Chromium versions higher than 120 due to those versions
requiring a more recent clang version. Also, kirkstone users **must** ensure the
following:
* Chromium needs a somewhat recent version of Rust, and for that
meta-lts-mixins' **kirkstone/rust-1.68** or **kirkstone/rust-1.70** branch
needs to be used.

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

* Chromium needs at least clang 18, but meta-clang's kirkstone branch provides
clang 14. Thus, we depend on meta-clang's `kirkstone-clang18` branch.

## PACKAGECONFIG knobs

Expand Down
2 changes: 1 addition & 1 deletion meta-chromium/conf/layer.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ BBFILE_PATTERN_chromium-browser-layer := "^${LAYERDIR}/"
BBFILE_PRIORITY_chromium-browser-layer = "7"

LAYERVERSION_chromium-browser-layer = "1"
LAYERSERIES_COMPAT_chromium-browser-layer = "kirkstone langdale mickledore nanbield scarthgap"
LAYERSERIES_COMPAT_chromium-browser-layer = "kirkstone scarthgap styhead walnascar"

LAYERDEPENDS_chromium-browser-layer = "clang-layer core openembedded-layer lts-rust-mixin"
91 changes: 36 additions & 55 deletions meta-chromium/recipes-browser/chromium/chromium-gn.inc
Original file line number Diff line number Diff line change
Expand Up @@ -4,54 +4,32 @@ require gn-utils.inc

GTKIC_VERSION = "${@bb.utils.contains('PACKAGECONFIG', 'gtk4', '4', '3',d)}"

inherit features_check gtk-icon-cache qemu
inherit features_check gtk-icon-cache qemu rust-common

# The actual directory name in out/ is irrelevant for GN.
OUTPUT_DIR = "out/Release"
B = "${S}/${OUTPUT_DIR}"

# Backported patches.
SRC_URI += "\
file://backport/IWYU-for-chrome-browser-ui-views-dark_mode_.patch \
file://backport/IWYU-for-net-filter-zstd_source_stream.cc.patch \
file://backport/IWYU-for-components-user_education-common-p.patch \
file://backport/atspi-mark-possibly-unused-gn-variables.patch \
file://backport/Revert-recent-C-20-usage-in-CFX_FillRenderO.patch \
file://backport/IWYU-for-chrome-browser-ui-tabs-organizatio.patch \
file://backport/IWYU-for-content-browser-generic_sensor-fra.patch \
file://backport/IWYU-for-g-c-service-shared_image-ozone_ima.patch \
file://backport/Make-toolchain_supports_rust_thin_lto-configurable.patch \
file://backport/NewTabPage-Add-missing-dep-to-cr_components.patch \
"
# None currently \o/

# Non-specific patches.
SRC_URI += "\
file://0001-Remove-the-GN-settings-done-for-clang-that-conflict-.patch \
file://0001-Drop-GN-compiler-settings-conflicting-with-OE.patch \
file://0002-v8-qemu-wrapper.patch \
file://0003-wrapper-extra-flags.patch \
file://0004-Delete-compiler-options-not-available-in-release-ver.patch \
file://0005-avoid-link-latomic-failure-on-CentOS-8-host.patch \
file://0006-Revert-__attribute__-and-alignas-changes.patch \
file://0007-Add-missing-typename-s.patch \
file://0008-Don-t-pass-unknown-LLVM-options.patch \
file://0009-Avoid-capturing-structured-bindings.patch \
file://0010-Revert-Reland-Reland-mte-refactor-the-tagging-functi.patch \
file://0011-Avoid-parenthesized-initialization-of-aggregates.patch \
file://0012-Fix-constexpr-variable-cannot-have-non-literal-type-.patch \
file://0013-Fix-undefined-symbol-PaintOpWriter-SerializedSize-un.patch \
file://0014-Fix-implicitly-deleted-default-constructor-build-err.patch \
file://0015-Don-t-delete-CrashKeyWithName-dtor.patch \
file://0016-Use-base-ranges-instead-of-std-ranges.patch \
file://0017-Use-the-correct-path-to-libclang_rt.builtins.a.patch \
file://0018-Adjust-the-Rust-build-to-our-needs.patch \
file://0019-Don-t-require-profiler_builtins.rlib.patch \
file://0006-Don-t-pass-unknown-LLVM-options.patch \
file://0007-Fix-constexpr-variable-must-be-initialized-by-a-cons.patch \
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 \
"
# ARM/AArch64-specific patches.
SRC_URI:append:arm = "\
file://arm/0001-BUILD-do-not-specify-march-on-arm.patch \
file://arm/0002-Fix-ARM-build-with-recent-glibc.patch \
file://arm/0003-Fix-static_assert-failed-build-error-on-32-bit-ARM.patch \
"
SRC_URI:append:aarch64 = "${@bb.utils.contains('TUNE_FEATURES', 'crypto', '', ' file://arm/0004-Fix-AES-crypto-SIGILL-on-rpi4-64.patch', d)}"
SRC_URI:append:aarch64 = "${@bb.utils.contains('TUNE_FEATURES', 'crypto', '', ' file://arm/0001-Fix-AES-crypto-SIGILL-on-rpi4-64.patch', d)}"

# musl-specific patches.
SRC_URI:append:libc-musl = "\
Expand Down Expand Up @@ -92,6 +70,7 @@ DEPENDS += " \
jpeg \
libdrm \
libffi \
libstd-rs \
libwebp \
libxkbcommon \
libxslt \
Expand All @@ -106,7 +85,6 @@ DEPENDS += " \
pkgconfig-native \
${@bb.utils.contains('DISTRO_FEATURES', 'pulseaudio', 'pulseaudio', '', d)} \
qemu-native \
rust \
rust-native \
virtual/libgl \
"
Expand Down Expand Up @@ -308,8 +286,8 @@ GN_ARGS += ' \
'

# Make sure Chromium is able to find clang libraries. See
# 0023-Use-the-correct-path-to-libclang_rt.builtins.a.patch and the
# add_clang_symlink and copy_clang_library tasks for more context.
# 0008-Use-the-correct-path-to-libclang_rt.builtins.a.patch and the
# add_clang_latest and copy_clang_library tasks for more context.
GN_ARGS += ' \
clang_base_path="${@clang_install_path(d)}" \
clang_version="latest" \
Expand All @@ -325,7 +303,7 @@ GN_ARGS += 'max_jobs_per_link="${@oe.utils.parallel_make_argument(d, '%d')}"'
# Rust code is rebuilt after updating the Rust toolchain. This is irrelevant for
# our build setup, but not setting it leads to an error.
GN_ARGS += ' \
rust_sysroot_absolute="${RECIPE_SYSROOT_NATIVE}/usr" \
rust_sysroot_absolute="${STAGING_DIR_NATIVE}/usr" \
rustc_version="custom" \
rust_target_triple_vendor_for_target="${TARGET_VENDOR}" \
'
Expand Down Expand Up @@ -379,7 +357,7 @@ GN_ARGS:append:armv6 = ' arm_use_neon=false'
GN_ARGS:append:libc-musl = ' use_allocator_shim=false use_partition_alloc_as_malloc=false enable_backup_ref_ptr_support=false'

CHROMIUM_EXTRA_ARGS ?= " \
${@bb.utils.contains('PACKAGECONFIG', 'use-egl', '--use-gl=egl', '', d)} \
${@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)} \
"
Expand Down Expand Up @@ -455,39 +433,42 @@ do_add_nodejs_symlink () {
}
addtask add_nodejs_symlink after do_configure before do_compile

do_add_clang_symlink () {
# Creates a `latest` symlink in the native sysroot's /usr/lib/clang
# directory that points to /usr/lib/clang/$CLANG_VERSION. Chromium manually
# links against libclang_rt.builtins.a and uses the `clang_version` GN
# variable to find it. This allows us to set it to the same value for all
do_add_clang_latest () {
# Creates a `latest` directory in the native sysroot's /usr/lib/clang
# directory that is a copy of /usr/lib/clang/$CLANG_VERSION. Chromium
# manually links against libclang_rt.builtins.a and uses the `clang_version`
# GN variable to find it. This allows us to set it to the same value for all
# Yocto releases.
cd "${RECIPE_SYSROOT_NATIVE}/usr/lib/clang"
cd "${STAGING_LIBDIR_NATIVE}/clang"
rm -rf latest
# find the directory containing the library
for dir in *; do
if [ -n "$(find $dir -name 'libclang_rt.builtins*')" ] ; then
ln -sf "$dir" latest
cp -r "$dir" latest
break
fi
done
}
addtask add_clang_symlink after do_configure before do_compile
addtask add_clang_latest after do_configure before do_compile

do_copy_clang_library () {
# Chromium needs to link against libclang_rt.builtins.a for both host and
# target code, and expects to find both libraries in the same directory
# (thanks to 0023-Use-the-correct-path-to-libclang_rt.builtins.a.patch).
cd "${RECIPE_SYSROOT}"
lib_file="$(find usr/lib/clang -name 'libclang_rt.builtins*')"
lib_dir="$(dirname $lib_file)"
cp "$lib_file" "${RECIPE_SYSROOT_NATIVE}/$lib_dir"
# (thanks to 0008-Use-the-correct-path-to-libclang_rt.builtins.a.patch).
cd "${STAGING_DIR_HOST}${nonarch_libdir}/clang"
# lib_file = "./$CLANG_VERSION/lib/linux/libclang_rt.builtins-$ARCH.a"
lib_file="$(find . -name 'libclang_rt.builtins*')"
# stripped_lib_file = "lib/linux/libclang_rt.builtins-$ARCH.a"
stripped_lib_file="${lib_file#*/*/}"
cp "$lib_file" "${STAGING_LIBDIR_NATIVE}/clang/latest/${stripped_lib_file}"
}
addtask copy_clang_library after do_configure before do_compile
addtask copy_clang_library after do_add_clang_latest before do_compile

do_copy_target_rustlibs () {
# Chromium needs a single Rust sysroot that contains the rustlibs for both
# the host and target, so we copy the target rustlibs to the native sysroot.
rustlib_src_dir="${RECIPE_SYSROOT}/usr/lib/rustlib/${TARGET_ARCH}"*
cp -r $rustlib_src_dir "${RECIPE_SYSROOT_NATIVE}/usr/lib/rustlib"
rustlib_src_dir="${STAGING_LIBDIR}/rustlib/${TARGET_ARCH}"*
cp -r $rustlib_src_dir "${STAGING_LIBDIR_NATIVE}/rustlib"
}
addtask copy_target_rustlibs after do_configure before do_compile

Expand Down
Loading