From 9c9cca182b4ac70182f8b36de42ffc7889511b3b Mon Sep 17 00:00:00 2001 From: wangbin Date: Sat, 21 Jun 2025 09:31:43 +0800 Subject: [PATCH] fix cfi check err Signed-off-by: wangbin --- cfi_blocklist.txt | 16 ++++++++++++++++ datamgr_service.gni | 2 ++ .../distributeddataservice/service/test/BUILD.gn | 6 ++++++ 3 files changed, 24 insertions(+) create mode 100644 cfi_blocklist.txt diff --git a/cfi_blocklist.txt b/cfi_blocklist.txt new file mode 100644 index 000000000..89d302fdc --- /dev/null +++ b/cfi_blocklist.txt @@ -0,0 +1,16 @@ +# Copyright (C) 2025 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +[cfi] +src:*third_party/googletest/googlemock/include/gmock/* +src:*third_party/googletest/googletest/include/gtest/* \ No newline at end of file diff --git a/datamgr_service.gni b/datamgr_service.gni index da3e7a494..7b327ccea 100644 --- a/datamgr_service.gni +++ b/datamgr_service.gni @@ -38,6 +38,8 @@ udmf_path = "//foundation/distributeddatamgr/udmf" dataobject_path = "//foundation/distributeddatamgr/data_object" +datamgr_service_path = "//foundation/distributeddatamgr/datamgr_service" + declare_args() { datamgr_service_power = true if (!defined(global_parts_info.power_manager_native_powermgr_client) || diff --git a/services/distributeddataservice/service/test/BUILD.gn b/services/distributeddataservice/service/test/BUILD.gn index 4d16dc1f1..b4f1fb9ef 100755 --- a/services/distributeddataservice/service/test/BUILD.gn +++ b/services/distributeddataservice/service/test/BUILD.gn @@ -1085,6 +1085,12 @@ ohos_unittest("DataShareServiceImplTest") { ohos_unittest("KvdbServiceImplTest") { module_out_path = module_output_path + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + blocklist = "${datamgr_service_path}/cfi_blocklist.txt" + } sources = [ "${data_service_path}/app/src/kvstore_meta_manager.cpp", "kvdb_service_impl_test.cpp", -- Gitee