Skip to content

Commit 404f54a

Browse files
committed
Flutter 3.38.3
-moves to debian bullseye -riscv64 Signed-off-by: Joel Winarske <joel.winarske@gmail.com>
1 parent 4b1bf93 commit 404f54a

6 files changed

+253
-51
lines changed

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

Lines changed: 15 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,25 @@ jobs:
5656
run: |
5757
PATCH_DIR=$PWD/patches
5858
cd flutter
59+
5960
git apply $PATCH_DIR/0001-clang-toolchain.patch
6061
git apply $PATCH_DIR/0003-gn-riscv32-and-riscv64.patch
6162
git apply $PATCH_DIR/0005-fml-fixes-text_input-compiler-warnings.patch
6263
git apply $PATCH_DIR/0006-impeller-unnecessary-virtual-specifier.patch
63-
64+
65+
pushd engine/src/flutter/third_party/abseil-cpp
66+
git apply $PATCH_DIR/flutter/third_party/abseil-cpp/0001-flutter-third_party-abseil-cpp-clang-compiler-warnin.patch
67+
popd
68+
69+
pushd engine/src/flutter/third_party/googletest
70+
git apply $PATCH_DIR/flutter/third_party/googletest/0001-flutter-third_party-googletest-fix-implicit-conversi.patch
71+
popd
72+
73+
pushd engine/src/flutter/third_party/swiftshader
74+
git apply $PATCH_DIR/flutter/third_party/swiftshader/0001-flutter-third_party-swiftshader-pointer-cast-to-void.patch
75+
git apply $PATCH_DIR/flutter/third_party/swiftshader/0002-flutter-third_party-swiftshader-llvm-16.0-required-f.patch
76+
popd
77+
6478
- name: Build Debug
6579
working-directory: flutter/engine/src
6680
run: |
@@ -110,56 +124,6 @@ jobs:
110124
gh release upload "$tag_debug" "$tag_debug.tar.gz" "$tag_debug.tar.gz.sha256"
111125
gh release edit "$tag_debug" --draft=false
112126
113-
- name: Build Debug Unoptimized
114-
working-directory: flutter/engine/src
115-
run: |
116-
export PATH=$PATH:$PWD/../../../depot_tools
117-
export VPYTHON_VIRTUALENV_ROOT=$PWD/../../../vpython
118-
CLANG_ROOT=$(find -iname clang++)
119-
CLANG_ROOT=$(dirname $CLANG_ROOT)
120-
export CLANG_ROOT=$(dirname $CLANG_ROOT)
121-
./flutter/tools/gn --runtime-mode=debug \
122-
--unoptimized \
123-
--embedder-for-target \
124-
--no-build-embedder-examples \
125-
--no-goma --no-rbe \
126-
--no-stripped --no-enable-unittests \
127-
--no-dart-version-git-info \
128-
--linux-cpu $linux_cpu \
129-
--target-os linux \
130-
--target-sysroot $PWD/build/linux/$target_sysroot \
131-
--target-toolchain $PWD/$CLANG_ROOT \
132-
--target-triple $target_triple
133-
ninja -C out/linux_debug_unopt_$arch
134-
135-
- name: Prepare Debug Unoptimized Artifacts
136-
run: |
137-
scripts/prepare-sdk-$arch.sh flutter/engine/src/out/linux_debug_unopt_$arch $PWD/flutter/engine/src/build/linux/$target_sysroot
138-
139-
tar czfhv $tag_debug_unopt.tar.gz flutter/engine/src/out/linux_debug_unopt_$arch/engine-sdk/
140-
141-
sha256sum -b $tag_debug_unopt.tar.gz > $tag_debug_unopt.tar.gz.sha256
142-
143-
- name: Publish Debug Unoptimized
144-
if: ${{ inputs.release != 'true' }}
145-
uses: actions/upload-artifact@v4
146-
with:
147-
name: engine-sdk-debug-unoptimized
148-
path: |
149-
linux-engine-sdk-debug-unopt-riscv64-${{ inputs.srcrev }}.tar.gz
150-
linux-engine-sdk-debug-unopt-riscv64-${{ inputs.srcrev }}.tar.gz.sha256
151-
152-
- name: Release - Debug Unoptimized Release
153-
if: ${{ inputs.release == 'true' }}
154-
env:
155-
GH_TOKEN: ${{ github.token }}
156-
GH_REPO: ${{ github.repository }}
157-
run: |
158-
gh release delete "$tag_debug_unopt" --cleanup-tag -y |true
159-
gh release create --draft "$tag_debug_unopt" --title "$tag_debug_unopt" --notes "$notes_debug_unopt"
160-
gh release upload "$tag_debug_unopt" "$tag_debug_unopt.tar.gz" "$tag_debug_unopt.tar.gz.sha256"
161-
gh release edit "$tag_debug_unopt" --draft=false
162-
163127
- name: Build Release
164128
working-directory: flutter/engine/src
165129
run: |
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
From 08320737783dea5aa976783d6578bda03917165b Mon Sep 17 00:00:00 2001
2+
From: Joel Winarske <joel.winarske@gmail.com>
3+
Date: Sun, 9 Nov 2025 09:06:19 -0800
4+
Subject: [PATCH] [flutter/third_party/abseil-cpp] clang compiler warnings
5+
6+
-rebase patch
7+
8+
Upstream-Status: Inappropriate
9+
10+
Signed-off-by: Joel Winarske <joel.winarske@gmail.com>
11+
---
12+
absl/debugging/internal/stacktrace_riscv-inl.inc | 4 ++--
13+
1 file changed, 2 insertions(+), 2 deletions(-)
14+
15+
diff --git a/absl/debugging/internal/stacktrace_riscv-inl.inc b/absl/debugging/internal/stacktrace_riscv-inl.inc
16+
index 20183fa..be94560 100644
17+
--- a/absl/debugging/internal/stacktrace_riscv-inl.inc
18+
+++ b/absl/debugging/internal/stacktrace_riscv-inl.inc
19+
@@ -44,7 +44,7 @@ template <typename T>
20+
static inline uintptr_t ComputeStackFrameSize(const T *low, const T *high) {
21+
const char *low_char_ptr = reinterpret_cast<const char *>(low);
22+
const char *high_char_ptr = reinterpret_cast<const char *>(high);
23+
- return low < high ? high_char_ptr - low_char_ptr : kUnknownFrameSize;
24+
+ return low < high ? static_cast<uintptr_t>(high_char_ptr - low_char_ptr) : kUnknownFrameSize;
25+
}
26+
27+
// Given a pointer to a stack frame, locate and return the calling stackframe,
28+
@@ -151,7 +151,7 @@ static int UnwindImpl(void **result, int *sizes, int max_depth, int skip_count,
29+
} else {
30+
result[n] = return_address;
31+
if (IS_STACK_FRAMES) {
32+
- sizes[n] = ComputeStackFrameSize(frame_pointer, next_frame_pointer);
33+
+ sizes[n] = static_cast<int>(ComputeStackFrameSize(frame_pointer, next_frame_pointer));
34+
}
35+
n++;
36+
}
37+
--
38+
2.51.1
39+
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
From b8817a6a271d1b3738ef275ac1020b4189957716 Mon Sep 17 00:00:00 2001
2+
From: Joel Winarske <joel.winarske@gmail.com>
3+
Date: Mon, 10 Nov 2025 07:18:28 -0800
4+
Subject: [PATCH] [flutter/third_party/googletest] fix implicit conversion
5+
error
6+
7+
Upstream-Status: Inappropriate
8+
9+
Signed-off-by: Joel Winarske <joel.winarske@gmail.com>
10+
---
11+
googletest/include/gtest/gtest-printers.h | 4 ++--
12+
1 file changed, 2 insertions(+), 2 deletions(-)
13+
14+
diff --git a/googletest/include/gtest/gtest-printers.h b/googletest/include/gtest/gtest-printers.h
15+
index 1b12ef68..e56cfd15 100644
16+
--- a/googletest/include/gtest/gtest-printers.h
17+
+++ b/googletest/include/gtest/gtest-printers.h
18+
@@ -517,11 +517,11 @@ GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os);
19+
20+
GTEST_API_ void PrintTo(char32_t c, ::std::ostream* os);
21+
inline void PrintTo(char16_t c, ::std::ostream* os) {
22+
- PrintTo(ImplicitCast_<char32_t>(c), os);
23+
+ PrintTo(static_cast<char32_t>(c), os);
24+
}
25+
#ifdef __cpp_lib_char8_t
26+
inline void PrintTo(char8_t c, ::std::ostream* os) {
27+
- PrintTo(ImplicitCast_<char32_t>(c), os);
28+
+ PrintTo(static_cast<char32_t>(c), os);
29+
}
30+
#endif
31+
32+
--
33+
2.51.1
34+
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
From 68828dc53efbf4cd42a748e2a637d36ad2a7da12 Mon Sep 17 00:00:00 2001
2+
From: Joel Winarske <joel.winarske@gmail.com>
3+
Date: Mon, 10 Nov 2025 10:53:11 -0800
4+
Subject: [PATCH 1/2] [flutter/third_party/swiftshader] pointer cast to void*
5+
6+
Upstream-Status: Inappropriate
7+
8+
Signed-off-by: Joel Winarske <joel.winarske@gmail.com>
9+
---
10+
src/Device/Memset.hpp | 6 +++---
11+
1 file changed, 3 insertions(+), 3 deletions(-)
12+
13+
diff --git a/src/Device/Memset.hpp b/src/Device/Memset.hpp
14+
index 91c7e4d73..5b5e1e6c5 100644
15+
--- a/src/Device/Memset.hpp
16+
+++ b/src/Device/Memset.hpp
17+
@@ -39,19 +39,19 @@ struct Memset
18+
{
19+
static_assert(std::is_base_of<Memset<T>, T>::value, "Memset<T> must only clear the memory of a type of which it is a base class");
20+
static_assert(!std::is_polymorphic<T>::value, "Memset<T> must not be used with classes that have virtual functions");
21+
- ::memset(object, 0, sizeof(T));
22+
+ ::memset(static_cast<void*>(object), 0, sizeof(T));
23+
}
24+
25+
// Don't rely on the implicitly declared copy constructor and copy assignment operator.
26+
// They can leave padding bytes uninitialized.
27+
Memset(const Memset &rhs)
28+
{
29+
- ::memcpy(this, &rhs, sizeof(T));
30+
+ ::memcpy((void*)this, (void*)&rhs, sizeof(T));
31+
}
32+
33+
Memset &operator=(const Memset &rhs)
34+
{
35+
- ::memcpy(this, &rhs, sizeof(T));
36+
+ ::memcpy((void*)this, (void*)&rhs, sizeof(T));
37+
return *this;
38+
}
39+
40+
--
41+
2.51.1
42+
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
From d4ce6b54e3009ef96f55358e367a4a114a503b7f Mon Sep 17 00:00:00 2001
2+
From: Joel Winarske <joel.winarske@gmail.com>
3+
Date: Mon, 24 Nov 2025 16:34:21 -0800
4+
Subject: [PATCH] [flutter/third_party/swiftshader] llvm-16.0 required for
5+
6+
Upstream-Status: Inappropriate
7+
8+
Signed-off-by: Joel Winarske <joel.winarske@gmail.com>
9+
---
10+
src/Reactor/BUILD.gn | 2 +-
11+
1 file changed, 1 insertion(+), 1 deletion(-)
12+
13+
diff --git a/src/Reactor/BUILD.gn b/src/Reactor/BUILD.gn
14+
index 67dfeb0ec..dcb13614a 100644
15+
--- a/src/Reactor/BUILD.gn
16+
+++ b/src/Reactor/BUILD.gn
17+
@@ -307,7 +307,7 @@ if (supports_subzero) {
18+
19+
if (supports_llvm) {
20+
swiftshader_source_set("swiftshader_llvm_reactor") {
21+
- llvm_dir = "../../third_party/llvm-10.0"
22+
+ llvm_dir = "../../third_party/llvm-16.0"
23+
24+
deps = [
25+
":swiftshader_reactor_base",
26+
--
27+
2.52.0
28+

scripts/prepare-sdk-riscv64.sh

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
#! /bin/bash
2+
3+
pushd $1
4+
5+
SYSROOT=$2
6+
7+
mkdir -p engine-sdk/{bin,include,lib,data,clang_x64/bin,clang_x64/lib64}
8+
9+
#
10+
# Include
11+
#
12+
cp *.h engine-sdk/include/
13+
14+
#
15+
# /data
16+
#
17+
cp icudtl.dat engine-sdk/data/
18+
19+
#
20+
# cpp_client_wrapper_glfw
21+
#
22+
if [ -e cpp_client_wrapper_glfw ]; then
23+
mkdir -p engine-sdk/sdk/cpp_client_wrapper_glfw/
24+
cp -r cpp_client_wrapper_glfw/* engine-sdk/sdk/cpp_client_wrapper_glfw/
25+
fi
26+
27+
#
28+
# flutter_linux
29+
#
30+
if [ -e flutter_linux ]; then
31+
mkdir -p engine-sdk/include/flutter_linux
32+
cp -r flutter_linux/* engine-sdk/include/flutter_linux/
33+
fi
34+
35+
#
36+
# flutter_patched_sdk
37+
#
38+
if [ -e flutter_patched_sdk ]; then
39+
mkdir -p engine-sdk/sdk/flutter_patched_sdk
40+
cp -r flutter_patched_sdk/* engine-sdk/sdk/flutter_patched_sdk/
41+
fi
42+
43+
#
44+
# shader_lib
45+
#
46+
if [ -e shader_lib ]; then
47+
mkdir -p engine-sdk/sdk/flutter_patched_sdk
48+
cp -r shader_lib engine-sdk/
49+
fi
50+
51+
#
52+
# zip archives
53+
#
54+
if [ -e zip_archives ]; then
55+
mkdir -p engine-sdk/sdk/zip_archives
56+
cp -r zip_archives/* engine-sdk/sdk/zip_archives/
57+
fi
58+
59+
60+
export cwd=$(pwd)
61+
62+
#
63+
# host - x64
64+
#
65+
cd clang_x64/exe.unstripped
66+
for file in *; do
67+
cp "../$file" $cwd/engine-sdk/clang_x64/bin/
68+
69+
# Copy each library with its parent directories to the target directory
70+
for library in $(ldd "$file" | cut -d '>' -f 2 | awk '{print $1}')
71+
do
72+
[ -f "${library}" ] && cp --verbose --parents "${library}" "$cwd/engine-sdk/clang_x64/"
73+
done
74+
done
75+
cd $cwd
76+
77+
#
78+
# /bin
79+
#
80+
cd exe.unstripped
81+
for file in *; do
82+
cp "../$file" $cwd/engine-sdk/bin/
83+
done
84+
cd $cwd
85+
86+
#
87+
# /lib
88+
#
89+
cd so.unstripped
90+
for file in *; do
91+
cp "../$file" $cwd/engine-sdk/lib/
92+
done
93+
cd $cwd
94+
95+
popd

0 commit comments

Comments
 (0)