summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kanavin <alex.kanavin@gmail.com>2021-08-22 14:51:02 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-08-23 08:25:53 +0100
commit70cf1cf5e55236394131d4160c18088c869f3b6a (patch)
tree0cee624c747f81a379297d2f58d02c7c15e08ae8
parentfd6760fb5f2b6e11bdab97102a4e1faf7d2aa5df (diff)
downloadpoky-70cf1cf5e55236394131d4160c18088c869f3b6a.tar.gz
rng-tools: upgrade 6.13 -> 6.14
(From OE-Core rev: 28b3d8c01966d16f8ab8d61beaf9527f987f1ec6) Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-support/rng-tools/rng-tools/0001-Adding-ability-to-detect-non-posix-extensions-for-pt.patch41
-rw-r--r--meta/recipes-support/rng-tools/rng-tools/0002-Allow-for-use-of-either-pthread-affinity-set-methods.patch47
-rw-r--r--meta/recipes-support/rng-tools/rng-tools_6.14.bb (renamed from meta/recipes-support/rng-tools/rng-tools_6.13.bb)15
3 files changed, 96 insertions, 7 deletions
diff --git a/meta/recipes-support/rng-tools/rng-tools/0001-Adding-ability-to-detect-non-posix-extensions-for-pt.patch b/meta/recipes-support/rng-tools/rng-tools/0001-Adding-ability-to-detect-non-posix-extensions-for-pt.patch
new file mode 100644
index 0000000000..89edc4c403
--- /dev/null
+++ b/meta/recipes-support/rng-tools/rng-tools/0001-Adding-ability-to-detect-non-posix-extensions-for-pt.patch
@@ -0,0 +1,41 @@
1From 66e6adc138eef1367d7492fb79ae4da84ed62934 Mon Sep 17 00:00:00 2001
2From: Neil Horman <nhorman@gmail.com>
3Date: Thu, 15 Jul 2021 08:43:01 -0400
4Subject: [PATCH] Adding ability to detect non-posix extensions for pthreads
5
6Theres a desire to build rngd with musl, which doesn't have all the gnu
7extensions (but it has some). So test for those. Note, this requires
8the addition of the USE_EXTENSIONS macro to enable -d_GNU_SOURCE
9
10Upstream-Status: Backport
11Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
12Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
13---
14 configure.ac | 7 +++++++
15 1 file changed, 7 insertions(+)
16
17diff --git a/configure.ac b/configure.ac
18index 9df633d..d0c2179 100644
19--- a/configure.ac
20+++ b/configure.ac
21@@ -25,6 +25,7 @@ AC_CANONICAL_TARGET dnl required for broken AX_PTHREAD
22 AM_INIT_AUTOMAKE([foreign])
23 AC_CONFIG_HEADERS([rng-tools-config.h])
24 AC_CONFIG_MACRO_DIRS([m4])
25+AC_USE_SYSTEM_EXTENSIONS
26
27 dnl Parse options
28
29@@ -100,6 +101,12 @@ AS_IF(
30 ], [AC_MSG_NOTICE([Disabling JITTER entropy source])]
31 )
32
33+AC_CHECK_DECL(pthread_attr_setaffinity_np,
34+ [AC_DEFINE([HAVE_PTHREAD_ATTR_SETAFFINITY], 1,[Set ATTR_SETAFFINITY])],
35+ [ AC_CHECK_DECL(pthread_setaffinity_np,
36+ [AC_DEFINE([HAVE_PTHREAD_SETAFFINITY],1, [Set PTHREAD_SETAFFINITY])], [ AC_MSG_ERROR([Neither pthread_setaffinity_np nor pthread_attr_setaffinity_np found])],[[#include <pthread.h>]])
37+ ], [[#include <pthread.h>]])
38+
39 AS_IF(
40 [ test "x$with_nistbeacon" != "xno"],
41 [
diff --git a/meta/recipes-support/rng-tools/rng-tools/0002-Allow-for-use-of-either-pthread-affinity-set-methods.patch b/meta/recipes-support/rng-tools/rng-tools/0002-Allow-for-use-of-either-pthread-affinity-set-methods.patch
new file mode 100644
index 0000000000..f7470d04bf
--- /dev/null
+++ b/meta/recipes-support/rng-tools/rng-tools/0002-Allow-for-use-of-either-pthread-affinity-set-methods.patch
@@ -0,0 +1,47 @@
1From e4909f329245db52415102e96fc7c99ca1445d05 Mon Sep 17 00:00:00 2001
2From: Neil Horman <nhorman@gmail.com>
3Date: Thu, 15 Jul 2021 08:48:10 -0400
4Subject: [PATCH] Allow for use of either pthread affinity set methods
5
6musl has support for pthread_setaffinity_np, but not
7pthread_attr_setaffinity_np. so check for hte existence of either
8function in configure, and use the appropriate one.
9
10Upstream-Status: Backport
11Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
12Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
13---
14 rngd_jitter.c | 15 ++++++++++++++-
15 1 file changed, 14 insertions(+), 1 deletion(-)
16
17diff --git a/rngd_jitter.c b/rngd_jitter.c
18index ea29436..5c7e09e 100644
19--- a/rngd_jitter.c
20+++ b/rngd_jitter.c
21@@ -67,12 +67,25 @@ static int rngd_notime_start(void *ctx,
22 for(i=i-1;i>=0;i--) {
23 CPU_SET(i,cpus);
24 }
25- pthread_attr_setaffinity_np(&thread_ctx->notime_pthread_attr, cpusize, cpus);
26
27+ /*
28+ * Note that only one of:
29+ * HAVE_PTHREAD_ATTR_SETAFFINITY
30+ * and
31+ * HAVE_PTHREAD_SETAFFINITY
32+ * Will ever be set, as per the configure.ac logic
33+ */
34+#ifdef HAVE_PTHREAD_ATTR_SETAFFINITY
35+ pthread_attr_setaffinity_np(&thread_ctx->notime_pthread_attr, cpusize, cpus);
36+#endif
37 ret = -pthread_create(&thread_ctx->notime_thread_id,
38 &thread_ctx->notime_pthread_attr,
39 start_routine, arg);
40
41+#ifdef HAVE_PTHREAD_SETAFFINITY
42+ pthread_setaffinity_np(&thread_ctx->notime_thread_id, cpusize, cpus);
43+#endif
44+
45 CPU_FREE(cpus);
46 return ret;
47 }
diff --git a/meta/recipes-support/rng-tools/rng-tools_6.13.bb b/meta/recipes-support/rng-tools/rng-tools_6.14.bb
index 84dbc76855..6b79a3b040 100644
--- a/meta/recipes-support/rng-tools/rng-tools_6.13.bb
+++ b/meta/recipes-support/rng-tools/rng-tools_6.14.bb
@@ -8,13 +8,14 @@ LICENSE = "GPLv2"
8LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" 8LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
9DEPENDS = "sysfsutils openssl" 9DEPENDS = "sysfsutils openssl"
10 10
11SRC_URI = "\ 11SRC_URI = "git://github.com/nhorman/rng-tools.git \
12 git://github.com/nhorman/rng-tools.git \ 12 file://init \
13 file://init \ 13 file://default \
14 file://default \ 14 file://rngd.service \
15 file://rngd.service \ 15 file://0001-Adding-ability-to-detect-non-posix-extensions-for-pt.patch \
16" 16 file://0002-Allow-for-use-of-either-pthread-affinity-set-methods.patch \
17SRCREV = "d8dac0e8bede73e42b3d59f3b48c662ad0032e8c" 17 "
18SRCREV = "c16176d3800b91f4d016b66733b384493b06f294"
18 19
19S = "${WORKDIR}/git" 20S = "${WORKDIR}/git"
20 21