Source: findutils
Version: 4.6.0+git+20170606-2
Severity: important
Tags: patch, fixed-upstream
User: debian-h...@lists.debian.org
Usertags: hurd

Hi,

finditils currently does not build from source on GNU/Hurd since Debian
version 4.6.0+git+20161106-2. This is due to that 
HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER is not defined by configure and then 
assumes that the function pthread_rwlockattr_setkind_np()
is available. On GNU/Hurd it is not. The Hurd libpthread is built from
the sources in glibc/libpthread/*, not in glibc/nptl.

The problem is due to the gnulib version used in the findutils build.
The attached (modified) upstream gnulib patch fixes the build problems
by using the fallback implementation of rwlocks on systems without
PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP. This patch is a
modified version of the upstream gnulib patch:
gnulib.git-4084b3a1094372b960ce4a97634e08f4538c8bdd.patch
where the ChangeLog entry of the patch is slightly modified.

See more about posix-2008 pthread_rwlock_rdlock at
http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_rwlock_rdlock.html

This regression has already been fixed in upstream gnulib as written
above. This regression is a known issue for both grep (fixed already) and wget 
(#858995)

Thanks!
From 4084b3a1094372b960ce4a97634e08f4538c8bdd Mon Sep 17 00:00:00 2001
From: Bruno Haible <br...@clisp.org>
Date: Tue, 21 Feb 2017 17:07:27 +0100
Subject: [PATCH] lock tests: Fix build failure on GNU/Hurd (regression from
 2017-01-05).

Reported by Rene Saavedra <ren...@openmailbox.org> in
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=25821 via Paul Eggert.
* lib/glthread/lock.h: On glibc systems without
PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP, use the fallback
implementation of rwlocks.
* lib/glthread/lock.c: Likewise.
---
 ChangeLog           | 10 ++++++++++
 lib/glthread/lock.c |  2 +-
 lib/glthread/lock.h |  2 +-
 3 files changed, 12 insertions(+), 2 deletions(-)

Index: findutils-4.6.0+git+20170606/ChangeLog
===================================================================
--- findutils-4.6.0+git+20170606.orig/ChangeLog
+++ findutils-4.6.0+git+20170606/ChangeLog
@@ -54,6 +54,16 @@
 
 	Reported by Dan Jacobson <jida...@jidanni.org>.
 
+2017-02-21  Bruno Haible  <br...@clisp.org>
+
+	lock tests: Fix build failure on GNU/Hurd (regression from 2017-01-05).
+	Reported by Rene Saavedra <ren...@openmailbox.org> in
+	https://debbugs.gnu.org/cgi/bugreport.cgi?bug=25821 via Paul Eggert.
+	* lib/glthread/lock.h: On glibc systems without
+	PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP, use the fallback
+	implementation of rwlocks.
+	* lib/glthread/lock.c: Likewise.
+
 2017-02-20  Bernhard Voelker  <m...@bernhard-voelker.de>
 
 	find: fix -printf '%h' for arguments with one or more trailing slashes
Index: findutils-4.6.0+git+20170606/gl/lib/glthread/lock.c
===================================================================
--- findutils-4.6.0+git+20170606.orig/gl/lib/glthread/lock.c
+++ findutils-4.6.0+git+20170606/gl/lib/glthread/lock.c
@@ -30,7 +30,7 @@
 
 /* ------------------------- gl_rwlock_t datatype ------------------------- */
 
-# if HAVE_PTHREAD_RWLOCK && (HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER || (__GNU_LIBRARY__ > 1))
+# if HAVE_PTHREAD_RWLOCK && (HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER || (defined PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP && (__GNU_LIBRARY__ > 1)))
 
 #  ifdef PTHREAD_RWLOCK_INITIALIZER
 
Index: findutils-4.6.0+git+20170606/gl/lib/glthread/lock.h
===================================================================
--- findutils-4.6.0+git+20170606.orig/gl/lib/glthread/lock.h
+++ findutils-4.6.0+git+20170606/gl/lib/glthread/lock.h
@@ -179,7 +179,7 @@ typedef pthread_mutex_t gl_lock_t;
 
 /* ------------------------- gl_rwlock_t datatype ------------------------- */
 
-# if HAVE_PTHREAD_RWLOCK && (HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER || (__GNU_LIBRARY__ > 1))
+# if HAVE_PTHREAD_RWLOCK && (HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER || (defined PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP && (__GNU_LIBRARY__ > 1)))
 
 #  ifdef PTHREAD_RWLOCK_INITIALIZER
 

Reply via email to