diff --git a/frameworks/concurrent_task_client/BUILD.gn b/frameworks/concurrent_task_client/BUILD.gn index 296049b11396a6f1459ff1554ffe1da438eaa808..25358c3ed4b260ad5569d3f14ef8caf654e996ef 100644 --- a/frameworks/concurrent_task_client/BUILD.gn +++ b/frameworks/concurrent_task_client/BUILD.gn @@ -33,15 +33,23 @@ config("client_public_config") { ohos_shared_library("concurrent_task_client") { branch_protector_ret = "pac_ret" - sanitize = { - cfi = true - cfi_cross_dso = true - debug = false - } configs = [ ":client_private_config" ] public_configs = [ ":client_public_config" ] + cflags_cc = [ + "-fomit-frame-pointer", + "-fdata-sections", + "-ffunction-sections", + "-fno-unroll-loops", + "-fno-exceptions", + "-fno-unwind-tables", + "-fno-asynchronous-unwind-tables", + "-g0", + "-Os", + ] + + ldflags = [ "-Wl,--exclude-libs=ALL" ] sources = [ "src/concurrent_task_client.cpp", "src/concurrent_task_service_proxy.cpp", diff --git a/frameworks/native/BUILD.gn b/frameworks/native/BUILD.gn index 77ad594dad820ed3a6bbe38d71aac57856d27dbe..2c624189dca5884dcf2920a8cbd66d0816793183 100644 --- a/frameworks/native/BUILD.gn +++ b/frameworks/native/BUILD.gn @@ -16,12 +16,18 @@ import("//build/ohos/ndk/ndk.gni") ohos_shared_library("qos_ndk") { branch_protector_ret = "pac_ret" - sanitize = { - cfi = true - cfi_cross_dso = true - debug = false - } + cflags_cc = [ + "-fomit-frame-pointer", + "-fdata-sections", + "-ffunction-sections", + "-fno-unroll-loops", + "-fno-exceptions", + "-fno-unwind-tables", + "-fno-asynchronous-unwind-tables", + "-g0", + "-Os", + ] include_dirs = [ "../../interfaces/", "../../interfaces/kits/c/", diff --git a/qos/BUILD.gn b/qos/BUILD.gn index b6ee0666967b41582fd6f1eb98162c606b1f2b6c..8372df94d44e21143b4a26057dc2b1f7c8ad9685 100644 --- a/qos/BUILD.gn +++ b/qos/BUILD.gn @@ -24,12 +24,18 @@ config("qos_config") { ohos_shared_library("qos") { branch_protector_ret = "pac_ret" - sanitize = { - cfi = true - cfi_cross_dso = true - debug = false - } + cflags_cc = [ + "-fomit-frame-pointer", + "-fdata-sections", + "-ffunction-sections", + "-fno-unroll-loops", + "-fno-exceptions", + "-fno-unwind-tables", + "-fno-asynchronous-unwind-tables", + "-g0", + "-Os", + ] public_configs = [ ":qos_config" ] sources = [ "../services/src/qos_interface.cpp", diff --git a/services/BUILD.gn b/services/BUILD.gn index a1c05646cc64036fd4a5fabb39bc97fa64fd94f7..21036d9e62cc4617cf43c7bc4e38e736f100284a 100644 --- a/services/BUILD.gn +++ b/services/BUILD.gn @@ -35,8 +35,24 @@ ohos_shared_library("concurrentsvc") { sanitize = { cfi = true cfi_cross_dso = true + cfi_no_nvcall = true + cfi_vcall_ical_only = true debug = false } + + cflags_cc = [ + "-fomit-frame-pointer", + "-fdata-sections", + "-ffunction-sections", + "-fno-unroll-loops", + "-fno-exceptions", + "-fno-unwind-tables", + "-fno-asynchronous-unwind-tables", + "-g0", + "-Os", + ] + + ldflags = [ "-Wl,--exclude-libs=ALL" ] sources = [ "../common/src/config_reader.cpp", "src/concurrent_task_controller.cpp",