From 2b5feb75130e46024e448460e76fc67e7011803e Mon Sep 17 00:00:00 2001 From: wangkai Date: Tue, 7 Nov 2023 10:31:38 +0800 Subject: [PATCH] cfi Signed-off-by: wangkai --- interfaces/innerkits/BUILD.gn | 6 ++++++ interfaces/jskits/BUILD.gn | 24 ++++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/interfaces/innerkits/BUILD.gn b/interfaces/innerkits/BUILD.gn index 713457d..4a50219 100755 --- a/interfaces/innerkits/BUILD.gn +++ b/interfaces/innerkits/BUILD.gn @@ -32,6 +32,12 @@ config("udmf_client_config") { } ohos_shared_library("udmf_client") { + branch_protector_ret = "pac_ret" + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + } sources = [ "${udmf_framework_path}/common/graph.cpp", "${udmf_framework_path}/common/tlv_util.cpp", diff --git a/interfaces/jskits/BUILD.gn b/interfaces/jskits/BUILD.gn index f1e1316..a23a56d 100755 --- a/interfaces/jskits/BUILD.gn +++ b/interfaces/jskits/BUILD.gn @@ -37,6 +37,12 @@ config("udmf_napi_config") { } ohos_shared_library("unifieddatachannel_napi") { + branch_protector_ret = "pac_ret" + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + } sources = [ "${udmf_framework_path}/jskitsimpl/data/application_defined_record_napi.cpp", "${udmf_framework_path}/jskitsimpl/data/audio_napi.cpp", @@ -84,6 +90,12 @@ ohos_shared_library("unifieddatachannel_napi") { } ohos_shared_library("uniformtypedescriptor_napi") { + branch_protector_ret = "pac_ret" + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + } sources = [ "${udmf_framework_path}/jskitsimpl/data/type_descriptor_napi.cpp", "${udmf_framework_path}/jskitsimpl/data/uniform_type_descriptor_napi.cpp", @@ -113,6 +125,12 @@ ohos_shared_library("uniformtypedescriptor_napi") { } ohos_shared_library("udmf_data_napi") { + branch_protector_ret = "pac_ret" + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + } sources = [ "${udmf_framework_path}/jskitsimpl/data/application_defined_record_napi.cpp", "${udmf_framework_path}/jskitsimpl/data/audio_napi.cpp", @@ -159,6 +177,12 @@ ohos_shared_library("udmf_data_napi") { } ohos_static_library("udmf_js_common") { + branch_protector_ret = "pac_ret" + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + } sources = [ "${udmf_framework_path}/jskitsimpl/common/napi_data_utils.cpp", "${udmf_framework_path}/jskitsimpl/common/napi_error_utils.cpp", -- Gitee