diff --git a/frameworks/concurrent_task_client/BUILD.gn b/frameworks/concurrent_task_client/BUILD.gn index 296049b11396a6f1459ff1554ffe1da438eaa808..42733cda8433e103140bf0eba3412ad59827da15 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..4a492fcdf046cfffee097fa613a195d276288300 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..0a2cc86bc03cbcdc7c2a9dbe374667207e40689e 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..9b1c7e5f4bea89146eada3d3c386ad8f99c5a049 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",