diff mbox series

[v2] libjitterentropy: upgrade 3.6.3 -> 3.7.0

Message ID 20261117024644.2849146-1-ragaprasanth@gmail.com
State New
Headers show
Series [v2] libjitterentropy: upgrade 3.6.3 -> 3.7.0 | expand

Commit Message

Prasanth R Nov. 17, 2026, 2:46 a.m. UTC
3.7.0 locks the collector memory with mlock(), changes the startup to
meet NTG.1, replaces the SHA3-256 output with XDRBG-256 and adds
jent_status(). LICENSE only changes the copyright year.

Two fixes are needed:

- 3.7.0 uses C11 threads on Linux and makes struct jent_notime_ctx
  private, so rng-tools fails to build. Backport the Linux part of the
  upstream fix.
- The Makefile now uses -std=c11, which hides clock_gettime() on arm,
  mips and riscv. Build with -D_DEFAULT_SOURCE.

This picks up Jaipaul Cheernam's earlier upgrade patch [1].

[1] https://patchwork.yoctoproject.org/project/oe-core/patch/20261002071557.74249-2-jaipaul.cheernam@est.tech/

AI-Generated: Uses Claude
Signed-off-by: Prasanth R <prasanth.r@lineo.co.jp>
---
v2:
- Picked up Jaipaul's upgrade; backport the rng-tools fix and build
  with -D_DEFAULT_SOURCE for arm, mips and riscv.

Tested:
- qemux86-64 and qemuarm: libjitterentropy with rng-tools.

 ...Linux-and-make-struct-jent_notime_ct.patch | 75 +++++++++++++++++++
 ...opy_3.6.3.bb => libjitterentropy_3.7.0.bb} | 13 +++-
 2 files changed, 85 insertions(+), 3 deletions(-)
 create mode 100644 meta/recipes-support/libjitterentropy/libjitterentropy/0001-Use-pthreads-on-Linux-and-make-struct-jent_notime_ct.patch
 rename meta/recipes-support/libjitterentropy/{libjitterentropy_3.6.3.bb => libjitterentropy_3.7.0.bb} (67%)

Comments

patchtest@automation.yoctoproject.org Nov. 17, 2026, 3:01 a.m. UTC | #1
Thank you for your submission. Patchtest identified one
or more issues with the patch. Please see the log below for
more information:

---
Testing patch /home/patchtest/share/mboxes/v2-libjitterentropy-upgrade-3.6.3---3.7.0.patch

FAIL: test lic files chksum modified not mentioned: LIC_FILES_CHKSUM changed without "License-Update:" tag and description in commit message (test_metadata.TestMetadata.test_lic_files_chksum_modified_not_mentioned)

PASS: pretest src uri left files (test_metadata.TestMetadata.pretest_src_uri_left_files)
PASS: test CVE check ignore (test_metadata.TestMetadata.test_cve_check_ignore)
PASS: test CVE tag format (test_patch.TestPatch.test_cve_tag_format)
PASS: test Signed-off-by presence (test_mbox.TestMbox.test_signed_off_by_presence)
PASS: test Signed-off-by presence (test_patch.TestPatch.test_signed_off_by_presence)
PASS: test Upstream-Status presence (test_patch.TestPatch.test_upstream_status_presence_format)
PASS: test auh changelog truncation notice (test_mbox.TestMbox.test_auh_changelog_truncation_notice)
PASS: test author valid (test_mbox.TestMbox.test_author_valid)
PASS: test commit message presence (test_mbox.TestMbox.test_commit_message_presence)
PASS: test commit message user tags (test_mbox.TestMbox.test_commit_message_user_tags)
PASS: test max line length (test_metadata.TestMetadata.test_max_line_length)
PASS: test mbox format (test_mbox.TestMbox.test_mbox_format)
PASS: test non-AUH upgrade (test_mbox.TestMbox.test_non_auh_upgrade)
PASS: test shortlog format (test_mbox.TestMbox.test_shortlog_format)
PASS: test shortlog length (test_mbox.TestMbox.test_shortlog_length)
PASS: test src uri left files (test_metadata.TestMetadata.test_src_uri_left_files)
PASS: test target mailing list (test_mbox.TestMbox.test_target_mailing_list)

