package/stress-ng: fix non-NPTL build

Buildroot commit 2ce329692a bumped
stress-ng to version 0.19.06 which includes commit
15b26e33da

This commit breaks the build with non-NPTL toolchains.

Fixes:
https://autobuild.buildroot.net/results/d4f/d4fadef213455b1776d93e30e51ffe09fb1879c5/

Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
This commit is contained in:
Bernd Kuhls
2025-11-30 11:44:23 +01:00
committed by Peter Korsgaard
parent 92da94bf21
commit 363cfcb1a3

View File

@@ -0,0 +1,42 @@
From 73d1f5ed2167fca8a1cbfb85f4da123f00e524a1 Mon Sep 17 00:00:00 2001
From: Bernd Kuhls <bernd@kuhls.net>
Date: Sun, 30 Nov 2025 11:36:10 +0100
Subject: [PATCH] stress-pthread: fix non-NPTL build
https://github.com/ColinIanKing/stress-ng/commit/15b26e33daaf36acd5eeceaaf6fc954f46792a8b
added the usage of attr without using HAVE_PTHREAD_ATTR_SETSTACK for
toolchains without NPTL support.
This patch fixes build errors detected by buildroot autobuilders:
https://autobuild.buildroot.net/results/d4f/d4fadef213455b1776d93e30e51ffe09fb1879c5/build-end.log
stress-pthread.c: In function 'stress_pthread':
stress-pthread.c:567:81: error: 'attr' undeclared (first use in this function)
567 | pthreads[i].ret = pthread_create(&pthreads[i].pthread, &attr,
Upstream: https://github.com/ColinIanKing/stress-ng/pull/593
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
---
stress-pthread.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/stress-pthread.c b/stress-pthread.c
index aafcf0f0a..8605b7a1d 100644
--- a/stress-pthread.c
+++ b/stress-pthread.c
@@ -564,7 +564,11 @@ static int stress_pthread(stress_args_t *args)
pthreads[i].t_create = stress_time_now();
pthreads[i].t_run = pthreads[i].t_create;
+#if defined(HAVE_PTHREAD_ATTR_SETSTACK)
pthreads[i].ret = pthread_create(&pthreads[i].pthread, &attr,
+#else
+ pthreads[i].ret = pthread_create(&pthreads[i].pthread, NULL,
+#endif
stress_pthread_func, (void *)&pargs);
if (UNLIKELY(pthreads[i].ret)) {
/* Out of resources, don't try any more */
--
2.47.3