提交 2ced3fab 编写于 作者: H handyohos

feat: Add 64bit support for modulemgr.

1)install from lib64 for arm64 platform
Signed-off-by: Nhandyohos <zhangxiaotian@huawei.com>
Change-Id: I7420b15591b180bf4b09c563d0d6751cdc321c90
上级 6b4e30fd
...@@ -170,6 +170,10 @@ if (defined(ohos_lite)) { ...@@ -170,6 +170,10 @@ if (defined(ohos_lite)) {
"_GNU_SOURCE", "_GNU_SOURCE",
"INIT_FILE", "INIT_FILE",
] ]
if (target_cpu == "arm64") {
defines += [ "SUPPORT_64BIT" ]
}
include_dirs = [ include_dirs = [
"./include", "./include",
"//third_party/bounds_checking_function/include", "//third_party/bounds_checking_function/include",
......
...@@ -27,6 +27,11 @@ ...@@ -27,6 +27,11 @@
#include "modulemgr.h" #include "modulemgr.h"
#define MODULE_SUFFIX_D ".z.so" #define MODULE_SUFFIX_D ".z.so"
#ifdef SUPPORT_64BIT
#define MODULE_LIB_NAME "lib64"
#else
#define MODULE_LIB_NAME "lib"
#endif
struct tagMODULE_MGR { struct tagMODULE_MGR {
ListNode modules; ListNode modules;
...@@ -114,7 +119,7 @@ static void *moduleInstall(MODULE_ITEM *module, int argc, const char *argv[]) ...@@ -114,7 +119,7 @@ static void *moduleInstall(MODULE_ITEM *module, int argc, const char *argv[])
if (module->moduleMgr->name[0] == '/') { if (module->moduleMgr->name[0] == '/') {
snprintf_s(path, sizeof(path), sizeof(path) - 1, "%s/%s" MODULE_SUFFIX_D, module->moduleMgr->name, module->name); snprintf_s(path, sizeof(path), sizeof(path) - 1, "%s/%s" MODULE_SUFFIX_D, module->moduleMgr->name, module->name);
} else { } else {
snprintf_s(path, sizeof(path), sizeof(path) - 1, "/system/lib/%s/%s" MODULE_SUFFIX_D, module->moduleMgr->name, module->name); snprintf_s(path, sizeof(path), sizeof(path) - 1, "/system/" MODULE_LIB_NAME "/%s/%s" MODULE_SUFFIX_D, module->moduleMgr->name, module->name);
} }
currentInstallArgs = &(module->moduleMgr->installArgs); currentInstallArgs = &(module->moduleMgr->installArgs);
...@@ -236,7 +241,7 @@ MODULE_MGR *ModuleMgrScan(const char *modulePath) ...@@ -236,7 +241,7 @@ MODULE_MGR *ModuleMgrScan(const char *modulePath)
if (modulePath[0] == '/') { if (modulePath[0] == '/') {
snprintf_s(path, sizeof(path), sizeof(path) - 1, "%s", modulePath); snprintf_s(path, sizeof(path), sizeof(path) - 1, "%s", modulePath);
} else { } else {
snprintf_s(path, sizeof(path), sizeof(path) - 1, "/system/lib/%s", modulePath); snprintf_s(path, sizeof(path), sizeof(path) - 1, "/system/" MODULE_LIB_NAME "/%s", modulePath);
} }
scanModules(moduleMgr, path); scanModules(moduleMgr, path);
......
...@@ -237,6 +237,10 @@ if (defined(ohos_lite)) { ...@@ -237,6 +237,10 @@ if (defined(ohos_lite)) {
] ]
} }
if (target_cpu == "arm64") {
defines += [ "SUPPORT_64BIT" ]
}
if (!enable_ramdisk) { if (!enable_ramdisk) {
defines += [ "DISABLE_INIT_TWO_STAGES" ] defines += [ "DISABLE_INIT_TWO_STAGES" ]
} }
......
...@@ -212,6 +212,10 @@ ohos_unittest("init_ut") { ...@@ -212,6 +212,10 @@ ohos_unittest("init_ut") {
] ]
defines += [ "_GNU_SOURCE" ] defines += [ "_GNU_SOURCE" ]
if (target_cpu == "arm64") {
defines += [ "SUPPORT_64BIT" ]
}
external_deps = [ external_deps = [
"hiviewdfx_hilog_native:libhilog", "hiviewdfx_hilog_native:libhilog",
"init:libinit_module_engine", "init:libinit_module_engine",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册