diff --git a/interfaces/innerkits/BUILD.gn b/interfaces/innerkits/BUILD.gn index 13e0238baa3220af5fe65f61569e50b894a0e713..3caa62f5c874fba245cf78f83898719010912d6f 100755 --- a/interfaces/innerkits/BUILD.gn +++ b/interfaces/innerkits/BUILD.gn @@ -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", diff --git a/interfaces/innerkits/modulemgr/modulemgr.c b/interfaces/innerkits/modulemgr/modulemgr.c index 8697eb541e832eacef528bd7ae10e74a4118b2e6..84e2cfb8e4913f2c12832dbf03fbe27e35b583fe 100755 --- a/interfaces/innerkits/modulemgr/modulemgr.c +++ b/interfaces/innerkits/modulemgr/modulemgr.c @@ -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); diff --git a/services/BUILD.gn b/services/BUILD.gn index 16d42030c429f60454de36f369186aff4f562e42..061676d4a1948360144ec5463ed41c038863fe90 100755 --- a/services/BUILD.gn +++ b/services/BUILD.gn @@ -237,6 +237,10 @@ if (defined(ohos_lite)) { ] } + if (target_cpu == "arm64") { + defines += [ "SUPPORT_64BIT" ] + } + if (!enable_ramdisk) { defines += [ "DISABLE_INIT_TWO_STAGES" ] } diff --git a/test/unittest/BUILD.gn b/test/unittest/BUILD.gn index e3e7cabbfd2ae9426ba56b507b0a850d0517d706..b8821193f9ebe46d0199e7d9f5756fa6fd71c863 100755 --- a/test/unittest/BUILD.gn +++ b/test/unittest/BUILD.gn @@ -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",