Skip to content

Commit d5d4dc0

Browse files
chromium: Update to 138.0.7204.35 (scarthgap)
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. scarthgap branch of meta-oe ships with clang18. meta-lts-mixins with scarthgap-clang20 branch should be included in layer.conf 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-Disable-crabbyavif-to-fix-build-errors.patch 0012-Revert-Allow-and-use-std-hardware_destructive_interf.patch 0013-Revert-Set-Rust-symbol-visibility-to-hidden-when-C-s.patch 0014-pdfium-Fix-missing-PDFiumAPIStringBufferAdapter-temp.patch 0015-Revert-Connect-the-Rust-log-crate-to-the-base-loggin.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 master, clang, MACHINE=qemux86-64 chromium-x11 master, clang, MACHINE=qemux86-64, qemuarm, qemuarm64 Repo hashes (from meta-chromium-test) meta-oe: commit: "491671faee11ea131feab5a3a451d1a01deb2ab1" poky: commit: "ac257900c33754957b2696529682029d997a8f28" meta-clang: commit: "76596813cd0061bd9818a80926e6900af61fcaa0" meta-lts-mixins: commit: "96deb45139df027473faf0938fe006d33c45c375"
1 parent 2dabbb1 commit d5d4dc0

23 files changed

+597
-1054
lines changed

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

Lines changed: 59 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,10 @@ 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-Disable-crabbyavif-to-fix-build-errors.patch \
29-
file://0012-Revert-Allow-and-use-std-hardware_destructive_interf.patch \
30-
file://0013-Revert-Set-Rust-symbol-visibility-to-hidden-when-C-s.patch \
31-
file://0014-pdfium-Fix-missing-PDFiumAPIStringBufferAdapter-temp.patch \
32-
file://0015-Revert-Connect-the-Rust-log-crate-to-the-base-loggin.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 \
3330
"
31+
3432
# ARM/AArch64-specific patches.
3533
SRC_URI:append:aarch64 = "${@bb.utils.contains('TUNE_FEATURES', 'crypto', '', ' file://arm/0001-Fix-AES-crypto-SIGILL-on-rpi4-64.patch', d)}"
3634

@@ -112,7 +110,7 @@ BUILD_CC:toolchain-clang = "clang"
112110
BUILD_CXX:toolchain-clang = "clang++"
113111
BUILD_LD:toolchain-clang = "clang"
114112

115-
PACKAGECONFIG ??= "upower use-egl"
113+
PACKAGECONFIG ??= "upower use-egl use-v4l2"
116114

117115
# this makes sure the dependencies for the EGL mode are present; otherwise, the configure scripts
118116
# automatically and silently fall back to GLX
@@ -124,10 +122,10 @@ PACKAGECONFIG[use-egl] = ",,virtual/egl virtual/libgles2"
124122
# be necessary but are OK to add).
125123
PACKAGECONFIG[component-build] = ""
126124

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

132130
PACKAGECONFIG[cups] = "use_cups=true,use_cups=false,cups"
133131
PACKAGECONFIG[gtk4] = ""
@@ -146,6 +144,10 @@ PACKAGECONFIG[upower] = ",,,upower"
146144
# but remember to also use proprietary codecs so that H.264 is supported. Also note
147145
# that not all the hardware configs might be supported.
148146
PACKAGECONFIG[use-vaapi] = "use_vaapi=true use_libgav1_parser=true,use_vaapi=false,libva"
147+
# Enable stateless V4L2 M2M video decoding support.
148+
# This requires 'proprietary-codecs' PACKAGECONFIG
149+
# to decode h264 streams on the V4L2 M2M device.
150+
PACKAGECONFIG[use-v4l2] = "use_v4l2_codec=true,use_v4l2_codec=false"
149151

