summaryrefslogtreecommitdiff
path: root/0001-add-secure-compile-option.patch
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2025-09-22 11:37:06 +0000
committerCoprDistGit <infra@openeuler.org>2025-09-22 11:37:06 +0000
commitb4569749c080c40468b3d6495165389b02ca2280 (patch)
treebb44e21e2f8c6f4a0add0a9e4331f94b9b174719 /0001-add-secure-compile-option.patch
parentb8be8a0933f0f46ed3216a88793bf05c6cb2b023 (diff)
automatic import of protobuf
Diffstat (limited to '0001-add-secure-compile-option.patch')
-rw-r--r--0001-add-secure-compile-option.patch27
1 files changed, 27 insertions, 0 deletions
diff --git a/0001-add-secure-compile-option.patch b/0001-add-secure-compile-option.patch
new file mode 100644
index 0000000..0594f0e
--- /dev/null
+++ b/0001-add-secure-compile-option.patch
@@ -0,0 +1,27 @@
+From 4cf6dc9f628fc2c5b3478d70e15d4fab8a32ae86 Mon Sep 17 00:00:00 2001
+From: zhongtao <zhongtao17@huawei.com>
+Date: Wed, 10 Apr 2024 11:43:51 +0800
+Subject: [PATCH] add secure compile option
+
+Signed-off-by: zhongtao <zhongtao17@huawei.com>
+---
+ CMakeLists.txt | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 4137ce2..d17f09d 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -2,6 +2,9 @@
+ # to 3.26.
+ cmake_minimum_required(VERSION 3.10...3.26)
+
++set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-z,now -fstack-check -fPIE")
++set(CMAKE_EXE_LINKER_FLAGS "-pie")
++
+ # Revert to old behavior for MSVC debug symbols.
+ if(POLICY CMP0141)
+ cmake_policy(SET CMP0141 OLD)
+--
+2.25.1
+