1 Star 0 Fork 32

fantaotao1/gazelle

forked from src-openEuler/gazelle 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0062-enable-secure-compile-and-open-compile-log.patch 1.87 KB
一键复制 编辑 原始数据 按行查看 历史
From 2e36e8a3885563d12eac0e5cbed56ddaf1d28e27 Mon Sep 17 00:00:00 2001
From: jiangheng <jiangheng14@huawei.com>
Date: Thu, 14 Jul 2022 22:05:57 +0800
Subject: [PATCH 09/19] enable-secure-compile-and-open-compile-log
---
src/lstack/Makefile | 2 +-
src/ltran/CMakeLists.txt | 5 +++--
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/lstack/Makefile b/src/lstack/Makefile
index 8fc2435..98289d8 100644
--- a/src/lstack/Makefile
+++ b/src/lstack/Makefile
@@ -21,7 +21,7 @@ OPTIMIZATION = -O2 -g
RM = rm -f
LDFLAGS = -shared -ldl -lm -lpthread -lrt -lnuma -lconfig -lboundscheck
-SEC_FLAGS = -fstack-protector-strong -Werror -Wall -Wl,-z,relro,-z,now -Wl,-z,noexecstack -Wtrampolines -fPIC
+SEC_FLAGS = -fstack-protector-strong -Werror -Wall -Wl,-z,relro, -Wl,-z,now -Wl,-z,noexecstack -Wtrampolines -fPIC -D_FORTIFY_SOURCE=2
INC = -I$(LSTACK_DIR)/include \
-I$(LSTACK_DIR)/../common \
diff --git a/src/ltran/CMakeLists.txt b/src/ltran/CMakeLists.txt
index c21d88a..970bc1b 100644
--- a/src/ltran/CMakeLists.txt
+++ b/src/ltran/CMakeLists.txt
@@ -13,7 +13,8 @@ project(ltran)
set(COMMON_DIR ${PROJECT_SOURCE_DIR}/../common)
-set(CMAKE_C_FLAGS "-O2 -g -fstack-protector-strong -Wall -Werror -fPIE -pie -pthread")
+set(CMAKE_VERBOSE_MAKEFILE ON)
+set(CMAKE_C_FLAGS "-g -fstack-protector-strong -Wall -Werror -fPIE -pie -pthread -D_FORTIFY_SOURCE=2 -O2 -fPIC")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D LTRAN_COMPILE")
if($ENV{GAZELLE_COVERAGE_ENABLE})
@@ -57,4 +58,4 @@ set_target_properties(ltran PROPERTIES LINK_FLAGS "-L$ENV{DPDK_LIB_PATH} -Wl,--w
add_executable(gazellectl ltran_dfx.c ${COMMON_DIR}/gazelle_dfx_msg.c)
target_include_directories(gazellectl PRIVATE $ENV{DPDK_INCLUDE_FILE} ${COMMON_DIR})
-target_link_libraries(gazellectl PRIVATE boundscheck)
+target_link_libraries(gazellectl PRIVATE boundscheck -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack)
--
2.23.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/fantaotao1/gazelle.git
git@gitee.com:fantaotao1/gazelle.git
fantaotao1
gazelle
gazelle
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385