Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions meta-chromium/recipes-browser/chromium/chromium-gn.inc
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ SRC_URI += "\
file://chromium-145-zip_ffi_glue-use-edition2024.patch \
file://disable-sanitizer.patch \
file://chromium148-bytemuck-v1-remove-simd-LaneCount-usage.patch \
file://0001-Only-pass-sysroot-if-use_sysroot.patch \
file://0001-build-Omit-ar-from-inputs-when-resolved-via-PATH.patch \
file://0001-build-Fix-get_path_info-on-empty-ar-in-unbundle-tool.patch \
"

# ARM/AArch64-specific patches.
Expand Down
40 changes: 23 additions & 17 deletions meta-chromium/recipes-browser/chromium/chromium.inc

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
From d9f87418ffc6bd6a796a78302f41b49210dcb331 Mon Sep 17 00:00:00 2001
From 5abc3bab3b9535f8173099e3db255eadd8399596 Mon Sep 17 00:00:00 2001
From: Max Ihlenfeldt <max@igalia.com>
Date: Tue, 25 Jun 2024 11:06:19 +0000
Subject: [PATCH] Drop GN compiler settings conflicting with OE
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The clang cross compiler built with meta-clang has lots of these
settings built-in and specifying them with GN confuses the compiler:
Expand All @@ -14,78 +17,17 @@ settings built-in and specifying them with GN confuses the compiler:
Upstream-Status: Inappropriate [OE-Specific]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Max Ihlenfeldt <max@igalia.com>
Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
---
build/config/compiler/BUILD.gn | 46 ----------------------------------
1 file changed, 46 deletions(-)
build/config/compiler/BUILD.gn | 17 -----------------
build/config/compiler_cpu_abi.gn | 29 -----------------------------
2 files changed, 46 deletions(-)

diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
index 59942a3..cf5e62e 100644
index e1da11405c..c1767f2988 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -1375,25 +1375,6 @@
"-mfpmath=sse",
"-msse3",
]
- } else if (current_cpu == "arm") {
- if (is_clang && !is_android && !is_chromeos_device) {
- cflags += [ "--target=arm-linux-gnueabihf" ]
- ldflags += [ "--target=arm-linux-gnueabihf" ]
- }
- cflags += [
- "-march=$arm_arch",
- "-mfloat-abi=$arm_float_abi",
- ]
- } else if (current_cpu == "arm64") {
- if (is_clang && !is_android && !is_fuchsia && !is_chromeos_device) {
- cflags += [ "--target=aarch64-linux-gnu" ]
- ldflags += [ "--target=aarch64-linux-gnu" ]
- }
- if (target_os == "chromeos" && cros_target_cpu_arch != "" &&
- is_a_target_toolchain) {
- cflags += [ "-march=$cros_target_cpu_arch" ]
- ldflags += [ "-march=$cros_target_cpu_arch" ]
- }
} else if (current_cpu == "mipsel") {
ldflags += [ "-Wl,--hash-style=sysv" ]
if (custom_toolchain == "") {
@@ -1401,9 +1382,6 @@
if (is_android) {
cflags += [ "--target=mipsel-linux-android" ]
ldflags += [ "--target=mipsel-linux-android" ]
- } else {
- cflags += [ "--target=mipsel-linux-gnu" ]
- ldflags += [ "--target=mipsel-linux-gnu" ]
}
} else {
cflags += [ "-EL" ]
@@ -1483,8 +1461,6 @@
ldflags += [ "-Wl,--hash-style=sysv" ]
if (custom_toolchain == "") {
if (is_clang) {
- cflags += [ "--target=mips-linux-gnu" ]
- ldflags += [ "--target=mips-linux-gnu" ]
} else {
cflags += [ "-EB" ]
ldflags += [ "-EB" ]
@@ -1533,8 +1509,6 @@
cflags += [ "--target=mips64el-linux-android" ]
ldflags += [ "--target=mips64el-linux-android" ]
} else {
- cflags += [ "--target=mips64el-linux-gnuabi64" ]
- ldflags += [ "--target=mips64el-linux-gnuabi64" ]
}
} else {
cflags += [
@@ -1592,8 +1566,6 @@
ldflags += [ "-Wl,--hash-style=sysv" ]
if (custom_toolchain == "") {
if (is_clang) {
- cflags += [ "--target=mips64-linux-gnuabi64" ]
- ldflags += [ "--target=mips64-linux-gnuabi64" ]
} else {
cflags += [
"-EB",
@@ -1764,23 +1736,6 @@
@@ -1425,23 +1425,6 @@ config("compiler_deterministic") {
}
}

Expand All @@ -109,3 +51,74 @@ index 59942a3..cf5e62e 100644
if (use_clang_modules) {
cflags += [
# This removes absolute paths from .pcm files.
diff --git a/build/config/compiler_cpu_abi.gn b/build/config/compiler_cpu_abi.gn
index ae62bab587..3a4347f705 100644
--- a/build/config/compiler_cpu_abi.gn
+++ b/build/config/compiler_cpu_abi.gn
@@ -73,25 +73,6 @@ if ((is_posix && !is_apple) || is_fuchsia) {
"-mfpmath=sse",
"-msse3",
]
- } else if (current_cpu == "arm") {
- if (is_clang && !is_android && !is_chromeos_device) {
- cpu_abi_cflags += [ "--target=arm-linux-gnueabihf" ]
- cpu_abi_ldflags += [ "--target=arm-linux-gnueabihf" ]
- }
- cpu_abi_cflags += [
- "-march=$arm_arch",
- "-mfloat-abi=$arm_float_abi",
- ]
- } else if (current_cpu == "arm64") {
- if (is_clang && !is_android && !is_fuchsia && !is_chromeos_device) {
- cpu_abi_cflags += [ "--target=aarch64-linux-gnu" ]
- cpu_abi_ldflags += [ "--target=aarch64-linux-gnu" ]
- }
- if (target_os == "chromeos" && cros_target_cpu_arch != "" &&
- is_a_target_toolchain) {
- cpu_abi_cflags += [ "-march=$cros_target_cpu_arch" ]
- cpu_abi_ldflags += [ "-march=$cros_target_cpu_arch" ]
- }
} else if (current_cpu == "mipsel") {
cpu_abi_ldflags += [ "-Wl,--hash-style=sysv" ]
if (custom_toolchain == "") {
@@ -99,9 +80,6 @@ if ((is_posix && !is_apple) || is_fuchsia) {
if (is_android) {
cpu_abi_cflags += [ "--target=mipsel-linux-android" ]
cpu_abi_ldflags += [ "--target=mipsel-linux-android" ]
- } else {
- cpu_abi_cflags += [ "--target=mipsel-linux-gnu" ]
- cpu_abi_ldflags += [ "--target=mipsel-linux-gnu" ]
}
} else {
cpu_abi_cflags += [ "-EL" ]
@@ -181,8 +159,6 @@ if ((is_posix && !is_apple) || is_fuchsia) {
cpu_abi_ldflags += [ "-Wl,--hash-style=sysv" ]
if (custom_toolchain == "") {
if (is_clang) {
- cpu_abi_cflags += [ "--target=mips-linux-gnu" ]
- cpu_abi_ldflags += [ "--target=mips-linux-gnu" ]
} else {
cpu_abi_cflags += [ "-EB" ]
cpu_abi_ldflags += [ "-EB" ]
@@ -230,9 +206,6 @@ if ((is_posix && !is_apple) || is_fuchsia) {
if (is_android) {
cpu_abi_cflags += [ "--target=mips64el-linux-android" ]
cpu_abi_ldflags += [ "--target=mips64el-linux-android" ]
- } else {
- cpu_abi_cflags += [ "--target=mips64el-linux-gnuabi64" ]
- cpu_abi_ldflags += [ "--target=mips64el-linux-gnuabi64" ]
}
} else {
cpu_abi_cflags += [
@@ -290,8 +263,6 @@ if ((is_posix && !is_apple) || is_fuchsia) {
cpu_abi_ldflags += [ "-Wl,--hash-style=sysv" ]
if (custom_toolchain == "") {
if (is_clang) {
- cpu_abi_cflags += [ "--target=mips64-linux-gnuabi64" ]
- cpu_abi_ldflags += [ "--target=mips64-linux-gnuabi64" ]
} else {
cpu_abi_cflags += [
"-EB",
--
2.54.0

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we name this Backport-151-Only-pass-sysroot-if-use_sysroot.patch so we know from the file name that it's a backport and it will be included in upstream 151?

The same applies to the two other backports if we do need to keep them.

(I've filed #1011 for unifying all patches' names.)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we name this Backport-151-Only-pass-sysroot-if-use_sysroot.patch so we know from the file name that it's a backport and it will be included in upstream 151?

The same applies to the two other backports if we do need to keep them.

(I've filed #1011 for unifying all patches' names.)

Since chromium git does not seem to use tags recently (the latest one is 148.0.7734.5), how should I know from which version a commit is backported?

Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
From b93239da427a5019a9742d44e50e9996c1b04ea9 Mon Sep 17 00:00:00 2001
From: Nathan Pratta Teodosio <nathan.teodosio@canonical.com>
Date: Fri, 19 Jun 2026 09:06:46 -0700
Subject: [PATCH] Only pass sysroot if use_sysroot.

Fixes the build when use_sysroot = false as then 'sysroot' variable is empty.

Bug: None
Change-Id: I7fc7ba35f3ba416af0cbd8df94393dc901724b8b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7927226
Reviewed-by: Sylvain Defresne <sdefresne@chromium.org>
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1649706}

Upstream-Status: Backport
---
build/modules/BUILD.gn | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/build/modules/BUILD.gn b/build/modules/BUILD.gn
index 02bfd462acd0f..3ef79fa7933c3 100644
--- a/build/modules/BUILD.gn
+++ b/build/modules/BUILD.gn
@@ -223,7 +223,7 @@
# otherwise.
"--append-module=std.new:export new_h\\nexport vcruntime_exception",
]
- } else {
+ } else if (use_sysroot) {
# We need to pass the sysroot in so that it can scan it to generate a
# modulemap for the sysroot headers.
args += [
--
2.54.0

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this and 0001-build-Omit-ar-from-inputs-when-resolved-via-PATH.patch? Both patches only touch build/toolchain/gcc_toolchain.gni, and we use clang.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the commit message for the error generated otherwise. Apparently gcc_toolchain.gni is also used for clang under Linux.

Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
From 7d6555b11f181bdc24ba56577f753a07add6e8c7 Mon Sep 17 00:00:00 2001
From: Matt Jolly <kangie@gentoo.org>
Date: Tue, 16 Jun 2026 21:57:07 -0700
Subject: [PATCH] build: Fix get_path_info on empty ar in unbundle toolchain

Some toolchains leave ar empty during initial setup, causing GN to error
when get_path_info() is called with an empty string. Guard the check to
only run when ar is not empty.

Signed-off-by: Matt Jolly <kangie@gentoo.org>
Change-Id: I87615806ddfda6f262a7500b0c5b6fed1f452985
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7949777
Reviewed-by: Takuto Ikuta <tikuta@chromium.org>
Commit-Queue: Takuto Ikuta <tikuta@chromium.org>
Reviewed-by: Matt Stark <msta@google.com>
Cr-Commit-Position: refs/heads/main@{#1648076}

Upstream-Status: Backport
---
build/toolchain/gcc_toolchain.gni | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/build/toolchain/gcc_toolchain.gni b/build/toolchain/gcc_toolchain.gni
index ec66ab3f948b1..d8457bfa53a4e 100644
--- a/build/toolchain/gcc_toolchain.gni
+++ b/build/toolchain/gcc_toolchain.gni
@@ -409,8 +409,9 @@ template("single_gcc_toolchain") {
} else {
command = "rm -f {{output}} && $command"

- # Add ar to inputs if it's not from $PATH.
- if (get_path_info(ar, "file") != ar) {
+ # Add ar to inputs if it's not from $PATH. Some toolchains leave
+ # |ar| empty during toolchain setup, so guard get_path_info() here.
+ if (ar != "" && get_path_info(ar, "file") != ar) {
inputs =
[ get_path_info(rebase_path(ar, ".", root_out_dir), "abspath") ]
}
--
2.55.0

Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
From 60f987d8d5f7272793a40290d060b8f50933f825 Mon Sep 17 00:00:00 2001
From: Takuto Ikuta <tikuta@chromium.org>
Date: Mon, 8 Jun 2026 19:43:20 -0700
Subject: [PATCH] build: Omit ar from inputs when resolved via $PATH

The GN build configuration previously added the `ar` tool to the inputs
list unconditionally. However, if the `ar` tool is specified simply by
its filename and is resolved via the system `$PATH`, it should not be
tracked as a direct input dependency.

This change adds a condition to verify if `ar` is an explicit path
rather than just a filename. It only includes `ar` in the action's
inputs list when it is not resolved from `$PATH`.

This is to address
https://crrev.com/c/7835150/8/build/toolchain/gcc_toolchain.gni#406

Bug: 358521078
Change-Id: I096ac4aa7f3b697c58c94af1349159b9c87f4201
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7904982
Commit-Queue: Takuto Ikuta <tikuta@chromium.org>
Reviewed-by: Matt Stark <msta@google.com>
Auto-Submit: Takuto Ikuta <tikuta@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1643634}

Upstream-Status: Backport
---
build/toolchain/gcc_toolchain.gni | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/build/toolchain/gcc_toolchain.gni b/build/toolchain/gcc_toolchain.gni
index 51433d488da07..ec66ab3f948b1 100644
--- a/build/toolchain/gcc_toolchain.gni
+++ b/build/toolchain/gcc_toolchain.gni
@@ -408,8 +408,12 @@ template("single_gcc_toolchain") {
command = "cmd /s /c \"\"$python_path\" $tool_wrapper_path delete-file {{output}} && $command\""
} else {
command = "rm -f {{output}} && $command"
- inputs =
- [ get_path_info(rebase_path(ar, ".", root_out_dir), "abspath") ]
+
+ # Add ar to inputs if it's not from $PATH.
+ if (get_path_info(ar, "file") != ar) {
+ inputs =
+ [ get_path_info(rebase_path(ar, ".", root_out_dir), "abspath") ]
+ }
}

# Almost all targets build with //build/config/compiler:thin_archive which
--
2.55.0