Skip to content

Commit 0a182ba

Browse files
chromium: Merge interlinked compiler option patches (#825)
Build and patch changes: ------------------------ `arm/0001-BUILD-do-not-specify-march-on-arm.patch` depends on `0001-Remove-the-GN-settings-done-for-clang-that-conflict-.patch` (i.e. it fails to apply on its own), which is confusing and makes rebasing on new upstream releases harder. This merges the two patches into a single one. License changes: ---------------- Added licenses: none. Removed licenses: none. Updated licenses: none. Test-built: ----------- * chromium-ozone-wayland: - scarthgap, clang, MACHINE=qemuarm64 * chromium-x11: - master, clang, MACHINE=qemuarm Signed-off-by: Max Ihlenfeldt <[email protected]>
1 parent 718c798 commit 0a182ba

File tree

4 files changed

+34
-77
lines changed

4 files changed

+34
-77
lines changed

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ SRC_URI += "\
1717

1818
# Non-specific patches.
1919
SRC_URI += "\
20-
file://0001-Remove-the-GN-settings-done-for-clang-that-conflict-.patch \
20+
file://0001-Drop-GN-compiler-settings-conflicting-with-OE.patch \
2121
file://0002-v8-qemu-wrapper.patch \
2222
file://0003-wrapper-extra-flags.patch \
2323
file://0004-Delete-compiler-options-not-available-in-release-ver.patch \
@@ -29,10 +29,7 @@ SRC_URI += "\
2929
file://0010-Don-t-require-profiler_builtins.rlib.patch \
3030
"
3131
# ARM/AArch64-specific patches.
32-
SRC_URI:append:arm = "\
33-
file://arm/0001-BUILD-do-not-specify-march-on-arm.patch \
34-
"
35-
SRC_URI:append:aarch64 = "${@bb.utils.contains('TUNE_FEATURES', 'crypto', '', ' file://arm/0002-Fix-AES-crypto-SIGILL-on-rpi4-64.patch', d)}"
32+
SRC_URI:append:aarch64 = "${@bb.utils.contains('TUNE_FEATURES', 'crypto', '', ' file://arm/0001-Fix-AES-crypto-SIGILL-on-rpi4-64.patch', d)}"
3633

3734
# musl-specific patches.
3835
SRC_URI:append:libc-musl = "\
Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,46 @@
1-
From 7eb6877c15ab9d73c9a7cf3a8a17a1a23f7396f9 Mon Sep 17 00:00:00 2001
2-
From: Khem Raj <raj.khem@gmail.com>
3-
Date: Mon, 29 Apr 2019 12:00:19 +0300
4-
Subject: [PATCH] Remove the GN settings done for clang that conflict with OE
1+
From b49388c4ee899f7a424a1f1df52868eed1e9c83f Mon Sep 17 00:00:00 2001
2+
From: Max Ihlenfeldt <max@igalia.com>
3+
Date: Tue, 25 Jun 2024 11:06:19 +0000
4+
Subject: [PATCH] Drop GN compiler settings conflicting with OE
55

6-
clang cross compiler that is build with meta-clang has lot of these
7-
settings built-in and specifying them here confuses the compiler
8-
9-
--target option and -no-canonical-prefixes options result in clang
10-
11-
finding the headers in target sysroot
6+
The clang cross compiler built with meta-clang has lots of these
7+
settings built-in and specifying them with GN confuses the compiler:
8+
* The --target and -no-canonical-prefixes options result in clang
9+
finding the headers in target sysroot.
10+
* GN tries to guess the right values for march/mtune/float-abi, but the
11+
OE config machinary has computed these values already and fed it via
12+
compiler cmdline to the Chromium build.
1213

1314
Upstream-Status: Inappropriate [OE-Specific]
14-
1515
Signed-off-by: Khem Raj <[email protected]>
16-
Rebased-by: Maksim Sisov <[email protected]>
17-
Rebased-by: Randy MacLeod <[email protected]>
18-
16+
Signed-off-by: Max Ihlenfeldt <[email protected]>
1917
---
20-
build/config/compiler/BUILD.gn | 38 ----------------------------------
21-
1 file changed, 38 deletions(-)
18+
build/config/compiler/BUILD.gn | 48 ----------------------------------
19+
1 file changed, 48 deletions(-)
2220

2321
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
24-
index 973d8bc..8165472 100644
22+
index 973d8bc..f0ffab2 100644
2523
--- a/build/config/compiler/BUILD.gn
2624
+++ b/build/config/compiler/BUILD.gn
27-
@@ -1198,11 +1198,6 @@ config("compiler_cpu_abi") {
25+
@@ -1197,27 +1197,6 @@ config("compiler_cpu_abi") {
26+
"-msse3",
2827
]
2928
}
30-
} else if (current_cpu == "arm") {
29+
- } else if (current_cpu == "arm") {
3130
- if (is_clang && !is_android && !is_nacl &&
3231
- !(is_chromeos_lacros && is_chromeos_device)) {
3332
- cflags += [ "--target=arm-linux-gnueabihf" ]
3433
- ldflags += [ "--target=arm-linux-gnueabihf" ]
3534
- }
36-
if (!is_nacl) {
37-
cflags += [
38-
"-march=$arm_arch",
39-
@@ -1212,12 +1207,6 @@ config("compiler_cpu_abi") {
40-
if (arm_tune != "") {
41-
cflags += [ "-mtune=$arm_tune" ]
42-
}
35+
- if (!is_nacl) {
36+
- cflags += [
37+
- "-march=$arm_arch",
38+
- "-mfloat-abi=$arm_float_abi",
39+
- ]
40+
- }
41+
- if (arm_tune != "") {
42+
- cflags += [ "-mtune=$arm_tune" ]
43+
- }
4344
- } else if (current_cpu == "arm64") {
4445
- if (is_clang && !is_android && !is_nacl && !is_fuchsia &&
4546
- !(is_chromeos_lacros && is_chromeos_device)) {
@@ -49,7 +50,7 @@ index 973d8bc..8165472 100644
4950
} else if (current_cpu == "mipsel" && !is_nacl) {
5051
ldflags += [ "-Wl,--hash-style=sysv" ]
5152
if (custom_toolchain == "") {
52-
@@ -1225,9 +1214,6 @@ config("compiler_cpu_abi") {
53+
@@ -1225,9 +1204,6 @@ config("compiler_cpu_abi") {
5354
if (is_android) {
5455
cflags += [ "--target=mipsel-linux-android" ]
5556
ldflags += [ "--target=mipsel-linux-android" ]
@@ -59,7 +60,7 @@ index 973d8bc..8165472 100644
5960
}
6061
} else {
6162
cflags += [ "-EL" ]
62-
@@ -1307,8 +1293,6 @@ config("compiler_cpu_abi") {
63+
@@ -1307,8 +1283,6 @@ config("compiler_cpu_abi") {
6364
ldflags += [ "-Wl,--hash-style=sysv" ]
6465
if (custom_toolchain == "") {
6566
if (is_clang) {
@@ -68,7 +69,7 @@ index 973d8bc..8165472 100644
6869
} else {
6970
cflags += [ "-EB" ]
7071
ldflags += [ "-EB" ]
71-
@@ -1356,9 +1340,6 @@ config("compiler_cpu_abi") {
72+
@@ -1356,9 +1330,6 @@ config("compiler_cpu_abi") {
7273
if (is_android) {
7374
cflags += [ "--target=mips64el-linux-android" ]
7475
ldflags += [ "--target=mips64el-linux-android" ]
@@ -78,7 +79,7 @@ index 973d8bc..8165472 100644
7879
}
7980
} else {
8081
cflags += [
81-
@@ -1416,8 +1397,6 @@ config("compiler_cpu_abi") {
82+
@@ -1416,8 +1387,6 @@ config("compiler_cpu_abi") {
8283
ldflags += [ "-Wl,--hash-style=sysv" ]
8384
if (custom_toolchain == "") {
8485
if (is_clang) {
@@ -87,7 +88,7 @@ index 973d8bc..8165472 100644
8788
} else {
8889
cflags += [
8990
"-EB",
90-
@@ -1580,23 +1559,6 @@ config("compiler_deterministic") {
91+
@@ -1580,23 +1549,6 @@ config("compiler_deterministic") {
9192
}
9293
}
9394
}

meta-chromium/recipes-browser/chromium/files/arm/0001-BUILD-do-not-specify-march-on-arm.patch

Lines changed: 0 additions & 41 deletions
This file was deleted.

0 commit comments

Comments
 (0)