Skip to content

Commit 09d2fe9

Browse files
caneraltinbasakotavio
authored andcommitted
chromium: Update to 138.0.7204.157
Chromium 138+ uses its bundled libc++ and compiler-rt. To ensure the build system uses these and does not fall back to system-provided runtime libraries, explicitly pass the target triple and disable system stdlib++. This avoids linker errors caused by missing crtbeginS.o, crtendS.o, and libgcc when using Clang with a minimal sysroot. Release Notes: https://chromereleases.googleblog.com/2025/07/stable-channel-update-for-desktop_15.html Build and patch changes: ------------------------ Added patches: * 0011-fix-check_version-Only-compare-node.js-major-version.patch Updated patches: * 0009-Adjust-the-Rust-build-to-our-needs.patch Removed patches: * 0011-Revert-Allow-and-use-std-hardware_destructive_interf.patch * 0012-Revert-Set-Rust-symbol-visibility-to-hidden-when-C-s.patch * 0013-pdfium-Fix-missing-PDFiumAPIStringBufferAdapter-temp.patch * 0014-Revert-Remove-libavif-based-AVIF-decoder.patch * 0015-Revert-Remove-third_party-libavif.patch * 0016-Disable-crabbyavif-to-fix-build-errors.patch * 0016-Fix-adler-reference-for-Rust-1.86-and-later.patch * 0017-rust-Use-adler-instead-of-adler2.patch * 0018-third_party-node-update_node_binaries-Update-nodejs-.patch * 0020-rust-filter-out-arm-specific-flags-from-rust-compile.patch License changes: ---------------- Added licenses: * third_party/compiler-rt/src/LICENSE.TXT * third_party/libtess2/LICENSE * third_party/llvm-libc/src/LICENSE.TXT * third_party/net/third_party/mozilla_security_manager/LICENSE Removed licenses: * third_party/accessibility-audit/LICENSE * third_party/io_grpc_grpc_api/LICENSE * third_party/libavifinfo/LICENSE Updated licenses: * third_party/android_deps/libs/com_google_android_gms_play_services_auth/LICENSE -> third_party/android_deps/autorolled/committed/libs/com_google_android_gms_play_services_auth/LICENSE * third_party/android_deps/libs/com_google_android_gms_play_services_auth_api_phone/LICENSE -> third_party/android_deps/autorolled/committed/libs/com_google_android_gms_play_services_auth_api_phone/LICENSE * third_party/android_deps/libs/com_google_android_gms_play_services_auth_base/LICENSE -> third_party/android_deps/autorolled/committed/libs/com_google_android_gms_play_services_auth_base/LICENSE * third_party/android_deps/libs/com_google_android_gms_play_services_auth_blockstore/LICENSE -> third_party/android_deps/autorolled/committed/libs/com_google_android_gms_play_services_auth_blockstore/LICENSE * third_party/android_deps/libs/com_google_android_gms_play_services_fido/LICENSE -> third_party/android_deps/autorolled/committed/libs/com_google_android_gms_play_services_fido/LICENSE * third_party/android_deps/libs/com_google_android_libraries_identity_googleid_googleid/LICENSE -> third_party/android_deps/autorolled/committed/libs/com_google_android_libraries_identity_googleid_googleid/LICENSE * third_party/expat/src/expat/COPYING * third_party/libjpeg_turbo/LICENSE Test-built: ----------- * chromium-ozone-wayland * MACHINE=qemux86-64, qemuarm, qemuarm64 * chromium-x11 * MACHINE=qemux86-64, qemuarm, qemuarm64 Test dependencies: ------------------ * URI: git://git.yoctoproject.org/poky - branch: scarthgap - revision: ac257900c33754957b2696529682029d997a8f28 * URI: git://git.openembedded.org/meta-openembedded - layers: meta-oe - branch: scarthgap - revision: 491671faee11ea131feab5a3a451d1a01deb2ab1 * URI: git://github.com/kraj/meta-clang - branch: scarthgap-clang20 - revision: 76596813cd0061bd9818a80926e6900af61fcaa0 * URI: git://git.yoctoproject.org/meta-lts-mixins - branch: scarthgap/rust - revision: 96deb45139df027473faf0938fe006d33c45c375 Signed-off-by: Caner Altinbasak <cal@brightsign.biz> Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
1 parent 89e00fa commit 09d2fe9

