diff --git a/frameworks/hilog_ndk/BUILD.gn b/frameworks/hilog_ndk/BUILD.gn index ff22b32a9e434101e75abcec58431d93492974a5..d69f53fdf7c4980f70785ea5c1e09f026e5cd1a6 100644 --- a/frameworks/hilog_ndk/BUILD.gn +++ b/frameworks/hilog_ndk/BUILD.gn @@ -14,6 +14,7 @@ import("//build/ohos.gni") ohos_shared_library("hilog_ndk") { + branch_protector_ret = "pac_ret" sanitize = { cfi = true cfi_cross_dso = true diff --git a/frameworks/libhilog/BUILD.gn b/frameworks/libhilog/BUILD.gn index c8bbd92fe0d1102891074895640425dfe01bc0be..e201517ba30e8e78157932a0c57d5bfc88bfaba9 100644 --- a/frameworks/libhilog/BUILD.gn +++ b/frameworks/libhilog/BUILD.gn @@ -41,6 +41,12 @@ config("libhilog_config") { template("libhilog_source") { forward_variables_from(invoker, "*") ohos_source_set(target_name) { + branch_protector_ret = "pac_ret" + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + } if (platform != "windows" && platform != "mac" && platform != "linux") { param_sources = [ "$param_root/properties.cpp" ] ioctl_sources = [ "$ioctl_root/log_ioctl.cpp" ] diff --git a/interfaces/native/innerkits/BUILD.gn b/interfaces/native/innerkits/BUILD.gn index 26c638ba7d055132617bde8cb9ff983aed62cf08..8c43d64c7b31362a4dd531b5daab86a461ee3f37 100644 --- a/interfaces/native/innerkits/BUILD.gn +++ b/interfaces/native/innerkits/BUILD.gn @@ -49,6 +49,7 @@ if (is_mingw || is_mac || is_linux || is_ohos) { "system", "updater", ] + branch_protector_ret = "pac_ret" sanitize = { cfi = true cfi_cross_dso = true @@ -73,6 +74,7 @@ template("libhilog") { } } else { ohos_shared_library(target_name) { + branch_protector_ret = "pac_ret" sanitize = { cfi = true cfi_cross_dso = true diff --git a/services/hilogd/BUILD.gn b/services/hilogd/BUILD.gn index 9a5bbede8c74551dc5c85367fa1cc110264352be..5ad2377ea6fe51bec83ab8d4735bd46b0930d419 100644 --- a/services/hilogd/BUILD.gn +++ b/services/hilogd/BUILD.gn @@ -20,6 +20,12 @@ config("hilogd_config") { } ohos_executable("hilogd") { + branch_protector_ret = "pac_ret" + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + } sources = [ "cmd_executor.cpp", "flow_control.cpp", diff --git a/services/hilogtool/BUILD.gn b/services/hilogtool/BUILD.gn index aa7ea15b765fc34ae7f836e30413358aacdee476..b142f967760b5f9b053c30e48c839c8758028a78 100644 --- a/services/hilogtool/BUILD.gn +++ b/services/hilogtool/BUILD.gn @@ -20,6 +20,12 @@ config("hilog_config") { } ohos_executable("hilog") { + branch_protector_ret = "pac_ret" + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + } sources = [ "log_display.cpp", "main.cpp",