From 0fddf3bcf958cbd2fd45ecb5312781ba1f31ade6 Mon Sep 17 00:00:00 2001 From: mayujie Date: Sat, 29 Jul 2023 17:19:50 +0800 Subject: [PATCH] modify cfi issue Signed-off-by: mayujie --- services/bluetooth/external/BUILD.gn | 8 +++++--- services/bluetooth/hardware/BUILD.gn | 8 +++++--- services/bluetooth/ipc/BUILD.gn | 10 ++++++---- services/bluetooth/server/BUILD.gn | 10 ++++++---- services/bluetooth/service/BUILD.gn | 8 +++++--- services/bluetooth/stack/BUILD.gn | 10 ++++++---- 6 files changed, 33 insertions(+), 21 deletions(-) diff --git a/services/bluetooth/external/BUILD.gn b/services/bluetooth/external/BUILD.gn index 7b78d8dc..08b7b1cc 100644 --- a/services/bluetooth/external/BUILD.gn +++ b/services/bluetooth/external/BUILD.gn @@ -28,9 +28,11 @@ config("btdummy_public_config") { } ohos_shared_library("btdummy") { - # sanitize = { - # cfi = true - # } + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + } stack_protector_ret = true configs = [ ":btdummy_config" ] public_configs = [ ":btdummy_public_config" ] diff --git a/services/bluetooth/hardware/BUILD.gn b/services/bluetooth/hardware/BUILD.gn index e9e62b3c..ca8495bb 100644 --- a/services/bluetooth/hardware/BUILD.gn +++ b/services/bluetooth/hardware/BUILD.gn @@ -15,9 +15,11 @@ import("//build/ohos.gni") import("//drivers/hdf_core/adapter/uhdf2/uhdf.gni") ohos_shared_library("bluetooth_hdi_adapter") { - # sanitize = { - # cfi = true - # } + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + } stack_protector_ret = true include_dirs = [ "include", diff --git a/services/bluetooth/ipc/BUILD.gn b/services/bluetooth/ipc/BUILD.gn index 2758c0a0..bc3ab012 100644 --- a/services/bluetooth/ipc/BUILD.gn +++ b/services/bluetooth/ipc/BUILD.gn @@ -22,10 +22,12 @@ config("btipc_public_config") { } ohos_static_library("btipc_service") { - # sanitize = { - # cfi = true - # blocklist = "./ipc_blocklist.txt" - # } + sanitize = { + cfi = true + blocklist = "./ipc_blocklist.txt" + cfi_cross_dso = true + debug = false + } stack_protector_ret = true public_configs = [ ":btipc_public_config" ] include_dirs = [ diff --git a/services/bluetooth/server/BUILD.gn b/services/bluetooth/server/BUILD.gn index 95ca2e0b..6c579ea4 100644 --- a/services/bluetooth/server/BUILD.gn +++ b/services/bluetooth/server/BUILD.gn @@ -19,10 +19,12 @@ SUBSYSTEM_DIR = "//foundation/communication" BT_ROOT = "//foundation/communication/bluetooth_service/services/bluetooth" ohos_shared_library("bluetooth_server") { - # sanitize = { - # cfi = true - # blocklist = "./bluetooth_server_blocklist.txt" - # } + sanitize = { + cfi = true + blocklist = "./bluetooth_server_blocklist.txt" + cfi_cross_dso = true + debug = false + } stack_protector_ret = true include_dirs = [ "include", diff --git a/services/bluetooth/service/BUILD.gn b/services/bluetooth/service/BUILD.gn index b0d86e59..b07698ce 100644 --- a/services/bluetooth/service/BUILD.gn +++ b/services/bluetooth/service/BUILD.gn @@ -449,9 +449,11 @@ ohos_shared_library("btservice") { SBC_CODEC_DIR = "$BT_SERVICE_DIR/src/gavdp/a2dp_codec/sbclib" ohos_shared_library("btsbc") { - # sanitize = { - # cfi = true - # } + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + } stack_protector_ret = true sources = [ "$SBC_CODEC_DIR/src/sbc_decoder.cpp", diff --git a/services/bluetooth/stack/BUILD.gn b/services/bluetooth/stack/BUILD.gn index b58d5729..b057605c 100644 --- a/services/bluetooth/stack/BUILD.gn +++ b/services/bluetooth/stack/BUILD.gn @@ -212,10 +212,12 @@ config("btstack_config") { } ohos_shared_library("btstack") { - # sanitize = { - # cfi = true - # blocklist = "./btstack_blocklist.txt" - # } + sanitize = { + cfi = true + blocklist = "./btstack_blocklist.txt" + cfi_cross_dso = true + debug = false + } stack_protector_ret = true configs = [ ":btstack_config" ] public_configs = [ ":btstack_public_config" ] -- Gitee