From 99280a207fb1af5f885662542638690e9f14fe37 Mon Sep 17 00:00:00 2001
From: zhangxiaoyu <zhangxiaoyu58@huawei.com>
Date: Mon, 29 Nov 2021 11:26:43 +0800
Subject: [PATCH 1/2] add secure compile option in Makefile

Signed-off-by: zhangxiaoyu <zhangxiaoyu58@huawei.com>
---
 CMakeLists.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6e428af8..2eb897db 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -451,6 +451,7 @@ if (NOT CMAKE_MODULE_PATH)
 endif()
 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake/")
 
+set(CMAKE_C_FLAGS "-Wl,-z,now -fPIC -fstack-protector-all -D_FORTIFY_SOURCE=2 -O2 -Wall -rdynamic ${CMAKE_C_FLAGS}")
 
 if (CMAKE_TOOLCHAIN_FILE)
 	message(STATUS "CMAKE_TOOLCHAIN_FILE='${CMAKE_TOOLCHAIN_FILE}'")
-- 
2.25.1

