kumquat-buildroot/package/stress-ng/0001-stress-mmap-fix-build-with-HAVE_SYSCALL-or-__NR_mmap.patch
Julien Olivain 00553ea186 package/stress-ng: bump to version V0.15.04
This commit dropped the patch, included upstream in:
5d419c790e
which was included in V0.14.04.

Three patches are also introduced to fix build issues (all
upstream not but not yet in version).

Also, this new version now depends on BR2_TOOLCHAIN_HAS_SYNC_4.

Finally, a new _MAKE_FLAGS is introduced to prevent the package to
modify too much its CFLAGS.

For change log since V0.13.05, see:
- https://github.com/ColinIanKing/stress-ng/blob/V0.15.04/debian/changelog
or commit logs:
- https://github.com/ColinIanKing/stress-ng/commits/V0.15.04

Signed-off-by: Julien Olivain <ju.o@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2023-03-12 22:30:52 +01:00

55 lines
1.9 KiB
Diff

From 625dd7e458e6aa488f7dd4764e4a62b6fbf79a9d Mon Sep 17 00:00:00 2001
From: Julien Olivain <ju.o@free.fr>
Date: Thu, 23 Feb 2023 21:54:16 +0100
Subject: [PATCH] stress-mmap: fix build with HAVE_SYSCALL or __NR_mmap2 is
undefined
Commit afae500a added macro tests for defined(HAVE_SYSCALL) and
system call numbers.
More specifically, in stress-mmap.c, function mmap2_try() was defined
only if __NR_mmap2 is defined. See:
https://github.com/ColinIanKing/stress-ng/commit/afae500a23b198b9df421ad0fd9270fcdf65c3fb#diff-ffb0db2473f6c5e1b93dd33bce389ee836671a628fff9f903d097733f7ddfc9c
This commit forgot to replicate the same test when the mmap2_try()
function is used later at:
https://github.com/ColinIanKing/stress-ng/blob/50f3ef2560e928c4694894be0bb652e663af5076/stress-mmap.c#L754
When HAVE_SYSCALL or __NR_mmap2 is undefined, compilation fails with:
stress-mmap.c: In function 'stress_mmap':
stress-mmap.c:809:31: error: 'mmap2_try' undeclared (first use in this function); did you mean 'mmap_prot'?
context.mmap = (mmap_func_t)mmap2_try;
^~~~~~~~~
mmap_prot
stress-mmap.c:809:31: note: each undeclared identifier is reported only once for each function it appears in
This patch fixes this issue.
Upstream-reference:
https://github.com/ColinIanKing/stress-ng/commit/3da49180fdfa8a70307569202ed9431f5295913e
Signed-off-by: Julien Olivain <ju.o@free.fr>
---
stress-mmap.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/stress-mmap.c b/stress-mmap.c
index cf343078..68f5a9b8 100644
--- a/stress-mmap.c
+++ b/stress-mmap.c
@@ -805,7 +805,9 @@ static int stress_mmap(const stress_args_t *args)
context.mmap_file = true;
if (mmap_mmap2) {
-#if defined(HAVE_MMAP2)
+#if defined(HAVE_MMAP2) && \
+ defined(HAVE_SYSCALL) && \
+ defined(__NR_mmap2)
context.mmap = (mmap_func_t)mmap2_try;
#else
if (args->instance == 0)
--
2.39.2