File tree

30 files changed

+247
-4709
lines changed

30 files changed

+247
-4709
lines changed

meta-chromium/README.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,17 @@ This layer depends on:
1515
- revision: HEAD
1616

1717
* URI: git://github.com/kraj/meta-clang
18-
- branch: master
18+
- branch: scarthgap-clang20
19+
- revision: HEAD
20+
21+
* URI: git://git.yoctoproject.org/meta-lts-mixins
22+
- branch: scarthgap/rust
1923
- revision: HEAD
2024

25+
**NOTE**: the compiler may require some adjustments based on the latest
26+
dependencies updates. Please refer to the *Test-built* section in the update
27+
commit logs for specific revision hashes used during build tests.
28+
2129
## Contributing
2230

2331
The preferred way to contribute to this layer is to send GitHub pull requests or
@@ -122,11 +130,6 @@ This is particularly a problem for the toolchain (i.e. LLVM/clang and Rust).
122130
Chromium needs a more recent version of Rust than OE Core provides for
123131
scarthgap, which is why we depend on meta-lts-mixins' `scarthgap/rust` branch.
124132

125-
**Side note: For now, clang 18 provided by meta-clang is recent enough, but at
126-
some point during scarthgap's LTS lifetime Chromium won't be compilable with
127-
that version, and we'll have to create e.g. a scarthgap-clang20 branch for
128-
meta-clang and use that.**
129-
130133
## PACKAGECONFIG knobs
131134

132135
* component-build: (off by default)

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 = "scarthgap styhead walnascar"
12+
LAYERSERIES_COMPAT_chromium-browser-layer = "scarthgap styhead walnascar whinlatter"
1313

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

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

Lines changed: 46 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -25,27 +25,11 @@ SRC_URI += "\
2525
file://0008-Use-the-correct-path-to-libclang_rt.builtins.a.patch \
2626
file://0009-Adjust-the-Rust-build-to-our-needs.patch \
2727
file://0010-Don-t-require-profiler_builtins.rlib.patch \
28-
file://0011-Revert-Allow-and-use-std-hardware_destructive_interf.patch \
29-
file://0012-Revert-Set-Rust-symbol-visibility-to-hidden-when-C-s.patch \
30-
file://0013-pdfium-Fix-missing-PDFiumAPIStringBufferAdapter-temp.patch \
31-
file://0014-Revert-Remove-libavif-based-AVIF-decoder.patch \
32-
file://0015-Revert-Remove-third_party-libavif.patch \
33-
file://0016-Disable-crabbyavif-to-fix-build-errors.patch \
34-
file://0017-rust-Use-adler-instead-of-adler2.patch \
35-
file://0018-third_party-node-update_node_binaries-Update-nodejs-.patch \
36-
file://0019-Reduce-minimum-browser-window-width-to-480px.patch \
37-
file://0020-rust-filter-out-arm-specific-flags-from-rust-compile.patch \
38-
file://0021-chromium-fix-v4l2-compiler-error-on-arm.patch \
28+
file://0011-fix-check_version-Only-compare-node.js-major-version.patch \
29+
file://0012-chromium-fix-v4l2-compiler-error-on-arm.patch \
30+
file://0013-Reduce-minimum-browser-window-width-to-480px.patch \
3931
"
4032

41-
# Missing third_party sources.
42-
SRC_URI += "\
43-
git://chromium.googlesource.com/external/github.com/AOMediaCodec/libavif;protocol=https;branch=main;name=libavif;destsuffix=third_party/libavif/src \
44-
"
45-
46-
SRCREV_FORMAT .= "_libavif"
47-
SRCREV_libavif = "e7b34a1f5e9f7024d08311c7bae156061b889882"
48-
4933
# ARM/AArch64-specific patches.
5034
SRC_URI:append:aarch64 = "${@bb.utils.contains('TUNE_FEATURES', 'crypto', '', ' file://arm/0001-Fix-AES-crypto-SIGILL-on-rpi4-64.patch', d)}"
5135

