diff --git a/meta-chromium/README.md b/meta-chromium/README.md index 57ddc183..41ca133d 100644 --- a/meta-chromium/README.md +++ b/meta-chromium/README.md @@ -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 @@ -72,6 +82,21 @@ 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. +### 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 +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.** + ## PACKAGECONFIG knobs * component-build: (off by default) diff --git a/meta-chromium/conf/layer.conf b/meta-chromium/conf/layer.conf index d2de2af7..48c22a5f 100644 --- a/meta-chromium/conf/layer.conf +++ b/meta-chromium/conf/layer.conf @@ -11,4 +11,4 @@ BBFILE_PRIORITY_chromium-browser-layer = "7" LAYERVERSION_chromium-browser-layer = "1" LAYERSERIES_COMPAT_chromium-browser-layer = "scarthgap styhead walnascar" -LAYERDEPENDS_chromium-browser-layer = "clang-layer core openembedded-layer" +LAYERDEPENDS_chromium-browser-layer = "clang-layer core openembedded-layer lts-rust-mixin" diff --git a/meta-chromium/recipes-browser/chromium/chromium-gn.inc b/meta-chromium/recipes-browser/chromium/chromium-gn.inc index 06d2cda4..d1df2eae 100644 --- a/meta-chromium/recipes-browser/chromium/chromium-gn.inc +++ b/meta-chromium/recipes-browser/chromium/chromium-gn.inc @@ -27,7 +27,6 @@ SRC_URI += "\ 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-Tell-rustc-that-we-will-always-be-providing-c.patch \ " # 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)}" diff --git a/meta-chromium/recipes-browser/chromium/files/0013-Revert-Tell-rustc-that-we-will-always-be-providing-c.patch b/meta-chromium/recipes-browser/chromium/files/0013-Revert-Tell-rustc-that-we-will-always-be-providing-c.patch deleted file mode 100644 index 1e4206d9..00000000 --- a/meta-chromium/recipes-browser/chromium/files/0013-Revert-Tell-rustc-that-we-will-always-be-providing-c.patch +++ /dev/null @@ -1,95 +0,0 @@ -From 0b85ec304cb6c6927942c1714a8002592d889d64 Mon Sep 17 00:00:00 2001 -From: Max Ihlenfeldt -Date: Tue, 3 Dec 2024 16:11:37 +0000 -Subject: [PATCH] Revert "Tell rustc that we will always be providing clangrt - libraries" - -https://crrev.com/c/5913992 added `-Zexternal-clangrt` to the default -Rust compiler flags. That option is only available since Rust 1.78, but -Scarthgap is still using Rust 1.75. - -Upstream-Status: Inappropriate [specific to older versions of Rust] -Signed-off-by: Max Ihlenfeldt ---- - build/config/compiler/BUILD.gn | 3 --- - build/rust/std/BUILD.gn | 46 ++++++++++++++++++++++++++++++++++ - 2 files changed, 46 insertions(+), 3 deletions(-) - -diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn -index f162751..d04e731 100644 ---- a/build/config/compiler/BUILD.gn -+++ b/build/config/compiler/BUILD.gn -@@ -1041,9 +1041,6 @@ config("compiler") { - # For deterministic builds, keep the local machine's current working - # directory from appearing in build outputs. - "-Zremap-cwd-prefix=.", -- -- # We use clang-rt sanitizer runtimes. -- "-Zexternal-clangrt", - ] - - if (!is_win || force_rustc_color_output) { -diff --git a/build/rust/std/BUILD.gn b/build/rust/std/BUILD.gn -index 136d06b..a6d4795 100644 ---- a/build/rust/std/BUILD.gn -+++ b/build/rust/std/BUILD.gn -@@ -237,6 +237,51 @@ if (toolchain_has_rust) { - visibility = [ ":*" ] - } - -+ # When given -Zsanitize=..., rustc insists on passing a sanitizer runtime to -+ # the linker it invokes. Unfortunately, our C++ ldflags already tell the -+ # linker to link against a C++ sanitizer runtime - which contains the same -+ # symbols. So, make a blank library. -+ # The list of relevant sanitizers here is taken from -+ # https://github.com/rust-lang/rust/blob/7e7483d26e3cec7a44ef00cf7ae6c9c8c918bec6/compiler/rustc_codegen_ssa/src/back/link.rs#L1148 -+ template("rustc_sanitizer_runtime") { -+ rt_name = target_name -+ not_needed([ "invoker" ]) -+ static_library("sanitizer_rt_$rt_name") { -+ sources = [] -+ output_name = "librustc-${rust_channel}_rt.$rt_name" -+ output_dir = "$local_rustc_sysroot/$sysroot_lib_subdir" -+ if (is_win) { -+ arflags = [ "/llvmlibempty" ] -+ } -+ } -+ } -+ rustc_sanitizer_runtimes = [] -+ if (is_asan) { -+ rustc_sanitizer_runtime("asan") { -+ } -+ rustc_sanitizer_runtimes += [ ":sanitizer_rt_asan" ] -+ } -+ if (is_lsan) { -+ rustc_sanitizer_runtime("lsan") { -+ } -+ rustc_sanitizer_runtimes += [ ":sanitizer_rt_lsan" ] -+ } -+ if (is_msan) { -+ rustc_sanitizer_runtime("msan") { -+ } -+ rustc_sanitizer_runtimes += [ ":sanitizer_rt_msan" ] -+ } -+ if (is_tsan) { -+ rustc_sanitizer_runtime("tsan") { -+ } -+ rustc_sanitizer_runtimes += [ ":sanitizer_rt_tsan" ] -+ } -+ if (is_hwasan) { -+ rustc_sanitizer_runtime("hwasan") { -+ } -+ rustc_sanitizer_runtimes += [ ":sanitizer_rt_hwasan" ] -+ } -+ - # Builds and links against the Rust stdlib. Both Rust and C++ targets should - # depend on this, as it provides the path to the library and includes the - # allocator hooks. -@@ -255,6 +300,7 @@ if (toolchain_has_rust) { - foreach(libname, stdlib_files + skip_stdlib_files) { - deps += [ "rules:$libname" ] - } -+ deps += rustc_sanitizer_runtimes - - public_deps = [ ":remap_alloc" ] - }