• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1From 5f7471e01f331a61f44798fccaa5730df4a22d1f Mon Sep 17 00:00:00 2001
2From: Zhu Guodong <zhuguodong0001@163.com>
3Date: Tue, 23 May 2023 20:39:59 +0800
4Subject: [PATCH] add secure option
5
6---
7 mindspore/lite/BUILD.gn        | 5 +++++
8 mindspore/lite/mindir/BUILD.gn | 5 ++++-
9 2 files changed, 9 insertions(+), 1 deletion(-)
10
11diff --git a/mindspore/lite/BUILD.gn b/mindspore/lite/BUILD.gn
12index 12fd49bd..4d4af7f6 100644
13--- a/mindspore/lite/BUILD.gn
14+++ b/mindspore/lite/BUILD.gn
15@@ -626,6 +626,7 @@ ohos_shared_library("mindspore_lib") {
16     ":mindspore_api",
17     ":disable_android",
18     ":opencl_option",
19+    ":secure_option",
20   ]
21
22   remove_configs = [ "//build/config/compiler:no_rtti" ]
23@@ -686,3 +687,7 @@ config("disable_android") {
24     "-U__ANDROID_API__",
25   ]
26 }
27+
28+config("secure_option") {
29+  cflags = [ "-fstack-protector-all" ]
30+}
31diff --git a/mindspore/lite/mindir/BUILD.gn b/mindspore/lite/mindir/BUILD.gn
32index e260a12f..2ab4f1bb 100644
33--- a/mindspore/lite/mindir/BUILD.gn
34+++ b/mindspore/lite/mindir/BUILD.gn
35@@ -47,7 +47,10 @@ ohos_shared_library("mindir_lib") {
36     "ipc:ipc_core",
37     "bounds_checking_function:libsec_shared",
38   ]
39-  configs = ["../:disable_android"]
40+  configs = [
41+    "../:disable_android",
42+    "../:secure_option",
43+  ]
44   defines = [ "MS_COMPILE_OHOS" ]
45   deps = [ "//drivers/interface/nnrt/v1_0:nnrt_idl_headers" ]
46   output_name = "mindir"
47--
482.34.1
49
50