aboutsummaryrefslogtreecommitdiffstats
path: root/testing/qalculate-gtk/dont-rewrite-Os-to-O2.patch
diff options
context:
space:
mode:
Diffstat (limited to 'testing/qalculate-gtk/dont-rewrite-Os-to-O2.patch')
-rw-r--r--testing/qalculate-gtk/dont-rewrite-Os-to-O2.patch39
1 files changed, 39 insertions, 0 deletions
diff --git a/testing/qalculate-gtk/dont-rewrite-Os-to-O2.patch b/testing/qalculate-gtk/dont-rewrite-Os-to-O2.patch
new file mode 100644
index 0000000000..0c7016f17e
--- /dev/null
+++ b/testing/qalculate-gtk/dont-rewrite-Os-to-O2.patch
@@ -0,0 +1,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