diff --git a/frameworks/libhilog/BUILD.gn b/frameworks/libhilog/BUILD.gn index ff99027365fee6dd7c173b9847be02d2a08385cb..f67a2afa5e6ff9305a57dfc11d71ea3f77ca45ae 100644 --- a/frameworks/libhilog/BUILD.gn +++ b/frameworks/libhilog/BUILD.gn @@ -131,6 +131,13 @@ ohos_source_set("libhilog_base_source") { vsnprintf_sources = [ "$vsnprintf_root/vsnprintf_s_p.cpp" ] + branch_protector_ret = "pac_ret" + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + } + sources = [ "$libhilog_base_root/hilog_base.cpp" ] sources += vsnprintf_sources diff --git a/interfaces/native/innerkits/BUILD.gn b/interfaces/native/innerkits/BUILD.gn index 9023a14afcc98a0a08f4ba139cb575605efbf5a9..07be0bac0bd77c64994c5a0a7198b3ab8ae5e1a2 100644 --- a/interfaces/native/innerkits/BUILD.gn +++ b/interfaces/native/innerkits/BUILD.gn @@ -121,6 +121,13 @@ config("libhilog_base_pub_cfg") { ohos_static_library("libhilog_base") { public_configs = [ ":libhilog_base_pub_cfg" ] + branch_protector_ret = "pac_ret" + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + } + deps = [ "../../../frameworks/libhilog:libhilog_base_source" ] subsystem_name = "hiviewdfx"