Skip to content

Commit 508981d

Browse files
committed
chromium: 140.0.7339.136
RUNTIME and TC_CXX_RUNTIME are both set explicitly to "llvm" in chromium.inc. Therefore the :runtime-llvm override is not needed because it's always on. But it's also a problem in whinlatter now, because the DEPENDS = "compiler-rt" is not applied properly, making do_copy_clang_library() fail. Remove :runtime-llvm override. Use TOOLCHAIN_NATIVE instead of TOOLCHAIN:class-native. Drop 0008-Use-the-correct-path-to-libclang_rt.builtins.a.patch and fix do_copy_clang_library() in a way that's compatible with clang in oe-core. Depend on lld-native. Signed-off-by: Zoltán Böszörményi <[email protected]>
1 parent 10a4cf6 commit 508981d

9 files changed

+94
-141
lines changed

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

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ SRC_URI += "\
2222
file://0005-avoid-link-latomic-failure-on-CentOS-8-host.patch \
2323
file://0006-Don-t-pass-unknown-LLVM-options.patch \
2424
file://0007-Fix-constexpr-variable-must-be-initialized-by-a-cons.patch \
25-
file://0008-Use-the-correct-path-to-libclang_rt.builtins.a.patch \
2625
file://0009-Adjust-the-Rust-build-to-our-needs.patch \
2726
file://0010-Don-t-require-profiler_builtins.rlib.patch \
2827
file://0011-fix-check_version-Only-compare-node.js-major-version.patch \
@@ -75,6 +74,7 @@ DEPENDS += " \
7574
libwebp \
7675
libxkbcommon \
7776
libxslt \
77+
lld-native \
7878
ninja-native \
7979
nodejs-native \
8080
nspr \
@@ -89,7 +89,7 @@ DEPENDS += " \
8989
rust-native \
9090
virtual/libgl \
9191
"
92-
DEPENDS:append:runtime-llvm = " compiler-rt compiler-rt-native libcxx-native"
92+
DEPENDS:append = " compiler-rt compiler-rt-native libcxx-native"
9393
DEPENDS:append:libc-musl = " libexecinfo"
9494

9595
LDFLAGS:append:libc-musl = " -lexecinfo"
@@ -284,12 +284,12 @@ GN_ARGS += ' \
284284
'
285285

286286
# Use libcxx headers for native parts
287-
BUILD_CPPFLAGS:append:runtime-llvm = " -isysroot=${STAGING_DIR_NATIVE} -stdlib=libc++"
287+
BUILD_CPPFLAGS:append = " -isysroot=${STAGING_DIR_NATIVE} -stdlib=libc++"
288288
# Use libgcc for native parts
289-
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}"
289+
BUILD_LDFLAGS:append = " -rtlib=libgcc -unwindlib=libgcc -stdlib=libc++ -lc++abi -rpath ${STAGING_LIBDIR_NATIVE}"
290+
LDFLAGS:append = " --target=${TARGET_SYS}"
291+
CXXFLAGS:append = " --target=${TARGET_SYS} -nostdlib++"
292+
CFLAGS:append = " --target=${TARGET_SYS}"
293293

