From c51442a02c5ac1a9e8d70b724ceea7e8a14c8bc2 Mon Sep 17 00:00:00 2001 From: sybapp Date: Thu, 13 Feb 2025 07:57:44 +0000 Subject: [PATCH] add support for loongarch64 Change-Id: Ib2be82f55415f1d9b253846df2ee75c4b67bc3cb Signed-off-by: sybapp --- cj_environment/frameworks/cj_environment/BUILD.gn | 4 ++++ .../frameworks/cj_environment/src/cj_environment.cpp | 2 ++ frameworks/native/ability/native/BUILD.gn | 8 ++++++++ frameworks/native/appkit/BUILD.gn | 4 ++++ frameworks/native/appkit/app/extension_plugin_info.cpp | 4 +--- interfaces/inner_api/connect_server_manager/BUILD.gn | 4 ++++ interfaces/inner_api/runtime/BUILD.gn | 4 ++++ .../continuation_register_manager_proxy_test/BUILD.gn | 2 ++ .../continuation_register_manager_test/BUILD.gn | 2 ++ 9 files changed, 31 insertions(+), 3 deletions(-) diff --git a/cj_environment/frameworks/cj_environment/BUILD.gn b/cj_environment/frameworks/cj_environment/BUILD.gn index ae470d06c3c..441ff5d749c 100644 --- a/cj_environment/frameworks/cj_environment/BUILD.gn +++ b/cj_environment/frameworks/cj_environment/BUILD.gn @@ -24,6 +24,8 @@ config("cj_rt_public_config") { if (target_cpu == "arm64") { defines += [ "_ARM64_" ] + } else if (target_cpu == "loongarch64") { + defines += [ "_LOONGARCH64_" ] } if (target_cpu == "arm64") { @@ -32,6 +34,8 @@ config("cj_rt_public_config") { defines += [ "APP_USE_ARM" ] } else if (target_cpu == "x86_64") { defines += [ "APP_USE_X86_64" ] + } else if (target_cpu == "loongarch64") { + defines += [ "APP_USE_LOONGARCH64" ] } } diff --git a/cj_environment/frameworks/cj_environment/src/cj_environment.cpp b/cj_environment/frameworks/cj_environment/src/cj_environment.cpp index caf5290aeeb..5098156a364 100644 --- a/cj_environment/frameworks/cj_environment/src/cj_environment.cpp +++ b/cj_environment/frameworks/cj_environment/src/cj_environment.cpp @@ -34,6 +34,8 @@ #define APP_LIB_NAME "arm" #elif defined(APP_USE_X86_64) #define APP_LIB_NAME "x86_64" +#elif defined(APP_USE_LOONGARCH64) +#define APP_LIB_NAME "loongarch64" #elif defined(NAPI_TARGET_ARM64) #define APP_LIB_NAME "arm64" #else diff --git a/frameworks/native/ability/native/BUILD.gn b/frameworks/native/ability/native/BUILD.gn index 1b0733865e7..e91c4da07f4 100644 --- a/frameworks/native/ability/native/BUILD.gn +++ b/frameworks/native/ability/native/BUILD.gn @@ -51,6 +51,8 @@ config("ability_config") { defines += [ "AMS_LOG_DOMAIN = 0xD001300" ] if (target_cpu == "arm64") { defines += [ "_ARM64_" ] + } else if (target_cpu == "loongarch64") { + defines += [ "_LOONGARCH64_" ] } if (target_cpu == "arm64") { @@ -59,6 +61,8 @@ config("ability_config") { defines += [ "APP_USE_ARM" ] } else if (target_cpu == "x86_64") { defines += [ "APP_USE_X86_64" ] + } else if (target_cpu == "loongarch64") { + defines += [ "APP_USE_LOONGARCH64" ] } if (ability_runtime_graphics) { @@ -2012,6 +2016,8 @@ config("embedded_ui_extension_module_config") { defines += [ "AMS_LOG_DOMAIN = 0xD001300" ] if (target_cpu == "arm64") { defines += [ "_ARM64_" ] + } else if (target_cpu == "loongarch64") { + defines += [ "_LOONGARCH64_" ] } if (target_cpu == "arm64") { @@ -2020,6 +2026,8 @@ config("embedded_ui_extension_module_config") { defines += [ "APP_USE_ARM" ] } else if (target_cpu == "x86_64") { defines += [ "APP_USE_X86_64" ] + } else if (target_cpu == "loongarch64") { + defines += [ "APP_USE_LOONGARCH64" ] } if (ability_runtime_graphics) { diff --git a/frameworks/native/appkit/BUILD.gn b/frameworks/native/appkit/BUILD.gn index 4f9daaa22d4..1b9625bb119 100644 --- a/frameworks/native/appkit/BUILD.gn +++ b/frameworks/native/appkit/BUILD.gn @@ -35,6 +35,8 @@ config("appkit_config") { defines += [ "AMS_LOG_DOMAIN = 0xD001305" ] if (target_cpu == "arm64") { defines += [ "_ARM64_" ] + } else if (target_cpu == "loongarch64") { + defines += [ "_LOONGARCH64_" ] } if (target_cpu == "arm64") { defines += [ "APP_USE_ARM64" ] @@ -42,6 +44,8 @@ config("appkit_config") { defines += [ "APP_USE_ARM" ] } else if (target_cpu == "x86_64") { defines += [ "APP_USE_X86_64" ] + } else if (target_cpu == "loongarch64") { + defines += [ "APP_USE_LOONGARCH64" ] } include_dirs = [ diff --git a/frameworks/native/appkit/app/extension_plugin_info.cpp b/frameworks/native/appkit/app/extension_plugin_info.cpp index fe51add2cc6..99f2248218a 100755 --- a/frameworks/native/appkit/app/extension_plugin_info.cpp +++ b/frameworks/native/appkit/app/extension_plugin_info.cpp @@ -25,9 +25,7 @@ namespace OHOS { namespace AbilityRuntime { -#ifdef APP_USE_ARM64 -const std::string EXTENSION_LIB = "system/lib64/extensionability"; -#elif defined(APP_USE_X86_64) +#if defined(APP_USE_ARM64) || defined(APP_USE_X86_64) || defined(APP_USE_LOONGARCH64) const std::string EXTENSION_LIB = "system/lib64/extensionability"; #else const std::string EXTENSION_LIB = "system/lib/extensionability"; diff --git a/interfaces/inner_api/connect_server_manager/BUILD.gn b/interfaces/inner_api/connect_server_manager/BUILD.gn index c2c684462c3..18d11f3416a 100644 --- a/interfaces/inner_api/connect_server_manager/BUILD.gn +++ b/interfaces/inner_api/connect_server_manager/BUILD.gn @@ -20,6 +20,8 @@ config("connect_server_manager_config") { defines = [] if (target_cpu == "arm64") { defines += [ "_ARM64_" ] + } else if (target_cpu == "loongarch64") { + defines += [ "_LOONGARCH64_" ] } if (target_cpu == "arm64") { @@ -28,6 +30,8 @@ config("connect_server_manager_config") { defines += [ "APP_USE_ARM" ] } else if (target_cpu == "x86_64") { defines += [ "APP_USE_X86_64" ] + } else if (target_cpu == "loongarch64") { + defines += [ "APP_USE_LOONGARCH64" ] } } diff --git a/interfaces/inner_api/runtime/BUILD.gn b/interfaces/inner_api/runtime/BUILD.gn index faec0e820c8..14be7c15ca0 100644 --- a/interfaces/inner_api/runtime/BUILD.gn +++ b/interfaces/inner_api/runtime/BUILD.gn @@ -22,6 +22,8 @@ config("runtime_config") { if (target_cpu == "arm64") { defines += [ "_ARM64_" ] + } else if (target_cpu == "loongarch64") { + defines += [ "_LOONGARCH64_" ] } if (target_cpu == "arm64") { @@ -30,6 +32,8 @@ config("runtime_config") { defines += [ "APP_USE_ARM" ] } else if (target_cpu == "x86_64") { defines += [ "APP_USE_X86_64" ] + } else if (target_cpu == "loongarch64") { + defines += [ "APP_USE_LOONGARCH64" ] } include_dirs = [] diff --git a/test/unittest/continuation_test/remote_register_service_test/continuation_register_manager_proxy_test/BUILD.gn b/test/unittest/continuation_test/remote_register_service_test/continuation_register_manager_proxy_test/BUILD.gn index 97e8ed29efb..81488c392d9 100644 --- a/test/unittest/continuation_test/remote_register_service_test/continuation_register_manager_proxy_test/BUILD.gn +++ b/test/unittest/continuation_test/remote_register_service_test/continuation_register_manager_proxy_test/BUILD.gn @@ -56,6 +56,8 @@ config("ability_config") { defines = [ "AMS_LOG_TAG = \"Ability\"" ] if (target_cpu == "arm64") { defines += [ "_ARM64_" ] + } else if (target_cpu == "loongarch64") { + defines += [ "_LOONGARCH64_" ] } if (ability_runtime_graphics) { diff --git a/test/unittest/continuation_test/remote_register_service_test/continuation_register_manager_test/BUILD.gn b/test/unittest/continuation_test/remote_register_service_test/continuation_register_manager_test/BUILD.gn index 33087af41c1..e6f3d9cb0be 100644 --- a/test/unittest/continuation_test/remote_register_service_test/continuation_register_manager_test/BUILD.gn +++ b/test/unittest/continuation_test/remote_register_service_test/continuation_register_manager_test/BUILD.gn @@ -56,6 +56,8 @@ config("ability_config") { defines = [ "AMS_LOG_TAG = \"Ability\"" ] if (target_cpu == "arm64") { defines += [ "_ARM64_" ] + } else if (target_cpu == "loongarch64") { + defines += [ "_LOONGARCH64_" ] } if (ability_runtime_graphics) { -- Gitee