From 3ba01157870fd6b483510f044ac7c9eb83c999c6 Mon Sep 17 00:00:00 2001 From: xujintong Date: Mon, 4 Dec 2023 22:24:19 +0800 Subject: [PATCH] Fix the unavailable issue in TDD Signed-off-by: xujintong --- interfaces/innerkits/native/BUILD.gn | 30 +++++++++++++++++++ interfaces/kits/js/BUILD.gn | 30 +++++++++++++++++++ tests/moduletests/backup_kit_inner/BUILD.gn | 6 ++++ .../unittests/backup_api/backup_impl/BUILD.gn | 6 ++++ tests/unittests/backup_sa/module_ipc/BUILD.gn | 12 ++++++++ tests/unittests/backup_utils/BUILD.gn | 6 ++++ tools/backup_tool/BUILD.gn | 10 +++++++ 7 files changed, 100 insertions(+) diff --git a/interfaces/innerkits/native/BUILD.gn b/interfaces/innerkits/native/BUILD.gn index bc2f205ea..84838bca0 100644 --- a/interfaces/innerkits/native/BUILD.gn +++ b/interfaces/innerkits/native/BUILD.gn @@ -66,6 +66,16 @@ ohos_shared_library("fileshare_native") { } ohos_shared_library("fileuri_native") { + stack_protector_ret = true + sanitize = { + integer_overflow = true + ubsan = true + boundary_sanitize = true + cfi = true + cfi_cross_dso = true + debug = false + } + sources = [ "../../common/src/common_func.cpp", "../../common/src/json_utils.cpp", @@ -110,6 +120,16 @@ config("remote_file_share_config") { } ohos_shared_library("remote_file_share_native") { + stack_protector_ret = true + sanitize = { + integer_overflow = true + ubsan = true + boundary_sanitize = true + cfi = true + cfi_cross_dso = true + debug = false + } + sources = [ "../../common/src/json_utils.cpp", "../../common/src/sandbox_helper.cpp", @@ -143,6 +163,16 @@ config("sandbox_helper_config") { } ohos_shared_library("sandbox_helper_native") { + stack_protector_ret = true + sanitize = { + integer_overflow = true + ubsan = true + boundary_sanitize = true + cfi = true + cfi_cross_dso = true + debug = false + } + sources = [ "../../common/src/json_utils.cpp", "../../common/src/sandbox_helper.cpp", diff --git a/interfaces/kits/js/BUILD.gn b/interfaces/kits/js/BUILD.gn index ee1a7758b..5b2fa6ab3 100644 --- a/interfaces/kits/js/BUILD.gn +++ b/interfaces/kits/js/BUILD.gn @@ -52,6 +52,16 @@ ohos_shared_library("remotefileshare") { } ohos_shared_library("fileshare") { + stack_protector_ret = true + sanitize = { + integer_overflow = true + ubsan = true + boundary_sanitize = true + cfi = true + cfi_cross_dso = true + debug = false + } + include_dirs = [ ".", "../../common/include", @@ -92,6 +102,16 @@ ohos_shared_library("fileshare") { } ohos_shared_library("fileuri") { + stack_protector_ret = true + sanitize = { + integer_overflow = true + ubsan = true + boundary_sanitize = true + cfi = true + cfi_cross_dso = true + debug = false + } + include_dirs = [ ".", "../../common/include", @@ -133,6 +153,16 @@ ohos_shared_library("fileuri") { } ohos_shared_library("backup") { + stack_protector_ret = true + sanitize = { + integer_overflow = true + ubsan = true + boundary_sanitize = true + cfi = true + cfi_cross_dso = true + debug = false + } + relative_install_dir = "module/file" subsystem_name = "filemanagement" part_name = "app_file_service" diff --git a/tests/moduletests/backup_kit_inner/BUILD.gn b/tests/moduletests/backup_kit_inner/BUILD.gn index d506df4c4..6573d6c7c 100644 --- a/tests/moduletests/backup_kit_inner/BUILD.gn +++ b/tests/moduletests/backup_kit_inner/BUILD.gn @@ -47,6 +47,12 @@ ohos_unittest("b_session_test") { "ipc:ipc_core", "samgr:samgr_proxy", ] + + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + } use_exceptions = true } diff --git a/tests/unittests/backup_api/backup_impl/BUILD.gn b/tests/unittests/backup_api/backup_impl/BUILD.gn index 33b29384e..478b25738 100644 --- a/tests/unittests/backup_api/backup_impl/BUILD.gn +++ b/tests/unittests/backup_api/backup_impl/BUILD.gn @@ -72,6 +72,12 @@ ohos_unittest("backup_sa_impl_test") { "samgr:samgr_proxy", ] + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + } + use_exceptions = true } diff --git a/tests/unittests/backup_sa/module_ipc/BUILD.gn b/tests/unittests/backup_sa/module_ipc/BUILD.gn index 2d3ac401c..a93e52b4d 100644 --- a/tests/unittests/backup_sa/module_ipc/BUILD.gn +++ b/tests/unittests/backup_sa/module_ipc/BUILD.gn @@ -50,6 +50,12 @@ ohos_unittest("module_ipc_test") { "storage_service:storage_manager_sa_proxy", ] + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + } + use_exceptions = true } @@ -186,6 +192,12 @@ ohos_unittest("backup_service_scheduler_test") { "storage_service:storage_manager_sa_proxy", ] + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + } + use_exceptions = true } diff --git a/tests/unittests/backup_utils/BUILD.gn b/tests/unittests/backup_utils/BUILD.gn index 6148f4aa3..7e2e8eb4c 100644 --- a/tests/unittests/backup_utils/BUILD.gn +++ b/tests/unittests/backup_utils/BUILD.gn @@ -77,6 +77,12 @@ ohos_unittest("b_json_test") { "hilog:libhilog", ] + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + } + use_exceptions = true } diff --git a/tools/backup_tool/BUILD.gn b/tools/backup_tool/BUILD.gn index b164c2006..bdf86c51e 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") { + stack_protector_ret = true + sanitize = { + integer_overflow = true + ubsan = true + boundary_sanitize = true + cfi = true + cfi_cross_dso = true + debug = false + } + include_dirs = [] deps = [] defines = [] -- Gitee