Skip to contentSkip to conversation

package/rng-tools: fix musl build

Buildroot Peter Korsgaard 1 participant 1 message Jan 25, 2022

lore
Share & tools
lore
#0 lore raw

commit: https://git.buildroot.net/buildroot/commit/?id=b30309847e307dee233d7cd8c57586f1ff50cad5
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/2021.11.x

Fix the following musl build failure raised since bump to version 6.14 in commit 5292d1cf9ad0605cc264fedc75c1b9a169aa183b:

/home/buildroot/autobuild/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/i586-buildroot-linux-musl/9.3.0/../../../../i586-buildroot-linux-musl/bin/ld: rngd-rngd_jitter.o: in function `rngd_notime_start':
rngd_jitter.c:(.text+0xdc2): undefined reference to `pthread_attr_setaffinity_np'

Fixes:
- http://autobuild.buildroot.org/results/3ec7df86856aa9bee2f18a8faa44fd58bc8a6657

(cherry picked from commit d94e2b6dd4f291a77bbfd06eabb7ce85c9bb6aa9)
---
 ...-detect-non-posix-extensions-for-pthreads.patch | 43 +++++++++++++++++++
 ...se-of-either-pthread-affinity-set-methods.patch | 49 ++++++++++++++++++++++
 2 files changed, 92 insertions(+)
package/rng-tools/0001-Adding-ability-to-detect-non-posix-extensions-for-pthreads.patch new file +43 -0
new file mode 100644
index 0000000000..ba6cf63d7c
@@ -0,0 +1,43 @@
+From d1840e54a15fc454936cada10cce7fd91d06232b Mon Sep 17 00:00:00 2001
+From: Neil Horman <[email protected]>
+Date: Thu, 15 Jul 2021 08:43:01 -0400
+Subject: [PATCH] Adding ability to detect non-posix extensions for pthreads
+
+Theres a desire to build rngd with musl, which doesn't have all the gnu
+extensions (but it has some).  So test for those.  Note, this requires
+the addition of the USE_EXTENSIONS macro to enable -d_GNU_SOURCE
+
+Signed-off-by: Neil Horman <[email protected]>
+
+[Retrieved from:
+https://github.com/nhorman/rng-tools/commit/d1840e54a15fc454936cada10cce7fd91d06232b]
+Signed-off-by: Fabrice Fontaine <[email protected]>
+---
+ configure.ac | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index 0fe06fc..de7dca3 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -25,6 +25,7 @@ AC_CANONICAL_TARGET dnl required for broken AX_PTHREAD
+ AM_INIT_AUTOMAKE([foreign])
+ AC_CONFIG_HEADERS([rng-tools-config.h])
+ AC_CONFIG_MACRO_DIRS([m4])
++AC_USE_SYSTEM_EXTENSIONS
+ 
+ dnl Parse options
+ 
+@@ -100,6 +101,12 @@ AS_IF(
+ 	], [AC_MSG_NOTICE([Disabling JITTER entropy source])]
+ )
+ 
++AC_CHECK_DECL(pthread_attr_setaffinity_np,
++		[AC_DEFINE([HAVE_PTHREAD_ATTR_SETAFFINITY], 1,[Set ATTR_SETAFFINITY])],
++		[ AC_CHECK_DECL(pthread_setaffinity_np,
++		   [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>]])
++		], [[#include <pthread.h>]])
++
+ AS_IF(
+ 	[ test "x$with_nistbeacon" != "xno"],
+ 	[
package/rng-tools/0002-Allow-for-use-of-either-pthread-affinity-set-methods.patch new file +49 -0

49 lines not on this page · raw message

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot