diff --git a/frameworks/js/backup_ext/BUILD.gn b/frameworks/js/backup_ext/BUILD.gn index 313ae8e6ce9e926c3b904674283eac191cc363d1..297159bc1e050e09615549848cdc63e8edfebdc5 100644 --- a/frameworks/js/backup_ext/BUILD.gn +++ b/frameworks/js/backup_ext/BUILD.gn @@ -14,6 +14,16 @@ import("//build/ohos.gni") ohos_static_library("backupextensionability_napi_fwk") { + branch_protector_ret = true + sanitize = { + integer_overflow = true + ubsan = true + boundary_sanitize = true + cfi = true + cfi_cross_dso = true + debug = false + } + sources = [ "ext_backup_impl.cpp" ] external_deps = [ "napi:ace_napi" ] diff --git a/tests/utils/BUILD.gn b/tests/utils/BUILD.gn index aea2ba640768addf81ec0f4317f065bf92a287f1..bab4af694ddddc0f98d999d51f8199b8d09ae3b3 100644 --- a/tests/utils/BUILD.gn +++ b/tests/utils/BUILD.gn @@ -19,6 +19,16 @@ config("test_util_public_config") { } ohos_static_library("backup_test_utils") { + branch_protector_ret = true + sanitize = { + integer_overflow = true + ubsan = true + boundary_sanitize = true + cfi = true + cfi_cross_dso = true + debug = false + } + testonly = true sources = [ "src/test_manager.cpp" ] diff --git a/tools/backup_tool/BUILD.gn b/tools/backup_tool/BUILD.gn index 9ec3a7acae16bc5386528570bba48dc59e23605d..fbe6de359d1f34d9084acc52ade46aa4e2c328b4 100644 --- a/tools/backup_tool/BUILD.gn +++ b/tools/backup_tool/BUILD.gn @@ -15,6 +15,16 @@ import("//build/ohos.gni") import("//foundation/filemanagement/app_file_service/backup.gni") ohos_executable("backup_tool") { + branch_protector_ret = true + sanitize = { + integer_overflow = true + ubsan = true + boundary_sanitize = true + cfi = true + cfi_cross_dso = true + debug = false + } + sources = [ "src/main.cpp", "src/tools_op.cpp", diff --git a/utils/BUILD.gn b/utils/BUILD.gn index 3a8524ca6945917635ebf77011b54a7117eb7551..eae5075ffa2cf51063c5c0063bdd3cb87f3ef519 100644 --- a/utils/BUILD.gn +++ b/utils/BUILD.gn @@ -41,6 +41,16 @@ ohos_rust_static_ffi("backup_cxx_rust") { } ohos_static_library("backup_cxx_cppdeps") { + branch_protector_ret = true + sanitize = { + integer_overflow = true + ubsan = true + boundary_sanitize = true + cfi = true + cfi_cross_dso = true + debug = false + } + part_name = "app_file_service" subsystem_name = "filemanagement" defines = [ "RUST_CXX_NO_EXCEPTIONS" ]