SKIP: pretest pylint: No python related patches, skipping test (test_python_pylint.PyLint.pretest_pylint)
SKIP: test bugzilla entry format: No bug ID found (test_mbox.TestMbox.test_bugzilla_entry_format)
SKIP: test lic files chksum presence: No added recipes, skipping test (test_metadata.TestMetadata.test_lic_files_chksum_presence)
SKIP: test license presence: No added recipes, skipping test (test_metadata.TestMetadata.test_license_presence)
SKIP: test pylint: No python related patches, skipping test (test_python_pylint.PyLint.test_pylint)
SKIP: test series merge on head: Merge test is disabled for now (test_mbox.TestMbox.test_series_merge_on_head)
SKIP: test summary presence: No added recipes, skipping test (test_metadata.TestMetadata.test_summary_presence)

---

Please address the issues identified and
submit a new revision of the patch, or alternatively, reply to this
email with an explanation of why the patch should be accepted. If you
believe these results are due to an error in patchtest, please submit a
bug at https://bugzilla.yoctoproject.org/ (use the 'Patchtest' category
under 'Yocto Project Subprojects'). For more information on specific
failures, see: https://wiki.yoctoproject.org/wiki/Patchtest. Thank
you!
diff mbox series

Patch

diff --git a/meta/recipes-support/libjitterentropy/libjitterentropy/0001-Use-pthreads-on-Linux-and-make-struct-jent_notime_ct.patch b/meta/recipes-support/libjitterentropy/libjitterentropy/0001-Use-pthreads-on-Linux-and-make-struct-jent_notime_ct.patch
new file mode 100644
index 0000000000..6fd654fc37
--- /dev/null
+++ b/meta/recipes-support/libjitterentropy/libjitterentropy/0001-Use-pthreads-on-Linux-and-make-struct-jent_notime_ct.patch
@@ -0,0 +1,75 @@ 
+From 1bc2ca956d4c64b765c2f19751614949ebe3734d Mon Sep 17 00:00:00 2001
+From: Prasanth R <ragaprasanth@gmail.com>
+Date: Tue, 17 Nov 2026 10:12:23 +0900
+Subject: [PATCH] Use pthreads on Linux and make struct jent_notime_ctx public
+
+3.7.0 switched Linux to C11 <threads.h> and moved struct jent_notime_ctx
+out of jitterentropy.h. This breaks callers that install their own
+thread handler with jent_entropy_switch_notime_impl(), such as
+rng-tools: the start callback no longer takes a pthread start routine,
+and the context is an incomplete type.
+
+Use pthreads on Linux again and define the pthread context in the
+public header, as upstream did in commit a038d0c ("threads: always use
+pthreads on Linux, add a native Win32 backend"). Only the Linux part
+of that commit is taken.
+
+Upstream-Status: Backport [https://github.com/smuellerDD/jitterentropy-library/commit/a038d0c372f83aba10f3850c5b122dc5ff8cdc8c]
+Signed-off-by: Prasanth R <prasanth.r@lineo.co.jp>
+
+---
+ jitterentropy.h           | 15 ++++++++++++++-
+ src/jitterentropy-timer.c |  8 +-------
+ 2 files changed, 15 insertions(+), 8 deletions(-)
+
+diff --git a/jitterentropy.h b/jitterentropy.h
+index f935c09..3ab1ba3 100644
+--- a/jitterentropy.h
++++ b/jitterentropy.h
+@@ -154,10 +154,23 @@ extern "C" {
+ #endif
+ #endif
+ 
+-#if defined(__MINGW32__) || defined(__APPLE__) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
++#if defined(__MINGW32__) || defined(__APPLE__) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__linux__)
+ #define JENT_PTHREAD
+ #endif
+ 
++#ifdef JENT_PTHREAD
++#include <pthread.h>
++/*
++ * Context handed to the jent_notime_thread handlers. It is part of the API:
++ * a caller that installs its own handler with
++ * jent_entropy_switch_notime_impl() has to create and join the thread.
++ */
++struct jent_notime_ctx {
++	pthread_attr_t notime_pthread_attr;	/* pthreads library */
++	pthread_t notime_thread_id;		/* pthreads thread ID */
++};
++#endif
++
+ /* Forward declaration of opaque value */
+ struct rand_data;
+ 
+diff --git a/src/jitterentropy-timer.c b/src/jitterentropy-timer.c
+index 77f732e..2c974f5 100644
+--- a/src/jitterentropy-timer.c
++++ b/src/jitterentropy-timer.c
+@@ -24,13 +24,7 @@
+ /* Timer-less entropy source */
+ #ifdef JENT_CONF_ENABLE_INTERNAL_TIMER
+ 
+-#ifdef JENT_PTHREAD
+-#include <pthread.h>
+-struct jent_notime_ctx {
+-	pthread_attr_t notime_pthread_attr;     /* pthreads library */
+-	pthread_t notime_thread_id;             /* pthreads thread ID */
+-};
+-#else
++#ifndef JENT_PTHREAD
+ #include <threads.h>
+ struct jent_notime_ctx {
+ 	thrd_t notime_thread_id;                /* thread ID */
+-- 
+2.43.0
+
diff --git a/meta/recipes-support/libjitterentropy/libjitterentropy_3.6.3.bb b/meta/recipes-support/libjitterentropy/libjitterentropy_3.7.0.bb
similarity index 67%
rename from meta/recipes-support/libjitterentropy/libjitterentropy_3.6.3.bb
rename to meta/recipes-support/libjitterentropy/libjitterentropy_3.7.0.bb
index 27c87c1322..2186127b76 100644
--- a/meta/recipes-support/libjitterentropy/libjitterentropy_3.6.3.bb
+++ b/meta/recipes-support/libjitterentropy/libjitterentropy_3.7.0.bb
@@ -5,15 +5,22 @@  stamp. It is a small-scale, yet fast entropy source that is viable in almost \
 all environments and on a lot of CPU architectures."
 HOMEPAGE = "https://www.chronox.de/jent"
 LICENSE = "BSD-3-Clause OR GPL-2.0-only"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=e01027c4ad1fe5a4768f8488c945d491 \
+LIC_FILES_CHKSUM = "file://LICENSE;md5=fcaa2e2fa77c4ea22e45bf79e9a41093 \
                     file://LICENSE.gplv2;md5=eb723b61539feef013de476e68b5c50a \
                     file://LICENSE.bsd;md5=66a5cedaf62c4b2637025f049f9b826f \
                     "
-SRC_URI = "git://github.com/smuellerDD/jitterentropy-library.git;branch=master;protocol=https;tag=v${PV}"
-SRCREV = "c90ff465dcdb6a6949542c72a26a8ab496daa8cb"
+SRC_URI = "git://github.com/smuellerDD/jitterentropy-library.git;branch=master;protocol=https;tag=v${PV} \
+           file://0001-Use-pthreads-on-Linux-and-make-struct-jent_notime_ct.patch \
+           "
+SRCREV = "e783cf1c450bce4d72f95c9f9c84546a6094976a"
 
 do_configure[noexec] = "1"
 
+# The Makefile builds with -std=c11, which hides clock_gettime() on
+# targets without a cycle counter in jitterentropy-base-user.h (arm, mips,
+# riscv). Fixed upstream after 3.7.0.
+CFLAGS += "-D_DEFAULT_SOURCE"
+
 LDFLAGS += "-Wl,-O0"
 
 do_install () {