150152
# Base GN arguments, mostly related to features we want to enable or disable.
151153
GN_ARGS = " \
@@ -203,6 +205,13 @@ DEBUG_FLAGS:remove:x86 = "-g"
203205
DEBUG_FLAGS:append:x86 = "-g1"
204206
GN_ARGS += "symbol_level=0"
205207

208+
# For ARM builds, completely remove debug flags that cause binary size issues
209+
# This prevents the "output file too large" linker error on ARM32
210+
CFLAGS:remove:arm = "-g"
211+
CXXFLAGS:remove:arm = "-g"
212+
TARGET_CFLAGS:remove:arm = "-g"
213+
TARGET_CXXFLAGS:remove:arm = "-g"
214+
206215
# As of Chromium 62.0.3202.94 and Yocto Rocko (GCC 7, binutils 2.29), passing
207216
# -g to the compiler results in many linker errors on aarch64, such as:
208217
# obj/third_party/WebKit/Source/modules/payments/libpayments.a(PaymentEventDataConversion.o)(.debug_loc+0x4e25): error: relocation overflow in R_AARCH64_ABS32
@@ -255,6 +264,10 @@ GN_ARGS += "disable_fieldtrial_testing_config=true"
255264
# See https://crrev.com/c/2424669
256265
GN_ARGS += "chrome_pgo_phase=0"
257266

267+
# Disable passing --warning-suppression-mappings= flag to clang.
268+
# This feature is available on Clang21+
269+
GN_ARGS += "clang_warning_suppression_file="""
270+
258271
# API keys for accessing Google services. By default, we use an invalid key
259272
# only to prevent the "you are missing an API key" infobar from being shown on
260273
# startup.
@@ -274,6 +287,9 @@ GN_ARGS += ' \
274287
BUILD_CPPFLAGS:append:runtime-llvm = " -isysroot=${STAGING_DIR_NATIVE} -stdlib=libc++"
275288
# Use libgcc for native parts
276289
BUILD_LDFLAGS:append:runtime-llvm = " -rtlib=libgcc -unwindlib=libgcc -stdlib=libc++ -lc++abi -rpath ${STAGING_LIBDIR_NATIVE}"
290+
LDFLAGS:append:runtime-llvm = " --target=${TARGET_SYS}"
291+
CXXFLAGS:append:runtime-llvm = " --target=${TARGET_SYS} -nostdlib++"
292+
CFLAGS:append:runtime-llvm = " --target=${TARGET_SYS}"
277293

278294
# Toolchains we will use for the build. We need to point to the toolchain file
279295
# we've created, set the right target architecture and make sure we are not
@@ -341,15 +357,16 @@ ARM_VERSION:armv6 = "6"
341357
# overriding what GN wants
342358
TUNE_CCARGS:remove = "-mthumb"
343359

360+
# Linking rust with partitionalloc is problematic in arm32
344361
GN_ARGS:append:arm = ' \
345362
arm_float_abi="${ARM_FLOAT_ABI}" \
346363
arm_fpu="${ARM_FPU}" \
347364
arm_tune="${ARM_TUNE}" \
348365
arm_version=${ARM_VERSION} \
366+
use_partition_alloc_as_malloc=false \
367+
enable_backup_ref_ptr_support=false \
349368
'
350-
# tcmalloc's atomicops-internals-arm-v6plus.h uses the "dmb" instruction that
351-
# is not available on (some?) ARMv6 models, which causes the build to fail.
352-
GN_ARGS:append:armv6 = ' use_partition_alloc_as_malloc=false enable_backup_ref_ptr_support=false'
369+
353370
# The WebRTC code fails to build on ARMv6 when NEON is enabled.
354371
# https://bugs.chromium.org/p/webrtc/issues/detail?id=6574
355372
GN_ARGS:append:armv6 = ' arm_use_neon=false'
@@ -363,6 +380,7 @@ CHROMIUM_EXTRA_ARGS ?= " \
363380
${@bb.utils.contains('PACKAGECONFIG', 'use-egl', '--use-angle=gles-egl', '', d)} \
364381
${@bb.utils.contains('PACKAGECONFIG', 'kiosk-mode', '--kiosk --no-first-run --incognito', '', d)} \
365382
${@bb.utils.contains('PACKAGECONFIG', 'gtk4', '--gtk-version=4', '', d)} \
383+
${@bb.utils.contains('PACKAGECONFIG', 'use-v4l2', '--ozone-platform-hint=wayland --enable-features=AcceleratedVideoDecoder,AcceleratedVideoDecodeLinuxGL,AcceleratedVideoDecodeLinuxZeroCopyGL', '', d)} \
366384
"
367385

