Hello community,
here is the log from the commit of package npth for openSUSE:Factory checked in at 2016-12-04 15:06:01
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/npth (Old)
and /work/SRC/openSUSE:Factory/.npth.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "npth"
Changes:
--------
--- /work/SRC/openSUSE:Factory/npth/npth.changes 2015-04-13 20:29:53.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.npth.new/npth.changes 2016-12-04 15:06:11.000000000 +0100
@@ -1,0 +2,9 @@
+Thu Dec 1 16:22:27 UTC 2016 - astieger@suse.com
+
+- update to 1.3:
+ * Bypass npth_protect/npth_unprotect iff the library has not yet
+ been initialized.
+ * Improve detection of clock_gettime
+- use reproducible build timestamp
+
+-------------------------------------------------------------------
Old:
----
npth-1.2.tar.bz2
npth-1.2.tar.bz2.sig
New:
----
npth-1.3.tar.bz2
npth-1.3.tar.bz2.sig
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ npth.spec ++++++
--- /var/tmp/diff_new_pack.amprFH/_old 2016-12-04 15:06:12.000000000 +0100
+++ /var/tmp/diff_new_pack.amprFH/_new 2016-12-04 15:06:12.000000000 +0100
@@ -1,7 +1,7 @@
#
# spec file for package npth
#
-# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,9 +16,9 @@
#
-Name: npth
%define lname libnpth0
-Version: 1.2
+Name: npth
+Version: 1.3
Release: 0
Summary: New GNU Portable Threads library
License: LGPL-3.0+ or GPL-2.0+
@@ -30,6 +30,7 @@
Source: ftp://ftp.gnupg.org/gcrypt/npth/%name-%version.tar.bz2
Source2: ftp://ftp.gnupg.org/gcrypt/npth/%name-%version.tar.bz2.sig
Source4: %name.keyring
+Source99: %name.changes
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
@@ -63,16 +64,17 @@
%setup -q
%build
-%configure
-make %{?_smp_mflags};
+date=$(date -u +%%Y-%%m-%%dT%%H:%%M+0000 -r %SOURCE99)
+%configure \
+ --enable-build-timestamp="$date"
+make %{?_smp_mflags}
%install
-b="%buildroot";
-make install DESTDIR="$b";
-rm -f "$b/%_libdir"/*.la;
+b="%buildroot"
+make install DESTDIR="$b"
+find %buildroot -type f -name "*.la" -delete -print
%post -n %lname -p /sbin/ldconfig
-
%postun -n %lname -p /sbin/ldconfig
%files -n %lname
++++++ npth-1.2.tar.bz2 -> npth-1.3.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/npth-1.2/ChangeLog new/npth-1.3/ChangeLog
--- old/npth-1.2/ChangeLog 2015-04-11 14:02:43.000000000 +0200
+++ new/npth-1.3/ChangeLog 2016-11-22 11:16:05.000000000 +0100
@@ -1,3 +1,74 @@
+2016-11-22 Werner Koch
+
+ Release 1.3.
+ * configure.ac: Bump LT version to C0/A0/R6.
+
+2016-11-21 Werner Koch
+
+ Bypass npth_unprotect/protect when npth has not yet been initialized.
+ * src/npth.c (initialized_or_any_threads): New variable.
+ (npth_init): Set var.
+ (npth_create): Set var.
+ (npth_unprotect, npth_protect): Shortcut if not initialized.
+
+ * w32/npth.c (initialized_or_any_threads): New variable.
+ (npth_init): Set var.
+ (npth_unprotect, npth_protect): Shortcut if not initialized.
+
+2016-10-10 Justus Winter
+
+ src: Fix setting thread names on macOS.
+ * src/npth.c (npth_setname_np): Support Apple's one-argument form.
+
+2016-07-13 Werner Koch
+
+ build: Update config.{guess,sub} to {2016-05-15,2016-06-20}.
+ * build-aux/config.guess: Update.
+ * build-aux/config.sub: Update.
+
+2016-07-05 NIIBE Yutaka
+
+ Fix for semaphore access by child.
+ * configure.ac (HAVE_FORK_UNSAFE_SEMAPHORE): New.
+ * src/npth.c (sem_init): Use NPTH_SEMAPHORE_PSHARED.
+ * tests/t-fork.c: New.
+
+2016-06-25 Werner Koch
+
+ w32: Include io.h for read(2) and write(2).
+ * w32/npth.c: Include io.h.
+
+ Fix problem with regression tests on recent glibc.
+ * configure.ac: Change pthread test to test pthread_detach
+
+2015-11-26 Werner Koch
+
+ Improve debug output.
+ * w32/npth.c (_npth_debug): Print to stderr.
+ (enter_npth, leave_npth): Include the tid in the debug output.
+
+2015-08-25 Werner Koch
+
+ Add configure option --enable-build-timestamp.
+ * configure.ac (BUILD_TIMESTAMP): Set to "<none>" by default. Also
+ with ac_define_unquoted.
+
+2015-06-06 Jim Meyering
+
+ configure.ac: improve check for clock_gettime library.
+ * configure.ac: When using AC_SEARCH_LIBS, handle the case in which
+ that function returns "none required". Also, save and restore LIBS
+ around the check, and properly m4-quote the first argument to AC_DEFINE.
+ Finally, also set and AC_SUBST LIB_CLOCK_GETTIME.
+ This added code is very similar to that provided in gnulib's
+ clock-time.m4.
+ * tests/Makefile.am (LDADD): Append $(LIB_CLOCK_GETTIME).
+
+2015-04-28 NIIBE Yutaka
+
+ npth-config: supply a library dependency for clock_gettime.
+ * configure.ac (clock_gettime): Update config_libs.
+
2015-04-11 Werner Koch
Release 1.2.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/npth-1.2/Makefile.in new/npth-1.3/Makefile.in
--- old/npth-1.2/Makefile.in 2015-04-11 14:02:27.000000000 +0200
+++ new/npth-1.3/Makefile.in 2016-11-22 11:15:03.000000000 +0100
@@ -303,6 +303,7 @@
LIBS = @LIBS@
LIBSOCKET = @LIBSOCKET@
LIBTOOL = @LIBTOOL@
+LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/npth-1.2/NEWS new/npth-1.3/NEWS
--- old/npth-1.2/NEWS 2015-04-11 13:56:56.000000000 +0200
+++ new/npth-1.3/NEWS 2016-11-22 11:11:19.000000000 +0100
@@ -1,3 +1,14 @@
+Noteworthy changes in version 1.3 (2016-11-22)
+----------------------------------------------
+
+ * Bypass npth_protect/npth_unprotect iff the library has not yet been
+ initialized.
+
+ * Fix problems on macOS and AIX
+
+ * Improve detection of clock_gettime
+
+
Noteworthy changes in version 1.2 (2015-04-11)
----------------------------------------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/npth-1.2/VERSION new/npth-1.3/VERSION
--- old/npth-1.2/VERSION 2015-04-11 14:02:43.000000000 +0200
+++ new/npth-1.3/VERSION 2016-11-22 11:16:05.000000000 +0100
@@ -1 +1 @@
-1.2
+1.3
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/npth-1.2/build-aux/config.guess new/npth-1.3/build-aux/config.guess
--- old/npth-1.2/build-aux/config.guess 2015-01-28 11:26:06.000000000 +0100
+++ new/npth-1.3/build-aux/config.guess 2016-07-13 19:03:42.000000000 +0200
@@ -1,8 +1,8 @@
#! /bin/sh
# Attempt to guess a canonical system name.
-# Copyright 1992-2015 Free Software Foundation, Inc.
+# Copyright 1992-2016 Free Software Foundation, Inc.
-timestamp='2015-01-01'
+timestamp='2016-05-15'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -27,7 +27,7 @@
# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
#
# You can get the latest version of this script from:
-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess...
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
#
# Please send patches to .
@@ -50,7 +50,7 @@
GNU config.guess ($timestamp)
Originally written by Per Bothner.
-Copyright 1992-2015 Free Software Foundation, Inc.
+Copyright 1992-2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -168,19 +168,29 @@
# Note: NetBSD doesn't particularly care about the vendor
# portion of the name. We always set it to "unknown".
sysctl="sysctl -n hw.machine_arch"
- UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
- /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
+ UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
+ /sbin/$sysctl 2>/dev/null || \
+ /usr/sbin/$sysctl 2>/dev/null || \
+ echo unknown)`
case "${UNAME_MACHINE_ARCH}" in
armeb) machine=armeb-unknown ;;
arm*) machine=arm-unknown ;;
sh3el) machine=shl-unknown ;;
sh3eb) machine=sh-unknown ;;
sh5el) machine=sh5le-unknown ;;
+ earmv*)
+ arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
+ endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'`
+ machine=${arch}${endian}-unknown
+ ;;
*) machine=${UNAME_MACHINE_ARCH}-unknown ;;
esac
# The Operating System including object format, if it has switched
- # to ELF recently, or will in the future.
+ # to ELF recently (or will in the future) and ABI.
case "${UNAME_MACHINE_ARCH}" in
+ earm*)
+ os=netbsdelf
+ ;;
arm*|i386|m68k|ns32k|sh3*|sparc|vax)
eval $set_cc_for_build
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
@@ -197,6 +207,13 @@
os=netbsd
;;
esac
+ # Determine ABI tags.
+ case "${UNAME_MACHINE_ARCH}" in
+ earm*)
+ expr='s/^earmv[0-9]/-eabi/;s/eb$//'
+ abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"`
+ ;;
+ esac
# The OS release
# Debian GNU/NetBSD machines have a different userland, and
# thus, need a distinct triplet. However, they do not need
@@ -207,13 +224,13 @@
release='-gnu'
;;
*)
- release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+ release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2`
;;
esac
# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
# contains redundant information, the shorter form:
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
- echo "${machine}-${os}${release}"
+ echo "${machine}-${os}${release}${abi}"
exit ;;
*:Bitrig:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
@@ -223,6 +240,10 @@
UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
exit ;;
+ *:LibertyBSD:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
+ echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE}
+ exit ;;
*:ekkoBSD:*:*)
echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
exit ;;
@@ -235,6 +256,9 @@
*:MirBSD:*:*)
echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
exit ;;
+ *:Sortix:*:*)
+ echo ${UNAME_MACHINE}-unknown-sortix
+ exit ;;
alpha:OSF1:*:*)
case $UNAME_RELEASE in
*4.0)
@@ -251,42 +275,42 @@
ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
case "$ALPHA_CPU_TYPE" in
"EV4 (21064)")
- UNAME_MACHINE="alpha" ;;
+ UNAME_MACHINE=alpha ;;
"EV4.5 (21064)")
- UNAME_MACHINE="alpha" ;;
+ UNAME_MACHINE=alpha ;;
"LCA4 (21066/21068)")
- UNAME_MACHINE="alpha" ;;
+ UNAME_MACHINE=alpha ;;
"EV5 (21164)")
- UNAME_MACHINE="alphaev5" ;;
+ UNAME_MACHINE=alphaev5 ;;
"EV5.6 (21164A)")
- UNAME_MACHINE="alphaev56" ;;
+ UNAME_MACHINE=alphaev56 ;;
"EV5.6 (21164PC)")
- UNAME_MACHINE="alphapca56" ;;
+ UNAME_MACHINE=alphapca56 ;;
"EV5.7 (21164PC)")
- UNAME_MACHINE="alphapca57" ;;
+ UNAME_MACHINE=alphapca57 ;;
"EV6 (21264)")
- UNAME_MACHINE="alphaev6" ;;
+ UNAME_MACHINE=alphaev6 ;;
"EV6.7 (21264A)")
- UNAME_MACHINE="alphaev67" ;;
+ UNAME_MACHINE=alphaev67 ;;
"EV6.8CB (21264C)")
- UNAME_MACHINE="alphaev68" ;;
+ UNAME_MACHINE=alphaev68 ;;
"EV6.8AL (21264B)")
- UNAME_MACHINE="alphaev68" ;;
+ UNAME_MACHINE=alphaev68 ;;
"EV6.8CX (21264D)")
- UNAME_MACHINE="alphaev68" ;;
+ UNAME_MACHINE=alphaev68 ;;
"EV6.9A (21264/EV69A)")
- UNAME_MACHINE="alphaev69" ;;
+ UNAME_MACHINE=alphaev69 ;;
"EV7 (21364)")
- UNAME_MACHINE="alphaev7" ;;
+ UNAME_MACHINE=alphaev7 ;;
"EV7.9 (21364A)")
- UNAME_MACHINE="alphaev79" ;;
+ UNAME_MACHINE=alphaev79 ;;
esac
# A Pn.n version is a patched version.
# A Vn.n version is a released version.
# A Tn.n version is a released field test version.
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
- echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
exitcode=$?
trap '' 0
@@ -359,16 +383,16 @@
exit ;;
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
eval $set_cc_for_build
- SUN_ARCH="i386"
+ SUN_ARCH=i386
# If there is a compiler, see if it is configured for 64-bit objects.
# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
# This test works for both compilers.
- if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+ if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
- (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null
then
- SUN_ARCH="x86_64"
+ SUN_ARCH=x86_64
fi
fi
echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
@@ -393,7 +417,7 @@
exit ;;
sun*:*:4.2BSD:*)
UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
- test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
+ test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3
case "`/bin/arch`" in
sun3)
echo m68k-sun-sunos${UNAME_RELEASE}
@@ -618,13 +642,13 @@
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
case "${sc_cpu_version}" in
- 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
- 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+ 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
+ 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
532) # CPU_PA_RISC2_0
case "${sc_kernel_bits}" in
- 32) HP_ARCH="hppa2.0n" ;;
- 64) HP_ARCH="hppa2.0w" ;;
- '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
+ 32) HP_ARCH=hppa2.0n ;;
+ 64) HP_ARCH=hppa2.0w ;;
+ '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20
esac ;;
esac
fi
@@ -663,11 +687,11 @@
exit (0);
}
EOF
- (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+ (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
test -z "$HP_ARCH" && HP_ARCH=hppa
fi ;;
esac
- if [ ${HP_ARCH} = "hppa2.0w" ]
+ if [ ${HP_ARCH} = hppa2.0w ]
then
eval $set_cc_for_build
@@ -680,12 +704,12 @@
# $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
# => hppa64-hp-hpux11.23
- if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
+ if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
grep -q __LP64__
then
- HP_ARCH="hppa2.0w"
+ HP_ARCH=hppa2.0w
else
- HP_ARCH="hppa64"
+ HP_ARCH=hppa64
fi
fi
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
@@ -790,14 +814,14 @@
echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit ;;
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
- FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
+ FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit ;;
5000:UNIX_System_V:4.*:*)
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+ FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit ;;
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
@@ -879,7 +903,7 @@
exit ;;
*:GNU/*:*:*)
# other systems with GNU libc and userland
- echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
+ echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
exit ;;
i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix
@@ -902,7 +926,7 @@
EV68*) UNAME_MACHINE=alphaev68 ;;
esac
objdump --private-headers /bin/sh | grep -q ld.so.1
- if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
+ if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
arc:Linux:*:* | arceb:Linux:*:*)
@@ -933,6 +957,9 @@
crisv32:Linux:*:*)
echo ${UNAME_MACHINE}-axis-linux-${LIBC}
exit ;;
+ e2k:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
frv:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
@@ -945,6 +972,9 @@
ia64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
+ k1om:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
m32r*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
@@ -1021,7 +1051,7 @@
echo ${UNAME_MACHINE}-dec-linux-${LIBC}
exit ;;
x86_64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo ${UNAME_MACHINE}-pc-linux-${LIBC}
exit ;;
xtensa*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
@@ -1100,7 +1130,7 @@
# uname -m prints for DJGPP always 'pc', but it prints nothing about
# the processor, so we play safe by assuming i586.
# Note: whatever this is, it MUST be the same as what config.sub
- # prints for the "djgpp" host, or else GDB configury will decide that
+ # prints for the "djgpp" host, or else GDB configure will decide that
# this is a cross-build.
echo i586-pc-msdosdjgpp
exit ;;
@@ -1249,6 +1279,9 @@
SX-8R:SUPER-UX:*:*)
echo sx8r-nec-superux${UNAME_RELEASE}
exit ;;
+ SX-ACE:SUPER-UX:*:*)
+ echo sxace-nec-superux${UNAME_RELEASE}
+ exit ;;
Power*:Rhapsody:*:*)
echo powerpc-apple-rhapsody${UNAME_RELEASE}
exit ;;
@@ -1262,9 +1295,9 @@
UNAME_PROCESSOR=powerpc
fi
if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
- if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+ if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
- (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null
then
case $UNAME_PROCESSOR in
@@ -1286,7 +1319,7 @@
exit ;;
*:procnto*:*:* | *:QNX:[0123456789]*:*)
UNAME_PROCESSOR=`uname -p`
- if test "$UNAME_PROCESSOR" = "x86"; then
+ if test "$UNAME_PROCESSOR" = x86; then
UNAME_PROCESSOR=i386
UNAME_MACHINE=pc
fi
@@ -1317,7 +1350,7 @@
# "uname -m" is not consistent, so use $cputype instead. 386
# is converted to i386 for consistency with other x86
# operating systems.
- if test "$cputype" = "386"; then
+ if test "$cputype" = 386; then
UNAME_MACHINE=i386
else
UNAME_MACHINE="$cputype"
@@ -1359,7 +1392,7 @@
echo i386-pc-xenix
exit ;;
i*86:skyos:*:*)
- echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
+ echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'`
exit ;;
i*86:rdos:*:*)
echo ${UNAME_MACHINE}-pc-rdos
@@ -1370,23 +1403,25 @@
x86_64:VMkernel:*:*)
echo ${UNAME_MACHINE}-unknown-esx
exit ;;
+ amd64:Isilon\ OneFS:*:*)
+ echo x86_64-unknown-onefs
+ exit ;;
esac
cat >&2 <http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess...
+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
and
- http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;h...
+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
-If the version you run ($0) is already up to date, please
-send the following data and any information you think might be
-pertinent to in order to provide the needed
-information to handle your system.
+If $0 has already been updated, send the following data and any
+information you think might be pertinent to config-patches@gnu.org to
+provide the necessary information to handle your system.
config.guess timestamp = $timestamp
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/npth-1.2/build-aux/config.sub new/npth-1.3/build-aux/config.sub
--- old/npth-1.2/build-aux/config.sub 2015-01-28 11:26:03.000000000 +0100
+++ new/npth-1.3/build-aux/config.sub 2016-07-13 19:03:42.000000000 +0200
@@ -1,8 +1,8 @@
#! /bin/sh
# Configuration validation subroutine script.
-# Copyright 1992-2015 Free Software Foundation, Inc.
+# Copyright 1992-2016 Free Software Foundation, Inc.
-timestamp='2015-01-01'
+timestamp='2016-06-20'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -33,7 +33,7 @@
# Otherwise, we print the canonical config type on stdout and succeed.
# You can get the latest version of this script from:
-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;h...
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
# This file is supposed to be the same for all GNU packages
# and recognize all the CPU types, system types and aliases
@@ -53,8 +53,7 @@
me=`echo "$0" | sed -e 's,.*/,,'`
usage="\
-Usage: $0 [OPTION] CPU-MFR-OPSYS
- $0 [OPTION] ALIAS
+Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
Canonicalize a configuration name.
@@ -68,7 +67,7 @@
version="\
GNU config.sub ($timestamp)
-Copyright 1992-2015 Free Software Foundation, Inc.
+Copyright 1992-2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -117,7 +116,7 @@
case $maybe_os in
nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
- knetbsd*-gnu* | netbsd*-gnu* | \
+ knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
kopensolaris*-gnu* | \
storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os
@@ -255,11 +254,12 @@
| arc | arceb \
| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
| avr | avr32 \
+ | ba \
| be32 | be64 \
| bfin \
| c4x | c8051 | clipper \
| d10v | d30v | dlx | dsp16xx \
- | epiphany \
+ | e2k | epiphany \
| fido | fr30 | frv | ft32 \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| hexagon \
@@ -305,7 +305,7 @@
| riscv32 | riscv64 \
| rl78 | rx \
| score \
- | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
| sh64 | sh64le \
| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
@@ -376,12 +376,13 @@
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
| avr-* | avr32-* \
+ | ba-* \
| be32-* | be64-* \
| bfin-* | bs2000-* \
| c[123]* | c30-* | [cjt]90-* | c4x-* \
| c8051-* | clipper-* | craynv-* | cydra-* \
| d10v-* | d30v-* | dlx-* \
- | elxsi-* \
+ | e2k-* | elxsi-* \
| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
| h8300-* | h8500-* \
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
@@ -428,12 +429,13 @@
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
| pyramid-* \
+ | riscv32-* | riscv64-* \
| rl78-* | romp-* | rs6000-* | rx-* \
| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
| sparclite-* \
- | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
+ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \
| tahoe-* \
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
| tile*-* \
@@ -518,6 +520,9 @@
basic_machine=i386-pc
os=-aros
;;
+ asmjs)
+ basic_machine=asmjs-unknown
+ ;;
aux)
basic_machine=m68k-apple
os=-aux
@@ -638,6 +643,14 @@
basic_machine=m68k-bull
os=-sysv3
;;
+ e500v[12])
+ basic_machine=powerpc-unknown
+ os=$os"spe"
+ ;;
+ e500v[12]-*)
+ basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=$os"spe"
+ ;;
ebmon29k)
basic_machine=a29k-amd
os=-ebmon
@@ -1373,18 +1386,18 @@
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
| -sym* | -kopensolaris* | -plan9* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
- | -aos* | -aros* \
+ | -aos* | -aros* | -cloudabi* | -sortix* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
- | -bitrig* | -openbsd* | -solidbsd* \
+ | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \
| -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -chorusos* | -chorusrdb* | -cegcc* \
| -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
- | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
+ | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
| -linux-newlib* | -linux-musl* | -linux-uclibc* \
| -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
@@ -1393,7 +1406,8 @@
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
- | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*)
+ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
+ | -onefs* | -tirtos* | -phoenix*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
@@ -1525,6 +1539,8 @@
;;
-nacl*)
;;
+ -ios)
+ ;;
-none)
;;
*)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/npth-1.2/config.h.in new/npth-1.3/config.h.in
--- old/npth-1.2/config.h.in 2015-04-11 14:00:23.000000000 +0200
+++ new/npth-1.3/config.h.in 2016-11-22 11:16:05.000000000 +0100
@@ -1,11 +1,17 @@
/* config.h.in. Generated from configure.ac by autoheader. */
+/* The time this package was configured for a build */
+#undef BUILD_TIMESTAMP
+
/* Define to 1 if you have the `clock_gettime' function. */
#undef HAVE_CLOCK_GETTIME
/* Define to 1 if you have the header file. */
#undef HAVE_DLFCN_H
+/* Defined if we have fork-unsafe semaphore */
+#undef HAVE_FORK_UNSAFE_SEMAPHORE
+
/* Define to 1 if you have the `gettimeofday' function. */
#undef HAVE_GETTIMEOFDAY
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/npth-1.2/configure new/npth-1.3/configure
--- old/npth-1.2/configure 2015-04-11 14:02:28.000000000 +0200
+++ new/npth-1.3/configure 2016-11-22 11:15:03.000000000 +0100
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for npth 1.2.
+# Generated by GNU Autoconf 2.69 for npth 1.3.
#
# Report bugs to .
#
@@ -590,8 +590,8 @@
# Identity of this package.
PACKAGE_NAME='npth'
PACKAGE_TARNAME='npth'
-PACKAGE_VERSION='1.2'
-PACKAGE_STRING='npth 1.2'
+PACKAGE_VERSION='1.3'
+PACKAGE_STRING='npth 1.3'
PACKAGE_BUGREPORT='gnupg-devel@gnupg.org'
PACKAGE_URL=''
@@ -645,6 +645,7 @@
emacs_local_vars_read_only
emacs_local_vars_begin
NETLIBS
+LIB_CLOCK_GETTIME
LIBSOCKET
INSERT_SOCKLEN_T
SYS_SOCKET_H
@@ -652,9 +653,9 @@
INSERT_TIME_H
INSERT_SYS_TIME_H
INSERT_SYS_SELECT_H
+BUILD_TIMESTAMP
BUILD_FILEVERSION
BUILD_ISODATE
-BUILD_TIMESTAMP
HAVE_W64_SYSTEM_FALSE
HAVE_W64_SYSTEM_TRUE
HAVE_W32_SYSTEM_FALSE
@@ -797,6 +798,7 @@
with_gnu_ld
with_sysroot
enable_libtool_lock
+enable_build_timestamp
'
ac_precious_vars='build_alias
host_alias
@@ -1347,7 +1349,7 @@
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures npth 1.2 to adapt to many kinds of systems.
+\`configure' configures npth 1.3 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1417,7 +1419,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of npth 1.2:";;
+ short | recursive ) echo "Configuration of npth 1.3:";;
esac
cat <<\_ACEOF
@@ -1440,6 +1442,9 @@
--enable-fast-install[=PKGS]
optimize for fast installation [default=yes]
--disable-libtool-lock avoid locking (might break parallel builds)
+ --enable-build-timestamp
+ set an explicit build timestamp for reproducibility.
+ (default is the current time in ISO-8601 format)
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
@@ -1526,7 +1531,7 @@
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-npth configure 1.2
+npth configure 1.3
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1949,7 +1954,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by npth $as_me 1.2, which was
+It was created by npth $as_me 1.3, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -2307,7 +2312,7 @@
#
LIBNPTH_LT_CURRENT=0
LIBNPTH_LT_AGE=0
-LIBNPTH_LT_REVISION=5
+LIBNPTH_LT_REVISION=6
# If the API is changed in an incompatible way: increment the next counter.
NPTH_CONFIG_API_VERSION=1
@@ -2835,7 +2840,7 @@
# Define the identity of the package.
PACKAGE='npth'
- VERSION='1.2'
+ VERSION='1.3'
cat >>confdefs.h <<_ACEOF
@@ -12947,6 +12952,9 @@
$as_echo "#define _XOPEN_SOURCE 500" >>confdefs.h
;;
+ *-*-aix*)
+ have_fork_unsafe_semaphore=yes
+ ;;
esac
if test "$have_ld_version_script" = "yes"; then
@@ -12957,6 +12965,11 @@
HAVE_LD_VERSION_SCRIPT_FALSE=
fi
+if test "$have_fork_unsafe_semaphore" = yes; then
+
+$as_echo "#define HAVE_FORK_UNSAFE_SEMAPHORE 1" >>confdefs.h
+
+fi
# Set some default values
config_libs="-lnpth"
@@ -13013,13 +13026,28 @@
# Generate values for the DLL version info
#
if test "$have_w32_system" = yes; then
- BUILD_TIMESTAMP=`date --iso-8601=minutes`
BUILD_ISODATE=`date --iso-8601`
BUILD_FILEVERSION=`echo "$VERSION" | sed 's/\([0-9.]*\).*/\1./;s/\./,/g'`
- BUILD_FILEVERSION="${BUILD_FILEVERSION}48279"
+ BUILD_FILEVERSION="${BUILD_FILEVERSION}53688"
fi
+# Check whether --enable-build-timestamp was given.
+if test "${enable_build_timestamp+set}" = set; then :
+ enableval=$enable_build_timestamp; if test "$enableval" = "yes"; then
+ BUILD_TIMESTAMP=`date -u +%Y-%m-%dT%H:%M+0000 2>/dev/null || date`
+ else
+ BUILD_TIMESTAMP="$enableval"
+ fi
+else
+ BUILD_TIMESTAMP="<none>"
+fi
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define BUILD_TIMESTAMP "$BUILD_TIMESTAMP"
+_ACEOF
@@ -13220,10 +13248,12 @@
#
# Checks for libraries and functions.
#
+# We test for pthread_detach because glibc 2.22 includes
+# pthread_create but not pthread_detach.
if test "$have_w32_system" = no; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pthread_create" >&5
-$as_echo_n "checking for library containing pthread_create... " >&6; }
-if ${ac_cv_search_pthread_create+:} false; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pthread_detach" >&5
+$as_echo_n "checking for library containing pthread_detach... " >&6; }
+if ${ac_cv_search_pthread_detach+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_func_search_save_LIBS=$LIBS
@@ -13236,11 +13266,11 @@
#ifdef __cplusplus
extern "C"
#endif
-char pthread_create ();
+char pthread_detach ();
int
main ()
{
-return pthread_create ();
+return pthread_detach ();
;
return 0;
}
@@ -13253,31 +13283,31 @@
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
fi
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_search_pthread_create=$ac_res
+ ac_cv_search_pthread_detach=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext
- if ${ac_cv_search_pthread_create+:} false; then :
+ if ${ac_cv_search_pthread_detach+:} false; then :
break
fi
done
-if ${ac_cv_search_pthread_create+:} false; then :
+if ${ac_cv_search_pthread_detach+:} false; then :
else
- ac_cv_search_pthread_create=no
+ ac_cv_search_pthread_detach=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_pthread_create" >&5
-$as_echo "$ac_cv_search_pthread_create" >&6; }
-ac_res=$ac_cv_search_pthread_create
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_pthread_detach" >&5
+$as_echo "$ac_cv_search_pthread_detach" >&6; }
+ac_res=$ac_cv_search_pthread_detach
if test "$ac_res" != no; then :
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
fi
- case "x$ac_cv_search_pthread_create" in
+ case "x$ac_cv_search_pthread_detach" in
xno)
have_pthread=no
;;
@@ -13286,7 +13316,7 @@
;;
*)
have_pthread=yes
- config_libs="$config_libs $ac_cv_search_pthread_create"
+ config_libs="$config_libs $ac_cv_search_pthread_detach"
;;
esac
if test "$have_pthread" != no; then
@@ -13493,6 +13523,12 @@
config_libs="$config_libs $LIBSOCKET"
+# Save and restore LIBS so e.g., -lrt, isn't added to it. Otherwise, *all*
+# programs in the package would end up linked with that potentially-shared
+# library, inducing unnecessary run-time overhead.
+LIB_CLOCK_GETTIME=
+
+gl_saved_libs=$LIBS
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5
$as_echo_n "checking for library containing clock_gettime... " >&6; }
if ${ac_cv_search_clock_gettime+:} false; then :
@@ -13546,15 +13582,18 @@
ac_res=$ac_cv_search_clock_gettime
if test "$ac_res" != no; then :
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-
-fi
-
-if test "x$ac_cv_search_clock_gettime" != no; then
+ if test "$ac_cv_search_clock_gettime" != "none required"; then
+ LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime
+ config_libs="$config_libs $LIB_CLOCK_GETTIME"
+ fi
$as_echo "#define HAVE_CLOCK_GETTIME 1" >>confdefs.h
+
fi
+LIBS=$gl_saved_libs
+
#
# Set NETLIBS
@@ -14180,7 +14219,7 @@
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by npth $as_me 1.2, which was
+This file was extended by npth $as_me 1.3, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -14246,7 +14285,7 @@
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-npth config.status 1.2
+npth config.status 1.3
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
@@ -16240,6 +16279,6 @@
echo "
$PACKAGE_NAME-$PACKAGE_VERSION prepared for make
- Revision: bc97d51 (48279)
+ Revision: d1b8d54 (53688)
Platform: $host
"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/npth-1.2/configure.ac new/npth-1.3/configure.ac
--- old/npth-1.2/configure.ac 2015-04-11 13:57:20.000000000 +0200
+++ new/npth-1.3/configure.ac 2016-11-22 11:12:12.000000000 +0100
@@ -35,7 +35,7 @@
# the version number immediately after the release and do another
# commit and push so that the git magic is able to work.
# See below for the LT versions.
-m4_define(my_version, [1.2])
+m4_define(my_version, [1.3])
# Below is m4 magic to extract and compute the git revision number,
# the decimalized short revision number, a beta version string and a
@@ -61,7 +61,7 @@
#
LIBNPTH_LT_CURRENT=0
LIBNPTH_LT_AGE=0
-LIBNPTH_LT_REVISION=5
+LIBNPTH_LT_REVISION=6
# If the API is changed in an incompatible way: increment the next counter.
NPTH_CONFIG_API_VERSION=1
@@ -125,9 +125,15 @@
*-apple-darwin*)
AC_DEFINE(_XOPEN_SOURCE, 500, Activate POSIX interface on MacOS X)
;;
+ *-*-aix*)
+ have_fork_unsafe_semaphore=yes
+ ;;
esac
AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
+if test "$have_fork_unsafe_semaphore" = yes; then
+ AC_DEFINE(HAVE_FORK_UNSAFE_SEMAPHORE, 1, [Defined if we have fork-unsafe semaphore])
+fi
# Set some default values
config_libs="-lnpth"
@@ -168,16 +174,27 @@
# Generate values for the DLL version info
#
if test "$have_w32_system" = yes; then
- BUILD_TIMESTAMP=`date --iso-8601=minutes`
BUILD_ISODATE=`date --iso-8601`
changequote(,)dnl
BUILD_FILEVERSION=`echo "$VERSION" | sed 's/\([0-9.]*\).*/\1./;s/\./,/g'`
changequote([,])dnl
BUILD_FILEVERSION="${BUILD_FILEVERSION}git_revision_dec"
fi
-AC_SUBST(BUILD_TIMESTAMP)
AC_SUBST(BUILD_ISODATE)
AC_SUBST(BUILD_FILEVERSION)
+AC_ARG_ENABLE([build-timestamp],
+ AC_HELP_STRING([--enable-build-timestamp],
+ [set an explicit build timestamp for reproducibility.
+ (default is the current time in ISO-8601 format)]),
+ [if test "$enableval" = "yes"; then
+ BUILD_TIMESTAMP=`date -u +%Y-%m-%dT%H:%M+0000 2>/dev/null || date`
+ else
+ BUILD_TIMESTAMP="$enableval"
+ fi],
+ [BUILD_TIMESTAMP="<none>"])
+AC_SUBST(BUILD_TIMESTAMP)
+AC_DEFINE_UNQUOTED(BUILD_TIMESTAMP, "$BUILD_TIMESTAMP",
+ [The time this package was configured for a build])
#
@@ -237,9 +254,11 @@
#
# Checks for libraries and functions.
#
+# We test for pthread_detach because glibc 2.22 includes
+# pthread_create but not pthread_detach.
if test "$have_w32_system" = no; then
- AC_SEARCH_LIBS([pthread_create],[pthread])
- case "x$ac_cv_search_pthread_create" in
+ AC_SEARCH_LIBS([pthread_detach],[pthread])
+ case "x$ac_cv_search_pthread_detach" in
xno)
have_pthread=no
;;
@@ -248,7 +267,7 @@
;;
*)
have_pthread=yes
- config_libs="$config_libs $ac_cv_search_pthread_create"
+ config_libs="$config_libs $ac_cv_search_pthread_detach"
;;
esac
if test "$have_pthread" != no; then
@@ -267,11 +286,21 @@
npth_LIBSOCKET
config_libs="$config_libs $LIBSOCKET"
-AC_SEARCH_LIBS([clock_gettime],[rt posix4])
-if test "x$ac_cv_search_clock_gettime" != no; then
- AC_DEFINE(HAVE_CLOCK_GETTIME,1,
- [Define to 1 if you have the `clock_gettime' function.])
-fi
+# Save and restore LIBS so e.g., -lrt, isn't added to it. Otherwise, *all*
+# programs in the package would end up linked with that potentially-shared
+# library, inducing unnecessary run-time overhead.
+LIB_CLOCK_GETTIME=
+AC_SUBST([LIB_CLOCK_GETTIME])
+gl_saved_libs=$LIBS
+AC_SEARCH_LIBS([clock_gettime], [rt posix4],
+ [if test "$ac_cv_search_clock_gettime" != "none required"; then
+ LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime
+ config_libs="$config_libs $LIB_CLOCK_GETTIME"
+ fi
+ AC_DEFINE([HAVE_CLOCK_GETTIME],1,
+ [Define to 1 if you have the `clock_gettime' function.])
+ ])
+LIBS=$gl_saved_libs
#
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/npth-1.2/npth.spec new/npth-1.3/npth.spec
--- old/npth-1.2/npth.spec 2015-04-11 14:02:43.000000000 +0200
+++ new/npth-1.3/npth.spec 2016-11-22 11:16:05.000000000 +0100
@@ -1,7 +1,7 @@
# This is a template. The dist target uses it to create the real file.
Summary: NPTH - the new GNU Portable Threads Library
Name: npth
-Version: 1.2
+Version: 1.3
Release: 1
URL: http://www.gnupg.org/
Source: ftp://ftp.gnupg.org/gcrypt/alpha
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/npth-1.2/src/Makefile.in new/npth-1.3/src/Makefile.in
--- old/npth-1.2/src/Makefile.in 2015-04-11 14:02:27.000000000 +0200
+++ new/npth-1.3/src/Makefile.in 2016-11-22 11:15:03.000000000 +0100
@@ -272,6 +272,7 @@
LIBS = @LIBS@
LIBSOCKET = @LIBSOCKET@
LIBTOOL = @LIBTOOL@
+LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/npth-1.2/src/npth.c new/npth-1.3/src/npth.c
--- old/npth-1.2/src/npth.c 2014-12-18 16:52:12.000000000 +0100
+++ new/npth-1.3/src/npth.c 2016-11-21 09:42:10.000000000 +0100
@@ -61,12 +61,46 @@
static sem_t sceptre_buffer;
static sem_t *sceptre = &sceptre_buffer;
+/* Configure defines HAVE_FORK_UNSAFE_SEMAPHORE if child process can't
+ access non-shared unnamed semaphore which is created by its parent.
+
+ We use unnamed semaphore (if available) for the global lock. The
+ specific semaphore is only valid for those threads in a process,
+ and it is no use by other processes. Thus, PSHARED argument for
+ sem_init is naturally 0.
+
+ However, there are daemon-like applications which use fork after
+ npth's initialization by npth_init. In this case, a child process
+ uses the semaphore which was created by its parent process, while
+ parent does nothing with the semaphore. In some system (e.g. AIX),
+ access by child process to non-shared unnamed semaphore is
+ prohibited. For such a system, HAVE_FORK_UNSAFE_SEMAPHORE should
+ be defined, so that unnamed semaphore will be created with the
+ option PSHARED=1. The purpose of the setting of PSHARED=1 is only
+ for allowing the access of the lock by child process. For NPTH, it
+ does not mean any other interactions between processes.
+
+ */
+#ifdef HAVE_FORK_UNSAFE_SEMAPHORE
+#define NPTH_SEMAPHORE_PSHARED 1
+#else
+#define NPTH_SEMAPHORE_PSHARED 0
+#endif
+
/* The main thread is the active thread at the time pth_init was
called. As of now it is only useful for debugging. The volatile
make sure the compiler does not eliminate this set but not used
variable. */
static volatile pthread_t main_thread;
+/* This flag is set as soon as npth_init has been called or if any
+ * thread has been created. It will never be cleared again. The only
+ * purpose is to make npth_protect and npth_unprotect more robust in
+ * that they can be shortcut when npth_init has not yet been called.
+ * This is important for libraries which want to support nPth by using
+ * those two functions but may have be initialized before pPth. */
+static int initialized_or_any_threads;
+
/* Systems that don't have pthread_mutex_timedlock get a busy wait
implementation that probes the lock every BUSY_WAIT_INTERVAL
milliseconds. */
@@ -177,12 +211,15 @@
main_thread = pthread_self();
+ /* Track that we have been initialized. */
+ initialized_or_any_threads |= 1;
+
/* Better reset ERRNO so that we know that it has been set by
sem_init. */
errno = 0;
- /* The semaphore is not shared and binary. */
- res = sem_init (sceptre, 0, 1);
+ /* The semaphore is binary. */
+ res = sem_init (sceptre, NPTH_SEMAPHORE_PSHARED, 1);
if (res < 0)
{
/* Mac OSX and some AIX versions have sem_init but return
@@ -231,8 +268,15 @@
#ifdef __NetBSD__
return pthread_setname_np (target_thread, "%s", (void*) name);
#else
+#ifdef __APPLE__
+ if (target_thread == npth_self ())
+ return pthread_setname_np (name);
+ else
+ return ENOTSUP;
+#else
return pthread_setname_np (target_thread, name);
#endif
+#endif
#else
(void)target_thread;
(void)name;
@@ -282,6 +326,8 @@
if (!startup)
return errno;
+ initialized_or_any_threads |= 2;
+
startup->start_routine = start_routine;
startup->arg = arg;
err = pthread_create (thread, attr, thread_start, startup);
@@ -683,14 +729,23 @@
void
npth_unprotect (void)
{
- ENTER();
+ /* If we are not initialized we may not access the semaphore and
+ * thus we shortcut it. Note that in this case the unprotect/protect
+ * is not needed. For failsafe reasons if an nPth thread has ever
+ * been created but nPth has accidentally not initialized we do not
+ * shortcut so that a stack backtrace (due to the access of the
+ * uninitialized semaphore) is more expressive. */
+ if (initialized_or_any_threads)
+ ENTER();
}
void
npth_protect (void)
{
- LEAVE();
+ /* See npth_unprotect for commentary. */
+ if (initialized_or_any_threads)
+ LEAVE();
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/npth-1.2/src/npth.h new/npth-1.3/src/npth.h
--- old/npth-1.2/src/npth.h 2015-04-11 14:02:41.000000000 +0200
+++ new/npth-1.3/src/npth.h 2016-11-22 11:15:44.000000000 +0100
@@ -1,5 +1,5 @@
/* npth.h - a lightweight implementation of pth over pthread.
- Configured for: x86_64-unknown-linux-gnu.
+ Configured for: x86_64-pc-linux-gnu.
Copyright (C) 2011, 2012, 2015 g10 Code GmbH
This file is part of NPTH.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/npth-1.2/tests/Makefile.am new/npth-1.3/tests/Makefile.am
--- old/npth-1.2/tests/Makefile.am 2013-03-15 20:25:51.000000000 +0100
+++ new/npth-1.3/tests/Makefile.am 2016-07-13 19:03:55.000000000 +0200
@@ -35,11 +35,12 @@
if HAVE_W32_SYSTEM
AM_CPPFLAGS = -I$(top_srcdir)/w32
AM_LDFLAGS =
-LDADD = ../w32/libnpth.la
+LDADD = ../w32/libnpth.la $(LIB_CLOCK_GETTIME)
else
AM_CPPFLAGS = -I../src -D_POSIX_C_SOURCE=200112L
AM_LDFLAGS =
-LDADD = ../src/libnpth.la $(LIBSOCKET)
+LDADD = ../src/libnpth.la $(LIBSOCKET) $(LIB_CLOCK_GETTIME)
+TESTS += t-fork
endif
noinst_HEADERS = t-support.h
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/npth-1.2/tests/Makefile.in new/npth-1.3/tests/Makefile.in
--- old/npth-1.2/tests/Makefile.in 2015-04-11 14:02:27.000000000 +0200
+++ new/npth-1.3/tests/Makefile.in 2016-11-22 11:15:03.000000000 +0100
@@ -107,8 +107,9 @@
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
-TESTS = t-mutex$(EXEEXT) t-thread$(EXEEXT)
-noinst_PROGRAMS = $(am__EXEEXT_1)
+TESTS = t-mutex$(EXEEXT) t-thread$(EXEEXT) $(am__EXEEXT_1)
+@HAVE_W32_SYSTEM_FALSE@am__append_1 = t-fork
+noinst_PROGRAMS = $(am__EXEEXT_2)
subdir = tests
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(top_srcdir)/build-aux/depcomp $(noinst_HEADERS)
@@ -124,25 +125,38 @@
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
-am__EXEEXT_1 = t-mutex$(EXEEXT) t-thread$(EXEEXT)
+@HAVE_W32_SYSTEM_FALSE@am__EXEEXT_1 = t-fork$(EXEEXT)
+am__EXEEXT_2 = t-mutex$(EXEEXT) t-thread$(EXEEXT) $(am__EXEEXT_1)
PROGRAMS = $(noinst_PROGRAMS)
-t_mutex_SOURCES = t-mutex.c
-t_mutex_OBJECTS = t-mutex.$(OBJEXT)
-t_mutex_LDADD = $(LDADD)
+t_fork_SOURCES = t-fork.c
+t_fork_OBJECTS = t-fork.$(OBJEXT)
+t_fork_LDADD = $(LDADD)
am__DEPENDENCIES_1 =
-@HAVE_W32_SYSTEM_FALSE@t_mutex_DEPENDENCIES = ../src/libnpth.la \
+@HAVE_W32_SYSTEM_FALSE@t_fork_DEPENDENCIES = ../src/libnpth.la \
+@HAVE_W32_SYSTEM_FALSE@ $(am__DEPENDENCIES_1) \
@HAVE_W32_SYSTEM_FALSE@ $(am__DEPENDENCIES_1)
-@HAVE_W32_SYSTEM_TRUE@t_mutex_DEPENDENCIES = ../w32/libnpth.la
+@HAVE_W32_SYSTEM_TRUE@t_fork_DEPENDENCIES = ../w32/libnpth.la \
+@HAVE_W32_SYSTEM_TRUE@ $(am__DEPENDENCIES_1)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
am__v_lt_1 =
+t_mutex_SOURCES = t-mutex.c
+t_mutex_OBJECTS = t-mutex.$(OBJEXT)
+t_mutex_LDADD = $(LDADD)
+@HAVE_W32_SYSTEM_FALSE@t_mutex_DEPENDENCIES = ../src/libnpth.la \
+@HAVE_W32_SYSTEM_FALSE@ $(am__DEPENDENCIES_1) \
+@HAVE_W32_SYSTEM_FALSE@ $(am__DEPENDENCIES_1)
+@HAVE_W32_SYSTEM_TRUE@t_mutex_DEPENDENCIES = ../w32/libnpth.la \
+@HAVE_W32_SYSTEM_TRUE@ $(am__DEPENDENCIES_1)
t_thread_SOURCES = t-thread.c
t_thread_OBJECTS = t-thread.$(OBJEXT)
t_thread_LDADD = $(LDADD)
@HAVE_W32_SYSTEM_FALSE@t_thread_DEPENDENCIES = ../src/libnpth.la \
+@HAVE_W32_SYSTEM_FALSE@ $(am__DEPENDENCIES_1) \
@HAVE_W32_SYSTEM_FALSE@ $(am__DEPENDENCIES_1)
-@HAVE_W32_SYSTEM_TRUE@t_thread_DEPENDENCIES = ../w32/libnpth.la
+@HAVE_W32_SYSTEM_TRUE@t_thread_DEPENDENCIES = ../w32/libnpth.la \
+@HAVE_W32_SYSTEM_TRUE@ $(am__DEPENDENCIES_1)
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
@@ -177,8 +191,8 @@
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
-SOURCES = t-mutex.c t-thread.c
-DIST_SOURCES = t-mutex.c t-thread.c
+SOURCES = t-fork.c t-mutex.c t-thread.c
+DIST_SOURCES = t-fork.c t-mutex.c t-thread.c
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
@@ -276,6 +290,7 @@
LIBS = @LIBS@
LIBSOCKET = @LIBSOCKET@
LIBTOOL = @LIBTOOL@
+LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
@@ -372,8 +387,8 @@
@HAVE_W32_SYSTEM_TRUE@AM_CPPFLAGS = -I$(top_srcdir)/w32
@HAVE_W32_SYSTEM_FALSE@AM_LDFLAGS =
@HAVE_W32_SYSTEM_TRUE@AM_LDFLAGS =
-@HAVE_W32_SYSTEM_FALSE@LDADD = ../src/libnpth.la $(LIBSOCKET)
-@HAVE_W32_SYSTEM_TRUE@LDADD = ../w32/libnpth.la
+@HAVE_W32_SYSTEM_FALSE@LDADD = ../src/libnpth.la $(LIBSOCKET) $(LIB_CLOCK_GETTIME)
+@HAVE_W32_SYSTEM_TRUE@LDADD = ../w32/libnpth.la $(LIB_CLOCK_GETTIME)
noinst_HEADERS = t-support.h
all: all-am
@@ -419,6 +434,10 @@
echo " rm -f" $$list; \
rm -f $$list
+t-fork$(EXEEXT): $(t_fork_OBJECTS) $(t_fork_DEPENDENCIES) $(EXTRA_t_fork_DEPENDENCIES)
+ @rm -f t-fork$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(t_fork_OBJECTS) $(t_fork_LDADD) $(LIBS)
+
t-mutex$(EXEEXT): $(t_mutex_OBJECTS) $(t_mutex_DEPENDENCIES) $(EXTRA_t_mutex_DEPENDENCIES)
@rm -f t-mutex$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(t_mutex_OBJECTS) $(t_mutex_LDADD) $(LIBS)
@@ -433,6 +452,7 @@
distclean-compile:
-rm -f *.tab.c
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-fork.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-mutex.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-thread.Po@am__quote@
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/npth-1.2/tests/t-fork.c new/npth-1.3/tests/t-fork.c
--- old/npth-1.2/tests/t-fork.c 1970-01-01 01:00:00.000000000 +0100
+++ new/npth-1.3/tests/t-fork.c 2016-07-13 19:03:55.000000000 +0200
@@ -0,0 +1,49 @@
+/* t-fork.c
+ * Copyright 2016 g10 Code GmbH
+ *
+ * This file is free software; as a special exception the author gives
+ * unlimited permission to copy and/or distribute it, with or without
+ * modifications, as long as this notice is preserved.
+ *
+ * This file is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
+ * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+
+#include
+#include
+#include
+#include "t-support.h"
+
+
+int
+main (int argc, const char *argv[])
+{
+ int rc;
+ pid_t pid;
+
+ if (argc >= 2 && !strcmp (argv[1], "--verbose"))
+ opt_verbose = 1;
+
+ rc = npth_init ();
+ fail_if_err (rc);
+
+ pid = fork ();
+ if (pid == (pid_t)-1)
+ fail_msg ("fork failed");
+ else if (pid)
+ {
+ int status;
+
+ info_msg ("forked");
+ wait (&status);
+ fail_if_err (status);
+ }
+ else
+ {
+ info_msg ("child exit");
+ npth_usleep (1000); /* Let NPTH enter, sleep, and leave. */
+ }
+
+ return 0;
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/npth-1.2/w32/Makefile.in new/npth-1.3/w32/Makefile.in
--- old/npth-1.2/w32/Makefile.in 2015-04-11 14:02:28.000000000 +0200
+++ new/npth-1.3/w32/Makefile.in 2016-11-22 11:15:03.000000000 +0100
@@ -273,6 +273,7 @@
LIBS = @LIBS@
LIBSOCKET = @LIBSOCKET@
LIBTOOL = @LIBTOOL@
+LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/npth-1.2/w32/npth.c new/npth-1.3/w32/npth.c
--- old/npth-1.2/w32/npth.c 2014-06-27 19:00:38.000000000 +0200
+++ new/npth-1.3/w32/npth.c 2016-11-21 09:31:29.000000000 +0100
@@ -35,12 +35,13 @@
#include
#include
+#include
#include "npth.h"
#include
#define DEBUG_CALLS 1
-#define _npth_debug(x, ...) printf(__VA_ARGS__)
+#define _npth_debug(x, ...) fprintf(stderr, __VA_ARGS__)
#ifndef TEST
#undef DEBUG_CALLS
@@ -57,6 +58,15 @@
global data such as the thread_table. */
static CRITICAL_SECTION sceptre;
+/* This flag is set as soon as npth_init has been called or if any
+ * thread has been created. It will never be cleared again. The only
+ * purpose is to make npth_protect and npth_unprotect more robust in
+ * that they can be shortcut when npth_init has not yet been called.
+ * This is important for libraries which want to support nPth by using
+ * those two functions but may have be initialized before pPth. */
+static int initialized_or_any_threads;
+
+
typedef struct npth_impl_s *npth_impl_t;
#define MAX_THREADS 1024
#define INVALID_THREAD_ID 0
@@ -150,8 +160,8 @@
int res;
if (DEBUG_CALLS)
- _npth_debug (DEBUG_CALLS, "enter_npth (%s)\n",
- function ? function : "unknown");
+ _npth_debug (DEBUG_CALLS, "tid %lu: enter_npth (%s)\n",
+ npth_self (), function ? function : "unknown");
LeaveCriticalSection (&sceptre);
}
@@ -162,8 +172,8 @@
EnterCriticalSection (&sceptre);
if (DEBUG_CALLS)
- _npth_debug (DEBUG_CALLS, "leave_npth (%s)\n",
- function ? function : "");
+ _npth_debug (DEBUG_CALLS, "tid %lu: leave_npth (%s)\n",
+ npth_self (), function ? function : "");
}
#define ENTER() enter_npth(__FUNCTION__)
@@ -320,6 +330,9 @@
InitializeCriticalSection (&sceptre);
+ /* Track that we have been initialized. */
+ initialized_or_any_threads = 1;
+
/* Fake a thread table item for the main thread. */
tls_index = TlsAlloc();
if (tls_index == TLS_OUT_OF_INDEXES)
@@ -1745,14 +1758,23 @@
void
npth_unprotect (void)
{
- ENTER();
+ /* If we are not initialized we may not access the semaphore and
+ * thus we shortcut it. Note that in this case the unprotect/protect
+ * is not needed. For failsafe reasons if an nPth thread has ever
+ * been created but nPth has accidentally not initialized we do not
+ * shortcut so that a stack backtrace (due to the access of the
+ * uninitialized semaphore) is more expressive. */
+ if (initialized_or_any_threads)
+ ENTER();
}
void
npth_protect (void)
{
- LEAVE();
+ /* See npth_unprotect for commentary. */
+ if (initialized_or_any_threads)
+ LEAVE();
}