Skip to content
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

kirkstone: backport chromium from scarthgap #843

Draft
wants to merge 26 commits into
base: kirkstone
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 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
901c92f
WIP: chromium: Adjust config to use lts-rust-mixin layer
adalessandro Oct 22, 2024
123b293
meta-chromium: Add kirkstone layer compat
adalessandro Oct 22, 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
18 changes: 1 addition & 17 deletions meta-chromium/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 @@ -72,22 +72,6 @@ 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.

### dunfell-specific requirements

The dunfell 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) and, at times,
node.js. As such, dunfell users **must** ensure the following:
* Chromium needs clang >= 12 and for that, meta-clang's **dunfell-clang12**
branch needs to be used.
* Since Chromium 112, at least Nodejs 14 is required for parts of the build.
meta-oe needs to be at least a commit
116bfe8d5e5851e7fc5424f40da8691a19c5b5ee ("nodejs: make 14.18.1 available but
not default") and `PREFERRED_VERSION_nodejs-native = "14.%"` needs to be
added to `conf/local.conf`.

## PACKAGECONFIG knobs

* component-build: (off by default)
Expand Down
4 changes: 2 additions & 2 deletions 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"
LAYERDEPENDS_chromium-browser-layer = "clang-layer core openembedded-layer lts-rust-mixin"
82 changes: 32 additions & 50 deletions meta-chromium/recipes-browser/chromium/chromium-gn.inc
Original file line number Diff line number Diff line change
Expand Up @@ -11,45 +11,24 @@ 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 \
"
# 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://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 \
"
# 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 @@ -306,8 +285,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 @@ -323,7 +302,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 @@ -453,39 +432,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