From 3050e13f1182301fe080f9b84b1285bc5ac10178 Mon Sep 17 00:00:00 2001 From: liuyifei Date: Thu, 27 Mar 2025 03:38:00 +0000 Subject: [PATCH 1/3] =?UTF-8?q?=E5=BC=80=E5=90=AFCFI=E4=BD=BF=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liuyifei --- frameworks/hilog_ndk/BUILD.gn | 1 + frameworks/libhilog/BUILD.gn | 1 + interfaces/js/kits/napi/BUILD.gn | 2 ++ interfaces/native/innerkits/BUILD.gn | 2 ++ services/hilogd/BUILD.gn | 1 + services/hilogtool/BUILD.gn | 1 + 6 files changed, 8 insertions(+) diff --git a/frameworks/hilog_ndk/BUILD.gn b/frameworks/hilog_ndk/BUILD.gn index ff22b32..d69f53f 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 c8bbd92..e489ff2 100644 --- a/frameworks/libhilog/BUILD.gn +++ b/frameworks/libhilog/BUILD.gn @@ -41,6 +41,7 @@ config("libhilog_config") { template("libhilog_source") { forward_variables_from(invoker, "*") ohos_source_set(target_name) { + branch_protector_ret = "pac_ret" if (platform != "windows" && platform != "mac" && platform != "linux") { param_sources = [ "$param_root/properties.cpp" ] ioctl_sources = [ "$ioctl_root/log_ioctl.cpp" ] diff --git a/interfaces/js/kits/napi/BUILD.gn b/interfaces/js/kits/napi/BUILD.gn index 198c340..01fc374 100644 --- a/interfaces/js/kits/napi/BUILD.gn +++ b/interfaces/js/kits/napi/BUILD.gn @@ -15,6 +15,7 @@ import("//base/hiviewdfx/hilog/hilog.gni") import("//build/ohos.gni") ohos_source_set("libhilognapi_src") { + branch_protector_ret = "pac_ret" defines = [] include_dirs = [ "//base/hiviewdfx/hilog/frameworks/libhilog/param/include", @@ -65,6 +66,7 @@ config("libhilog_js_cfg") { } ohos_shared_library("libhilognapi") { + branch_protector_ret = "pac_ret" sanitize = { cfi = true cfi_cross_dso = true diff --git a/interfaces/native/innerkits/BUILD.gn b/interfaces/native/innerkits/BUILD.gn index 26c638b..6c147f1 100644 --- a/interfaces/native/innerkits/BUILD.gn +++ b/interfaces/native/innerkits/BUILD.gn @@ -25,6 +25,7 @@ config("libhilog_pub_config") { } if (is_mingw || is_mac || is_linux || is_ohos) { ohos_shared_library("libhilog") { + branch_protector_ret = "pac_ret" public_configs = [ ":libhilog_pub_config" ] if (is_ohos) { deps = [ "../../../frameworks/libhilog:libhilog_source_ohos" ] @@ -65,6 +66,7 @@ template("libhilog") { forward_variables_from(invoker, "*") if (current_os == "android" || current_os == "ios") { ohos_static_library(target_name) { + branch_protector_ret = "pac_ret" public_configs = [ ":libhilog_pub_config" ] deps = [ "../../../platform:libhilog_platform_source_$platform" ] diff --git a/services/hilogd/BUILD.gn b/services/hilogd/BUILD.gn index 9a5bbed..b1275b0 100644 --- a/services/hilogd/BUILD.gn +++ b/services/hilogd/BUILD.gn @@ -20,6 +20,7 @@ config("hilogd_config") { } ohos_executable("hilogd") { + branch_protector_ret = "pac_ret" sources = [ "cmd_executor.cpp", "flow_control.cpp", diff --git a/services/hilogtool/BUILD.gn b/services/hilogtool/BUILD.gn index aa7ea15..09998f6 100644 --- a/services/hilogtool/BUILD.gn +++ b/services/hilogtool/BUILD.gn @@ -20,6 +20,7 @@ config("hilog_config") { } ohos_executable("hilog") { + branch_protector_ret = "pac_ret" sources = [ "log_display.cpp", "main.cpp", -- Gitee From 5580e1ed962a5513eb992d721b23e8b49e6c455f Mon Sep 17 00:00:00 2001 From: liuyifei Date: Thu, 27 Mar 2025 09:43:00 +0000 Subject: [PATCH 2/3] update interfaces/native/innerkits/BUILD.gn. Signed-off-by: liuyifei --- interfaces/native/innerkits/BUILD.gn | 1 - 1 file changed, 1 deletion(-) diff --git a/interfaces/native/innerkits/BUILD.gn b/interfaces/native/innerkits/BUILD.gn index 6c147f1..05e096a 100644 --- a/interfaces/native/innerkits/BUILD.gn +++ b/interfaces/native/innerkits/BUILD.gn @@ -66,7 +66,6 @@ template("libhilog") { forward_variables_from(invoker, "*") if (current_os == "android" || current_os == "ios") { ohos_static_library(target_name) { - branch_protector_ret = "pac_ret" public_configs = [ ":libhilog_pub_config" ] deps = [ "../../../platform:libhilog_platform_source_$platform" ] -- Gitee From 55eac0137abc504368b9a868faeeee91eacd8029 Mon Sep 17 00:00:00 2001 From: liuyifei Date: Thu, 27 Mar 2025 11:54:11 +0000 Subject: [PATCH 3/3] update frameworks/libhilog/BUILD.gn. Signed-off-by: liuyifei --- frameworks/libhilog/BUILD.gn | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frameworks/libhilog/BUILD.gn b/frameworks/libhilog/BUILD.gn index e489ff2..e201517 100644 --- a/frameworks/libhilog/BUILD.gn +++ b/frameworks/libhilog/BUILD.gn @@ -42,6 +42,11 @@ 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" ] -- Gitee