未验证 提交 a9788845 编写于 作者: O openharmony_ci 提交者: Gitee

!610 Add 64bit support for modulemgr

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