294294
# Toolchains we will use for the build. We need to point to the toolchain file
295295
# we've created, set the right target architecture and make sure we are not
@@ -492,15 +492,7 @@ do_add_clang_latest () {
492492
addtask add_clang_latest after do_configure before do_compile
493493

494494
do_copy_clang_library () {
495-
# Chromium needs to link against libclang_rt.builtins.a for both host and
496-
# target code, and expects to find both libraries in the same directory
497-
# (thanks to 0008-Use-the-correct-path-to-libclang_rt.builtins.a.patch).
498-
cd "${STAGING_DIR_HOST}${nonarch_libdir}/clang"
499-
# lib_file = "./$CLANG_VERSION/lib/linux/libclang_rt.builtins-$ARCH.a"
500-
lib_file="$(find . -name 'libclang_rt.builtins*')"
501-
# stripped_lib_file = "lib/linux/libclang_rt.builtins-$ARCH.a"
502-
stripped_lib_file="${lib_file#*/*/}"
503-
cp "$lib_file" "${STAGING_LIBDIR_NATIVE}/clang/latest/${stripped_lib_file}"
495+
cp -r ${STAGING_LIBDIR_NATIVE}/clang/latest ${STAGING_DIR_HOST}${nonarch_libdir}/clang/
504496
}
505497
addtask copy_clang_library after do_add_clang_latest before do_compile
506498

File renamed without changes.
File renamed without changes.

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

Lines changed: 44 additions & 31 deletions
Large diffs are not rendered by default.

meta-chromium/recipes-browser/chromium/files/0001-Drop-GN-compiler-settings-conflicting-with-OE.patch

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -22,34 +22,31 @@ diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
2222
index 59942a3cf6..cf5e62eb15 100644
2323
--- a/build/config/compiler/BUILD.gn
2424
+++ b/build/config/compiler/BUILD.gn
25-
@@ -1255,26 +1255,6 @@ config("compiler_cpu_abi") {
26-
"-msse3",
27-
]
28-
}
25+
@@ -1301,23 +1301,6 @@
26+
"-mfpmath=sse",
27+
"-msse3",
28+
]
2929
- } else if (current_cpu == "arm") {
30-
- if (is_clang && !is_android && !is_nacl && !is_chromeos_device) {
30+
- if (is_clang && !is_android && !is_chromeos_device) {
3131
- cflags += [ "--target=arm-linux-gnueabihf" ]
3232
- ldflags += [ "--target=arm-linux-gnueabihf" ]
3333
- }
34-
- if (!is_nacl) {
35-
- cflags += [
36-
- "-march=$arm_arch",
37-
- "-mfloat-abi=$arm_float_abi",
38-
- ]
39-
- }
34+
- cflags += [
35+
- "-march=$arm_arch",
36+
- "-mfloat-abi=$arm_float_abi",
37+
- ]
4038
- if (arm_tune != "") {
4139
- cflags += [ "-mtune=$arm_tune" ]
4240
- }
4341
- } else if (current_cpu == "arm64") {
44-
- if (is_clang && !is_android && !is_nacl && !is_fuchsia &&
45-
- !is_chromeos_device) {
42+
- if (is_clang && !is_android && !is_fuchsia && !is_chromeos_device) {
4643
- cflags += [ "--target=aarch64-linux-gnu" ]
4744
- ldflags += [ "--target=aarch64-linux-gnu" ]
4845
- }
49-
} else if (current_cpu == "mipsel" && !is_nacl) {
46+
} else if (current_cpu == "mipsel") {
5047
ldflags += [ "-Wl,--hash-style=sysv" ]
5148
if (custom_toolchain == "") {
52-
@@ -1282,9 +1262,6 @@ config("compiler_cpu_abi") {
49+
@@ -1325,9 +1308,6 @@
5350
if (is_android) {
5451
cflags += [ "--target=mipsel-linux-android" ]
5552
ldflags += [ "--target=mipsel-linux-android" ]
@@ -59,7 +56,7 @@ index 59942a3cf6..cf5e62eb15 100644
5956
}
6057
} else {
6158
cflags += [ "-EL" ]
62-
@@ -1364,8 +1341,6 @@ config("compiler_cpu_abi") {
59+
@@ -1407,8 +1387,6 @@
6360
ldflags += [ "-Wl,--hash-style=sysv" ]
6461
if (custom_toolchain == "") {
6562
if (is_clang) {
@@ -68,7 +65,7 @@ index 59942a3cf6..cf5e62eb15 100644
6865
} else {
6966
cflags += [ "-EB" ]
7067
ldflags += [ "-EB" ]
71-
@@ -1414,8 +1389,6 @@ config("compiler_cpu_abi") {
68+
@@ -1457,8 +1435,6 @@
7269
cflags += [ "--target=mips64el-linux-android" ]
7370
ldflags += [ "--target=mips64el-linux-android" ]
7471
} else {
@@ -77,7 +74,7 @@ index 59942a3cf6..cf5e62eb15 100644
7774
}
7875
} else {
7976
cflags += [
80-
@@ -1473,8 +1446,6 @@ config("compiler_cpu_abi") {
77+
@@ -1516,8 +1492,6 @@
8178
ldflags += [ "-Wl,--hash-style=sysv" ]
8279
if (custom_toolchain == "") {
8380
if (is_clang) {
@@ -86,14 +83,14 @@ index 59942a3cf6..cf5e62eb15 100644
8683
} else {
8784
cflags += [
8885
"-EB",
89-
@@ -1656,23 +1627,6 @@ config("compiler_deterministic") {
86+
@@ -1686,23 +1660,6 @@
9087
}
9188
}
9289

9390
- # Tells the compiler not to use absolute paths when passing the default
9491
- # paths to the tools it invokes. We don't want this because we don't
9592
- # really need it and it can mess up the RBE cache entries.
96-
- if (is_clang && (!is_nacl || is_nacl_saigo)) {
93+
- if (is_clang) {
9794
- cflags += [ "-no-canonical-prefixes" ]
9895
-
9996
- # Same for links: Let the compiler driver invoke the linker
@@ -107,7 +104,7 @@ index 59942a3cf6..cf5e62eb15 100644
107104
- }
108105
- }
109106
-
110-
if (use_libcxx_modules) {
107+
if (use_clang_modules) {
111108
cflags += [
112109
# This removes absolute paths from .pcm files.
113110
--

meta-chromium/recipes-browser/chromium/files/0004-Delete-compiler-options-not-available-in-release-ver.patch

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,31 +23,34 @@ diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
2323
index cf5e62eb15..58e0fd0a71 100644
2424
--- a/build/config/compiler/BUILD.gn
2525
+++ b/build/config/compiler/BUILD.gn
26-
@@ -629,13 +629,6 @@ config("compiler") {
26+
@@ -687,16 +687,6 @@
2727
cflags += [ "-ffp-contract=off" ]
2828
}
2929

3030
- # Enable ELF CREL (see crbug.com/357878242) for all platforms that use ELF
3131
- # (excluding toolchains that use an older version of LLVM).
3232
- # TODO(crbug.com/376278218): This causes segfault on Linux ARM builds.
33+
- # It also causes segfault on Linux s390x:
34+
- # https://github.com/llvm/llvm-project/issues/149511
3335
- if (is_linux && use_lld && !llvm_android_mainline && current_cpu != "arm" &&
36+
- current_cpu != "s390x" &&
3437
- default_toolchain != "//build/toolchain/cros:target") {
3538
- cflags += [ "-Wa,--crel,--allow-experimental-crel" ]
3639
- }
3740
}
3841

3942
# C11/C++11 compiler flags setup.
40-
@@ -2083,6 +2076,11 @@ config("default_warnings") {
41-
}
43+
@@ -2086,6 +2076,11 @@
44+
# this as well. http://crbug.com/316352
45+
"-Wno-unneeded-internal-declaration",
4246

43-
cflags += [
44-
+ # Disable unknown warnings, since system clang may not have
45-
+ # backported newer warning yet unlike internal clang that
46-
+ # chromium uses.
47-
+ "-Wno-unknown-warning-option",
47+
+ # Disable unknown warnings, since system clang may not have
48+
+ # backported newer warning yet unlike internal clang that
49+
+ # chromium uses.
50+
+ "-Wno-unknown-warning-option",
4851
+
49-
# TODO(crbug.com/330524456): -Wcast-function-type is under -Wextra now.
50-
"-Wno-cast-function-type",
52+
# TODO(crbug.com/330524456): -Wcast-function-type is under -Wextra now.
53+
"-Wno-cast-function-type",
5154

5255
--
5356
2.39.5

meta-chromium/recipes-browser/chromium/files/0008-Use-the-correct-path-to-libclang_rt.builtins.a.patch

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

meta-chromium/recipes-browser/chromium/files/0009-Adjust-the-Rust-build-to-our-needs.patch

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ Co-authored-by: Caner Altinbasak <[email protected]>
2020
Signed-off-by: Max Ihlenfeldt <[email protected]>
2121
---
2222
build/config/rust.gni | 28 ++++++++++++++++++----------
23-
build/rust/filter_clang_args.py | 5 +++++
24-
build/rust/rustc_wrapper.py | 1 +
23+
...ni_impl/filter_clang_args.py | 5 +++++
24+
...ni_impl/rustc_wrapper.py | 1 +
2525
build/rust/std/BUILD.gn | 28 +++++++++++++++++++++-------
2626
build/rust/std/find_std_rlibs.py | 16 +++++++++++-----
2727
5 files changed, 56 insertions(+), 22 deletions(-)
@@ -97,10 +97,10 @@ index bd18d13119..e260576fba 100644
9797
cargo_target_abi = ""
9898
}
9999
} else if (is_android) {
100-
diff --git a/build/rust/filter_clang_args.py b/build/rust/filter_clang_args.py
100+
diff --git a/build/rust/gni_impl/filter_clang_args.py b/build/rust/gni_impl/filter_clang_args.py
101101
index 5a1843c0df..7fb4b49516 100644
102-
--- a/build/rust/filter_clang_args.py
103-
+++ b/build/rust/filter_clang_args.py
102+
--- a/build/rust/gni_impl/filter_clang_args.py
103+
+++ b/build/rust/gni_impl/filter_clang_args.py
104104
@@ -24,6 +24,11 @@ def filter_clang_args(clangargs):
105105
pass
106106
elif args[i].startswith('-plugin-arg'):
@@ -113,10 +113,10 @@ index 5a1843c0df..7fb4b49516 100644
113113
else:
114114
yield args[i]
115115
i += 1
116-
diff --git a/build/rust/rustc_wrapper.py b/build/rust/rustc_wrapper.py
116+
diff --git a/build/rust/gni_impl/rustc_wrapper.py b/build/rust/gni_impl/rustc_wrapper.py
117117
index 8f2096dfe5..de43d44eed 100755
118-
--- a/build/rust/rustc_wrapper.py
119-
+++ b/build/rust/rustc_wrapper.py
118+
--- a/build/rust/gni_impl/rustc_wrapper.py
119+
+++ b/build/rust/gni_impl/rustc_wrapper.py
120120
@@ -160,6 +160,7 @@ def main():
121121
rustc_args = remaining_args[:ldflags_separator]
122122
ldflags = remaining_args[ldflags_separator + 1:rustenv_separator]

meta-chromium/recipes-browser/chromium/gn-native_138.0.7204.157.bb renamed to meta-chromium/recipes-browser/chromium/gn-native_140.0.7339.136.bb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ BUILD_LD = "${CXX}"
2828
BUILD_AR = "llvm-ar"
2929

3030
DEPENDS = "clang-native ninja-native"
31-
DEPENDS:append:runtime-llvm = " compiler-rt-native libcxx-native"
31+
DEPENDS:append = " compiler-rt-native libcxx-native"
3232
# Use libcxx headers for native parts
33-
CXXFLAGS:append:runtime-llvm = " -isysroot=${STAGING_DIR_NATIVE} -stdlib=libc++"
33+
CXXFLAGS:append = " -isysroot=${STAGING_DIR_NATIVE} -stdlib=libc++"
3434
# Use libgcc for native parts
35-
LDFLAGS:append:runtime-llvm = " -rtlib=libgcc -unwindlib=libgcc -stdlib=libc++ -lc++abi -rpath ${STAGING_LIBDIR_NATIVE}"
35+
LDFLAGS:append = " -rtlib=libgcc -unwindlib=libgcc -stdlib=libc++ -lc++abi -rpath ${STAGING_LIBDIR_NATIVE}"
3636

3737
do_configure[noexec] = "1"
3838

0 commit comments

Comments
 (0)