aboutsummaryrefslogtreecommitdiffstats
path: root/testing/qalculate-gtk/dont-rewrite-Os-to-O2.patch
blob: 0c7016f17ec550b0f7bbcda0939339bbc75121f9 (plain) (blame)
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
30
31
32
33
34
35
36
37
38
39
Patch-Source: https://github.com/Qalculate/qalculate-gtk/pull/350
From 50c1278b3b81a34a611a0077f3a5a6ee07e90d98 Mon Sep 17 00:00:00 2001
From: Jakub Jirutka <jakub@jirutka.cz>
Date: Fri, 21 Jan 2022 01:40:06 +0100
Subject: [PATCH] Do not rewrite -Os to -O2

It doesn't segfault when compiled with -Os (gcc 11.2.1), and if it
does, that means you have an undefined behaviour here which may result
in security vulnerability.
---
 configure.ac | 15 ---------------
 1 file changed, 15 deletions(-)

diff --git a/configure.ac b/configure.ac
index 0f7e3bc..1883bd1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -29,21 +29,6 @@ dnl  ------------------------------------
 dnl | check for compiler characteristics |-------------------------------------
 dnl  ------------------------------------
 
-dnl Replace -Os with -O2 to stop segfault on startup
-if test "x$GCC" = "xyes"; then
-	case $CFLAGS in
-	*-Os*)
-		CFLAGS="$CFLAGS -O2"
-		;;
-	esac
-	case $CXXFLAGS in
-	*-Os*)
-		CXXFLAGS="$CXXFLAGS -O2"
-		;;
-	esac
-fi
-
-
 dnl Use -Wall if we have gcc.
 changequote(,)dnl
 if test "x$GCC" = "xyes"; then