From b6eb0ae7ddc098e69f4d5e2f005996f182f8392a Mon Sep 17 00:00:00 2001 From: wangyongzhong2 Date: Thu, 14 Sep 2023 20:51:05 +0800 Subject: [PATCH] add cfi config Signed-off-by: wangyongzhong2 --- common/BUILD.gn | 9 +++++++++ frameworks/BUILD.gn | 3 ++- frameworks/js/napi/crypto/BUILD.gn | 5 +++-- plugin/BUILD.gn | 3 ++- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/common/BUILD.gn b/common/BUILD.gn index 39cb861..8bd102d 100644 --- a/common/BUILD.gn +++ b/common/BUILD.gn @@ -25,6 +25,15 @@ ohos_static_library("crypto_plugin_common") { sources = crypto_framwork_common_files + if (os_level == "standard") { + sanitize = { + cfi = true + cfi_cross_dso = true + debug = true + blocklist = "//base/security/crypto_framework/cfi_blocklist.txt" + } + } + defines = [ "HILOG_ENABLE" ] cflags = [ "-DHILOG_ENABLE", diff --git a/frameworks/BUILD.gn b/frameworks/BUILD.gn index 3d7acb9..9f54cf9 100644 --- a/frameworks/BUILD.gn +++ b/frameworks/BUILD.gn @@ -40,7 +40,8 @@ ohos_shared_library("crypto_framework_lib") { if (os_level == "standard") { sanitize = { cfi = true - debug = false + cfi_cross_dso = true + debug = true blocklist = "//base/security/crypto_framework/cfi_blocklist.txt" } } diff --git a/frameworks/js/napi/crypto/BUILD.gn b/frameworks/js/napi/crypto/BUILD.gn index 1ea4d3e..adafb1e 100644 --- a/frameworks/js/napi/crypto/BUILD.gn +++ b/frameworks/js/napi/crypto/BUILD.gn @@ -9,7 +9,7 @@ # 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. +# limitations under the License. import("//base/security/crypto_framework/common/common.gni") import("//base/security/crypto_framework/frameworks/frameworks.gni") @@ -30,7 +30,8 @@ ohos_shared_library("cryptoframework_napi") { if (os_level == "standard") { sanitize = { cfi = true - debug = false + cfi_cross_dso = true + debug = true blocklist = "//base/security/crypto_framework/cfi_blocklist.txt" } } diff --git a/plugin/BUILD.gn b/plugin/BUILD.gn index d6979b5..ba25eaf 100644 --- a/plugin/BUILD.gn +++ b/plugin/BUILD.gn @@ -41,7 +41,8 @@ ohos_shared_library("crypto_openssl_plugin_lib") { if (os_level == "standard") { sanitize = { cfi = true - debug = false + cfi_cross_dso = true + debug = true } } -- Gitee