Skip to content

Commit 20f14e4

Browse files
committed
chromium: Do not use use_lld=true / -fuse-ld=lld on whinlatter
CLANG 20+ does not like this option. Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
1 parent bc2e873 commit 20f14e4

File tree

2 files changed

+72
-1
lines changed

2 files changed

+72
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ SRC_URI += "\
2727
file://0010-Don-t-require-profiler_builtins.rlib.patch \
2828
file://0011-fix-check_version-Only-compare-node.js-major-version.patch \
2929
file://0012-chromium-fix-v4l2-compiler-error-on-arm.patch \
30+
${@'file://0022-Do-not-use-fuse-ld-option.patch' if d.getVar('WHINLATTER_OR_NEWER') == '1' else ''} \
3031
"
3132

3233
# ARM/AArch64-specific patches.
@@ -183,7 +184,7 @@ GN_ARGS += 'host_pkg_config="pkg-config-native"'
183184
GN_ARGS += "is_debug=false is_official_build=true"
184185

185186
# Use lld linker its quicker see https://lld.llvm.org/#performance
186-
GN_ARGS += "use_lld=true use_gold=false"
187+
GN_ARGS += "${@'' if d.getVar('WHINLATTER_OR_NEWER') == '1' else 'use_lld=true'} use_gold=false"
187188

188189
# By default, passing is_official_build=true to GN causes its symbol_level
189190
# variable to be set to "2". This means the compiler will be passed "-g2" and
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
2+
Upstream-Status: Inappropriate [CLANG 20+ specific]
3+
4+
--- chromium-136.0.7103.113/third_party/perfetto/gn/standalone/toolchain/BUILD.gn.old 2025-09-09 12:40:23.179245164 +0200
5+
+++ chromium-136.0.7103.113/third_party/perfetto/gn/standalone/toolchain/BUILD.gn 2025-09-09 12:42:05.799617038 +0200
6+
@@ -236,10 +236,6 @@
7+
external_cxxflags = ""
8+
external_ldflags = ""
9+
strip = ""
10+
- if (defined(invoker.linker) && invoker.linker != "") {
11+
- _invoker_linker = invoker.linker
12+
- ld_arg = "-fuse-ld=$_invoker_linker"
13+
- }
14+
if (defined(invoker.sysroot) && invoker.sysroot != "") {
15+
_invoker_sysroot = invoker.sysroot
16+
cc = "$cc --sysroot=$_invoker_sysroot"
17+
--- chromium-136.0.7103.113/third_party/instrumented_libs/noble/BUILD.gn.old 2025-09-09 12:40:12.186545761 +0200
18+
+++ chromium-136.0.7103.113/third_party/instrumented_libs/noble/BUILD.gn 2025-09-09 12:42:18.327479124 +0200
19+
@@ -121,7 +121,6 @@
20+
]
21+
package_ldflags = [
22+
"-fsanitize=memory",
23+
- "-fuse-ld=lld",
24+
"-Wl,--wrap=stat",
25+
"-Wl,--wrap=fstat",
26+
"-Wl,--wrap=lstat",
27+
--- chromium-138.0.7204.157/third_party/rust-src/src/llvm-project/llvm/utils/gn/build/BUILD.gn.old 2025-09-15 15:01:50.827516099 +0200
28+
+++ chromium-138.0.7204.157/third_party/rust-src/src/llvm-project/llvm/utils/gn/build/BUILD.gn 2025-09-15 15:03:07.815639451 +0200
29+
@@ -271,11 +271,6 @@
30+
}
31+
}
32+
33+
- # On Windows, the linker is not invoked through the compiler driver.
34+
- if (use_lld && current_os != "win") {
35+
- ldflags += [ "-fuse-ld=lld" ]
36+
- }
37+
-
38+
if (llvm_build_instrumented_coverage) {
39+
cflags += [
40+
"-fcoverage-mapping",
41+
--- chromium-138.0.7204.157/third_party/llvm/llvm/utils/gn/build/BUILD.gn.old 2025-09-15 15:01:57.610462716 +0200
42+
+++ chromium-138.0.7204.157/third_party/llvm/llvm/utils/gn/build/BUILD.gn 2025-09-15 15:03:12.520641707 +0200
43+
@@ -271,11 +271,6 @@
44+
}
45+
}
46+
47+
- # On Windows, the linker is not invoked through the compiler driver.
48+
- if (use_lld && current_os != "win") {
49+
- ldflags += [ "-fuse-ld=lld" ]
50+
- }
51+
-
52+
if (llvm_build_instrumented_coverage) {
53+
cflags += [
54+
"-fcoverage-mapping",
55+
--- chromium-138.0.7204.157/build/config/compiler/BUILD.gn.old 2025-09-15 15:02:02.288723789 +0200
56+
+++ chromium-138.0.7204.157/build/config/compiler/BUILD.gn 2025-09-15 15:03:23.158646802 +0200
57+
@@ -400,13 +400,6 @@
58+
}
59+
}
60+
61+
- if (use_lld) {
62+
- ldflags += [ "-fuse-ld=lld" ]
63+
- if (lld_path != "") {
64+
- ldflags += [ "-B" + rebase_path(lld_path, root_build_dir) ]
65+
- }
66+
- }
67+
-
68+
# Linker warnings.
69+
if (fatal_linker_warnings && !is_apple && current_os != "aix" &&
70+
current_os != "zos") {

0 commit comments

Comments
 (0)