diff --git a/etc/BUILD.gn b/etc/BUILD.gn index dddce63f76ca86119fb1b0a958057fee0e80b679..1a55cd445ff975211c86cf84fcd75a1668e8fa1e 100644 --- a/etc/BUILD.gn +++ b/etc/BUILD.gn @@ -39,7 +39,8 @@ if (defined(appspawn_sandbox_new) && appspawn_sandbox_new) { source = "../appdata-sandbox.json" patterns = [] extra_sandbox_cfgs = [] - if (target_cpu == "arm64" || target_cpu == "x86_64") { + if (target_cpu == "arm64" || target_cpu == "x86_64" || + target_cpu == "loongarch64") { extra_sandbox_cfgs += [ "../appdata-sandbox64.json" ] } if (is_asan || asan_detector) { diff --git a/modules/ace_adapter/BUILD.gn b/modules/ace_adapter/BUILD.gn index 4c274652ee644f13eccf8a25d308c44ca3cecc8f..37efd911ca0c0231f76c7b914f058bbb37dedbe2 100644 --- a/modules/ace_adapter/BUILD.gn +++ b/modules/ace_adapter/BUILD.gn @@ -58,7 +58,7 @@ ohos_shared_library("appspawn_ace") { part_name = "${part_name}" install_enable = true if (target_cpu == "arm64" || target_cpu == "x86_64" || - target_cpu == "riscv64") { + target_cpu == "riscv64" || target_cpu == "loongarch64") { module_install_dir = "lib64/appspawn/appspawn" } else { module_install_dir = "lib/appspawn/appspawn" diff --git a/modules/asan/BUILD.gn b/modules/asan/BUILD.gn index 29cec579ab2f4f495c1426ff9249615a03dfd3dc..371af2ce8963f5a2394c69997aef4699453d0d56 100644 --- a/modules/asan/BUILD.gn +++ b/modules/asan/BUILD.gn @@ -38,7 +38,7 @@ ohos_shared_library("appspawn_asan") { subsystem_name = "${subsystem_name}" part_name = "${part_name}" if (target_cpu == "arm64" || target_cpu == "x86_64" || - target_cpu == "riscv64") { + target_cpu == "riscv64" || target_cpu == "loongarch64") { module_install_dir = "lib64/appspawn" } else { module_install_dir = "lib/appspawn" diff --git a/modules/asan/asan_detector.c b/modules/asan/asan_detector.c index 901bc27ae41c9c38dc704ec75638d6faea40db9f..8400c955391ddc47855bbcdbd30ec7e789cf8791 100644 --- a/modules/asan/asan_detector.c +++ b/modules/asan/asan_detector.c @@ -25,7 +25,7 @@ extern bool may_init_gwp_asan(bool forceInit); // ide-asan #ifndef ASAN_DETECTOR -#if defined(__aarch64__) || defined(__x86_64__) +#if defined(__aarch64__) || defined(__x86_64__) || defined(__loongarch_lp64) #define ASAN_LD_PRELOAD "/system/lib64/libclang_rt.asan.so" #else #define ASAN_LD_PRELOAD "/system/lib/libclang_rt.asan.so" diff --git a/modules/common/BUILD.gn b/modules/common/BUILD.gn index a8441284e6a382e00e7405c7acd3995d671530cf..a58ae5fb778344267f6e9d0028369fdee180ca2f 100644 --- a/modules/common/BUILD.gn +++ b/modules/common/BUILD.gn @@ -95,7 +95,7 @@ ohos_shared_library("appspawn_common") { part_name = "${part_name}" install_enable = true if (target_cpu == "arm64" || target_cpu == "x86_64" || - target_cpu == "riscv64") { + target_cpu == "riscv64" || target_cpu == "loongarch64") { module_install_dir = "lib64/appspawn/common" } else { module_install_dir = "lib/appspawn/common" diff --git a/modules/common/appspawn_common.c b/modules/common/appspawn_common.c index 6ce56b278bdf850bffdb602b9da410848a4ed464..c8eda7a03ff2b0bfeb780763f53b5ce27c862e9f 100644 --- a/modules/common/appspawn_common.c +++ b/modules/common/appspawn_common.c @@ -153,7 +153,7 @@ static int SetCapabilities(const AppSpawnMgr *content, const AppSpawningCtx *pro static void InitDebugParams(const AppSpawnMgr *content, const AppSpawningCtx *property) { -#if defined(__aarch64__) || defined(__x86_64__) +#if defined(__aarch64__) || defined(__x86_64__) || defined(__loongarch_lp64) const char *debugSoPath = "/system/lib64/libhidebug.so"; #else const char *debugSoPath = "/system/lib/libhidebug.so"; diff --git a/modules/modulemgr/appspawn_modulemgr.h b/modules/modulemgr/appspawn_modulemgr.h index 53d0efb55663a30ea4e91bdb8f40c918c66a27c2..a6c763993bb4e700ccbf790daf50e166c6768d0c 100644 --- a/modules/modulemgr/appspawn_modulemgr.h +++ b/modules/modulemgr/appspawn_modulemgr.h @@ -29,7 +29,7 @@ extern "C" { #endif #define HOOK_STOP_WHEN_ERROR 0x2 -#if defined(__aarch64__) || defined(__x86_64__) +#if defined(__aarch64__) || defined(__x86_64__) || defined(__loongarch_lp64) #define ASAN_MODULE_PATH "/system/lib64/appspawn/libappspawn_asan" #else #define ASAN_MODULE_PATH "/system/lib/appspawn/libappspawn_asan" diff --git a/modules/native_adapter/BUILD.gn b/modules/native_adapter/BUILD.gn index 4a41ac595499b3d58827ad5a88a88ca41d4eb55d..34fce4c310f0a47015f056cef71bffc3aba7c5eb 100644 --- a/modules/native_adapter/BUILD.gn +++ b/modules/native_adapter/BUILD.gn @@ -44,7 +44,7 @@ ohos_shared_library("nativespawn") { part_name = "${part_name}" install_enable = true if (target_cpu == "arm64" || target_cpu == "x86_64" || - target_cpu == "riscv64") { + target_cpu == "riscv64" || target_cpu == "loongarch64") { module_install_dir = "lib64/appspawn/nativespawn" } else { module_install_dir = "lib/appspawn/nativespawn" diff --git a/modules/nweb_adapter/BUILD.gn b/modules/nweb_adapter/BUILD.gn index acd15abe223a366520e29f0fe8fac4c159b09e25..da1fc0e366a24eb181660516d857b289d31ae785 100644 --- a/modules/nweb_adapter/BUILD.gn +++ b/modules/nweb_adapter/BUILD.gn @@ -31,6 +31,9 @@ ohos_shared_library("appspawn_nweb") { if (target_cpu == "x86_64") { defines += [ "webview_x86_64" ] } + if (target_cpu == "loongarch64") { + defines += [ "webview_loongarch64" ] + } external_deps = [ "c_utils:utils", @@ -48,7 +51,7 @@ ohos_shared_library("appspawn_nweb") { part_name = "${part_name}" install_enable = true if (target_cpu == "arm64" || target_cpu == "x86_64" || - target_cpu == "riscv64") { + target_cpu == "riscv64" || target_cpu == "loongarch64") { module_install_dir = "lib64/appspawn/nwebspawn" } else { module_install_dir = "lib/appspawn/nwebspawn" diff --git a/modules/nweb_adapter/nwebspawn_adapter.cpp b/modules/nweb_adapter/nwebspawn_adapter.cpp index 6a54d3d087bc925d181ae3237ec31a5299b5f51d..1a6c2672d6f1f7c41f7a392e1dc76c4ed46744b0 100644 --- a/modules/nweb_adapter/nwebspawn_adapter.cpp +++ b/modules/nweb_adapter/nwebspawn_adapter.cpp @@ -41,6 +41,9 @@ namespace { #elif defined(webview_x86_64) const std::string ARK_WEB_CORE_HAP_LIB_PATH = "/data/storage/el1/bundle/arkwebcore/libs/x86_64"; +#elif defined(webview_loongarch64) + const std::string ARK_WEB_CORE_HAP_LIB_PATH = + "/data/storage/el1/bundle/arkwebcore/libs/loongarch64"; #else const std::string ARK_WEB_CORE_HAP_LIB_PATH = "/data/storage/el1/bundle/arkwebcore/libs/arm"; diff --git a/modules/sandbox/BUILD.gn b/modules/sandbox/BUILD.gn index 5a7d2d2c7188861dbf3efcf98882ee7119cd8f66..b8f94679e775e338275767153de9e6f8652254ae 100644 --- a/modules/sandbox/BUILD.gn +++ b/modules/sandbox/BUILD.gn @@ -61,7 +61,7 @@ if (defined(appspawn_sandbox_new) && appspawn_sandbox_new) { part_name = "${part_name}" install_enable = true if (target_cpu == "arm64" || target_cpu == "x86_64" || - target_cpu == "riscv64") { + target_cpu == "riscv64" || target_cpu == "loongarch64") { defines += [ "APPSPAWN_64" ] module_install_dir = "lib64/appspawn/common" } else { @@ -126,7 +126,7 @@ if (defined(appspawn_sandbox_new) && appspawn_sandbox_new) { part_name = "${part_name}" install_enable = true if (target_cpu == "arm64" || target_cpu == "x86_64" || - target_cpu == "riscv64") { + target_cpu == "riscv64" || target_cpu == "loongarch64") { defines += [ "APPSPAWN_64" ] module_install_dir = "lib64/appspawn/common" } else { diff --git a/modules/sysevent/BUILD.gn b/modules/sysevent/BUILD.gn index 7c0ef32ee07564a436b4fb7bf37bd9ebd4971571..6e72860e568e2ccba57d99ac14dfc01c7dd0cee2 100644 --- a/modules/sysevent/BUILD.gn +++ b/modules/sysevent/BUILD.gn @@ -30,7 +30,7 @@ ohos_shared_library("event_reporter") { part_name = "${part_name}" install_enable = true if (target_cpu == "arm64" || target_cpu == "x86_64" || - target_cpu == "riscv64") { + target_cpu == "riscv64" || target_cpu == "loongarch64") { module_install_dir = "lib64/appspawn/common" } else { module_install_dir = "lib/appspawn/common" diff --git a/test/unittest/app_spawn_standard_test/BUILD.gn b/test/unittest/app_spawn_standard_test/BUILD.gn index 7a2e19219e40b412200869e0dca3a228ccfaa062..3c814d167504578501a4f8c4f90801081453d7a6 100644 --- a/test/unittest/app_spawn_standard_test/BUILD.gn +++ b/test/unittest/app_spawn_standard_test/BUILD.gn @@ -207,7 +207,7 @@ ohos_unittest("AppSpawn_ut") { } if (target_cpu == "arm64" || target_cpu == "x86_64" || - target_cpu == "riscv64") { + target_cpu == "riscv64" || target_cpu == "loongarch64") { defines += [ "APPSPAWN_64" ] } @@ -396,7 +396,7 @@ ohos_unittest("AppSpawn_coldrun_ut") { } if (target_cpu == "arm64" || target_cpu == "x86_64" || - target_cpu == "riscv64") { + target_cpu == "riscv64" || target_cpu == "loongarch64") { defines += [ "APPSPAWN_64" ] } @@ -585,7 +585,7 @@ ohos_unittest("AppSpawn_common_ut") { } if (target_cpu == "arm64" || target_cpu == "x86_64" || - target_cpu == "riscv64") { + target_cpu == "riscv64" || target_cpu == "loongarch64") { defines += [ "APPSPAWN_64" ] }