File: add-fortify-source-missing-flag.patch

package info (click to toggle)
pytango 10.1.4-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,304 kB
  • sloc: python: 27,795; cpp: 16,150; sql: 252; sh: 152; makefile: 43
file content (28 lines) | stat: -rw-r--r-- 771 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
From: =?utf-8?q?Santiago_Ruano_Rinc=C3=B3n?= <santiago@freexian.com>
Date: Sun, 8 Mar 2026 16:00:47 +0000
Subject: Make cmake adds a fortify source C++ flag

Last-Update: 2025-03-13
Bug: https://gitlab.com/tango-controls/pytango/-/issues/671

cmake doesn't understand debian's common way to export C/C++ flags, so let's
include the fortify source hardening flag manually.
---
 CMakeLists.txt | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index f8ad58e..ae7efef 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -13,6 +13,10 @@ project(
     LANGUAGES CXX
 )
 
+if(NOT WIN32)
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_FORTIFY_SOURCE=3")
+endif()
+
 include(cmake/project-is-top-level.cmake)
 
 # ---- Dependencies -------