@@ -68,8 +52,6 @@ SRC_URI:append:libc-musl = "\
6852
file://musl/0015-fix-libc-version-include.patch \
6953
"
7054

71-
SRC_URI:append = "${@oe.utils.version_less_or_equal('RUSTVERSION', '1.85.1', '', ' file://0016-Fix-adler-reference-for-Rust-1.86-and-later.patch', d)}"
72-
7355
ANY_OF_DISTRO_FEATURES = "opengl vulkan"
7456

7557
# Append instead of assigning; the gtk-icon-cache class inherited above also
@@ -141,10 +123,10 @@ PACKAGECONFIG[use-egl] = ",,virtual/egl virtual/libgles2"
141123
# be necessary but are OK to add).
142124
PACKAGECONFIG[component-build] = ""
143125

144-
# Starting with M61, Chromium defaults to building with its own copy of libc++
145-
# instead of the system's libstdc++. Add a knob to control this behavior
146-
# https://groups.google.com/a/chromium.org/d/msg/chromium-packagers/8aYO3me2SCE/SZ8pJXhZAwAJ
147-
PACKAGECONFIG[custom-libcxx] = "use_custom_libcxx=true,use_custom_libcxx=false,,"
126+
# As of Chromium 138, libc++ is required unconditionally.
127+
# https://docs.google.com/document/d/193ig0qeM23rK1yH6bW14O3zIgVztyKaY4R1XRwgmUFk/edit?usp=sharing
128+
# Force use_custom_libcxx=true as Chromium 138+ requires libc++
129+
GN_ARGS += "use_custom_libcxx=true"
148130

149131
PACKAGECONFIG[cups] = "use_cups=true,use_cups=false,cups"
150132
PACKAGECONFIG[gtk4] = ""
@@ -283,6 +265,10 @@ GN_ARGS += "disable_fieldtrial_testing_config=true"
283265
# See https://crrev.com/c/2424669
284266
GN_ARGS += "chrome_pgo_phase=0"
285267

268+
# Disable passing --warning-suppression-mappings= flag to clang.
269+
# This feature is available on Clang21+
270+
GN_ARGS += "clang_warning_suppression_file="""
271+
286272
# API keys for accessing Google services. By default, we use an invalid key
287273
# only to prevent the "you are missing an API key" infobar from being shown on
288274
# startup.
@@ -302,6 +288,9 @@ GN_ARGS += ' \
302288
BUILD_CPPFLAGS:append:runtime-llvm = " -isysroot=${STAGING_DIR_NATIVE} -stdlib=libc++"
303289
# Use libgcc for native parts
304290
BUILD_LDFLAGS:append:runtime-llvm = " -rtlib=libgcc -unwindlib=libgcc -stdlib=libc++ -lc++abi -rpath ${STAGING_LIBDIR_NATIVE}"
291+
LDFLAGS:append:runtime-llvm = " --target=${TARGET_SYS}"
292+
CXXFLAGS:append:runtime-llvm = " --target=${TARGET_SYS} -nostdlib++"
293+
CFLAGS:append:runtime-llvm = " --target=${TARGET_SYS}"
305294

306295
# Toolchains we will use for the build. We need to point to the toolchain file
307296
# we've created, set the right target architecture and make sure we are not
@@ -369,15 +358,16 @@ ARM_VERSION:armv6 = "6"
369358
# overriding what GN wants
370359
TUNE_CCARGS:remove = "-mthumb"
371360