368386
# V8's JIT infrastructure requires binaries such as mksnapshot and
@@ -420,6 +438,7 @@ python do_write_toolchain_file () {
420438
toolchain_file = os.path.join(toolchain_dir, "BUILD.gn")
421439
write_toolchain_file(d, toolchain_file)
422440
}
441+
423442
addtask write_toolchain_file after do_patch before do_configure
424443

425444
do_add_nodejs_symlink () {
@@ -441,16 +460,34 @@ do_add_clang_latest () {
441460
# directory that is a copy of /usr/lib/clang/$CLANG_VERSION. Chromium
442461
# manually links against libclang_rt.builtins.a and uses the `clang_version`
443462
# GN variable to find it. This allows us to set it to the same value for all
444-
# Yocto releases.
463+
# Yocto releases. Also copy headers so bindgen can find system headers.
445464
cd "${STAGING_LIBDIR_NATIVE}/clang"
446465
rm -rf latest
447-
# find the directory containing the library
466+
467+
# Find a directory with runtime libraries and copy it as base
448468
for dir in *; do
449-
if [ -n "$(find $dir -name 'libclang_rt.builtins*')" ] ; then
469+
if [ -d "$dir" ] && [ -n "$(find $dir -name 'libclang_rt.builtins*' 2>/dev/null)" ]; then
470+
echo "Copying clang directory $dir to latest (runtime libraries)"
450471
cp -r "$dir" latest
451472
break
452473
fi
453474
done
475+
476+
# Find and copy headers from any versioned directory to ensure bindgen can find them
477+
headers_copied=false
478+
for dir in *; do
479+
if [ -d "$dir/include" ]; then
480+
echo "Found headers in $dir/include, copying to latest/include"
481+
mkdir -p latest/include
482+
cp -r "$dir/include/"* latest/include/
483+
headers_copied=true
484+
break
485+
fi
486+
done
487+
488+
if [ "$headers_copied" = false ]; then
489+
echo "Warning: No Clang headers found in any versioned directories"
490+
fi
454491
}
455492
addtask add_clang_latest after do_configure before do_compile
456493

@@ -478,6 +515,12 @@ addtask copy_target_rustlibs after do_configure before do_compile
478515
do_configure() {
479516
cd ${S}
480517
python3 ./build/linux/unbundle/replace_gn_files.py --system-libraries ${GN_UNBUNDLE_LIBS}
518+
519+
# Add Rust-style target triples (converted by Yocto's rust-common.bbclass)
520+
grep -qxF "${RUST_TARGET_SYS}" ${S}/build/rust/known-target-triples.txt || echo "${RUST_TARGET_SYS}" >> ${S}/build/rust/known-target-triples.txt
521+
grep -qxF "${RUST_HOST_SYS}" ${S}/build/rust/known-target-triples.txt || echo "${RUST_HOST_SYS}" >> ${S}/build/rust/known-target-triples.txt
522+
grep -qxF "${RUST_BUILD_SYS}" ${S}/build/rust/known-target-triples.txt || echo "${RUST_BUILD_SYS}" >> ${S}/build/rust/known-target-triples.txt
523+
481524
gn gen --args='${GN_ARGS}' "${OUTPUT_DIR}"
482525
}
483526

0 commit comments

Comments
 (0)