Skip to content

Commit 4b1bf93

Browse files
authored
Merge pull request #19 from meta-flutter/jw/riscv64-fix
riscv64 in armhf out
2 parents 7609537 + 73a09eb commit 4b1bf93

File tree

5 files changed

+135
-259
lines changed

5 files changed

+135
-259
lines changed

.github/workflows/flutter-engine-armv7hf.yaml

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

.github/workflows/flutter-engine-riscv64.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ jobs:
5757
PATCH_DIR=$PWD/patches
5858
cd flutter
5959
git apply $PATCH_DIR/0001-clang-toolchain.patch
60+
git apply $PATCH_DIR/0003-gn-riscv32-and-riscv64.patch
61+
git apply $PATCH_DIR/0005-fml-fixes-text_input-compiler-warnings.patch
62+
git apply $PATCH_DIR/0006-impeller-unnecessary-virtual-specifier.patch
6063
6164
- name: Build Debug
6265
working-directory: flutter/engine/src
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
From 748e416e394552cac6e4be30112c3ef45d1c0ec3 Mon Sep 17 00:00:00 2001
2+
From: Joel Winarske <joel.winarske@gmail.com>
3+
Date: Tue, 6 Aug 2024 08:03:59 -0700
4+
Subject: [PATCH] gn riscv32 and riscv64
5+
6+
Upstream-Status: Inappropriate
7+
8+
Signed-off-by: Joel Winarske <joel.winarske@gmail.com>
9+
---
10+
engine/src/flutter/tools/gn | 2 +-
11+
1 file changed, 1 insertion(+), 1 deletion(-)
12+
13+
diff --git a/engine/src/flutter/tools/gn b/engine/src/flutter/tools/gn
14+
index 0be76e5477..8fee233aed 100755
15+
--- a/engine/src/flutter/tools/gn
16+
+++ b/engine/src/flutter/tools/gn
17+
@@ -1015,7 +1015,7 @@ def parse_args(args):
18+
parser.add_argument('--web', action='store_true', default=False)
19+
parser.add_argument('--windows', dest='target_os', action='store_const', const='win')
20+
21+
- parser.add_argument('--linux-cpu', type=str, choices=['x64', 'x86', 'arm64', 'arm'])
22+
+ parser.add_argument('--linux-cpu', type=str, choices=['x64', 'x86', 'arm64', 'arm', 'riscv32', 'riscv64'])
23+
parser.add_argument('--fuchsia-cpu', type=str, choices=['x64', 'arm64'], default='x64')
24+
parser.add_argument('--windows-cpu', type=str, choices=['x64', 'arm64', 'x86'], default='x64')
25+
parser.add_argument('--simulator-cpu', type=str, choices=['x64', 'arm64'], default='x64')
26+
--
27+
2.45.2
28+
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
From c7bb26a38b1d5988cc45a60091a70b5e87ac36ba Mon Sep 17 00:00:00 2001
2+
From: Joel Winarske <joel.winarske@gmail.com>
3+
Date: Mon, 10 Nov 2025 09:49:09 -0800
4+
Subject: [PATCH] [fml] fixes text_input compiler warnings
5+
6+
Upstream-Status: Inappropriate
7+
8+
Signed-off-by: Joel Winarske <joel.winarske@gmail.com>
9+
---
10+
.../shell/platform/common/text_input_model.cc | 14 +++++++-------
11+
1 file changed, 7 insertions(+), 7 deletions(-)
12+
13+
diff --git a/engine/src/flutter/shell/platform/common/text_input_model.cc b/engine/src/flutter/shell/platform/common/text_input_model.cc
14+
index a21fe1ff3ef..ef807409dc1 100644
15+
--- a/engine/src/flutter/shell/platform/common/text_input_model.cc
16+
+++ b/engine/src/flutter/shell/platform/common/text_input_model.cc
17+
@@ -157,7 +157,7 @@ bool TextInputModel::Backspace() {
18+
// There is no selection. Delete the preceding codepoint.
19+
size_t position = selection_.position();
20+
if (position != editable_range().start()) {
21+
- int count = IsTrailingSurrogate(text_.at(position - 1)) ? 2 : 1;
22+
+ int count = IsTrailingSurrogate(static_cast<char32_t>(text_.at(position - 1))) ? 2 : 1;
23+
text_.erase(position - count, count);
24+
selection_ = TextRange(position - count);
25+
if (composing_) {
26+
@@ -175,7 +175,7 @@ bool TextInputModel::Delete() {
27+
// There is no selection. Delete the preceding codepoint.
28+
size_t position = selection_.position();
29+
if (position < editable_range().end()) {
30+
- int count = IsLeadingSurrogate(text_.at(position)) ? 2 : 1;
31+
+ int count = IsLeadingSurrogate(static_cast<char32_t>(text_.at(position))) ? 2 : 1;
32+
text_.erase(position, count);
33+
if (composing_) {
34+
composing_range_.set_end(composing_range_.end() - count);
35+
@@ -196,17 +196,17 @@ bool TextInputModel::DeleteSurrounding(int offset_from_cursor, int count) {
36+
count = i;
37+
break;
38+
}
39+
- start -= IsTrailingSurrogate(text_.at(start - 1)) ? 2 : 1;
40+
+ start -= IsTrailingSurrogate(static_cast<char32_t>(text_.at(start - 1))) ? 2 : 1;
41+
}
42+
} else {
43+
for (int i = 0; i < offset_from_cursor && start != max_pos; i++) {
44+
- start += IsLeadingSurrogate(text_.at(start)) ? 2 : 1;
45+
+ start += IsLeadingSurrogate(static_cast<char32_t>(text_.at(start))) ? 2 : 1;
46+
}
47+
}
48+
49+
auto end = start;
50+
for (int i = 0; i < count && end != max_pos; i++) {
51+
- end += IsLeadingSurrogate(text_.at(start)) ? 2 : 1;
52+
+ end += IsLeadingSurrogate(static_cast<char32_t>(text_.at(start))) ? 2 : 1;
53+
}
54+
55+
if (start == end) {
56+
@@ -271,7 +271,7 @@ bool TextInputModel::MoveCursorForward() {
57+
// Otherwise, move the cursor forward.
58+
size_t position = selection_.position();
59+
if (position != editable_range().end()) {
60+
- int count = IsLeadingSurrogate(text_.at(position)) ? 2 : 1;
61+
+ int count = IsLeadingSurrogate(static_cast<char32_t>(text_.at(position))) ? 2 : 1;
62+
selection_ = TextRange(position + count);
63+
return true;
64+
}
65+
@@ -287,7 +287,7 @@ bool TextInputModel::MoveCursorBack() {
66+
// Otherwise, move the cursor backward.
67+
size_t position = selection_.position();
68+
if (position != editable_range().start()) {
69+
- int count = IsTrailingSurrogate(text_.at(position - 1)) ? 2 : 1;
70+
+ int count = IsTrailingSurrogate(static_cast<char32_t>(text_.at(position - 1))) ? 2 : 1;
71+
selection_ = TextRange(position - count);
72+
return true;
73+
}
74+
--
75+
2.51.1
76+

0 commit comments

Comments
 (0)