Skip to content

Commit 8c6d6a6

Browse files
committed
Fix(Build): with Clang < 20 by removing unsupported compiler flags
The -fextend-variable-liveness=none flag is supported only in Clang 20+, was added to Chromium to workaround compile error in fuchsia-fyi-x64-dbg-persistent-emulator. ref: https://chromium.googlesource.com/chromium/src.git/+/baa29fd5df8262a9d5aebb9cc3d9d047a39add4c This updates our clang-19-compat.patch to remove all instances of this unsupported flag, allowing Chromium to build successfully with our current Clang version. Signed-off-by: Debasish Biswas <debasishbsws.dev@gmail.com>
1 parent da90b1f commit 8c6d6a6

2 files changed

Lines changed: 20 additions & 2 deletions

File tree

chromium/clang-19-compat.patch

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,31 @@
11
Description: Disable Clang >= 20 compiler options until packaged
2+
The -fextend-variable-liveness=none flag was added to Chromium to work with newer versions of Clang (likely Clang 20+)
3+
as -fextend-variable-liveness=none flag is not available in Clang<20
4+
It is a new compiler flag: https://releases.llvm.org/20.1.0/tools/clang/docs/ReleaseNotes.html#new-compiler-flags
5+
This whole patch can be removed once we package Clang 20+ in the future.
26
Author: James Page <james.page@chainguard.dev>
37

48
--- a/build/config/compiler/BUILD.gn.orig 2025-05-12 16:11:29.949768459 +0100
59
+++ b/build/config/compiler/BUILD.gn 2025-05-12 16:12:14.385296607 +0100
6-
@@ -312,7 +312,6 @@ config("compiler") {
10+
@@ -313,7 +313,6 @@ config("compiler") {
711
":compiler_cpu_abi",
812
":compiler_codegen",
913
":compiler_deterministic",
1014
- ":clang_warning_suppression",
1115
]
1216

1317
# Here we enable -fno-delete-null-pointer-checks, which makes various nullptr
18+
@@ -623,13 +622,6 @@ config("compiler") {
19+
default_toolchain != "//build/toolchain/cros:target") {
20+
cflags += [ "-Wa,--crel,--allow-experimental-crel" ]
21+
}
22+
-
23+
- # TODO(crbug.com/413427035): Remove once
24+
- # https://github.com/llvm/llvm-project/pull/136867/ is landed.
25+
- if (!is_win && !llvm_android_mainline &&
26+
- default_toolchain != "//build/toolchain/cros:target") {
27+
- cflags += [ "-fextend-variable-liveness=none" ]
28+
- }
29+
}
30+
31+
# C11/C++11 compiler flags setup.

chromium/gperf.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ gperf massaging that causes the problem.
55

66
--- a/third_party/blink/renderer/build/scripts/gperf.py
77
+++ b/third_party/blink/renderer/build/scripts/gperf.py
8-
@@ -28,27 +28,7 @@ def generate_gperf(gperf_path, gperf_input, gperf_args):
8+
@@ -28,27 +28,6 @@ def generate_gperf(gperf_path, gperf_input, gperf_args):
99
stdout=subprocess.PIPE,
1010
universal_newlines=True)
1111
gperf_output = gperf.communicate(gperf_input)[0]

0 commit comments

Comments
 (0)