361+
# Linking rust with partitionalloc is problematic in arm32
372362
GN_ARGS:append:arm = ' \
373363
arm_float_abi="${ARM_FLOAT_ABI}" \
374364
arm_fpu="${ARM_FPU}" \
375365
arm_tune="${ARM_TUNE}" \
376366
arm_version=${ARM_VERSION} \
367+
use_partition_alloc_as_malloc=false \
368+
enable_backup_ref_ptr_support=false \
377369
'
378-
# tcmalloc's atomicops-internals-arm-v6plus.h uses the "dmb" instruction that
379-
# is not available on (some?) ARMv6 models, which causes the build to fail.
380-
GN_ARGS:append:armv6 = ' use_partition_alloc_as_malloc=false enable_backup_ref_ptr_support=false'
370+
381371
# The WebRTC code fails to build on ARMv6 when NEON is enabled.
382372
# https://bugs.chromium.org/p/webrtc/issues/detail?id=6574
383373
GN_ARGS:append:armv6 = ' arm_use_neon=false'
@@ -449,6 +439,7 @@ python do_write_toolchain_file () {
449439
toolchain_file = os.path.join(toolchain_dir, "BUILD.gn")
450440
write_toolchain_file(d, toolchain_file)
451441
}
442+
452443
addtask write_toolchain_file after do_patch before do_configure
453444

454445
do_add_nodejs_symlink () {
@@ -470,16 +461,34 @@ do_add_clang_latest () {
470461
# directory that is a copy of /usr/lib/clang/$CLANG_VERSION. Chromium
471462
# manually links against libclang_rt.builtins.a and uses the `clang_version`
472463
# GN variable to find it. This allows us to set it to the same value for all
473-
# Yocto releases.
464+
# Yocto releases. Also copy headers so bindgen can find system headers.
474465
cd "${STAGING_LIBDIR_NATIVE}/clang"
475466
rm -rf latest
476-
# find the directory containing the library
467+
468+
# Find a directory with runtime libraries and copy it as base
477469
for dir in *; do
478-
if [ -n "$(find $dir -name 'libclang_rt.builtins*')" ] ; then
470+
if [ -d "$dir" ] && [ -n "$(find $dir -name 'libclang_rt.builtins*' 2>/dev/null)" ]; then
471+
echo "Copying clang directory $dir to latest (runtime libraries)"
479472
cp -r "$dir" latest
480473
break
481474
fi
482475
done
476+
477+
# Find and copy headers from any versioned directory to ensure bindgen can find them
478+
headers_copied=false
479+
for dir in *; do
480+
if [ -d "$dir/include" ]; then
481+
echo "Found headers in $dir/include, copying to latest/include"
482+
mkdir -p latest/include
483+
cp -r "$dir/include/"* latest/include/
484+
headers_copied=true
485+
break
486+
fi
487+
done
488+
489+
if [ "$headers_copied" = false ]; then
490+
echo "Warning: No Clang headers found in any versioned directories"
491+
fi
483492
}
484493
addtask add_clang_latest after do_configure before do_compile
485494

@@ -504,15 +513,15 @@ do_copy_target_rustlibs () {
504513
}
505514
addtask copy_target_rustlibs after do_configure before do_compile
506515

507-
do_copy_missing_third_party_sources () {
508-
rm -rf ${S}/third_party/libavif/src
509-
cp -r ${UNPACKDIR}/third_party/libavif/src/ ${S}/third_party/libavif/
510-
}
511-
addtask copy_missing_third_party_sources after do_patch before do_configure
512-
513516
do_configure() {
514517
cd ${S}
515518
python3 ./build/linux/unbundle/replace_gn_files.py --system-libraries ${GN_UNBUNDLE_LIBS}
519+
520+
# Add Rust-style target triples (converted by Yocto's rust-common.bbclass)
521+
grep -qxF "${RUST_TARGET_SYS}" ${S}/build/rust/known-target-triples.txt || echo "${RUST_TARGET_SYS}" >> ${S}/build/rust/known-target-triples.txt
522+
grep -qxF "${RUST_HOST_SYS}" ${S}/build/rust/known-target-triples.txt || echo "${RUST_HOST_SYS}" >> ${S}/build/rust/known-target-triples.txt
523+
grep -qxF "${RUST_BUILD_SYS}" ${S}/build/rust/known-target-triples.txt || echo "${RUST_BUILD_SYS}" >> ${S}/build/rust/known-target-triples.txt
524+
516525
gn gen --args='${GN_ARGS}' "${OUTPUT_DIR}"
517526
}
518527

0 commit comments

Comments
 (0)