Buildroot Archive mirror
 help / color / mirror / Atom feed
From: Peter Korsgaard <peter@korsgaard.com>
To: buildroot@buildroot.org
Subject: [Buildroot] [git commit] package/libnpth: fix gnupg2 build with uclibc
Date: Wed, 15 May 2024 08:13:08 +0200	[thread overview]
Message-ID: <20240515061605.D60268715C@busybox.osuosl.org> (raw)

commit: https://git.buildroot.net/buildroot/commit/?id=ad64ddd4f306eb787ce98263148a91b3386be570
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master

Fix the following build failure of gnupg2 raised since bump to version
1.7 in commit 3ef4d24192b20bd1eb5e34c9fa2a6aa5bde91f91 and
https://git.gnupg.org/cgi-bin/gitweb.cgi?p=npth.git;a=commitdiff;h=02ce6b2d27f91ed6285e4e92d99c21bcc7823c9b:

/home/autobuild/autobuild/instance-2/output-1/host/lib/gcc/armeb-buildroot-linux-uclibcgnueabi/13.2.0/../../../../armeb-buildroot-linux-uclibcgnueabi/bin/ld: /home/autobuild/autobuild/instance-2/output-1/host/bin/../armeb-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/libnpth.so: undefined reference to `busy_wait_for'

Fixes: 3ef4d24192b20bd1eb5e34c9fa2a6aa5bde91f91
 - http://autobuild.buildroot.org/results/9a27ffde79598a39b4fd55c716978d32d0beb924

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
 ...-npth_rwlock_timedrdlock-is-not-supported.patch | 51 ++++++++++++++++++++++
 package/libnpth/0003-Fix-previous-commit.patch     | 39 +++++++++++++++++
 2 files changed, 90 insertions(+)

diff --git a/package/libnpth/0002-Return-a-run-time-error-if-npth_rwlock_timedrdlock-is-not-supported.patch b/package/libnpth/0002-Return-a-run-time-error-if-npth_rwlock_timedrdlock-is-not-supported.patch
new file mode 100644
index 0000000000..0d9b38e4ce
--- /dev/null
+++ b/package/libnpth/0002-Return-a-run-time-error-if-npth_rwlock_timedrdlock-is-not-supported.patch
@@ -0,0 +1,51 @@
+From 01f03a91c9bd63910995aeef412beb3ca6dc9a67 Mon Sep 17 00:00:00 2001
+From: NIIBE Yutaka <gniibe@fsij.org>
+Date: Tue, 7 May 2024 13:45:47 +0900
+Subject: [PATCH] Return a run-time error if npth_rwlock_timedrdlock is not
+ supported.
+
+* src/npth.c (npth_rwlock_timedrdlock): Return ENOSYS if not
+supported.
+(npth_rwlock_timedwrlock): Use HAVE_PTHREAD_RWLOCK_TRYWRLOCK.
+
+--
+
+GnuPG-bug-id: 7109
+Fixed-commit: 363c370bd35dd0bb4e5636b2d4f06ea88c658794
+Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
+
+Upstream: https://git.gnupg.org/cgi-bin/gitweb.cgi?p=npth.git;a=commit;h=01f03a91c9bd63910995aeef412beb3ca6dc9a67
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+---
+ src/npth.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/src/npth.c b/src/npth.c
+index c0ff8da..f02540c 100644
+--- a/src/npth.c
++++ b/src/npth.c
+@@ -488,9 +488,11 @@ npth_rwlock_timedrdlock (npth_rwlock_t *rwlock, const struct timespec *abstime)
+   ENTER();
+ #if HAVE_PTHREAD_RWLOCK_TIMEDRDLOCK
+   err = pthread_rwlock_timedrdlock (rwlock, abstime);
+-#else
++#elif HAVE_PTHREAD_RWLOCK_TRYRDLOCK
+   err = busy_wait_for ((trylock_func_t) pthread_rwlock_tryrdlock, rwlock,
+ 		       abstime);
++#else
++  err = ENOSYS;
+ #endif
+   LEAVE();
+   return err;
+@@ -533,7 +535,7 @@ npth_rwlock_timedwrlock (npth_rwlock_t *rwlock, const struct timespec *abstime)
+   ENTER();
+ #if HAVE_PTHREAD_RWLOCK_TIMEDWRLOCK
+   err = pthread_rwlock_timedwrlock (rwlock, abstime);
+-#elif HAVE_PTHREAD_RWLOCK_TRYRDLOCK
++#elif HAVE_PTHREAD_RWLOCK_TRYWRLOCK
+   err = busy_wait_for ((trylock_func_t) pthread_rwlock_trywrlock, rwlock,
+ 		       abstime);
+ #else
+-- 
+2.30.2
+
diff --git a/package/libnpth/0003-Fix-previous-commit.patch b/package/libnpth/0003-Fix-previous-commit.patch
new file mode 100644
index 0000000000..5f3ce06bf6
--- /dev/null
+++ b/package/libnpth/0003-Fix-previous-commit.patch
@@ -0,0 +1,39 @@
+From 75c68399ef3bbb5d024f2a60474a7214fa479016 Mon Sep 17 00:00:00 2001
+From: NIIBE Yutaka <gniibe@fsij.org>
+Date: Mon, 13 May 2024 11:13:23 +0900
+Subject: [PATCH] Fix previous commit.
+
+Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
+
+Upstream: https://git.gnupg.org/cgi-bin/gitweb.cgi?p=npth.git;a=commit;h=75c68399ef3bbb5d024f2a60474a7214fa479016
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+---
+ src/npth.c | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+diff --git a/src/npth.c b/src/npth.c
+index f02540c..8dced17 100644
+--- a/src/npth.c
++++ b/src/npth.c
+@@ -178,6 +178,18 @@ static int initialized_or_any_threads;
+ typedef int (*trylock_func_t) (void *);
+ 
+ #ifndef HAVE_PTHREAD_MUTEX_TIMEDLOCK
++#define REQUIRE_THE_BUSY_WAIT_FOR_IMPLEMENTATION 1
++#endif
++
++#if !HAVE_PTHREAD_RWLOCK_TIMEDRDLOCK && HAVE_PTHREAD_RWLOCK_TRYRDLOCK
++#define REQUIRE_THE_BUSY_WAIT_FOR_IMPLEMENTATION 1
++#endif
++
++#if !HAVE_PTHREAD_RWLOCK_TIMEDWRLOCK && HAVE_PTHREAD_RWLOCK_TRYWRLOCK
++#define REQUIRE_THE_BUSY_WAIT_FOR_IMPLEMENTATION 1
++#endif
++
++#if REQUIRE_THE_BUSY_WAIT_FOR_IMPLEMENTATION
+ static int
+ busy_wait_for (trylock_func_t trylock, void *lock,
+ 	       const struct timespec *abstime)
+-- 
+2.30.2
+
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

                 reply	other threads:[~2024-05-15  6:16 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240515061605.D60268715C@busybox.osuosl.org \
    --to=peter@korsgaard.com \
    --cc=buildroot@buildroot.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).