Discussion:
bug#25821: grep-3.0 FAILS on Make phase
(too old to reply)
Paul Eggert
2017-02-21 00:35:23 UTC
Permalink
Raw Message
Thanks for the bug report <https://bugs.gnu.org/25821>. I'm forwarding this to
bug-gnulib, as it is apparently a bug in the Gnulib lock module's implementation
on the Hurd.

This bug does not affect grep per se, as it's a Gnulib test-harness bug and not
a Grep bug. I'm therefore closing the Grep bug report.
I´m trying to build 'grep' version 3.0 on Hurd system through Guix package
/-------------------------------------------------------------/
CC localcharset.o
CC glthread/lock.o
glthread/lock.c:53:3: warning: implicit declaration of function
'pthread_rwlockattr_setkind_np' [-Wimplicit-function-declaration]
err = pthread_rwlockattr_setkind_np (&attributes,
^
glthread/lock.c:54:40: error: 'PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP'
undeclared (first use in this function)
PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP);
^
glthread/lock.c:54:40: note: each undeclared identifier is reported only once
for each function it appears in
Makefile:1711: recipe for target 'glthread/lock.o' failed
make[3]: *** [glthread/lock.o] Error 1
make[3]: Leaving directory '/tmp/guix-build-grep-3.0.drv-0/grep-3.0/lib'
Makefile:1478: recipe for target 'all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory '/tmp/guix-build-grep-3.0.drv-0/grep-3.0/lib'
Makefile:1291: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/tmp/guix-build-grep-3.0.drv-0/grep-3.0'
Makefile:1232: recipe for target 'all' failed
make: *** [all] Error 2
phase `build' failed after 5.3 seconds
/-------------------------------------------------------------/
Any ideas that can help me to understand the error?
Attached environment variables file and build log file.
Thanks
r***@openmailbox.org
2017-02-21 00:39:11 UTC
Permalink
Raw Message
Hi,
Thank you for the quick response, I will keep an eye on the response of
gnulib team.
Post by Paul Eggert
Thanks for the bug report <https://bugs.gnu.org/25821>. I'm forwarding
this to bug-gnulib, as it is apparently a bug in the Gnulib lock
module's implementation on the Hurd.
This bug does not affect grep per se, as it's a Gnulib test-harness
bug and not a Grep bug. I'm therefore closing the Grep bug report.
Bruno Haible
2017-02-21 16:10:43 UTC
Permalink
Raw Message
Hi Rene,
glthread/lock.c:54:40: error: 'PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP'
undeclared (first use in this function)
PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP);
^
Thanks for the report. Fixed in gnulib as follows:


2017-02-21 Bruno Haible <***@clisp.org>

lock tests: Fix build failure on GNU/Hurd (regression from 2017-01-05).
Reported by Rene Saavedra <***@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.

diff --git a/lib/glthread/lock.c b/lib/glthread/lock.c
index 061562b..afc86f4 100644
--- a/lib/glthread/lock.c
+++ b/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

diff --git a/lib/glthread/lock.h b/lib/glthread/lock.h
index ec16d39..67932aa 100644
--- a/lib/glthread/lock.h
+++ b/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
r***@openmailbox.org
2017-02-21 18:14:55 UTC
Permalink
Raw Message
Hello Bruno,
thanks for the fix, now 'grep' built successfully.

Loading...