Browse Source

!67 fix securec compile options, build release version by default, instead of debug

Merge pull request !67 from yanghaoran/master
tags/v1.0.0
mindspore-ci-bot Gitee 4 years ago
parent
commit
63a27119bf
2 changed files with 5 additions and 6 deletions
  1. +1
    -1
      cmake/external_libs/securec.cmake
  2. +4
    -5
      third_party/patch/securec/securec.patch001

+ 1
- 1
cmake/external_libs/securec.cmake View File

@@ -4,7 +4,7 @@ graphengine_add_pkg(securec
MD5 0782dd2351fde6920d31a599b23d8c91
LIBS c_sec
PATCHES ${GE_SOURCE_DIR}/third_party/patch/securec/securec.patch001
CMAKE_OPTION " "
CMAKE_OPTION "-DCMAKE_BUILD_TYPE=Release"
)
include_directories(${securec_INC})
file(COPY ${securec_INC}/../lib/libc_sec.so DESTINATION ${CMAKE_SOURCE_DIR}/build/graphengine)

+ 4
- 5
third_party/patch/securec/securec.patch001 View File

@@ -1,12 +1,11 @@
diff -Npur bounds_checking_function/CMakeLists.txt securec/CMakeLists.txt
diff -Npur -x .git bounds_checking_function/CMakeLists.txt securec/CMakeLists.txt
--- bounds_checking_function/CMakeLists.txt 1970-01-01 08:00:00.000000000 +0800
+++ securec/CMakeLists.txt 2020-05-11 17:10:49.406735400 +0800
@@ -0,0 +1,19 @@
+++ securec/CMakeLists.txt 2020-09-19 16:53:48.689460700 +0800
@@ -0,0 +1,18 @@
+cmake_minimum_required(VERSION 3.14)
+project(Securec)
+set(CMAKE_BUILD_TYPE "Debug")
+set(CMAKE_C_FLAGS_DEBUG "$ENV{CFLAGS} -fPIC -O0 -Wall -Wno-deprecated-declarations -g2 -ggdb -fno-inline-functions -fno-omit-frame-pointer -D_LIBCPP_INLINE_VISIBILITY='' -D'_LIBCPP_EXTERN_TEMPLATE(...)='")
+set(CMAKE_C_FLAGS_RELEASE "$ENV{CFLAGS} -fPIC -O3 -Wall -Wno-deprecated-declarations")
+set(CMAKE_C_FLAGS_RELEASE "$ENV{CFLAGS} -fPIC -Wall -D_FORTIFY_SOURCE=2 -O2 -Wno-deprecated-declarations -fstack-protector-all -Wl,-z,relro,-z,now")
+set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
+
+#add flags


Loading…
Cancel
Save