Skip to content

Commit 4b7bc47

Browse files
MaxIhlenfeldtkraj
authored andcommitted
add patch for ARM static_assert build error
1 parent d6070e7 commit 4b7bc47

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@ SRC_URI:append:arm = "\
6262
file://0031-Fix-ARM-build-with-recent-glibc.patch \
6363
"
6464

65+
# This fixes a build error with older versions of clang when V8 pointer
66+
# compression is disabled, which is the case for 32-bit ARM.
67+
SRC_URI:append:arm = "\
68+
file://0041-Fix-static_assert-failed-build-error-on-32-bit-ARM.patch \
69+
"
70+
6571
ANY_OF_DISTRO_FEATURES = "opengl vulkan"
6672

6773
# Append instead of assigning; the gtk-icon-cache class inherited above also
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
From ddba656f3f0ff3406b689d04e97ca40016140b18 Mon Sep 17 00:00:00 2001
2+
From: Max Ihlenfeldt <max@igalia.com>
3+
Date: Thu, 5 Oct 2023 14:41:11 +0000
4+
Subject: [PATCH] Fix "static_assert failed" build error on 32-bit ARM
5+
6+
117 introduced some code where a static_assert is guarded by a constexpr
7+
if, and the assert will fail if the if-condition is false. Recent clang
8+
versions (e.g. clang 17) are able to handle this, but with clang <= 15,
9+
there is a build error because the static_assert fails.
10+
11+
Given that the code compiles fine with clang 17, we know that the logic
12+
checks out, even if clang 14/15 is unable to recognize it. Thus, we just
13+
comment out the static_assert.
14+
15+
Upstream-Status: Inappropriate [specific to older versions of clang]
16+
Signed-off-by: Max Ihlenfeldt <max@igalia.com>
17+
---
18+
v8/src/maglev/maglev-code-generator.cc | 4 ++--
19+
1 file changed, 2 insertions(+), 2 deletions(-)
20+
21+
diff --git a/v8/src/maglev/maglev-code-generator.cc b/v8/src/maglev/maglev-code-generator.cc
22+
index e5ec70c..271a311 100644
23+
--- a/v8/src/maglev/maglev-code-generator.cc
24+
+++ b/v8/src/maglev/maglev-code-generator.cc
25+
@@ -419,7 +419,7 @@ class ParallelMoveResolver {
26+
void EmitMovesFromSource(RegisterT source_reg, GapMoveTargets&& targets) {
27+
DCHECK(moves_from_register_[source_reg.code()].is_empty());
28+
if constexpr (DecompressIfNeeded) {
29+
- static_assert(COMPRESS_POINTERS_BOOL);
30+
+ // static_assert(COMPRESS_POINTERS_BOOL);
31+
if (targets.needs_decompression == kNeedsDecompression) {
32+
__ DecompressTagged(source_reg, source_reg);
33+
}
34+
@@ -462,7 +462,7 @@ class ParallelMoveResolver {
35+
// Decompress after the first move, subsequent moves reuse this register so
36+
// they're guaranteed to be decompressed.
37+
if constexpr (DecompressIfNeeded) {
38+
- static_assert(COMPRESS_POINTERS_BOOL);
39+
+ // static_assert(COMPRESS_POINTERS_BOOL);
40+
if (targets.needs_decompression == kNeedsDecompression) {
41+
__ DecompressTagged(register_with_slot_value, register_with_slot_value);
42+
targets.needs_decompression = kDoesNotNeedDecompression;

0 commit comments

Comments
 (0)