summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConrad Kostecki <conikost@gentoo.org>2023-06-05 13:03:32 +0200
committerConrad Kostecki <conikost@gentoo.org>2023-06-05 13:04:30 +0200
commitcc7c8229481e752e3a79095931f0823f04ad7e14 (patch)
treea4649de466f8584f575a6217920f5a2bb1c36510 /app-benchmarks
parentsys-apps/smc-sum: fix build without module (diff)
downloadgentoo-cc7c8229481e752e3a79095931f0823f04ad7e14.tar.gz
gentoo-cc7c8229481e752e3a79095931f0823f04ad7e14.tar.bz2
gentoo-cc7c8229481e752e3a79095931f0823f04ad7e14.zip
app-benchmarks/stress-ng: dont redefine fortify source
Closes: https://bugs.gentoo.org/906005 Signed-off-by: Conrad Kostecki <conikost@gentoo.org>
Diffstat (limited to 'app-benchmarks')
-rw-r--r--app-benchmarks/stress-ng/files/stress-ng-0.15.08-fortify-source.patch29
-rw-r--r--app-benchmarks/stress-ng/stress-ng-0.15.08-r1.ebuild (renamed from app-benchmarks/stress-ng/stress-ng-0.15.08.ebuild)2
2 files changed, 31 insertions, 0 deletions
diff --git a/app-benchmarks/stress-ng/files/stress-ng-0.15.08-fortify-source.patch b/app-benchmarks/stress-ng/files/stress-ng-0.15.08-fortify-source.patch
new file mode 100644
index 000000000000..7b8a75c44766
--- /dev/null
+++ b/app-benchmarks/stress-ng/files/stress-ng-0.15.08-fortify-source.patch
@@ -0,0 +1,29 @@
+From 967f8f4ff467e7d15b7cdf12f3e2f786e5e19375 Mon Sep 17 00:00:00 2001
+From: Colin Ian King <colin.i.king@gmail.com>
+Date: Wed, 31 May 2023 20:15:54 +0100
+Subject: [PATCH] Makefile: always undefine _FORTIFY_SOURCE before defining it
+
+Gentoo seems to define _FORTIFY_SOURCE in the build environment for
+some specific build options and we end up with duplicated define
+warnings. Undefine it before defining it.
+
+Closes https://github.com/ColinIanKing/stress-ng/issues/291
+
+Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index e08d60ea..693010e1 100644
+--- a/Makefile
++++ b/Makefile
+@@ -59,7 +59,7 @@ CFLAGS += -Werror=format-security
+ endif
+ ifneq ($(findstring pcc,$(CC)),pcc)
+ ifeq ($(shell $(CC) $(CFLAGS) -D_FORTIFY_SOURCE=2 -E -xc /dev/null > /dev/null 2>& 1 && echo 1),1)
+-CFLAGS += -D_FORTIFY_SOURCE=2
++CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
+ endif
+ endif
+ endif
diff --git a/app-benchmarks/stress-ng/stress-ng-0.15.08.ebuild b/app-benchmarks/stress-ng/stress-ng-0.15.08-r1.ebuild
index 12a6f5017085..28539472ec24 100644
--- a/app-benchmarks/stress-ng/stress-ng-0.15.08.ebuild
+++ b/app-benchmarks/stress-ng/stress-ng-0.15.08-r1.ebuild
@@ -34,6 +34,8 @@ RDEPEND="${DEPEND}"
DOCS=( "README.md" "README.Android" "TODO" "syscalls.txt" )
+PATCHES=( "${FILESDIR}/${PN}-0.15.08-fortify-source.patch" )
+
pkg_pretend() {
if use apparmor; then
CONFIG_CHECK="SECURITY_APPARMOR"