Skip to content

Commit a857a94

Browse files
committed
Merge branch 'scarthgap' into kirkstone
* Backports chromium 131.0.6778.139 to kirkstone. This relies on the recently added layer branches to satisfy the required dependencies: * Rust: meta-lts-mixins' kirkstone/rust branch. * Clang: meta-clang's `kirkstone-clang18` branch. Signed-off-by: Ariel D'Alessandro <[email protected]>
2 parents c512ef2 + 0c43dd6 commit a857a94

File tree

47 files changed

+538
-2895
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+538
-2895
lines changed

meta-chromium/README.md

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ post to the list). Please cc the maintainers if you send your patches.
3030
## Maintainers
3131

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

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

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

63+
## Supported OE/Yocto releases
64+
65+
We only support the master branch and the current LTS releases of OE/Yocto,
66+
using this repo's master branch for the former and separate branches for the
67+
latter.
68+
69+
Recent non-LTS releases should still work with our master branch, and we'll
70+
create branches capturing the last buildable version once they stop working with
71+
the latest version.
72+
6373
## Build requirements
6474

6575
This recipe requires clang, and GCC is not supported. Upstream Chromium has not
@@ -79,13 +89,12 @@ Chromium's release model because it often requires recent versions of certain
7989
recipes to build correctly.
8090

8191
This is particularly a problem for the toolchain (i.e. LLVM/clang and Rust).
82-
Because meta-clang's kirkstone branch currently only provides clang 14, we are
83-
unable to support Chromium versions higher than 120 due to those versions
84-
requiring a more recent clang version. Also, kirkstone users **must** ensure the
85-
following:
86-
* Chromium needs a somewhat recent version of Rust, and for that
87-
meta-lts-mixins' **kirkstone/rust-1.68** or **kirkstone/rust-1.70** branch
88-
needs to be used.
92+
93+
* Chromium needs a more recent version of Rust than OE Core provides for
94+
kirkstone, which is why we depend on meta-lts-mixins' `kirkstone/rust` branch.
95+
96+
* Chromium needs at least clang 18, but meta-clang's kirkstone branch provides
97+
clang 14. Thus, we depend on meta-clang's `kirkstone-clang18` branch.
8998

9099
## PACKAGECONFIG knobs
91100

meta-chromium/conf/layer.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ BBFILE_PATTERN_chromium-browser-layer := "^${LAYERDIR}/"
99
BBFILE_PRIORITY_chromium-browser-layer = "7"
1010

1111
LAYERVERSION_chromium-browser-layer = "1"
12-
LAYERSERIES_COMPAT_chromium-browser-layer = "kirkstone langdale mickledore nanbield scarthgap"
12+
LAYERSERIES_COMPAT_chromium-browser-layer = "kirkstone scarthgap styhead walnascar"
1313

1414
LAYERDEPENDS_chromium-browser-layer = "clang-layer core openembedded-layer lts-rust-mixin"

meta-chromium/recipes-browser/chromium/chromium-gn.inc

Lines changed: 36 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -4,54 +4,32 @@ require gn-utils.inc
44

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

7-
inherit features_check gtk-icon-cache qemu
7+
inherit features_check gtk-icon-cache qemu rust-common
88

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

