!5170 riscv架构适配

Merge pull request !5170 from liuxiangkun/OpenHarmony-3.2-Release
This commit is contained in:
openharmony_ci 2024-01-04 07:02:33 +00:00 committed by Gitee
commit 4186246bab
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
4 changed files with 27 additions and 4 deletions

View File

@ -117,6 +117,7 @@ constexpr const char* ARM_EABI_V7A = "armeabi-v7a";
constexpr const char* ARM64_V8A = "arm64-v8a";
constexpr const char* X86 = "x86";
constexpr const char* X86_64 = "x86_64";
constexpr const char* RISCV64 = "riscv64";
const std::string LIBS = "libs/";
const std::string AN = "an/";
const std::string AP = "ap/";
@ -128,6 +129,7 @@ const std::map<std::string, std::string> ABI_MAP = {
{ARM64_V8A, "arm64"},
{X86, "x86"},
{X86_64, "x86_64"},
{RISCV64, "riscv64"},
};
constexpr const char* SO_SUFFIX = ".so";
constexpr const char* AN_SUFFIX = ".an";

View File

@ -2051,8 +2051,12 @@ bool ParserNativeSo(
soRelativePath = Constants::LIBS + Constants::ABI_MAP.at(Constants::ARM64_V8A);
UpdateNativeSoAttrs(cpuAbi, soRelativePath, isLibIsolated, innerBundleInfo);
return true;
} else if (bundleExtractor.IsDirExist(Constants::LIBS + Constants::RISCV64)) {
cpuAbi = Constants::RISCV64;
soRelativePath = Constants::LIBS + Constants::ABI_MAP.at(Constants::RISCV64);
UpdateNativeSoAttrs(cpuAbi, soRelativePath, isLibIsolated, innerBundleInfo);
return true;
}
return false;
}

View File

@ -1381,8 +1381,12 @@ bool ParserNativeSo(
soRelativePath = Constants::LIBS + Constants::ABI_MAP.at(Constants::ARM64_V8A);
UpdateNativeSoAttrs(cpuAbi, soRelativePath, isLibIsolated, innerBundleInfo);
return true;
} else if (bundleExtractor.IsDirExist(Constants::LIBS + Constants::RISCV64)) {
cpuAbi = Constants::RISCV64;
soRelativePath = Constants::LIBS + Constants::ABI_MAP.at(Constants::RISCV64);
UpdateNativeSoAttrs(cpuAbi, soRelativePath, isLibIsolated, innerBundleInfo);
return true;
}
return false;
}
@ -1503,7 +1507,10 @@ bool ParserArkNativeFilePath(
APP_LOGD("an exist");
if (isDefault) {
if (isSystemLib64Exist) {
if (bundleExtractor.IsDirExist(Constants::AN + Constants::ARM64_V8A)) {
if (bundleExtractor.IsDirExist(Constants::AN + Constants::RISCV64)) {
innerBundleInfo.SetArkNativeFileAbi(Constants::RISCV64);
return true;
} else if (bundleExtractor.IsDirExist(Constants::AN + Constants::ARM64_V8A)) {
innerBundleInfo.SetArkNativeFileAbi(Constants::ARM64_V8A);
return true;
}

View File

@ -226,7 +226,17 @@ bool PatchProfile::DefaultNativeSo(
}
APP_LOGE("Can't find ARM64_V8A in ABI_MAP");
return false;
} else if (patchExtractor.IsDirExist(Constants::LIBS + Constants::RISCV64)) {
appqfInfo.cpuAbi = Constants::RISCV64;
auto iter = Constants::ABI_MAP.find(Constants::RISCV64);
if (iter != Constants::ABI_MAP.end()) {
appqfInfo.nativeLibraryPath = Constants::LIBS + iter->second;
return true;
}
APP_LOGE("Can't find RISCV64 in ABI_MAP");
return false;
}
APP_LOGE(" ARM64_V8A's directory doesn't exist");
return false;
}
@ -335,4 +345,4 @@ ErrCode PatchProfile::TransformTo(
return ERR_OK;
}
} // namespace AppExecFwk
} // namespace OHOS
} // namespace OHOS