File: remove-_FORTIFY_SOURCE.patch

package info (click to toggle)
yubihsm-shell 2.7.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,008 kB
  • sloc: ansic: 41,745; sh: 2,030; cpp: 528; makefile: 18; xml: 16
file content (29 lines) | stat: -rw-r--r-- 1,095 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
29
From: Pushkar Kulkarni <pushkar.kulkarni@canonical.com>
Date: Mon, 2 Dec 2024 12:49:15 +0000
Subject: Remove redefinition of _FORTIFY_SOURCE

Starting with Ubuntu 24.04, _FORTIFY_SOURCE=3 is a default flag and is
known to provide better mitigation than _FORTIFY_SOURCE=2.  This patch
also removes the -O2 flag, since -O3 is now the default on Ubuntu.

On Debian, these are already passed via dpkg-buildflags.

Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/yubihsm-shell/+bug/2089705
Forwarded: not-needed
---
 cmake/SecurityFlags.cmake | 2 --
 1 file changed, 2 deletions(-)

diff --git a/cmake/SecurityFlags.cmake b/cmake/SecurityFlags.cmake
index 1743b07..5e2ed75 100644
--- a/cmake/SecurityFlags.cmake
+++ b/cmake/SecurityFlags.cmake
@@ -13,8 +13,6 @@ if (CMAKE_C_COMPILER_ID STREQUAL "Clang" OR
     add_compile_options (-fpie -fpic)
     if (NOT FUZZING)
         add_compile_options (-Wall -Wextra -Werror)
-        add_compile_options(-O2)
-        add_definitions (-D_FORTIFY_SOURCE=2)
     endif ()
 
     check_c_compiler_flag("-fstack-protector-all" HAVE_STACK_PROTECTOR_ALL)