[Bug-wget] PATCH: Fix FTBFS on GNU/Hurd

2017-03-10 Thread Svante Signell
Hello,

wget currently does not build from source on GNU/Hurd since Debian version 1.18-
4. 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 attached patch fixes the build problems by conditioning on __GNU__ which is
unique for GNU/Hurd. However, a better solution would probably be to detect if
the function pthread_rwlockattr_setkind_np() is available in configure.ac or
m4/*.m4 or check if TPS+SCHED_FIFO/SCHED_RR is supported by
pthread_rwlock_rdlock(), see below.

As written in the comments of m4/pthread_rwlock_rdlock.m4 POSIX-2008 only
requires this for specific implementations:

dnl POSIX:2008 makes this requirement only for implementations that support TPS
dnl (Thread Priority Scheduling) and only for the scheduling policies SCHED_FIFO
dnl and SCHED_RR, see
dnl http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_rwlock_rdl
ock.html
dnl but test verifies the guarantee regardless of TPS and regardless of
dnl scheduling policy.

Thank you for your attention.--- a/lib/glthread/lock.c.orig	2017-02-04 15:41:52.0 +0100
+++ b/lib/glthread/lock.c	2017-03-10 13:20:05.0 +0100
@@ -34,7 +34,7 @@
 
 #  ifdef PTHREAD_RWLOCK_INITIALIZER
 
-#   if !HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER
+#   if !HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER && !defined(__GNU__)
  /* glibc with bug https://sourceware.org/bugzilla/show_bug.cgi?id=13701 */
 
 int
--- a/lib/glthread/lock.h.orig	2017-02-04 15:41:52.0 +0100
+++ b/lib/glthread/lock.h	2017-03-10 13:28:36.0 +0100
@@ -185,7 +185,7 @@
   STORAGECLASS pthread_rwlock_t NAME;
 #   define gl_rwlock_define_initialized(STORAGECLASS, NAME) \
   STORAGECLASS pthread_rwlock_t NAME = gl_rwlock_initializer;
-#   if HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER
+#   if defined(HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER) || defined(__GNU__)
 #define gl_rwlock_initializer \
PTHREAD_RWLOCK_INITIALIZER
 #define glthread_rwlock_init(LOCK) \


Re: [Bug-wget] wishlist: configure ~/.wget-hsts by environment variable

2017-03-10 Thread Tim Ruehsen
On Thursday, March 9, 2017 5:47:00 PM CET FĂ©lix Sipma wrote:
> Hi!
> 
> Would it be possible to add an environment variable to set the location of
> the hsts-file (by default set to "~/.wget-hsts"), in addition to the
> existing --hsts-file mechanism?

You are aware that you can put all options as 'commands' into a config file !?
The default is ~/.wgetrc but you can override it with WGETRC env variable.
If that isn't enough, you can override the above with --config= (or --no-
config).

> It would help, to have a home free of configuration and data files. I try to
> use $XDG_CONFIG_HOME and $XDG_DATA_HOME, but as wget does not seem to use
> these variables yet, it would probably be simpler to just add an
> environment variable for the hsts-file.

Use WGETRC and specify 'hstsfile' in that config file to point somewhere 
outside 
the home dir.

Tim


signature.asc
Description: This is a digitally signed message part.