From 5f7471e01f331a61f44798fccaa5730df4a22d1f Mon Sep 17 00:00:00 2001 From: Zhu Guodong Date: Tue, 23 May 2023 20:39:59 +0800 Subject: [PATCH] add secure option --- mindspore/lite/BUILD.gn | 5 +++++ mindspore/lite/mindir/BUILD.gn | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/mindspore/lite/BUILD.gn b/mindspore/lite/BUILD.gn index 12fd49bd..4d4af7f6 100644 --- a/mindspore/lite/BUILD.gn +++ b/mindspore/lite/BUILD.gn @@ -626,6 +626,7 @@ ohos_shared_library("mindspore_lib") { ":mindspore_api", ":disable_android", ":opencl_option", + ":secure_option", ] remove_configs = [ "//build/config/compiler:no_rtti" ] @@ -686,3 +687,7 @@ config("disable_android") { "-U__ANDROID_API__", ] } + +config("secure_option") { + cflags = [ "-fstack-protector-all" ] +} diff --git a/mindspore/lite/mindir/BUILD.gn b/mindspore/lite/mindir/BUILD.gn index e260a12f..2ab4f1bb 100644 --- a/mindspore/lite/mindir/BUILD.gn +++ b/mindspore/lite/mindir/BUILD.gn @@ -47,7 +47,10 @@ ohos_shared_library("mindir_lib") { "ipc:ipc_core", "bounds_checking_function:libsec_shared", ] - configs = ["../:disable_android"] + configs = [ + "../:disable_android", + "../:secure_option", + ] defines = [ "MS_COMPILE_OHOS" ] deps = [ "//drivers/interface/nnrt/v1_0:nnrt_idl_headers" ] output_name = "mindir" -- 2.34.1