diff --git a/OAT.xml b/OAT.xml
index 4d0f4aafc4974f259605d252a6c29240855c015b..553069e858aacb2b95a21133b6dc1d983072ef15 100644
--- a/OAT.xml
+++ b/OAT.xml
@@ -94,6 +94,7 @@ used to filter file path.
+
diff --git a/attachment/repos/bootstrap/ohos.sh b/attachment/repos/bootstrap/ohos.sh
index e58a59e1137535964979996bb09f7f8a42a4c074..7d623708a0d27658a9940ce42a10bc2df3dc16a5 100755
--- a/attachment/repos/bootstrap/ohos.sh
+++ b/attachment/repos/bootstrap/ohos.sh
@@ -1,3 +1,4 @@
+#! /bin/bash
# Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -10,12 +11,18 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-#! /bin/bash
#
#编译依赖
#sudo apt install g++-multilib git python3 curl
+if [[ `uname` =~ 'Darwin' ]]; then
+HOST_OS=mac
+elif [[ `uname` =~ 'Linux' ]];then
HOST_OS=linux
+else
+HOST_OS=linux
+fi
+
NDK_HOME=`pwd`/ndk/$HOST_OS/4.0/native
NDK_TOOLCHAIN_CMAKE=$NDK_HOME/build/cmake/ohos.toolchain.cmake
NDK_SDK_CMAKE=$NDK_HOME/build/cmake/sdk_native_platforms.cmake
diff --git a/attachment/repos/build3.bin b/attachment/repos/build3.bin
new file mode 100644
index 0000000000000000000000000000000000000000..e28c91ec351c51d22df9956200323ad77b514ba8
--- /dev/null
+++ b/attachment/repos/build3.bin
@@ -0,0 +1,112 @@
+diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn
+index 301b014..bd3476a 100644
+--- a/build/config/BUILDCONFIG.gn
++++ b/build/config/BUILDCONFIG.gn
+@@ -34,11 +34,8 @@
+ # When writing build files, to do something only for the host:
+ # if (current_toolchain == host_toolchain) { ...
+
+-print("11target_os:"+target_os)
+-print("11target_cpu:"+target_cpu)
+
+ if (target_os == "") {
+- #target_os = host_os
+ target_os = "ohos"
+ }
+
+@@ -60,16 +57,14 @@ if (current_cpu == "") {
+ if (current_os == "") {
+ if (host_os == "win") {
+ current_os = "win"
++ } else if (host_os == "mac" && (target_os == "ohos" || target_os == "linux")) {
++ current_os = "ohos"
+ } else {
+ #current_os = target_os
+ current_os = host_os
+ }
+ }
+
+-print("current_os:"+current_os)
+-print("current_cpu:"+current_cpu)
+-print("target_os:"+target_os)
+-print("target_cpu:"+target_cpu)
+ # =============================================================================
+ # BUILD FLAGS
+ # =============================================================================
+@@ -279,6 +274,19 @@ if (current_os == "win") {
+ is_posix = true
+ is_win = false
+ is_wasm = false
++} else if ((current_os == "ohos" || current_os == "linux") && host_os == "mac") {
++ target_os="linux"
++ is_android = false
++ is_chromeos = false
++ is_fuchsia = false
++ is_fuchsia_host = false
++ is_ios = false
++ is_linux = true
++ is_ohos = true
++ is_mac = false
++ is_posix = true
++ is_win = false
++ is_wasm = false
+ } else if (current_os == "linux") {
+ is_android = false
+ is_chromeos = false
+@@ -394,7 +402,7 @@ if (is_posix) {
+ ]
+ }
+
+-if( is_ohos){
++if(is_ohos || (is_linux && host_os == "mac")){
+ _native_compiler_configs += [ "//build/config/ohos:sdk" ]
+ }else if (is_linux) {
+ _native_compiler_configs += [ "//build/config/linux:sdk" ]
+@@ -541,8 +549,18 @@ shlib_toolchain = false
+ if (custom_toolchain != "") {
+ assert(custom_sysroot != "")
+ assert(custom_target_triple != "")
+- host_toolchain = "//build/toolchain/linux:clang_$host_cpu"
+ set_default_toolchain("//build/toolchain/custom")
++ if (host_os == "linux") {
++ if (is_clang) {
++ host_toolchain = "//build/toolchain/linux:clang_$host_cpu"
++ } else {
++ host_toolchain = "//build/toolchain/linux:$host_cpu"
++ }
++ } else if (host_os == "mac") {
++ host_toolchain = "//build/toolchain/mac:clang_$host_cpu"
++ } else {
++ assert(false, "Unknown host for ohos cross compile")
++ }
+ } else if (is_win) {
+ if (is_clang) {
+ host_toolchain = "//build/toolchain/win:clang_$host_cpu"
+@@ -576,15 +594,19 @@ if (custom_toolchain != "") {
+ set_default_toolchain("//build/toolchain/android:$current_cpu")
+ }
+ } else if (is_ohos) {
+- if (is_clang) {
+- host_toolchain = "//build/toolchain/linux:clang_$host_cpu"
+- set_default_toolchain("//build/toolchain/linux:clang_$current_cpu")
++ if (host_os == "linux") {
++ if (is_clang) {
++ host_toolchain = "//build/toolchain/linux:clang_$host_cpu"
++ set_default_toolchain("//build/toolchain/linux:clang_$current_cpu")
++ } else {
++ host_toolchain = "//build/toolchain/linux:$host_cpu"
++ set_default_toolchain("//build/toolchain/linux:$current_cpu")
++ }
++ } else if (host_os == "mac") {
++ host_toolchain = "//build/toolchain/mac:clang_$host_cpu"
++ set_default_toolchain("//build/toolchain/ohos:clang_$current_cpu")
+ } else {
+- host_toolchain = "//build/toolchain/linux:$host_cpu"
+- set_default_toolchain("//build/toolchain/linux:$current_cpu")
+- }
+- if (is_chromeos && cros_use_custom_toolchain) {
+- set_default_toolchain("//build/toolchain/cros:target")
++ assert(false, "Unknown host for ohos cross compile")
+ }
+ } else if (is_linux) {
+ if (is_clang) {
diff --git a/attachment/repos/dart.patch b/attachment/repos/dart.patch
index 708f9c78a00242371af7f3f367593b417c6212d5..840d6495d5e6278a5c35c271490e8f0e1c6be69f 100644
--- a/attachment/repos/dart.patch
+++ b/attachment/repos/dart.patch
@@ -112,7 +112,7 @@ index 33be98fc0aa..eda146a0580 100644
String? _authCode;
diff --git a/runtime/BUILD.gn b/runtime/BUILD.gn
-index 13bfd0a724b..65227b4be20 100644
+index 13bfd0a724b..28ea7c79797 100644
--- a/runtime/BUILD.gn
+++ b/runtime/BUILD.gn
@@ -88,6 +88,7 @@ config("dart_precompiler_config") {
@@ -146,8 +146,16 @@ index 13bfd0a724b..65227b4be20 100644
}
# We need to build gen_snapshot targeting Fuchsia during a build of the SDK
+@@ -221,6 +231,7 @@ config("dart_config") {
+ "-ggdb3",
+ "-fno-rtti",
+ "-fno-exceptions",
++ "-Wno-sign-compare"
+ ]
+ if (is_clang) {
+ cflags += [
diff --git a/runtime/bin/BUILD.gn b/runtime/bin/BUILD.gn
-index f597fa5b0c3..2bb3bd42adc 100644
+index f597fa5b0c3..fa98edfee62 100644
--- a/runtime/bin/BUILD.gn
+++ b/runtime/bin/BUILD.gn
@@ -32,6 +32,11 @@ config("libdart_builtin_config") {
@@ -162,6 +170,33 @@ index f597fa5b0c3..2bb3bd42adc 100644
}
template("build_libdart_builtin") {
+@@ -452,7 +457,7 @@ template("dart_io") {
+ ]
+ }
+
+- if (is_linux || is_win || is_fuchsia) {
++ if (is_linux || is_win || is_fuchsia || is_ohos) {
+ if (dart_use_fallback_root_certificates) {
+ sources += [ "//third_party/root_certificates/root_certificates.cc" ]
+ } else {
+@@ -1036,7 +1041,7 @@ shared_library("entrypoints_verification_test") {
+ # The only effect of DART_SHARED_LIB is to export the Dart API.
+ "DART_SHARED_LIB",
+ ]
+- if (is_linux || is_android) {
++ if (is_linux || is_android || is_ohos) {
+ cflags = [ "-fPIC" ]
+ }
+ if (is_win) {
+@@ -1091,7 +1096,7 @@ shared_library("ffi_test_functions") {
+ # The only effect of DART_SHARED_LIB is to export the Dart API.
+ "DART_SHARED_LIB",
+ ]
+- if (is_linux || is_android) {
++ if (is_linux || is_android || is_ohos) {
+ cflags = [ "-fPIC" ]
+ }
+ if (is_win) {
diff --git a/runtime/bin/builtin_natives.cc b/runtime/bin/builtin_natives.cc
index 14762ed7e63..74ea2336efc 100644
--- a/runtime/bin/builtin_natives.cc
diff --git a/attachment/scripts/config.json b/attachment/scripts/config.json
index 71500386436ce9aebc724b9d2884759ccb643206..d15251e003d97e65ad7e469e6c11b4eef769cb41 100644
--- a/attachment/scripts/config.json
+++ b/attachment/scripts/config.json
@@ -51,5 +51,11 @@
"target": "./src/build",
"type": "patch",
"file_path": "../flutter/attachment/repos/build2.bin"
+ },
+ {
+ "name": "build3",
+ "target": "./src/build",
+ "type": "patch",
+ "file_path": "../flutter/attachment/repos/build3.bin"
}
-]
\ No newline at end of file
+]