11diff --git a/engine/src/build/config/BUILDCONFIG.gn b/engine/src/build/config/BUILDCONFIG.gn
2- index b74b2e2..b181c74 100644
2+ index 596fd4fef78..84ae714527c 100644
33--- a/engine/src/build/config/BUILDCONFIG.gn
44+++ b/engine/src/build/config/BUILDCONFIG.gn
5- @@ -343 ,13 +343 ,13 @@ if (is_msan && !is_linux) {
5+ @@ -372 ,13 +372 ,13 @@ if (is_msan && !is_linux) {
66 # duplication in each target below.
77 _native_compiler_configs = [
88 "//build/config:feature_flags",
@@ -16,12 +16,12 @@ index b74b2e2..b181c74 100644
1616- "//build/config/compiler:runtime_library",
1717+ "//build/config/termux:runtime_library",
1818 ]
19-
19+
2020 if (use_flutter_cxx) {
21- @@ -377 ,7 +377 ,11 @@ if (is_posix) {
21+ @@ -406 ,7 +406 ,11 @@ if (is_posix) {
2222 ]
2323 }
24-
24+
2525- if (is_linux) {
2626+ import("//build/config/termux/termux.gni")
2727+
@@ -31,7 +31,7 @@ index b74b2e2..b181c74 100644
3131 _native_compiler_configs += [ "//build/config/linux:sdk" ]
3232 } else if (is_mac) {
3333 _native_compiler_configs += [ "//build/config/mac:sdk" ]
34- @@ -457 ,7 +461 ,7 @@ if (is_win) {
34+ @@ -486 ,7 +490 ,7 @@ if (is_win) {
3535 "//build/config/mac:mac_executable_flags",
3636 ]
3737 } else if (is_linux || is_android) {
@@ -40,10 +40,10 @@ index b74b2e2..b181c74 100644
4040 if (is_android) {
4141 _executable_configs += [ "//build/config/android:executable_config" ]
4242 }
43- @@ -521 ,7 +525 ,10 @@ import("//build/toolchain/custom/custom.gni")
43+ @@ -550 ,7 +554 ,10 @@ import("//build/toolchain/custom/custom.gni")
4444 # shlib_toolchain is a Fuchsia-specific symbol and not used by Flutter.
4545 shlib_toolchain = false
46-
46+
4747- if (custom_toolchain != "") {
4848+ if (is_termux) {
4949+ host_toolchain = "//build/toolchain/linux:clang_$host_cpu"
@@ -52,22 +52,131 @@ index b74b2e2..b181c74 100644
5252 assert(custom_sysroot != "")
5353 assert(custom_target_triple != "")
5454 host_toolchain = "//build/toolchain/linux:clang_$host_cpu"
55- @@ -597 ,6 +604 ,9 @@ if (custom_toolchain != "") {
55+ @@ -629 ,6 +636 ,9 @@ if (custom_toolchain != "") {
5656 } else {
5757 assert(false, "Toolchain not set because of unknown platform.")
5858 }
5959+ if (is_termux_host) {
6060+ host_toolchain = "//build/toolchain/termux:$host_cpu"
6161+ }
62-
62+
6363 # Sets default dependencies for executable and shared_library targets.
6464 #
65+ diff --git a/engine/src/build/config/compiler/BUILD.gn b/engine/src/build/config/compiler/BUILD.gn
66+ index 50f1b60eab1..cd1d7bcca5f 100644
67+ --- a/engine/src/build/config/compiler/BUILD.gn
68+ +++ b/engine/src/build/config/compiler/BUILD.gn
69+ @@ -19,6 +19,7 @@ import("//build/config/profiler.gni")
70+ import("//build/config/sanitizers/sanitizers.gni")
71+ import("//build/toolchain/ccache.gni")
72+ import("//build/toolchain/clang.gni")
73+ + import("//build/config/termux/termux.gni")
74+ import("//build/toolchain/toolchain.gni")
75+ import("//build/toolchain/wasm.gni")
76+
77+ @@ -228,7 +229,7 @@ config("compiler") {
78+ } else if (current_cpu == "x86") {
79+ cflags += [ "-m32" ]
80+ ldflags += [ "-m32" ]
81+ - if (is_clang) {
82+ + if (is_clang && !is_termux) {
83+ cflags += [
84+ # Align the stack on 16-byte boundaries, http://crbug.com/418554.
85+ "-mstack-alignment=16",
86+ @@ -271,7 +272,7 @@ config("compiler") {
87+ ]
88+ }
89+ } else if (is_win) {
90+ - if (is_clang) {
91+ + if (is_clang && !is_termux) {
92+ if (current_cpu == "x86") {
93+ cflags += [ "-m32" ]
94+ } else if (current_cpu == "x64") {
95+ @@ -406,7 +407,7 @@ config("compiler") {
96+
97+ # Clang-specific compiler flags setup.
98+ # ------------------------------------
99+ - if (is_clang) {
100+ + if (is_clang && !is_termux) {
101+ cflags += [ "-fcolor-diagnostics" ]
102+ }
103+
104+ @@ -514,7 +515,7 @@ config("cxx_version_default") {
105+ # a newer version. Targets that have explicitly opted into the newer version
106+ # must fix the errors they run into.
107+
108+ - if (is_clang) {
109+ + if (is_clang && !is_termux) {
110+ extra_warning_flags_cc = [
111+ # TODO(174665): Third-party dependency (Angle) needs to patched to work
112+ # around this.
113+ @@ -714,7 +715,7 @@ if (is_win) {
114+ "-Wno-nonportable-system-include-path",
115+ ]
116+ }
117+ - if (is_clang) {
118+ + if (is_clang && !is_termux) {
119+ default_warning_flags += [
120+ # No support for #pragma optimize. https://crbug.com/505314#c13
121+ "-Wno-ignored-pragma-optimize",
122+ @@ -767,21 +768,21 @@ if (is_win) {
123+ "-Wno-psabi",
124+ ]
125+
126+ - if (is_clang) {
127+ + if (is_clang) {
128+ default_warning_flags += [
129+ "-Wno-implicit-int-float-conversion",
130+ "-Wno-deprecated-copy",
131+ ]
132+ }
133+
134+ - if (!is_android && is_clang) {
135+ + if (!is_android && is_clang && !is_termux) {
136+ default_warning_flags += [
137+ # Needed for nlohmann/json.
138+ "-Wno-deprecated-literal-operator",
139+ ]
140+ }
141+
142+ - if (!is_wasm && is_clang) {
143+ + if (!is_wasm && is_clang && !is_termux) {
144+ default_warning_flags += [
145+ # Unqualified std::move is pretty common.
146+ "-Wno-unqualified-std-cast-call",
147+ @@ -867,7 +868,7 @@ config("no_chromium_code") {
148+ cflags += [ "-Wno-deprecated-non-prototype" ]
149+ }
150+
151+ - if (is_clang) {
152+ + if (is_clang && !is_termux) {
153+ cflags += [
154+ "-Wno-newline-eof",
155+ "-Wno-typedef-redefinition",
156+ @@ -902,7 +903,7 @@ config("enable_exceptions") {
157+ if (is_win) {
158+ cflags_cc = [ "/EHsc" ]
159+ defines = [ "_HAS_EXCEPTIONS=1" ]
160+ - } else if (is_clang) {
161+ + } else if (is_clang && !is_termux) {
162+ cflags_cc = [ "-fexceptions" ]
163+ }
164+ }
165+ @@ -1143,7 +1144,7 @@ config("no_symbols") {
166+ # To enable in a GN target, use:
167+ # configs += [ "//build/config/compiler:prevent_unsafe_narrowing" ]
168+ config("prevent_unsafe_narrowing") {
169+ - if (is_clang) {
170+ + if (is_clang && !is_termux) {
171+ cflags = [
172+ "-Wshorten-64-to-32",
173+ "-Wimplicit-int-conversion",
65174diff --git a/engine/src/build/config/sysroot.gni b/engine/src/build/config/sysroot.gni
66- index 5f7e48a..0f9c2e3 100644
175+ index 12c8df99f44..5e87f79075c 100644
67176--- a/engine/src/build/config/sysroot.gni
68177+++ b/engine/src/build/config/sysroot.gni
69178@@ -17,6 +17,8 @@ declare_args() {
70-
179+
71180 if (current_toolchain == default_toolchain && target_sysroot != "") {
72181 sysroot = target_sysroot
73182+ } else if (is_termux && custom_sysroot != "") {
@@ -226,7 +335,7 @@ index 0000000..8208b13
226335+ "-stdlib=libstdc++",
227336+ "-Wl,--warn-shared-textrel"
228337+ ]
229- + lib_dirs = [ "$custom_toolchain/lib/clang/19 /lib/linux/" ]
338+ + lib_dirs = [ "$custom_toolchain/lib/clang/18 /lib/linux/" ]
230339+ include_dirs = [
231340+ "//flutter/third_party/libcxx/include",
232341+ "//flutter/third_party/libcxxabi/include",
@@ -322,7 +431,7 @@ index 0000000..564c582
322431+ toolchain_cpu = "x86"
323432+ }
324433diff --git a/engine/src/flutter/shell/testing/BUILD.gn b/engine/src/flutter/shell/testing/BUILD.gn
325- index 28a19c7..5c3992b 100644
434+ index 28a19c75d1b..5c3992b31f8 100644
326435--- a/engine/src/flutter/shell/testing/BUILD.gn
327436+++ b/engine/src/flutter/shell/testing/BUILD.gn
328437@@ -56,6 +56,10 @@ executable("testing") {
@@ -334,5 +443,56 @@ index 28a19c7..5c3992b 100644
334443+ deps -= [ "//flutter/third_party/swiftshader/src/Vulkan:swiftshader_libvulkan_static" ]
335444+ }
336445 }
337-
446+
338447 metadata = {
448+ diff --git a/engine/src/flutter/build/secondary/third_party/inja/BUILD.gn b/engine/src/flutter/build/secondary/third_party/inja/BUILD.gn
449+ --- a/engine/src/flutter/build/secondary/third_party/inja/BUILD.gn
450+ +++ b/engine/src/flutter/build/secondary/third_party/inja/BUILD.gn
451+ @@ -11,6 +11,7 @@ config("inja_public_config") {
452+ if (is_clang) {
453+ cflags_cc = [
454+ "-Wno-unused-variable",
455+ "-Wno-newline-eof",
456+ + "-Wno-deprecated-literal-operator",
457+ ]
458+ }
459+
460+ diff --git a/engine/src/flutter/third_party/vulkan-deps/spirv-cross/src/gn/BUILD.gn b/engine/src/flutter/third_party/vulkan-deps/spirv-cross/src/gn/BUILD.gn
461+ --- a/engine/src/flutter/third_party/vulkan-deps/spirv-cross/src/gn/BUILD.gn
462+ +++ b/engine/src/flutter/third_party/vulkan-deps/spirv-cross/src/gn/BUILD.gn
463+ @@ -63,6 +63,7 @@ source_set("spirv_cross_sources") {
464+ "-Wno-newline-eof",
465+ "-Wno-sign-compare",
466+ "-Wno-unused-variable",
467+ + "-Wno-deprecated-this-capture",
468+ ]
469+ }
470+ }
471+ diff --git a/engine/src/flutter/build/secondary/third_party/spirv_cross_flutter/BUILD.gn b/engine/src/flutter/build/secondary/third_party/spirv_cross_flutter/BUILD.gn
472+ --- a/engine/src/flutter/build/secondary/third_party/spirv_cross_flutter/BUILD.gn
473+ +++ b/engine/src/flutter/build/secondary/third_party/spirv_cross_flutter/BUILD.gn
474+ @@ -13,5 +13,23 @@
475+ source_set("spirv_cross_flutter") {
476+ public_configs = [ ":spirv_cross_public" ]
477+
478+ + if (!is_win) {
479+ + cflags = [ "-fno-exceptions" ]
480+ + }
481+ +
482+ + if (is_clang) {
483+ + cflags_cc = [
484+ + "-Wno-extra-semi",
485+ + "-Wno-ignored-qualifiers",
486+ + "-Wno-implicit-fallthrough",
487+ + "-Wno-inconsistent-missing-override",
488+ + "-Wno-missing-field-initializers",
489+ + "-Wno-newline-eof",
490+ + "-Wno-sign-compare",
491+ + "-Wno-unused-variable",
492+ + "-Wno-deprecated-this-capture",
493+ + ]
494+ + }
495+ +
496+ sources = [
497+ "$source_root/GLSL.std.450.h",
498+
0 commit comments