Enable PAC in Verifier SO

Issue: https://gitee.com/openharmony/arkcompiler_runtime_core/issues/IAPSN6

Signed-off-by: chenyiyuan <chenyiyuan6@huawei.com>
Change-Id: I6cac34e96114c85cb587c1499f3b92e494037228
This commit is contained in:
chenyiyuan 2024-09-09 09:54:59 +08:00
parent 3fc3e06774
commit bc4535c83b
4 changed files with 17 additions and 9 deletions

View File

@ -250,12 +250,6 @@ config("ark_config") {
configs += [ "$ark_root/plugins/$plugin:ark_config" ]
}
if (enabled_pac_data_protect) {
cflags_c += [ "-march=armv8.4-a" ]
cflags_cc += [ "-march=armv8.4-a" ]
defines += [ "PANDA_ENABLE_DATA_PROTECT" ]
}
if (current_cpu == "arm") {
cflags_cc += [
"-march=armv7-a",

View File

@ -21,12 +21,13 @@ if (is_standard_system) {
declare_args() {
enabled_plugins = default_enabled_plugins
pandas_support_pac_oh_pac_data_protect = false
enabled_pac_data_protect = false
}
if (defined(target_cpu) && target_cpu == "arm64" &&
pandas_support_pac_oh_pac_data_protect && !is_emulator) {
if (!ark_standalone_build && !(defined(is_arkui_x) && is_arkui_x) && is_ohos &&
is_standard_system && target_cpu == "arm64" && !is_emulator &&
defined(global_parts_info) &&
defined(global_parts_info.security_code_signature)) {
enabled_pac_data_protect = true
}

View File

@ -31,6 +31,11 @@ config("arkfile_public_config") {
}
}
config("data_protect_configs") {
cflags_cc = [ "-march=armv8.4-a" ]
defines = [ "PANDA_ENABLE_DATA_PROTECT" ]
}
config("arkfile_fuzz_config") {
configs = [ "$build_root/config/compiler:exceptions" ]
defines = [ "SUPPORT_KNOWN_EXCEPTION" ]
@ -100,6 +105,11 @@ ohos_static_library("libarkfile_static") {
public_configs = libarkfile_configs
if (enabled_pac_data_protect) {
configs = libarkfile_configs
configs += [ ":data_protect_configs" ]
}
deps = [
":arkfile_header_deps",
"$ark_root/libpandabase:libarkbase_static",

View File

@ -57,6 +57,9 @@ libarkverifier_sources = [
]
ohos_shared_library("libarkverifier") {
if (!ark_standalone_build) {
branch_protector_ret = "pac_ret"
}
sources = libarkverifier_sources
deps = [ "$ark_root/libpandafile:libarkfile_static_verifier" ]