1313
# Backported patches.
14-
SRC_URI += "\
15-
file://backport/IWYU-for-chrome-browser-ui-views-dark_mode_.patch \
16-
file://backport/IWYU-for-net-filter-zstd_source_stream.cc.patch \
17-
file://backport/IWYU-for-components-user_education-common-p.patch \
18-
file://backport/atspi-mark-possibly-unused-gn-variables.patch \
19-
file://backport/Revert-recent-C-20-usage-in-CFX_FillRenderO.patch \
20-
file://backport/IWYU-for-chrome-browser-ui-tabs-organizatio.patch \
21-
file://backport/IWYU-for-content-browser-generic_sensor-fra.patch \
22-
file://backport/IWYU-for-g-c-service-shared_image-ozone_ima.patch \
23-
file://backport/Make-toolchain_supports_rust_thin_lto-configurable.patch \
24-
file://backport/NewTabPage-Add-missing-dep-to-cr_components.patch \
25-
"
14+
# None currently \o/
15+
2616
# Non-specific patches.
2717
SRC_URI += "\
28-
file://0001-Remove-the-GN-settings-done-for-clang-that-conflict-.patch \
18+
file://0001-Drop-GN-compiler-settings-conflicting-with-OE.patch \
2919
file://0002-v8-qemu-wrapper.patch \
3020
file://0003-wrapper-extra-flags.patch \
3121
file://0004-Delete-compiler-options-not-available-in-release-ver.patch \
3222
file://0005-avoid-link-latomic-failure-on-CentOS-8-host.patch \
33-
file://0006-Revert-__attribute__-and-alignas-changes.patch \
34-
file://0007-Add-missing-typename-s.patch \
35-
file://0008-Don-t-pass-unknown-LLVM-options.patch \
36-
file://0009-Avoid-capturing-structured-bindings.patch \
37-
file://0010-Revert-Reland-Reland-mte-refactor-the-tagging-functi.patch \
38-
file://0011-Avoid-parenthesized-initialization-of-aggregates.patch \
39-
file://0012-Fix-constexpr-variable-cannot-have-non-literal-type-.patch \
40-
file://0013-Fix-undefined-symbol-PaintOpWriter-SerializedSize-un.patch \
41-
file://0014-Fix-implicitly-deleted-default-constructor-build-err.patch \
42-
file://0015-Don-t-delete-CrashKeyWithName-dtor.patch \
43-
file://0016-Use-base-ranges-instead-of-std-ranges.patch \
44-
file://0017-Use-the-correct-path-to-libclang_rt.builtins.a.patch \
45-
file://0018-Adjust-the-Rust-build-to-our-needs.patch \
46-
file://0019-Don-t-require-profiler_builtins.rlib.patch \
23+
file://0006-Don-t-pass-unknown-LLVM-options.patch \
24+
file://0007-Fix-constexpr-variable-must-be-initialized-by-a-cons.patch \
25+
file://0008-Use-the-correct-path-to-libclang_rt.builtins.a.patch \
26+
file://0009-Adjust-the-Rust-build-to-our-needs.patch \
27+
file://0010-Don-t-require-profiler_builtins.rlib.patch \
28+
file://0011-Disable-crabbyavif-to-fix-build-errors.patch \
29+
file://0012-Revert-Allow-and-use-std-hardware_destructive_interf.patch \
4730
"
4831
# ARM/AArch64-specific patches.
49-
SRC_URI:append:arm = "\
50-
file://arm/0001-BUILD-do-not-specify-march-on-arm.patch \
51-
file://arm/0002-Fix-ARM-build-with-recent-glibc.patch \
52-
file://arm/0003-Fix-static_assert-failed-build-error-on-32-bit-ARM.patch \
53-
"
54-
SRC_URI:append:aarch64 = "${@bb.utils.contains('TUNE_FEATURES', 'crypto', '', ' file://arm/0004-Fix-AES-crypto-SIGILL-on-rpi4-64.patch', d)}"
32+
SRC_URI:append:aarch64 = "${@bb.utils.contains('TUNE_FEATURES', 'crypto', '', ' file://arm/0001-Fix-AES-crypto-SIGILL-on-rpi4-64.patch', d)}"
5533

5634
# musl-specific patches.
5735
SRC_URI:append:libc-musl = "\
@@ -92,6 +70,7 @@ DEPENDS += " \
9270
jpeg \
9371
libdrm \
9472
libffi \
73+
libstd-rs \
9574
libwebp \
9675
libxkbcommon \
9776
libxslt \
@@ -106,7 +85,6 @@ DEPENDS += " \
10685
pkgconfig-native \
10786
${@bb.utils.contains('DISTRO_FEATURES', 'pulseaudio', 'pulseaudio', '', d)} \
10887
qemu-native \
109-
rust \
11088
rust-native \
11189
virtual/libgl \
11290
"
@@ -308,8 +286,8 @@ GN_ARGS += ' \
308286
'
309287

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

381359
CHROMIUM_EXTRA_ARGS ?= " \
382-
${@bb.utils.contains('PACKAGECONFIG', 'use-egl', '--use-gl=egl', '', d)} \
360+
${@bb.utils.contains('PACKAGECONFIG', 'use-egl', '--use-angle=gles-egl', '', d)} \
383361
${@bb.utils.contains('PACKAGECONFIG', 'kiosk-mode', '--kiosk --no-first-run --incognito', '', d)} \
384362
${@bb.utils.contains('PACKAGECONFIG', 'gtk4', '--gtk-version=4', '', d)} \
385363
"
@@ -455,39 +433,42 @@ do_add_nodejs_symlink () {
455433
}
456434
addtask add_nodejs_symlink after do_configure before do_compile
457435

458-
do_add_clang_symlink () {
459-
# Creates a `latest` symlink in the native sysroot's /usr/lib/clang
460-
# directory that points to /usr/lib/clang/$CLANG_VERSION. Chromium manually
461-
# links against libclang_rt.builtins.a and uses the `clang_version` GN
462-
# variable to find it. This allows us to set it to the same value for all
436+
do_add_clang_latest () {
437+
# Creates a `latest` directory in the native sysroot's /usr/lib/clang
438+
# directory that is a copy of /usr/lib/clang/$CLANG_VERSION. Chromium
439+
# manually links against libclang_rt.builtins.a and uses the `clang_version`
440+
# GN variable to find it. This allows us to set it to the same value for all
463441
# Yocto releases.
464-
cd "${RECIPE_SYSROOT_NATIVE}/usr/lib/clang"
442+
cd "${STAGING_LIBDIR_NATIVE}/clang"
443+
rm -rf latest
465444
# find the directory containing the library
466445
for dir in *; do
467446
if [ -n "$(find $dir -name 'libclang_rt.builtins*')" ] ; then
468-
ln -sf "$dir" latest
447+
cp -r "$dir" latest
469448
break
470449
fi
471450
done
472451
}
473-
addtask add_clang_symlink after do_configure before do_compile
452+
addtask add_clang_latest after do_configure before do_compile
474453

475454
do_copy_clang_library () {
476455
# Chromium needs to link against libclang_rt.builtins.a for both host and
477456
# target code, and expects to find both libraries in the same directory
478-
# (thanks to 0023-Use-the-correct-path-to-libclang_rt.builtins.a.patch).
479-
cd "${RECIPE_SYSROOT}"
480-
lib_file="$(find usr/lib/clang -name 'libclang_rt.builtins*')"
481-
lib_dir="$(dirname $lib_file)"
482-
cp "$lib_file" "${RECIPE_SYSROOT_NATIVE}/$lib_dir"
457+
# (thanks to 0008-Use-the-correct-path-to-libclang_rt.builtins.a.patch).
458+
cd "${STAGING_DIR_HOST}${nonarch_libdir}/clang"
459+
# lib_file = "./$CLANG_VERSION/lib/linux/libclang_rt.builtins-$ARCH.a"
460+
lib_file="$(find . -name 'libclang_rt.builtins*')"
461+
# stripped_lib_file = "lib/linux/libclang_rt.builtins-$ARCH.a"
462+
stripped_lib_file="${lib_file#*/*/}"
463+
cp "$lib_file" "${STAGING_LIBDIR_NATIVE}/clang/latest/${stripped_lib_file}"
483464
}
484-
addtask copy_clang_library after do_configure before do_compile
465+
addtask copy_clang_library after do_add_clang_latest before do_compile
485466

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

0 commit comments

Comments
 (0)