From 9f8f3c4b5f4e33033d2a0e03bfb08358067a7d58 Mon Sep 17 00:00:00 2001 From: Jakub Jirutka Date: Fri, 21 Jan 2022 01:46:24 +0100 Subject: testing/qalculate-gtk: obey compiler opt flag --- testing/qalculate-gtk/APKBUILD | 18 +++++++++-- testing/qalculate-gtk/dont-rewrite-Os-to-O2.patch | 39 +++++++++++++++++++++++ 2 files changed, 54 insertions(+), 3 deletions(-) create mode 100644 testing/qalculate-gtk/dont-rewrite-Os-to-O2.patch diff --git a/testing/qalculate-gtk/APKBUILD b/testing/qalculate-gtk/APKBUILD index a4bb4db6725..1cb4014e551 100644 --- a/testing/qalculate-gtk/APKBUILD +++ b/testing/qalculate-gtk/APKBUILD @@ -3,20 +3,31 @@ pkgname=qalculate-gtk # the pkgver must be kept in sync with: libqalculate pkgver=3.22.0 -pkgrel=0 +pkgrel=1 pkgdesc="Multi-purpose desktop calculator - GTK+ version" url="https://qalculate.github.io/" license="GPL-2.0-or-later" arch="all" makedepends=" + autoconf + automake glib-dev gtk+3.0-dev intltool libqalculate-dev=~${pkgver%.*} + libtool " subpackages="$pkgname-doc $pkgname-lang" -source="https://github.com/Qalculate/qalculate-gtk/releases/download/v$pkgver/qalculate-gtk-$pkgver.tar.gz" -options="!check" # no test suite +source="https://github.com/Qalculate/qalculate-gtk/releases/download/v$pkgver/qalculate-gtk-$pkgver.tar.gz + dont-rewrite-Os-to-O2.patch + " +options="!check" # no test suite + +prepare() { + default_prepare + + autoreconf -f +} build() { ./configure \ @@ -33,4 +44,5 @@ package() { sha512sums=" 029e0a5db69d04a1bfb796915ded3b4533f3036d99833035ae7e8b214f0b2086f6ecb1c08f463561642bdbbd0fd729250a9bc892bbac5ee0a72a9073d7555a04 qalculate-gtk-3.22.0.tar.gz +69ae01c2ed88e0ffc54783913412a830b1d60b06e512b0f1510f18174a29699d41001c9e94d81caa74ac62a3b1119c68b8188ea1ad928672a3ad056681204d07 dont-rewrite-Os-to-O2.patch " 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 00000000000..0c7016f17ec --- /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 +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 -- cgit v1.2.3