diff --git a/5.008.009-64bit,threaded/DevelPatchPerl.patch b/5.008.009-64bit,threaded/DevelPatchPerl.patch index 7f31e1d..584b870 100644 --- a/5.008.009-64bit,threaded/DevelPatchPerl.patch +++ b/5.008.009-64bit,threaded/DevelPatchPerl.patch @@ -40,7 +40,7 @@ index 6f20c5e..684f369 100644 or die "Cannot exec $cpp"; } diff --git a/hints/linux.sh b/hints/linux.sh -index ac264c3..fb5a46e 100644 +index ac264c3..3f38ea0 100644 --- a/hints/linux.sh +++ b/hints/linux.sh @@ -13,11 +13,14 @@ @@ -123,10 +123,37 @@ index ac264c3..fb5a46e 100644 ppc*) # on ppc, it seems that gcc (at least gcc 3.3.2) isn't happy # with -O2 ; so downgrade to -O1. -@@ -143,6 +150,77 @@ case "$optimize" in +@@ -143,93 +150,78 @@ case "$optimize" in ;; esac +-# Are we using ELF? Thanks to Kenneth Albanowski +-# for this test. +-cat >try.c <<'EOM' +-/* Test for whether ELF binaries are produced */ +-#include +-#include +-#include +-main() { +- char buffer[4]; +- int i=open("a.out",O_RDONLY); +- if(i==-1) +- exit(1); /* fail */ +- if(read(i,&buffer[0],4)<4) +- exit(1); /* fail */ +- if(buffer[0] != 127 || buffer[1] != 'E' || +- buffer[2] != 'L' || buffer[3] != 'F') +- exit(1); /* fail */ +- exit(0); /* succeed (yes, it's ELF) */ +-} +-EOM +-if ${cc:-gcc} try.c >/dev/null 2>&1 && $run ./a.out; then +- cat <<'EOM' >&4 +- +-You appear to have ELF support. I'll try to use it for dynamic loading. +-If dynamic loading doesn't work, read hints/linux.sh for further information. +-EOM +- +# Ubuntu 11.04 (and later, presumably) doesn't keep most libraries +# (such as -lm) in /lib or /usr/lib. So we have to ask gcc to tell us +# where to look. We don't want gcc's own libraries, however, so we @@ -142,10 +169,16 @@ index ac264c3..fb5a46e 100644 +# plibpth to bypass this check. +if [ -x /usr/bin/gcc ] ; then + gcc=/usr/bin/gcc -+else + else +- cat <<'EOM' >&4 + gcc=gcc +fi -+ + +-You don't have an ELF gcc. I will use dld if possible. If you are +-using a version of DLD earlier than 3.2.6, or don't have it at all, you +-should probably upgrade. If you are forced to use 3.2.4, you should +-uncomment a couple of lines in hints/linux.sh and restart Configure so +-that shared libraries will be disallowed. +case "$plibpth" in +'') plibpth=`LANG=C LC_ALL=C $gcc $ccflags $ldflags -print-search-dirs | grep libraries | + cut -f2- -d= | tr ':' $trnl | grep -v 'gcc' | sed -e 's:/$::'` @@ -154,7 +187,54 @@ index ac264c3..fb5a46e 100644 + plibpth="$*" + ;; +esac -+ + +-EOM +- lddlflags="-r $lddlflags" +- # These empty values are so that Configure doesn't put in the +- # Linux ELF values. +- ccdlflags=' ' +- cccdlflags=' ' +- ccflags="-DOVR_DBL_DIG=14 $ccflags" +- so='sa' +- dlext='o' +- nm_so_opt=' ' +- ## If you are using DLD 3.2.4 which does not support shared libs, +- ## uncomment the next two lines: +- #ldflags="-static" +- #so='none' +- +- # In addition, on some systems there is a problem with perl and NDBM +- # which causes AnyDBM and NDBM_File to lock up. This is evidenced +- # in the tests as AnyDBM just freezing. Apparently, this only +- # happens on a.out systems, so we disable NDBM for all a.out linux +- # systems. If someone can suggest a more robust test +- # that would be appreciated. +- # +- # More info: +- # Date: Wed, 7 Feb 1996 03:21:04 +0900 +- # From: Jeffrey Friedl +- # +- # I tried compiling with DBM support and sure enough things locked up +- # just as advertised. Checking into it, I found that the lockup was +- # during the call to dbm_open. Not *in* dbm_open -- but between the call +- # to and the jump into. +- # +- # To make a long story short, making sure that the *.a and *.sa pairs of +- # /usr/lib/lib{m,db,gdbm}.{a,sa} +- # were perfectly in sync took care of it. +- # +- # This will generate a harmless Whoa There! message +- case "$d_dbm_open" in +- '') cat <<'EOM' >&4 +- +-Disabling ndbm. This will generate a Whoa There message in Configure. +-Read hints/linux.sh for further information. +-EOM +- # You can override this with Configure -Dd_dbm_open +- d_dbm_open=undef +- ;; +- esac +-fi +# libquadmath is sometimes installed as gcc internal library, +# so contrary to our usual policy of *not* looking at gcc internal +# directories we now *do* look at them, in case they contain @@ -171,7 +251,8 @@ index ac264c3..fb5a46e 100644 + done + ;; +esac -+ + +-rm -f try.c a.out +case "$libc" in +'') +# If you have glibc, then report the version for ./myconfig bug reporting. @@ -197,29 +278,13 @@ index ac264c3..fb5a46e 100644 + done + ;; +esac -+ - # Are we using ELF? Thanks to Kenneth Albanowski - # for this test. - cat >try.c <<'EOM' -@@ -163,7 +241,7 @@ main() { - exit(0); /* succeed (yes, it's ELF) */ - } - EOM --if ${cc:-gcc} try.c >/dev/null 2>&1 && $run ./a.out; then -+if ${cc:-gcc} $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then - cat <<'EOM' >&4 - - You appear to have ELF support. I'll try to use it for dynamic loading. -@@ -229,7 +307,7 @@ fi - - rm -f try.c a.out -if /bin/sh -c exit; then +if ${sh:-/bin/sh} -c exit; then echo '' echo 'You appear to have a working bash. Good.' else -@@ -296,7 +374,7 @@ fi +@@ -296,7 +288,7 @@ fi #'osfmach3ppc') ccdlflags='-Wl,-E' ;; #esac @@ -228,7 +293,7 @@ index ac264c3..fb5a46e 100644 sparc*) case "$cccdlflags" in *-fpic*) cccdlflags="`echo $cccdlflags|sed 's/-fpic/-fPIC/'`" ;; -@@ -311,24 +389,62 @@ esac +@@ -311,24 +303,62 @@ esac # version of -lgdbm which is a bad idea. So if we have 'nm' # make sure it can read the file # NI-S 2003/08/07 @@ -302,7 +367,7 @@ index ac264c3..fb5a46e 100644 if echo $libswanted | grep -v pthread >/dev/null then set `echo X "$libswanted "| sed -e 's/ c / pthread c /'` -@@ -375,16 +491,6 @@ $define|true|[yY]*) +@@ -375,16 +405,6 @@ $define|true|[yY]*) ;; esac @@ -319,7 +384,7 @@ index ac264c3..fb5a46e 100644 # If using g++, the Configure scan for dlopen() and (especially) # dlerror() might fail, easier just to forcibly hint them in. case "$cc" in -@@ -408,7 +514,7 @@ then +@@ -408,7 +428,7 @@ then DBLIB="$DBDIR/libdb.so" if [ -f $DBLIB ] then @@ -387,18 +452,6 @@ index 030db74..0d15a40 100644 } } -diff --git a/patchlevel.h b/patchlevel.h -index 82f11ed..2254fd1 100644 ---- a/patchlevel.h -+++ b/patchlevel.h -@@ -121,6 +121,7 @@ hunk. - #if !defined(PERL_PATCHLEVEL_H_IMPLICIT) && !defined(LOCAL_PATCH_COUNT) - static const char *local_patches[] = { - NULL -+ ,"Devel::PatchPerl 1.38" - ,NULL - }; - diff --git a/perl.c b/perl.c index 82e5538..b9e02fe 100644 --- a/perl.c diff --git a/5.008.009-64bit,threaded/Dockerfile b/5.008.009-64bit,threaded/Dockerfile index c89f5e6..9ea769d 100644 --- a/5.008.009-64bit,threaded/Dockerfile +++ b/5.008.009-64bit,threaded/Dockerfile @@ -10,7 +10,7 @@ COPY *.patch /usr/src/perl/ WORKDIR /usr/src/perl RUN curl -SL https://cpan.metacpan.org/authors/id/N/NW/NWCLARK/perl-5.8.9.tar.bz2 -o perl-5.8.9.tar.bz2 \ - && echo '19843b5a7585cf35d96c07dbcd419bbdd5813617 *perl-5.8.9.tar.bz2' | sha1sum -c - \ + && echo '1097fbcd48ceccb2bc735d119c9db399a02a8ab9f7dc53e29e47e6a8d0d72e79 *perl-5.8.9.tar.bz2' | sha256sum -c - \ && tar --strip-components=1 -xjf perl-5.8.9.tar.bz2 -C /usr/src/perl \ && rm perl-5.8.9.tar.bz2 \ && cat *.patch | patch -p1 \ diff --git a/5.008.009-64bit/DevelPatchPerl.patch b/5.008.009-64bit/DevelPatchPerl.patch index 7f31e1d..584b870 100644 --- a/5.008.009-64bit/DevelPatchPerl.patch +++ b/5.008.009-64bit/DevelPatchPerl.patch @@ -40,7 +40,7 @@ index 6f20c5e..684f369 100644 or die "Cannot exec $cpp"; } diff --git a/hints/linux.sh b/hints/linux.sh -index ac264c3..fb5a46e 100644 +index ac264c3..3f38ea0 100644 --- a/hints/linux.sh +++ b/hints/linux.sh @@ -13,11 +13,14 @@ @@ -123,10 +123,37 @@ index ac264c3..fb5a46e 100644 ppc*) # on ppc, it seems that gcc (at least gcc 3.3.2) isn't happy # with -O2 ; so downgrade to -O1. -@@ -143,6 +150,77 @@ case "$optimize" in +@@ -143,93 +150,78 @@ case "$optimize" in ;; esac +-# Are we using ELF? Thanks to Kenneth Albanowski +-# for this test. +-cat >try.c <<'EOM' +-/* Test for whether ELF binaries are produced */ +-#include +-#include +-#include +-main() { +- char buffer[4]; +- int i=open("a.out",O_RDONLY); +- if(i==-1) +- exit(1); /* fail */ +- if(read(i,&buffer[0],4)<4) +- exit(1); /* fail */ +- if(buffer[0] != 127 || buffer[1] != 'E' || +- buffer[2] != 'L' || buffer[3] != 'F') +- exit(1); /* fail */ +- exit(0); /* succeed (yes, it's ELF) */ +-} +-EOM +-if ${cc:-gcc} try.c >/dev/null 2>&1 && $run ./a.out; then +- cat <<'EOM' >&4 +- +-You appear to have ELF support. I'll try to use it for dynamic loading. +-If dynamic loading doesn't work, read hints/linux.sh for further information. +-EOM +- +# Ubuntu 11.04 (and later, presumably) doesn't keep most libraries +# (such as -lm) in /lib or /usr/lib. So we have to ask gcc to tell us +# where to look. We don't want gcc's own libraries, however, so we @@ -142,10 +169,16 @@ index ac264c3..fb5a46e 100644 +# plibpth to bypass this check. +if [ -x /usr/bin/gcc ] ; then + gcc=/usr/bin/gcc -+else + else +- cat <<'EOM' >&4 + gcc=gcc +fi -+ + +-You don't have an ELF gcc. I will use dld if possible. If you are +-using a version of DLD earlier than 3.2.6, or don't have it at all, you +-should probably upgrade. If you are forced to use 3.2.4, you should +-uncomment a couple of lines in hints/linux.sh and restart Configure so +-that shared libraries will be disallowed. +case "$plibpth" in +'') plibpth=`LANG=C LC_ALL=C $gcc $ccflags $ldflags -print-search-dirs | grep libraries | + cut -f2- -d= | tr ':' $trnl | grep -v 'gcc' | sed -e 's:/$::'` @@ -154,7 +187,54 @@ index ac264c3..fb5a46e 100644 + plibpth="$*" + ;; +esac -+ + +-EOM +- lddlflags="-r $lddlflags" +- # These empty values are so that Configure doesn't put in the +- # Linux ELF values. +- ccdlflags=' ' +- cccdlflags=' ' +- ccflags="-DOVR_DBL_DIG=14 $ccflags" +- so='sa' +- dlext='o' +- nm_so_opt=' ' +- ## If you are using DLD 3.2.4 which does not support shared libs, +- ## uncomment the next two lines: +- #ldflags="-static" +- #so='none' +- +- # In addition, on some systems there is a problem with perl and NDBM +- # which causes AnyDBM and NDBM_File to lock up. This is evidenced +- # in the tests as AnyDBM just freezing. Apparently, this only +- # happens on a.out systems, so we disable NDBM for all a.out linux +- # systems. If someone can suggest a more robust test +- # that would be appreciated. +- # +- # More info: +- # Date: Wed, 7 Feb 1996 03:21:04 +0900 +- # From: Jeffrey Friedl +- # +- # I tried compiling with DBM support and sure enough things locked up +- # just as advertised. Checking into it, I found that the lockup was +- # during the call to dbm_open. Not *in* dbm_open -- but between the call +- # to and the jump into. +- # +- # To make a long story short, making sure that the *.a and *.sa pairs of +- # /usr/lib/lib{m,db,gdbm}.{a,sa} +- # were perfectly in sync took care of it. +- # +- # This will generate a harmless Whoa There! message +- case "$d_dbm_open" in +- '') cat <<'EOM' >&4 +- +-Disabling ndbm. This will generate a Whoa There message in Configure. +-Read hints/linux.sh for further information. +-EOM +- # You can override this with Configure -Dd_dbm_open +- d_dbm_open=undef +- ;; +- esac +-fi +# libquadmath is sometimes installed as gcc internal library, +# so contrary to our usual policy of *not* looking at gcc internal +# directories we now *do* look at them, in case they contain @@ -171,7 +251,8 @@ index ac264c3..fb5a46e 100644 + done + ;; +esac -+ + +-rm -f try.c a.out +case "$libc" in +'') +# If you have glibc, then report the version for ./myconfig bug reporting. @@ -197,29 +278,13 @@ index ac264c3..fb5a46e 100644 + done + ;; +esac -+ - # Are we using ELF? Thanks to Kenneth Albanowski - # for this test. - cat >try.c <<'EOM' -@@ -163,7 +241,7 @@ main() { - exit(0); /* succeed (yes, it's ELF) */ - } - EOM --if ${cc:-gcc} try.c >/dev/null 2>&1 && $run ./a.out; then -+if ${cc:-gcc} $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then - cat <<'EOM' >&4 - - You appear to have ELF support. I'll try to use it for dynamic loading. -@@ -229,7 +307,7 @@ fi - - rm -f try.c a.out -if /bin/sh -c exit; then +if ${sh:-/bin/sh} -c exit; then echo '' echo 'You appear to have a working bash. Good.' else -@@ -296,7 +374,7 @@ fi +@@ -296,7 +288,7 @@ fi #'osfmach3ppc') ccdlflags='-Wl,-E' ;; #esac @@ -228,7 +293,7 @@ index ac264c3..fb5a46e 100644 sparc*) case "$cccdlflags" in *-fpic*) cccdlflags="`echo $cccdlflags|sed 's/-fpic/-fPIC/'`" ;; -@@ -311,24 +389,62 @@ esac +@@ -311,24 +303,62 @@ esac # version of -lgdbm which is a bad idea. So if we have 'nm' # make sure it can read the file # NI-S 2003/08/07 @@ -302,7 +367,7 @@ index ac264c3..fb5a46e 100644 if echo $libswanted | grep -v pthread >/dev/null then set `echo X "$libswanted "| sed -e 's/ c / pthread c /'` -@@ -375,16 +491,6 @@ $define|true|[yY]*) +@@ -375,16 +405,6 @@ $define|true|[yY]*) ;; esac @@ -319,7 +384,7 @@ index ac264c3..fb5a46e 100644 # If using g++, the Configure scan for dlopen() and (especially) # dlerror() might fail, easier just to forcibly hint them in. case "$cc" in -@@ -408,7 +514,7 @@ then +@@ -408,7 +428,7 @@ then DBLIB="$DBDIR/libdb.so" if [ -f $DBLIB ] then @@ -387,18 +452,6 @@ index 030db74..0d15a40 100644 } } -diff --git a/patchlevel.h b/patchlevel.h -index 82f11ed..2254fd1 100644 ---- a/patchlevel.h -+++ b/patchlevel.h -@@ -121,6 +121,7 @@ hunk. - #if !defined(PERL_PATCHLEVEL_H_IMPLICIT) && !defined(LOCAL_PATCH_COUNT) - static const char *local_patches[] = { - NULL -+ ,"Devel::PatchPerl 1.38" - ,NULL - }; - diff --git a/perl.c b/perl.c index 82e5538..b9e02fe 100644 --- a/perl.c diff --git a/5.008.009-64bit/Dockerfile b/5.008.009-64bit/Dockerfile index dc3ad8e..adf51e6 100644 --- a/5.008.009-64bit/Dockerfile +++ b/5.008.009-64bit/Dockerfile @@ -10,7 +10,7 @@ COPY *.patch /usr/src/perl/ WORKDIR /usr/src/perl RUN curl -SL https://cpan.metacpan.org/authors/id/N/NW/NWCLARK/perl-5.8.9.tar.bz2 -o perl-5.8.9.tar.bz2 \ - && echo '19843b5a7585cf35d96c07dbcd419bbdd5813617 *perl-5.8.9.tar.bz2' | sha1sum -c - \ + && echo '1097fbcd48ceccb2bc735d119c9db399a02a8ab9f7dc53e29e47e6a8d0d72e79 *perl-5.8.9.tar.bz2' | sha256sum -c - \ && tar --strip-components=1 -xjf perl-5.8.9.tar.bz2 -C /usr/src/perl \ && rm perl-5.8.9.tar.bz2 \ && cat *.patch | patch -p1 \ diff --git a/5.010.001-64bit,threaded/DevelPatchPerl.patch b/5.010.001-64bit,threaded/DevelPatchPerl.patch index a76fc16..f83adf0 100644 --- a/5.010.001-64bit,threaded/DevelPatchPerl.patch +++ b/5.010.001-64bit,threaded/DevelPatchPerl.patch @@ -92,7 +92,7 @@ index f8ca492..204bba0 100644 + $self->{LIBS}->[0] .= ' -lgdbm_compat' if -e $_.'/libgdbm_compat.so'; } diff --git a/hints/linux.sh b/hints/linux.sh -index c88f157..fb5a46e 100644 +index c88f157..3f38ea0 100644 --- a/hints/linux.sh +++ b/hints/linux.sh @@ -13,11 +13,14 @@ @@ -176,10 +176,37 @@ index c88f157..fb5a46e 100644 ppc*) # on ppc, it seems that gcc (at least gcc 3.3.2) isn't happy # with -O2 ; so downgrade to -O1. -@@ -146,6 +150,77 @@ case "$optimize" in +@@ -146,93 +150,78 @@ case "$optimize" in ;; esac +-# Are we using ELF? Thanks to Kenneth Albanowski +-# for this test. +-cat >try.c <<'EOM' +-/* Test for whether ELF binaries are produced */ +-#include +-#include +-#include +-main() { +- char buffer[4]; +- int i=open("a.out",O_RDONLY); +- if(i==-1) +- exit(1); /* fail */ +- if(read(i,&buffer[0],4)<4) +- exit(1); /* fail */ +- if(buffer[0] != 127 || buffer[1] != 'E' || +- buffer[2] != 'L' || buffer[3] != 'F') +- exit(1); /* fail */ +- exit(0); /* succeed (yes, it's ELF) */ +-} +-EOM +-if ${cc:-gcc} try.c >/dev/null 2>&1 && $run ./a.out; then +- cat <<'EOM' >&4 +- +-You appear to have ELF support. I'll try to use it for dynamic loading. +-If dynamic loading doesn't work, read hints/linux.sh for further information. +-EOM +- +# Ubuntu 11.04 (and later, presumably) doesn't keep most libraries +# (such as -lm) in /lib or /usr/lib. So we have to ask gcc to tell us +# where to look. We don't want gcc's own libraries, however, so we @@ -195,10 +222,16 @@ index c88f157..fb5a46e 100644 +# plibpth to bypass this check. +if [ -x /usr/bin/gcc ] ; then + gcc=/usr/bin/gcc -+else + else +- cat <<'EOM' >&4 + gcc=gcc +fi -+ + +-You don't have an ELF gcc. I will use dld if possible. If you are +-using a version of DLD earlier than 3.2.6, or don't have it at all, you +-should probably upgrade. If you are forced to use 3.2.4, you should +-uncomment a couple of lines in hints/linux.sh and restart Configure so +-that shared libraries will be disallowed. +case "$plibpth" in +'') plibpth=`LANG=C LC_ALL=C $gcc $ccflags $ldflags -print-search-dirs | grep libraries | + cut -f2- -d= | tr ':' $trnl | grep -v 'gcc' | sed -e 's:/$::'` @@ -207,7 +240,54 @@ index c88f157..fb5a46e 100644 + plibpth="$*" + ;; +esac -+ + +-EOM +- lddlflags="-r $lddlflags" +- # These empty values are so that Configure doesn't put in the +- # Linux ELF values. +- ccdlflags=' ' +- cccdlflags=' ' +- ccflags="-DOVR_DBL_DIG=14 $ccflags" +- so='sa' +- dlext='o' +- nm_so_opt=' ' +- ## If you are using DLD 3.2.4 which does not support shared libs, +- ## uncomment the next two lines: +- #ldflags="-static" +- #so='none' +- +- # In addition, on some systems there is a problem with perl and NDBM +- # which causes AnyDBM and NDBM_File to lock up. This is evidenced +- # in the tests as AnyDBM just freezing. Apparently, this only +- # happens on a.out systems, so we disable NDBM for all a.out linux +- # systems. If someone can suggest a more robust test +- # that would be appreciated. +- # +- # More info: +- # Date: Wed, 7 Feb 1996 03:21:04 +0900 +- # From: Jeffrey Friedl +- # +- # I tried compiling with DBM support and sure enough things locked up +- # just as advertised. Checking into it, I found that the lockup was +- # during the call to dbm_open. Not *in* dbm_open -- but between the call +- # to and the jump into. +- # +- # To make a long story short, making sure that the *.a and *.sa pairs of +- # /usr/lib/lib{m,db,gdbm}.{a,sa} +- # were perfectly in sync took care of it. +- # +- # This will generate a harmless Whoa There! message +- case "$d_dbm_open" in +- '') cat <<'EOM' >&4 +- +-Disabling ndbm. This will generate a Whoa There message in Configure. +-Read hints/linux.sh for further information. +-EOM +- # You can override this with Configure -Dd_dbm_open +- d_dbm_open=undef +- ;; +- esac +-fi +# libquadmath is sometimes installed as gcc internal library, +# so contrary to our usual policy of *not* looking at gcc internal +# directories we now *do* look at them, in case they contain @@ -224,7 +304,8 @@ index c88f157..fb5a46e 100644 + done + ;; +esac -+ + +-rm -f try.c a.out +case "$libc" in +'') +# If you have glibc, then report the version for ./myconfig bug reporting. @@ -250,29 +331,13 @@ index c88f157..fb5a46e 100644 + done + ;; +esac -+ - # Are we using ELF? Thanks to Kenneth Albanowski - # for this test. - cat >try.c <<'EOM' -@@ -166,7 +241,7 @@ main() { - exit(0); /* succeed (yes, it's ELF) */ - } - EOM --if ${cc:-gcc} try.c >/dev/null 2>&1 && $run ./a.out; then -+if ${cc:-gcc} $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then - cat <<'EOM' >&4 - - You appear to have ELF support. I'll try to use it for dynamic loading. -@@ -232,7 +307,7 @@ fi - - rm -f try.c a.out -if /bin/sh -c exit; then +if ${sh:-/bin/sh} -c exit; then echo '' echo 'You appear to have a working bash. Good.' else -@@ -299,7 +374,7 @@ fi +@@ -299,7 +288,7 @@ fi #'osfmach3ppc') ccdlflags='-Wl,-E' ;; #esac @@ -281,7 +346,7 @@ index c88f157..fb5a46e 100644 sparc*) case "$cccdlflags" in *-fpic*) cccdlflags="`echo $cccdlflags|sed 's/-fpic/-fPIC/'`" ;; -@@ -314,30 +389,62 @@ esac +@@ -314,30 +303,62 @@ esac # version of -lgdbm which is a bad idea. So if we have 'nm' # make sure it can read the file # NI-S 2003/08/07 @@ -361,7 +426,7 @@ index c88f157..fb5a46e 100644 if echo $libswanted | grep -v pthread >/dev/null then set `echo X "$libswanted "| sed -e 's/ c / pthread c /'` -@@ -384,16 +491,6 @@ $define|true|[yY]*) +@@ -384,16 +405,6 @@ $define|true|[yY]*) ;; esac @@ -378,7 +443,7 @@ index c88f157..fb5a46e 100644 # If using g++, the Configure scan for dlopen() and (especially) # dlerror() might fail, easier just to forcibly hint them in. case "$cc" in -@@ -417,7 +514,7 @@ then +@@ -417,7 +428,7 @@ then DBLIB="$DBDIR/libdb.so" if [ -f $DBLIB ] then @@ -486,18 +551,6 @@ index 22a97eb..6eac035 100644 print "\nRunning Makefile.PL in $ext_dir\n"; # Presumably this can be simplified -diff --git a/patchlevel.h b/patchlevel.h -index 4442407..b82feab 100644 ---- a/patchlevel.h -+++ b/patchlevel.h -@@ -131,6 +131,7 @@ static const char * const local_patches[] = { - NULL - PERL_GIT_UNPUSHED_COMMITS /* do not remove this line */ - PERL_GIT_UNCOMMITTED_CHANGES /* do not remove this line */ -+ ,"Devel::PatchPerl 1.38" - ,NULL - }; - diff --git a/perl.c b/perl.c index 94f2b13..5f30040 100644 --- a/perl.c @@ -512,9 +565,7 @@ index 94f2b13..5f30040 100644 # ifdef OS2 diff --git a/t/op/hash.t b/t/op/hash.t -old mode 100755 -new mode 100644 -index 9bde518..45eb782 +index 9bde518..45eb782 100755 --- a/t/op/hash.t +++ b/t/op/hash.t @@ -39,22 +39,36 @@ use constant THRESHOLD => 14; diff --git a/5.010.001-64bit,threaded/Dockerfile b/5.010.001-64bit,threaded/Dockerfile index d92c2ad..63a1b80 100644 --- a/5.010.001-64bit,threaded/Dockerfile +++ b/5.010.001-64bit,threaded/Dockerfile @@ -10,7 +10,7 @@ COPY *.patch /usr/src/perl/ WORKDIR /usr/src/perl RUN curl -SL https://cpan.metacpan.org/authors/id/D/DA/DAPM/perl-5.10.1.tar.bz2 -o perl-5.10.1.tar.bz2 \ - && echo '98b762b5cd4fb76dd354dfa5ba0d21bc2acacaf2 *perl-5.10.1.tar.bz2' | sha1sum -c - \ + && echo '9385f2c8c2ca8b1dc4a7c31903f1f8dc8f2ba867dc2a9e5c93012ed6b564e826 *perl-5.10.1.tar.bz2' | sha256sum -c - \ && tar --strip-components=1 -xjf perl-5.10.1.tar.bz2 -C /usr/src/perl \ && rm perl-5.10.1.tar.bz2 \ && cat *.patch | patch -p1 \ diff --git a/5.010.001-64bit/DevelPatchPerl.patch b/5.010.001-64bit/DevelPatchPerl.patch index a76fc16..f83adf0 100644 --- a/5.010.001-64bit/DevelPatchPerl.patch +++ b/5.010.001-64bit/DevelPatchPerl.patch @@ -92,7 +92,7 @@ index f8ca492..204bba0 100644 + $self->{LIBS}->[0] .= ' -lgdbm_compat' if -e $_.'/libgdbm_compat.so'; } diff --git a/hints/linux.sh b/hints/linux.sh -index c88f157..fb5a46e 100644 +index c88f157..3f38ea0 100644 --- a/hints/linux.sh +++ b/hints/linux.sh @@ -13,11 +13,14 @@ @@ -176,10 +176,37 @@ index c88f157..fb5a46e 100644 ppc*) # on ppc, it seems that gcc (at least gcc 3.3.2) isn't happy # with -O2 ; so downgrade to -O1. -@@ -146,6 +150,77 @@ case "$optimize" in +@@ -146,93 +150,78 @@ case "$optimize" in ;; esac +-# Are we using ELF? Thanks to Kenneth Albanowski +-# for this test. +-cat >try.c <<'EOM' +-/* Test for whether ELF binaries are produced */ +-#include +-#include +-#include +-main() { +- char buffer[4]; +- int i=open("a.out",O_RDONLY); +- if(i==-1) +- exit(1); /* fail */ +- if(read(i,&buffer[0],4)<4) +- exit(1); /* fail */ +- if(buffer[0] != 127 || buffer[1] != 'E' || +- buffer[2] != 'L' || buffer[3] != 'F') +- exit(1); /* fail */ +- exit(0); /* succeed (yes, it's ELF) */ +-} +-EOM +-if ${cc:-gcc} try.c >/dev/null 2>&1 && $run ./a.out; then +- cat <<'EOM' >&4 +- +-You appear to have ELF support. I'll try to use it for dynamic loading. +-If dynamic loading doesn't work, read hints/linux.sh for further information. +-EOM +- +# Ubuntu 11.04 (and later, presumably) doesn't keep most libraries +# (such as -lm) in /lib or /usr/lib. So we have to ask gcc to tell us +# where to look. We don't want gcc's own libraries, however, so we @@ -195,10 +222,16 @@ index c88f157..fb5a46e 100644 +# plibpth to bypass this check. +if [ -x /usr/bin/gcc ] ; then + gcc=/usr/bin/gcc -+else + else +- cat <<'EOM' >&4 + gcc=gcc +fi -+ + +-You don't have an ELF gcc. I will use dld if possible. If you are +-using a version of DLD earlier than 3.2.6, or don't have it at all, you +-should probably upgrade. If you are forced to use 3.2.4, you should +-uncomment a couple of lines in hints/linux.sh and restart Configure so +-that shared libraries will be disallowed. +case "$plibpth" in +'') plibpth=`LANG=C LC_ALL=C $gcc $ccflags $ldflags -print-search-dirs | grep libraries | + cut -f2- -d= | tr ':' $trnl | grep -v 'gcc' | sed -e 's:/$::'` @@ -207,7 +240,54 @@ index c88f157..fb5a46e 100644 + plibpth="$*" + ;; +esac -+ + +-EOM +- lddlflags="-r $lddlflags" +- # These empty values are so that Configure doesn't put in the +- # Linux ELF values. +- ccdlflags=' ' +- cccdlflags=' ' +- ccflags="-DOVR_DBL_DIG=14 $ccflags" +- so='sa' +- dlext='o' +- nm_so_opt=' ' +- ## If you are using DLD 3.2.4 which does not support shared libs, +- ## uncomment the next two lines: +- #ldflags="-static" +- #so='none' +- +- # In addition, on some systems there is a problem with perl and NDBM +- # which causes AnyDBM and NDBM_File to lock up. This is evidenced +- # in the tests as AnyDBM just freezing. Apparently, this only +- # happens on a.out systems, so we disable NDBM for all a.out linux +- # systems. If someone can suggest a more robust test +- # that would be appreciated. +- # +- # More info: +- # Date: Wed, 7 Feb 1996 03:21:04 +0900 +- # From: Jeffrey Friedl +- # +- # I tried compiling with DBM support and sure enough things locked up +- # just as advertised. Checking into it, I found that the lockup was +- # during the call to dbm_open. Not *in* dbm_open -- but between the call +- # to and the jump into. +- # +- # To make a long story short, making sure that the *.a and *.sa pairs of +- # /usr/lib/lib{m,db,gdbm}.{a,sa} +- # were perfectly in sync took care of it. +- # +- # This will generate a harmless Whoa There! message +- case "$d_dbm_open" in +- '') cat <<'EOM' >&4 +- +-Disabling ndbm. This will generate a Whoa There message in Configure. +-Read hints/linux.sh for further information. +-EOM +- # You can override this with Configure -Dd_dbm_open +- d_dbm_open=undef +- ;; +- esac +-fi +# libquadmath is sometimes installed as gcc internal library, +# so contrary to our usual policy of *not* looking at gcc internal +# directories we now *do* look at them, in case they contain @@ -224,7 +304,8 @@ index c88f157..fb5a46e 100644 + done + ;; +esac -+ + +-rm -f try.c a.out +case "$libc" in +'') +# If you have glibc, then report the version for ./myconfig bug reporting. @@ -250,29 +331,13 @@ index c88f157..fb5a46e 100644 + done + ;; +esac -+ - # Are we using ELF? Thanks to Kenneth Albanowski - # for this test. - cat >try.c <<'EOM' -@@ -166,7 +241,7 @@ main() { - exit(0); /* succeed (yes, it's ELF) */ - } - EOM --if ${cc:-gcc} try.c >/dev/null 2>&1 && $run ./a.out; then -+if ${cc:-gcc} $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then - cat <<'EOM' >&4 - - You appear to have ELF support. I'll try to use it for dynamic loading. -@@ -232,7 +307,7 @@ fi - - rm -f try.c a.out -if /bin/sh -c exit; then +if ${sh:-/bin/sh} -c exit; then echo '' echo 'You appear to have a working bash. Good.' else -@@ -299,7 +374,7 @@ fi +@@ -299,7 +288,7 @@ fi #'osfmach3ppc') ccdlflags='-Wl,-E' ;; #esac @@ -281,7 +346,7 @@ index c88f157..fb5a46e 100644 sparc*) case "$cccdlflags" in *-fpic*) cccdlflags="`echo $cccdlflags|sed 's/-fpic/-fPIC/'`" ;; -@@ -314,30 +389,62 @@ esac +@@ -314,30 +303,62 @@ esac # version of -lgdbm which is a bad idea. So if we have 'nm' # make sure it can read the file # NI-S 2003/08/07 @@ -361,7 +426,7 @@ index c88f157..fb5a46e 100644 if echo $libswanted | grep -v pthread >/dev/null then set `echo X "$libswanted "| sed -e 's/ c / pthread c /'` -@@ -384,16 +491,6 @@ $define|true|[yY]*) +@@ -384,16 +405,6 @@ $define|true|[yY]*) ;; esac @@ -378,7 +443,7 @@ index c88f157..fb5a46e 100644 # If using g++, the Configure scan for dlopen() and (especially) # dlerror() might fail, easier just to forcibly hint them in. case "$cc" in -@@ -417,7 +514,7 @@ then +@@ -417,7 +428,7 @@ then DBLIB="$DBDIR/libdb.so" if [ -f $DBLIB ] then @@ -486,18 +551,6 @@ index 22a97eb..6eac035 100644 print "\nRunning Makefile.PL in $ext_dir\n"; # Presumably this can be simplified -diff --git a/patchlevel.h b/patchlevel.h -index 4442407..b82feab 100644 ---- a/patchlevel.h -+++ b/patchlevel.h -@@ -131,6 +131,7 @@ static const char * const local_patches[] = { - NULL - PERL_GIT_UNPUSHED_COMMITS /* do not remove this line */ - PERL_GIT_UNCOMMITTED_CHANGES /* do not remove this line */ -+ ,"Devel::PatchPerl 1.38" - ,NULL - }; - diff --git a/perl.c b/perl.c index 94f2b13..5f30040 100644 --- a/perl.c @@ -512,9 +565,7 @@ index 94f2b13..5f30040 100644 # ifdef OS2 diff --git a/t/op/hash.t b/t/op/hash.t -old mode 100755 -new mode 100644 -index 9bde518..45eb782 +index 9bde518..45eb782 100755 --- a/t/op/hash.t +++ b/t/op/hash.t @@ -39,22 +39,36 @@ use constant THRESHOLD => 14; diff --git a/5.010.001-64bit/Dockerfile b/5.010.001-64bit/Dockerfile index 367cc6f..5c9328e 100644 --- a/5.010.001-64bit/Dockerfile +++ b/5.010.001-64bit/Dockerfile @@ -10,7 +10,7 @@ COPY *.patch /usr/src/perl/ WORKDIR /usr/src/perl RUN curl -SL https://cpan.metacpan.org/authors/id/D/DA/DAPM/perl-5.10.1.tar.bz2 -o perl-5.10.1.tar.bz2 \ - && echo '98b762b5cd4fb76dd354dfa5ba0d21bc2acacaf2 *perl-5.10.1.tar.bz2' | sha1sum -c - \ + && echo '9385f2c8c2ca8b1dc4a7c31903f1f8dc8f2ba867dc2a9e5c93012ed6b564e826 *perl-5.10.1.tar.bz2' | sha256sum -c - \ && tar --strip-components=1 -xjf perl-5.10.1.tar.bz2 -C /usr/src/perl \ && rm perl-5.10.1.tar.bz2 \ && cat *.patch | patch -p1 \ diff --git a/5.012.005-64bit,threaded/DevelPatchPerl.patch b/5.012.005-64bit,threaded/DevelPatchPerl.patch index 69d7fe7..d2a8373 100644 --- a/5.012.005-64bit,threaded/DevelPatchPerl.patch +++ b/5.012.005-64bit,threaded/DevelPatchPerl.patch @@ -117,7 +117,7 @@ index f8ca492..204bba0 100644 + $self->{LIBS}->[0] .= ' -lgdbm_compat' if -e $_.'/libgdbm_compat.so'; } diff --git a/hints/linux.sh b/hints/linux.sh -index 0519eca..fb5a46e 100644 +index 0519eca..3f38ea0 100644 --- a/hints/linux.sh +++ b/hints/linux.sh @@ -13,11 +13,14 @@ @@ -215,10 +215,93 @@ index 0519eca..fb5a46e 100644 cut -f2- -d= | tr ':' $trnl | grep -v 'gcc' | sed -e 's:/$::'` set X $plibpth # Collapse all entries on one line shift -@@ -171,6 +178,49 @@ case "$plibpth" in +@@ -171,93 +178,50 @@ case "$plibpth" in ;; esac +-# Are we using ELF? Thanks to Kenneth Albanowski +-# for this test. +-cat >try.c <<'EOM' +-/* Test for whether ELF binaries are produced */ +-#include +-#include +-#include +-main() { +- char buffer[4]; +- int i=open("a.out",O_RDONLY); +- if(i==-1) +- exit(1); /* fail */ +- if(read(i,&buffer[0],4)<4) +- exit(1); /* fail */ +- if(buffer[0] != 127 || buffer[1] != 'E' || +- buffer[2] != 'L' || buffer[3] != 'F') +- exit(1); /* fail */ +- exit(0); /* succeed (yes, it's ELF) */ +-} +-EOM +-if ${cc:-gcc} try.c >/dev/null 2>&1 && $run ./a.out; then +- cat <<'EOM' >&4 +- +-You appear to have ELF support. I'll try to use it for dynamic loading. +-If dynamic loading doesn't work, read hints/linux.sh for further information. +-EOM +- +-else +- cat <<'EOM' >&4 +- +-You don't have an ELF gcc. I will use dld if possible. If you are +-using a version of DLD earlier than 3.2.6, or don't have it at all, you +-should probably upgrade. If you are forced to use 3.2.4, you should +-uncomment a couple of lines in hints/linux.sh and restart Configure so +-that shared libraries will be disallowed. +- +-EOM +- lddlflags="-r $lddlflags" +- # These empty values are so that Configure doesn't put in the +- # Linux ELF values. +- ccdlflags=' ' +- cccdlflags=' ' +- ccflags="-DOVR_DBL_DIG=14 $ccflags" +- so='sa' +- dlext='o' +- nm_so_opt=' ' +- ## If you are using DLD 3.2.4 which does not support shared libs, +- ## uncomment the next two lines: +- #ldflags="-static" +- #so='none' +- +- # In addition, on some systems there is a problem with perl and NDBM +- # which causes AnyDBM and NDBM_File to lock up. This is evidenced +- # in the tests as AnyDBM just freezing. Apparently, this only +- # happens on a.out systems, so we disable NDBM for all a.out linux +- # systems. If someone can suggest a more robust test +- # that would be appreciated. +- # +- # More info: +- # Date: Wed, 7 Feb 1996 03:21:04 +0900 +- # From: Jeffrey Friedl +- # +- # I tried compiling with DBM support and sure enough things locked up +- # just as advertised. Checking into it, I found that the lockup was +- # during the call to dbm_open. Not *in* dbm_open -- but between the call +- # to and the jump into. +- # +- # To make a long story short, making sure that the *.a and *.sa pairs of +- # /usr/lib/lib{m,db,gdbm}.{a,sa} +- # were perfectly in sync took care of it. +- # +- # This will generate a harmless Whoa There! message +- case "$d_dbm_open" in +- '') cat <<'EOM' >&4 +- +-Disabling ndbm. This will generate a Whoa There message in Configure. +-Read hints/linux.sh for further information. +-EOM +- # You can override this with Configure -Dd_dbm_open +- d_dbm_open=undef +- ;; +- esac +-fi +# libquadmath is sometimes installed as gcc internal library, +# so contrary to our usual policy of *not* looking at gcc internal +# directories we now *do* look at them, in case they contain @@ -235,7 +318,8 @@ index 0519eca..fb5a46e 100644 + done + ;; +esac -+ + +-rm -f try.c a.out +case "$libc" in +'') +# If you have glibc, then report the version for ./myconfig bug reporting. @@ -261,29 +345,13 @@ index 0519eca..fb5a46e 100644 + done + ;; +esac -+ - # Are we using ELF? Thanks to Kenneth Albanowski - # for this test. - cat >try.c <<'EOM' -@@ -191,7 +241,7 @@ main() { - exit(0); /* succeed (yes, it's ELF) */ - } - EOM --if ${cc:-gcc} try.c >/dev/null 2>&1 && $run ./a.out; then -+if ${cc:-gcc} $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then - cat <<'EOM' >&4 - - You appear to have ELF support. I'll try to use it for dynamic loading. -@@ -257,7 +307,7 @@ fi - - rm -f try.c a.out -if /bin/sh -c exit; then +if ${sh:-/bin/sh} -c exit; then echo '' echo 'You appear to have a working bash. Good.' else -@@ -324,7 +374,7 @@ fi +@@ -324,7 +288,7 @@ fi #'osfmach3ppc') ccdlflags='-Wl,-E' ;; #esac @@ -292,7 +360,7 @@ index 0519eca..fb5a46e 100644 sparc*) case "$cccdlflags" in *-fpic*) cccdlflags="`echo $cccdlflags|sed 's/-fpic/-fPIC/'`" ;; -@@ -339,30 +389,62 @@ esac +@@ -339,30 +303,62 @@ esac # version of -lgdbm which is a bad idea. So if we have 'nm' # make sure it can read the file # NI-S 2003/08/07 @@ -372,7 +440,7 @@ index 0519eca..fb5a46e 100644 if echo $libswanted | grep -v pthread >/dev/null then set `echo X "$libswanted "| sed -e 's/ c / pthread c /'` -@@ -409,16 +491,6 @@ $define|true|[yY]*) +@@ -409,16 +405,6 @@ $define|true|[yY]*) ;; esac @@ -389,7 +457,7 @@ index 0519eca..fb5a46e 100644 # If using g++, the Configure scan for dlopen() and (especially) # dlerror() might fail, easier just to forcibly hint them in. case "$cc" in -@@ -442,7 +514,7 @@ then +@@ -442,7 +428,7 @@ then DBLIB="$DBDIR/libdb.so" if [ -f $DBLIB ] then @@ -472,22 +540,8 @@ index de26d84..52b0492 100644 print "\nRunning Makefile.PL in $ext_dir\n"; # Presumably this can be simplified -diff --git a/patchlevel.h b/patchlevel.h -index f1a12bd..420296d 100644 ---- a/patchlevel.h -+++ b/patchlevel.h -@@ -131,6 +131,7 @@ static const char * const local_patches[] = { - ,"uncommitted-changes" - #endif - PERL_GIT_UNPUSHED_COMMITS /* do not remove this line */ -+ ,"Devel::PatchPerl 1.38" - ,NULL - }; - diff --git a/t/op/hash.t b/t/op/hash.t -old mode 100755 -new mode 100644 -index 9bde518..45eb782 +index 9bde518..45eb782 100755 --- a/t/op/hash.t +++ b/t/op/hash.t @@ -39,22 +39,36 @@ use constant THRESHOLD => 14; diff --git a/5.012.005-64bit,threaded/Dockerfile b/5.012.005-64bit,threaded/Dockerfile index b8b9ce8..36041c6 100644 --- a/5.012.005-64bit,threaded/Dockerfile +++ b/5.012.005-64bit,threaded/Dockerfile @@ -10,7 +10,7 @@ COPY *.patch /usr/src/perl/ WORKDIR /usr/src/perl RUN curl -SL https://cpan.metacpan.org/authors/id/D/DO/DOM/perl-5.12.5.tar.bz2 -o perl-5.12.5.tar.bz2 \ - && echo '812139ceef512eb8458af29ffbf46d78ef26c12a *perl-5.12.5.tar.bz2' | sha1sum -c - \ + && echo '10749417fd3010aae320a34181ad4cd6a4855c1fc63403b87fa4d630b18e966c *perl-5.12.5.tar.bz2' | sha256sum -c - \ && tar --strip-components=1 -xjf perl-5.12.5.tar.bz2 -C /usr/src/perl \ && rm perl-5.12.5.tar.bz2 \ && cat *.patch | patch -p1 \ diff --git a/5.012.005-64bit/DevelPatchPerl.patch b/5.012.005-64bit/DevelPatchPerl.patch index 69d7fe7..d2a8373 100644 --- a/5.012.005-64bit/DevelPatchPerl.patch +++ b/5.012.005-64bit/DevelPatchPerl.patch @@ -117,7 +117,7 @@ index f8ca492..204bba0 100644 + $self->{LIBS}->[0] .= ' -lgdbm_compat' if -e $_.'/libgdbm_compat.so'; } diff --git a/hints/linux.sh b/hints/linux.sh -index 0519eca..fb5a46e 100644 +index 0519eca..3f38ea0 100644 --- a/hints/linux.sh +++ b/hints/linux.sh @@ -13,11 +13,14 @@ @@ -215,10 +215,93 @@ index 0519eca..fb5a46e 100644 cut -f2- -d= | tr ':' $trnl | grep -v 'gcc' | sed -e 's:/$::'` set X $plibpth # Collapse all entries on one line shift -@@ -171,6 +178,49 @@ case "$plibpth" in +@@ -171,93 +178,50 @@ case "$plibpth" in ;; esac +-# Are we using ELF? Thanks to Kenneth Albanowski +-# for this test. +-cat >try.c <<'EOM' +-/* Test for whether ELF binaries are produced */ +-#include +-#include +-#include +-main() { +- char buffer[4]; +- int i=open("a.out",O_RDONLY); +- if(i==-1) +- exit(1); /* fail */ +- if(read(i,&buffer[0],4)<4) +- exit(1); /* fail */ +- if(buffer[0] != 127 || buffer[1] != 'E' || +- buffer[2] != 'L' || buffer[3] != 'F') +- exit(1); /* fail */ +- exit(0); /* succeed (yes, it's ELF) */ +-} +-EOM +-if ${cc:-gcc} try.c >/dev/null 2>&1 && $run ./a.out; then +- cat <<'EOM' >&4 +- +-You appear to have ELF support. I'll try to use it for dynamic loading. +-If dynamic loading doesn't work, read hints/linux.sh for further information. +-EOM +- +-else +- cat <<'EOM' >&4 +- +-You don't have an ELF gcc. I will use dld if possible. If you are +-using a version of DLD earlier than 3.2.6, or don't have it at all, you +-should probably upgrade. If you are forced to use 3.2.4, you should +-uncomment a couple of lines in hints/linux.sh and restart Configure so +-that shared libraries will be disallowed. +- +-EOM +- lddlflags="-r $lddlflags" +- # These empty values are so that Configure doesn't put in the +- # Linux ELF values. +- ccdlflags=' ' +- cccdlflags=' ' +- ccflags="-DOVR_DBL_DIG=14 $ccflags" +- so='sa' +- dlext='o' +- nm_so_opt=' ' +- ## If you are using DLD 3.2.4 which does not support shared libs, +- ## uncomment the next two lines: +- #ldflags="-static" +- #so='none' +- +- # In addition, on some systems there is a problem with perl and NDBM +- # which causes AnyDBM and NDBM_File to lock up. This is evidenced +- # in the tests as AnyDBM just freezing. Apparently, this only +- # happens on a.out systems, so we disable NDBM for all a.out linux +- # systems. If someone can suggest a more robust test +- # that would be appreciated. +- # +- # More info: +- # Date: Wed, 7 Feb 1996 03:21:04 +0900 +- # From: Jeffrey Friedl +- # +- # I tried compiling with DBM support and sure enough things locked up +- # just as advertised. Checking into it, I found that the lockup was +- # during the call to dbm_open. Not *in* dbm_open -- but between the call +- # to and the jump into. +- # +- # To make a long story short, making sure that the *.a and *.sa pairs of +- # /usr/lib/lib{m,db,gdbm}.{a,sa} +- # were perfectly in sync took care of it. +- # +- # This will generate a harmless Whoa There! message +- case "$d_dbm_open" in +- '') cat <<'EOM' >&4 +- +-Disabling ndbm. This will generate a Whoa There message in Configure. +-Read hints/linux.sh for further information. +-EOM +- # You can override this with Configure -Dd_dbm_open +- d_dbm_open=undef +- ;; +- esac +-fi +# libquadmath is sometimes installed as gcc internal library, +# so contrary to our usual policy of *not* looking at gcc internal +# directories we now *do* look at them, in case they contain @@ -235,7 +318,8 @@ index 0519eca..fb5a46e 100644 + done + ;; +esac -+ + +-rm -f try.c a.out +case "$libc" in +'') +# If you have glibc, then report the version for ./myconfig bug reporting. @@ -261,29 +345,13 @@ index 0519eca..fb5a46e 100644 + done + ;; +esac -+ - # Are we using ELF? Thanks to Kenneth Albanowski - # for this test. - cat >try.c <<'EOM' -@@ -191,7 +241,7 @@ main() { - exit(0); /* succeed (yes, it's ELF) */ - } - EOM --if ${cc:-gcc} try.c >/dev/null 2>&1 && $run ./a.out; then -+if ${cc:-gcc} $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then - cat <<'EOM' >&4 - - You appear to have ELF support. I'll try to use it for dynamic loading. -@@ -257,7 +307,7 @@ fi - - rm -f try.c a.out -if /bin/sh -c exit; then +if ${sh:-/bin/sh} -c exit; then echo '' echo 'You appear to have a working bash. Good.' else -@@ -324,7 +374,7 @@ fi +@@ -324,7 +288,7 @@ fi #'osfmach3ppc') ccdlflags='-Wl,-E' ;; #esac @@ -292,7 +360,7 @@ index 0519eca..fb5a46e 100644 sparc*) case "$cccdlflags" in *-fpic*) cccdlflags="`echo $cccdlflags|sed 's/-fpic/-fPIC/'`" ;; -@@ -339,30 +389,62 @@ esac +@@ -339,30 +303,62 @@ esac # version of -lgdbm which is a bad idea. So if we have 'nm' # make sure it can read the file # NI-S 2003/08/07 @@ -372,7 +440,7 @@ index 0519eca..fb5a46e 100644 if echo $libswanted | grep -v pthread >/dev/null then set `echo X "$libswanted "| sed -e 's/ c / pthread c /'` -@@ -409,16 +491,6 @@ $define|true|[yY]*) +@@ -409,16 +405,6 @@ $define|true|[yY]*) ;; esac @@ -389,7 +457,7 @@ index 0519eca..fb5a46e 100644 # If using g++, the Configure scan for dlopen() and (especially) # dlerror() might fail, easier just to forcibly hint them in. case "$cc" in -@@ -442,7 +514,7 @@ then +@@ -442,7 +428,7 @@ then DBLIB="$DBDIR/libdb.so" if [ -f $DBLIB ] then @@ -472,22 +540,8 @@ index de26d84..52b0492 100644 print "\nRunning Makefile.PL in $ext_dir\n"; # Presumably this can be simplified -diff --git a/patchlevel.h b/patchlevel.h -index f1a12bd..420296d 100644 ---- a/patchlevel.h -+++ b/patchlevel.h -@@ -131,6 +131,7 @@ static const char * const local_patches[] = { - ,"uncommitted-changes" - #endif - PERL_GIT_UNPUSHED_COMMITS /* do not remove this line */ -+ ,"Devel::PatchPerl 1.38" - ,NULL - }; - diff --git a/t/op/hash.t b/t/op/hash.t -old mode 100755 -new mode 100644 -index 9bde518..45eb782 +index 9bde518..45eb782 100755 --- a/t/op/hash.t +++ b/t/op/hash.t @@ -39,22 +39,36 @@ use constant THRESHOLD => 14; diff --git a/5.012.005-64bit/Dockerfile b/5.012.005-64bit/Dockerfile index f7bc9e8..b962471 100644 --- a/5.012.005-64bit/Dockerfile +++ b/5.012.005-64bit/Dockerfile @@ -10,7 +10,7 @@ COPY *.patch /usr/src/perl/ WORKDIR /usr/src/perl RUN curl -SL https://cpan.metacpan.org/authors/id/D/DO/DOM/perl-5.12.5.tar.bz2 -o perl-5.12.5.tar.bz2 \ - && echo '812139ceef512eb8458af29ffbf46d78ef26c12a *perl-5.12.5.tar.bz2' | sha1sum -c - \ + && echo '10749417fd3010aae320a34181ad4cd6a4855c1fc63403b87fa4d630b18e966c *perl-5.12.5.tar.bz2' | sha256sum -c - \ && tar --strip-components=1 -xjf perl-5.12.5.tar.bz2 -C /usr/src/perl \ && rm perl-5.12.5.tar.bz2 \ && cat *.patch | patch -p1 \ diff --git a/5.014.004-64bit,threaded/DevelPatchPerl.patch b/5.014.004-64bit,threaded/DevelPatchPerl.patch index 5f5cd48..6b87690 100644 --- a/5.014.004-64bit,threaded/DevelPatchPerl.patch +++ b/5.014.004-64bit,threaded/DevelPatchPerl.patch @@ -40,7 +40,7 @@ index 56bc815..cf688be 100644 or die "Cannot exec $cpp"; } diff --git a/hints/linux.sh b/hints/linux.sh -index d0ac9fa..fb5a46e 100644 +index d0ac9fa..3f38ea0 100644 --- a/hints/linux.sh +++ b/hints/linux.sh @@ -39,7 +39,7 @@ i_libutil='undef' @@ -111,10 +111,93 @@ index d0ac9fa..fb5a46e 100644 cut -f2- -d= | tr ':' $trnl | grep -v 'gcc' | sed -e 's:/$::'` set X $plibpth # Collapse all entries on one line shift -@@ -182,6 +178,49 @@ case "$plibpth" in +@@ -182,93 +178,50 @@ case "$plibpth" in ;; esac +-# Are we using ELF? Thanks to Kenneth Albanowski +-# for this test. +-cat >try.c <<'EOM' +-/* Test for whether ELF binaries are produced */ +-#include +-#include +-#include +-main() { +- char buffer[4]; +- int i=open("a.out",O_RDONLY); +- if(i==-1) +- exit(1); /* fail */ +- if(read(i,&buffer[0],4)<4) +- exit(1); /* fail */ +- if(buffer[0] != 127 || buffer[1] != 'E' || +- buffer[2] != 'L' || buffer[3] != 'F') +- exit(1); /* fail */ +- exit(0); /* succeed (yes, it's ELF) */ +-} +-EOM +-if ${cc:-gcc} try.c >/dev/null 2>&1 && $run ./a.out; then +- cat <<'EOM' >&4 +- +-You appear to have ELF support. I'll try to use it for dynamic loading. +-If dynamic loading doesn't work, read hints/linux.sh for further information. +-EOM +- +-else +- cat <<'EOM' >&4 +- +-You don't have an ELF gcc. I will use dld if possible. If you are +-using a version of DLD earlier than 3.2.6, or don't have it at all, you +-should probably upgrade. If you are forced to use 3.2.4, you should +-uncomment a couple of lines in hints/linux.sh and restart Configure so +-that shared libraries will be disallowed. +- +-EOM +- lddlflags="-r $lddlflags" +- # These empty values are so that Configure doesn't put in the +- # Linux ELF values. +- ccdlflags=' ' +- cccdlflags=' ' +- ccflags="-DOVR_DBL_DIG=14 $ccflags" +- so='sa' +- dlext='o' +- nm_so_opt=' ' +- ## If you are using DLD 3.2.4 which does not support shared libs, +- ## uncomment the next two lines: +- #ldflags="-static" +- #so='none' +- +- # In addition, on some systems there is a problem with perl and NDBM +- # which causes AnyDBM and NDBM_File to lock up. This is evidenced +- # in the tests as AnyDBM just freezing. Apparently, this only +- # happens on a.out systems, so we disable NDBM for all a.out linux +- # systems. If someone can suggest a more robust test +- # that would be appreciated. +- # +- # More info: +- # Date: Wed, 7 Feb 1996 03:21:04 +0900 +- # From: Jeffrey Friedl +- # +- # I tried compiling with DBM support and sure enough things locked up +- # just as advertised. Checking into it, I found that the lockup was +- # during the call to dbm_open. Not *in* dbm_open -- but between the call +- # to and the jump into. +- # +- # To make a long story short, making sure that the *.a and *.sa pairs of +- # /usr/lib/lib{m,db,gdbm}.{a,sa} +- # were perfectly in sync took care of it. +- # +- # This will generate a harmless Whoa There! message +- case "$d_dbm_open" in +- '') cat <<'EOM' >&4 +- +-Disabling ndbm. This will generate a Whoa There message in Configure. +-Read hints/linux.sh for further information. +-EOM +- # You can override this with Configure -Dd_dbm_open +- d_dbm_open=undef +- ;; +- esac +-fi +# libquadmath is sometimes installed as gcc internal library, +# so contrary to our usual policy of *not* looking at gcc internal +# directories we now *do* look at them, in case they contain @@ -131,7 +214,8 @@ index d0ac9fa..fb5a46e 100644 + done + ;; +esac -+ + +-rm -f try.c a.out +case "$libc" in +'') +# If you have glibc, then report the version for ./myconfig bug reporting. @@ -157,29 +241,13 @@ index d0ac9fa..fb5a46e 100644 + done + ;; +esac -+ - # Are we using ELF? Thanks to Kenneth Albanowski - # for this test. - cat >try.c <<'EOM' -@@ -202,7 +241,7 @@ main() { - exit(0); /* succeed (yes, it's ELF) */ - } - EOM --if ${cc:-gcc} try.c >/dev/null 2>&1 && $run ./a.out; then -+if ${cc:-gcc} $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then - cat <<'EOM' >&4 - - You appear to have ELF support. I'll try to use it for dynamic loading. -@@ -268,7 +307,7 @@ fi - - rm -f try.c a.out -if /bin/sh -c exit; then +if ${sh:-/bin/sh} -c exit; then echo '' echo 'You appear to have a working bash. Good.' else -@@ -335,7 +374,7 @@ fi +@@ -335,7 +288,7 @@ fi #'osfmach3ppc') ccdlflags='-Wl,-E' ;; #esac @@ -188,7 +256,7 @@ index d0ac9fa..fb5a46e 100644 sparc*) case "$cccdlflags" in *-fpic*) cccdlflags="`echo $cccdlflags|sed 's/-fpic/-fPIC/'`" ;; -@@ -350,30 +389,62 @@ esac +@@ -350,30 +303,62 @@ esac # version of -lgdbm which is a bad idea. So if we have 'nm' # make sure it can read the file # NI-S 2003/08/07 @@ -268,7 +336,7 @@ index d0ac9fa..fb5a46e 100644 if echo $libswanted | grep -v pthread >/dev/null then set `echo X "$libswanted "| sed -e 's/ c / pthread c /'` -@@ -420,16 +491,6 @@ $define|true|[yY]*) +@@ -420,16 +405,6 @@ $define|true|[yY]*) ;; esac @@ -285,7 +353,7 @@ index d0ac9fa..fb5a46e 100644 # If using g++, the Configure scan for dlopen() and (especially) # dlerror() might fail, easier just to forcibly hint them in. case "$cc" in -@@ -453,7 +514,7 @@ then +@@ -453,7 +428,7 @@ then DBLIB="$DBDIR/libdb.so" if [ -f $DBLIB ] then @@ -309,15 +377,3 @@ index 13a15b4..a564bb3 100644 print "\nRunning Makefile.PL in $ext_dir\n"; # Presumably this can be simplified -diff --git a/patchlevel.h b/patchlevel.h -index 4d9cd6d..0052d4a 100644 ---- a/patchlevel.h -+++ b/patchlevel.h -@@ -137,6 +137,7 @@ static const char * const local_patches[] = { - ,"uncommitted-changes" - #endif - PERL_GIT_UNPUSHED_COMMITS /* do not remove this line */ -+ ,"Devel::PatchPerl 1.38" - ,NULL - }; - diff --git a/5.014.004-64bit,threaded/Dockerfile b/5.014.004-64bit,threaded/Dockerfile index 28f2656..b8af386 100644 --- a/5.014.004-64bit,threaded/Dockerfile +++ b/5.014.004-64bit,threaded/Dockerfile @@ -10,7 +10,7 @@ COPY *.patch /usr/src/perl/ WORKDIR /usr/src/perl RUN curl -SL https://cpan.metacpan.org/authors/id/D/DA/DAPM/perl-5.14.4.tar.bz2 -o perl-5.14.4.tar.bz2 \ - && echo '3527c9e26f985cba98796439bf555fde8be73cdf *perl-5.14.4.tar.bz2' | sha1sum -c - \ + && echo 'eece8c2b0d491bf6f746bd1f4f1bb7ce26f6b98e91c54690c617d7af38964745 *perl-5.14.4.tar.bz2' | sha256sum -c - \ && tar --strip-components=1 -xjf perl-5.14.4.tar.bz2 -C /usr/src/perl \ && rm perl-5.14.4.tar.bz2 \ && cat *.patch | patch -p1 \ diff --git a/5.014.004-64bit/DevelPatchPerl.patch b/5.014.004-64bit/DevelPatchPerl.patch index 5f5cd48..6b87690 100644 --- a/5.014.004-64bit/DevelPatchPerl.patch +++ b/5.014.004-64bit/DevelPatchPerl.patch @@ -40,7 +40,7 @@ index 56bc815..cf688be 100644 or die "Cannot exec $cpp"; } diff --git a/hints/linux.sh b/hints/linux.sh -index d0ac9fa..fb5a46e 100644 +index d0ac9fa..3f38ea0 100644 --- a/hints/linux.sh +++ b/hints/linux.sh @@ -39,7 +39,7 @@ i_libutil='undef' @@ -111,10 +111,93 @@ index d0ac9fa..fb5a46e 100644 cut -f2- -d= | tr ':' $trnl | grep -v 'gcc' | sed -e 's:/$::'` set X $plibpth # Collapse all entries on one line shift -@@ -182,6 +178,49 @@ case "$plibpth" in +@@ -182,93 +178,50 @@ case "$plibpth" in ;; esac +-# Are we using ELF? Thanks to Kenneth Albanowski +-# for this test. +-cat >try.c <<'EOM' +-/* Test for whether ELF binaries are produced */ +-#include +-#include +-#include +-main() { +- char buffer[4]; +- int i=open("a.out",O_RDONLY); +- if(i==-1) +- exit(1); /* fail */ +- if(read(i,&buffer[0],4)<4) +- exit(1); /* fail */ +- if(buffer[0] != 127 || buffer[1] != 'E' || +- buffer[2] != 'L' || buffer[3] != 'F') +- exit(1); /* fail */ +- exit(0); /* succeed (yes, it's ELF) */ +-} +-EOM +-if ${cc:-gcc} try.c >/dev/null 2>&1 && $run ./a.out; then +- cat <<'EOM' >&4 +- +-You appear to have ELF support. I'll try to use it for dynamic loading. +-If dynamic loading doesn't work, read hints/linux.sh for further information. +-EOM +- +-else +- cat <<'EOM' >&4 +- +-You don't have an ELF gcc. I will use dld if possible. If you are +-using a version of DLD earlier than 3.2.6, or don't have it at all, you +-should probably upgrade. If you are forced to use 3.2.4, you should +-uncomment a couple of lines in hints/linux.sh and restart Configure so +-that shared libraries will be disallowed. +- +-EOM +- lddlflags="-r $lddlflags" +- # These empty values are so that Configure doesn't put in the +- # Linux ELF values. +- ccdlflags=' ' +- cccdlflags=' ' +- ccflags="-DOVR_DBL_DIG=14 $ccflags" +- so='sa' +- dlext='o' +- nm_so_opt=' ' +- ## If you are using DLD 3.2.4 which does not support shared libs, +- ## uncomment the next two lines: +- #ldflags="-static" +- #so='none' +- +- # In addition, on some systems there is a problem with perl and NDBM +- # which causes AnyDBM and NDBM_File to lock up. This is evidenced +- # in the tests as AnyDBM just freezing. Apparently, this only +- # happens on a.out systems, so we disable NDBM for all a.out linux +- # systems. If someone can suggest a more robust test +- # that would be appreciated. +- # +- # More info: +- # Date: Wed, 7 Feb 1996 03:21:04 +0900 +- # From: Jeffrey Friedl +- # +- # I tried compiling with DBM support and sure enough things locked up +- # just as advertised. Checking into it, I found that the lockup was +- # during the call to dbm_open. Not *in* dbm_open -- but between the call +- # to and the jump into. +- # +- # To make a long story short, making sure that the *.a and *.sa pairs of +- # /usr/lib/lib{m,db,gdbm}.{a,sa} +- # were perfectly in sync took care of it. +- # +- # This will generate a harmless Whoa There! message +- case "$d_dbm_open" in +- '') cat <<'EOM' >&4 +- +-Disabling ndbm. This will generate a Whoa There message in Configure. +-Read hints/linux.sh for further information. +-EOM +- # You can override this with Configure -Dd_dbm_open +- d_dbm_open=undef +- ;; +- esac +-fi +# libquadmath is sometimes installed as gcc internal library, +# so contrary to our usual policy of *not* looking at gcc internal +# directories we now *do* look at them, in case they contain @@ -131,7 +214,8 @@ index d0ac9fa..fb5a46e 100644 + done + ;; +esac -+ + +-rm -f try.c a.out +case "$libc" in +'') +# If you have glibc, then report the version for ./myconfig bug reporting. @@ -157,29 +241,13 @@ index d0ac9fa..fb5a46e 100644 + done + ;; +esac -+ - # Are we using ELF? Thanks to Kenneth Albanowski - # for this test. - cat >try.c <<'EOM' -@@ -202,7 +241,7 @@ main() { - exit(0); /* succeed (yes, it's ELF) */ - } - EOM --if ${cc:-gcc} try.c >/dev/null 2>&1 && $run ./a.out; then -+if ${cc:-gcc} $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then - cat <<'EOM' >&4 - - You appear to have ELF support. I'll try to use it for dynamic loading. -@@ -268,7 +307,7 @@ fi - - rm -f try.c a.out -if /bin/sh -c exit; then +if ${sh:-/bin/sh} -c exit; then echo '' echo 'You appear to have a working bash. Good.' else -@@ -335,7 +374,7 @@ fi +@@ -335,7 +288,7 @@ fi #'osfmach3ppc') ccdlflags='-Wl,-E' ;; #esac @@ -188,7 +256,7 @@ index d0ac9fa..fb5a46e 100644 sparc*) case "$cccdlflags" in *-fpic*) cccdlflags="`echo $cccdlflags|sed 's/-fpic/-fPIC/'`" ;; -@@ -350,30 +389,62 @@ esac +@@ -350,30 +303,62 @@ esac # version of -lgdbm which is a bad idea. So if we have 'nm' # make sure it can read the file # NI-S 2003/08/07 @@ -268,7 +336,7 @@ index d0ac9fa..fb5a46e 100644 if echo $libswanted | grep -v pthread >/dev/null then set `echo X "$libswanted "| sed -e 's/ c / pthread c /'` -@@ -420,16 +491,6 @@ $define|true|[yY]*) +@@ -420,16 +405,6 @@ $define|true|[yY]*) ;; esac @@ -285,7 +353,7 @@ index d0ac9fa..fb5a46e 100644 # If using g++, the Configure scan for dlopen() and (especially) # dlerror() might fail, easier just to forcibly hint them in. case "$cc" in -@@ -453,7 +514,7 @@ then +@@ -453,7 +428,7 @@ then DBLIB="$DBDIR/libdb.so" if [ -f $DBLIB ] then @@ -309,15 +377,3 @@ index 13a15b4..a564bb3 100644 print "\nRunning Makefile.PL in $ext_dir\n"; # Presumably this can be simplified -diff --git a/patchlevel.h b/patchlevel.h -index 4d9cd6d..0052d4a 100644 ---- a/patchlevel.h -+++ b/patchlevel.h -@@ -137,6 +137,7 @@ static const char * const local_patches[] = { - ,"uncommitted-changes" - #endif - PERL_GIT_UNPUSHED_COMMITS /* do not remove this line */ -+ ,"Devel::PatchPerl 1.38" - ,NULL - }; - diff --git a/5.014.004-64bit/Dockerfile b/5.014.004-64bit/Dockerfile index 3c0cca2..117201f 100644 --- a/5.014.004-64bit/Dockerfile +++ b/5.014.004-64bit/Dockerfile @@ -10,7 +10,7 @@ COPY *.patch /usr/src/perl/ WORKDIR /usr/src/perl RUN curl -SL https://cpan.metacpan.org/authors/id/D/DA/DAPM/perl-5.14.4.tar.bz2 -o perl-5.14.4.tar.bz2 \ - && echo '3527c9e26f985cba98796439bf555fde8be73cdf *perl-5.14.4.tar.bz2' | sha1sum -c - \ + && echo 'eece8c2b0d491bf6f746bd1f4f1bb7ce26f6b98e91c54690c617d7af38964745 *perl-5.14.4.tar.bz2' | sha256sum -c - \ && tar --strip-components=1 -xjf perl-5.14.4.tar.bz2 -C /usr/src/perl \ && rm perl-5.14.4.tar.bz2 \ && cat *.patch | patch -p1 \ diff --git a/5.016.003-64bit,threaded/DevelPatchPerl.patch b/5.016.003-64bit,threaded/DevelPatchPerl.patch index f8204c2..0c1c567 100644 --- a/5.016.003-64bit,threaded/DevelPatchPerl.patch +++ b/5.016.003-64bit,threaded/DevelPatchPerl.patch @@ -40,7 +40,7 @@ index 439f254..a324604 100644 or die "Cannot exec $cpp"; } diff --git a/hints/linux.sh b/hints/linux.sh -index 688c68d..fb5a46e 100644 +index 688c68d..3f38ea0 100644 --- a/hints/linux.sh +++ b/hints/linux.sh @@ -39,7 +39,7 @@ i_libutil='undef' @@ -111,10 +111,93 @@ index 688c68d..fb5a46e 100644 cut -f2- -d= | tr ':' $trnl | grep -v 'gcc' | sed -e 's:/$::'` set X $plibpth # Collapse all entries on one line shift -@@ -182,6 +178,49 @@ case "$plibpth" in +@@ -182,93 +178,50 @@ case "$plibpth" in ;; esac +-# Are we using ELF? Thanks to Kenneth Albanowski +-# for this test. +-cat >try.c <<'EOM' +-/* Test for whether ELF binaries are produced */ +-#include +-#include +-#include +-main() { +- char buffer[4]; +- int i=open("a.out",O_RDONLY); +- if(i==-1) +- exit(1); /* fail */ +- if(read(i,&buffer[0],4)<4) +- exit(1); /* fail */ +- if(buffer[0] != 127 || buffer[1] != 'E' || +- buffer[2] != 'L' || buffer[3] != 'F') +- exit(1); /* fail */ +- exit(0); /* succeed (yes, it's ELF) */ +-} +-EOM +-if ${cc:-gcc} try.c >/dev/null 2>&1 && $run ./a.out; then +- cat <<'EOM' >&4 +- +-You appear to have ELF support. I'll try to use it for dynamic loading. +-If dynamic loading doesn't work, read hints/linux.sh for further information. +-EOM +- +-else +- cat <<'EOM' >&4 +- +-You don't have an ELF gcc. I will use dld if possible. If you are +-using a version of DLD earlier than 3.2.6, or don't have it at all, you +-should probably upgrade. If you are forced to use 3.2.4, you should +-uncomment a couple of lines in hints/linux.sh and restart Configure so +-that shared libraries will be disallowed. +- +-EOM +- lddlflags="-r $lddlflags" +- # These empty values are so that Configure doesn't put in the +- # Linux ELF values. +- ccdlflags=' ' +- cccdlflags=' ' +- ccflags="-DOVR_DBL_DIG=14 $ccflags" +- so='sa' +- dlext='o' +- nm_so_opt=' ' +- ## If you are using DLD 3.2.4 which does not support shared libs, +- ## uncomment the next two lines: +- #ldflags="-static" +- #so='none' +- +- # In addition, on some systems there is a problem with perl and NDBM +- # which causes AnyDBM and NDBM_File to lock up. This is evidenced +- # in the tests as AnyDBM just freezing. Apparently, this only +- # happens on a.out systems, so we disable NDBM for all a.out linux +- # systems. If someone can suggest a more robust test +- # that would be appreciated. +- # +- # More info: +- # Date: Wed, 7 Feb 1996 03:21:04 +0900 +- # From: Jeffrey Friedl +- # +- # I tried compiling with DBM support and sure enough things locked up +- # just as advertised. Checking into it, I found that the lockup was +- # during the call to dbm_open. Not *in* dbm_open -- but between the call +- # to and the jump into. +- # +- # To make a long story short, making sure that the *.a and *.sa pairs of +- # /usr/lib/lib{m,db,gdbm}.{a,sa} +- # were perfectly in sync took care of it. +- # +- # This will generate a harmless Whoa There! message +- case "$d_dbm_open" in +- '') cat <<'EOM' >&4 +- +-Disabling ndbm. This will generate a Whoa There message in Configure. +-Read hints/linux.sh for further information. +-EOM +- # You can override this with Configure -Dd_dbm_open +- d_dbm_open=undef +- ;; +- esac +-fi +# libquadmath is sometimes installed as gcc internal library, +# so contrary to our usual policy of *not* looking at gcc internal +# directories we now *do* look at them, in case they contain @@ -131,7 +214,8 @@ index 688c68d..fb5a46e 100644 + done + ;; +esac -+ + +-rm -f try.c a.out +case "$libc" in +'') +# If you have glibc, then report the version for ./myconfig bug reporting. @@ -157,29 +241,13 @@ index 688c68d..fb5a46e 100644 + done + ;; +esac -+ - # Are we using ELF? Thanks to Kenneth Albanowski - # for this test. - cat >try.c <<'EOM' -@@ -202,7 +241,7 @@ main() { - exit(0); /* succeed (yes, it's ELF) */ - } - EOM --if ${cc:-gcc} try.c >/dev/null 2>&1 && $run ./a.out; then -+if ${cc:-gcc} $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then - cat <<'EOM' >&4 - - You appear to have ELF support. I'll try to use it for dynamic loading. -@@ -268,7 +307,7 @@ fi - - rm -f try.c a.out -if /bin/sh -c exit; then +if ${sh:-/bin/sh} -c exit; then echo '' echo 'You appear to have a working bash. Good.' else -@@ -335,7 +374,7 @@ fi +@@ -335,7 +288,7 @@ fi #'osfmach3ppc') ccdlflags='-Wl,-E' ;; #esac @@ -188,7 +256,7 @@ index 688c68d..fb5a46e 100644 sparc*) case "$cccdlflags" in *-fpic*) cccdlflags="`echo $cccdlflags|sed 's/-fpic/-fPIC/'`" ;; -@@ -350,17 +389,55 @@ esac +@@ -350,17 +303,55 @@ esac # version of -lgdbm which is a bad idea. So if we have 'nm' # make sure it can read the file # NI-S 2003/08/07 @@ -254,7 +322,7 @@ index 688c68d..fb5a46e 100644 # This script UU/usethreads.cbu will get 'called-back' by Configure # after it has prompted the user for whether to use threads. -@@ -414,16 +491,6 @@ $define|true|[yY]*) +@@ -414,16 +405,6 @@ $define|true|[yY]*) ;; esac @@ -271,7 +339,7 @@ index 688c68d..fb5a46e 100644 # If using g++, the Configure scan for dlopen() and (especially) # dlerror() might fail, easier just to forcibly hint them in. case "$cc" in -@@ -447,7 +514,7 @@ then +@@ -447,7 +428,7 @@ then DBLIB="$DBDIR/libdb.so" if [ -f $DBLIB ] then @@ -280,15 +348,3 @@ index 688c68d..fb5a46e 100644 then if ldd $DBLIB | grep pthread >/dev/null then -diff --git a/patchlevel.h b/patchlevel.h -index be508d1..d71558a 100644 ---- a/patchlevel.h -+++ b/patchlevel.h -@@ -137,6 +137,7 @@ static const char * const local_patches[] = { - ,"uncommitted-changes" - #endif - PERL_GIT_UNPUSHED_COMMITS /* do not remove this line */ -+ ,"Devel::PatchPerl 1.38" - ,NULL - }; - diff --git a/5.016.003-64bit,threaded/Dockerfile b/5.016.003-64bit,threaded/Dockerfile index 23a52c3..d75c479 100644 --- a/5.016.003-64bit,threaded/Dockerfile +++ b/5.016.003-64bit,threaded/Dockerfile @@ -10,7 +10,7 @@ COPY *.patch /usr/src/perl/ WORKDIR /usr/src/perl RUN curl -SL https://cpan.metacpan.org/authors/id/R/RJ/RJBS/perl-5.16.3.tar.bz2 -o perl-5.16.3.tar.bz2 \ - && echo '060bc17cf9f142d043f9bf7b861422ec624875ea *perl-5.16.3.tar.bz2' | sha1sum -c - \ + && echo 'bb7bc735e6813b177dcfccd480defcde7eddefa173b5967eac11babd1bfa98e8 *perl-5.16.3.tar.bz2' | sha256sum -c - \ && tar --strip-components=1 -xjf perl-5.16.3.tar.bz2 -C /usr/src/perl \ && rm perl-5.16.3.tar.bz2 \ && cat *.patch | patch -p1 \ diff --git a/5.016.003-64bit/DevelPatchPerl.patch b/5.016.003-64bit/DevelPatchPerl.patch index f8204c2..0c1c567 100644 --- a/5.016.003-64bit/DevelPatchPerl.patch +++ b/5.016.003-64bit/DevelPatchPerl.patch @@ -40,7 +40,7 @@ index 439f254..a324604 100644 or die "Cannot exec $cpp"; } diff --git a/hints/linux.sh b/hints/linux.sh -index 688c68d..fb5a46e 100644 +index 688c68d..3f38ea0 100644 --- a/hints/linux.sh +++ b/hints/linux.sh @@ -39,7 +39,7 @@ i_libutil='undef' @@ -111,10 +111,93 @@ index 688c68d..fb5a46e 100644 cut -f2- -d= | tr ':' $trnl | grep -v 'gcc' | sed -e 's:/$::'` set X $plibpth # Collapse all entries on one line shift -@@ -182,6 +178,49 @@ case "$plibpth" in +@@ -182,93 +178,50 @@ case "$plibpth" in ;; esac +-# Are we using ELF? Thanks to Kenneth Albanowski +-# for this test. +-cat >try.c <<'EOM' +-/* Test for whether ELF binaries are produced */ +-#include +-#include +-#include +-main() { +- char buffer[4]; +- int i=open("a.out",O_RDONLY); +- if(i==-1) +- exit(1); /* fail */ +- if(read(i,&buffer[0],4)<4) +- exit(1); /* fail */ +- if(buffer[0] != 127 || buffer[1] != 'E' || +- buffer[2] != 'L' || buffer[3] != 'F') +- exit(1); /* fail */ +- exit(0); /* succeed (yes, it's ELF) */ +-} +-EOM +-if ${cc:-gcc} try.c >/dev/null 2>&1 && $run ./a.out; then +- cat <<'EOM' >&4 +- +-You appear to have ELF support. I'll try to use it for dynamic loading. +-If dynamic loading doesn't work, read hints/linux.sh for further information. +-EOM +- +-else +- cat <<'EOM' >&4 +- +-You don't have an ELF gcc. I will use dld if possible. If you are +-using a version of DLD earlier than 3.2.6, or don't have it at all, you +-should probably upgrade. If you are forced to use 3.2.4, you should +-uncomment a couple of lines in hints/linux.sh and restart Configure so +-that shared libraries will be disallowed. +- +-EOM +- lddlflags="-r $lddlflags" +- # These empty values are so that Configure doesn't put in the +- # Linux ELF values. +- ccdlflags=' ' +- cccdlflags=' ' +- ccflags="-DOVR_DBL_DIG=14 $ccflags" +- so='sa' +- dlext='o' +- nm_so_opt=' ' +- ## If you are using DLD 3.2.4 which does not support shared libs, +- ## uncomment the next two lines: +- #ldflags="-static" +- #so='none' +- +- # In addition, on some systems there is a problem with perl and NDBM +- # which causes AnyDBM and NDBM_File to lock up. This is evidenced +- # in the tests as AnyDBM just freezing. Apparently, this only +- # happens on a.out systems, so we disable NDBM for all a.out linux +- # systems. If someone can suggest a more robust test +- # that would be appreciated. +- # +- # More info: +- # Date: Wed, 7 Feb 1996 03:21:04 +0900 +- # From: Jeffrey Friedl +- # +- # I tried compiling with DBM support and sure enough things locked up +- # just as advertised. Checking into it, I found that the lockup was +- # during the call to dbm_open. Not *in* dbm_open -- but between the call +- # to and the jump into. +- # +- # To make a long story short, making sure that the *.a and *.sa pairs of +- # /usr/lib/lib{m,db,gdbm}.{a,sa} +- # were perfectly in sync took care of it. +- # +- # This will generate a harmless Whoa There! message +- case "$d_dbm_open" in +- '') cat <<'EOM' >&4 +- +-Disabling ndbm. This will generate a Whoa There message in Configure. +-Read hints/linux.sh for further information. +-EOM +- # You can override this with Configure -Dd_dbm_open +- d_dbm_open=undef +- ;; +- esac +-fi +# libquadmath is sometimes installed as gcc internal library, +# so contrary to our usual policy of *not* looking at gcc internal +# directories we now *do* look at them, in case they contain @@ -131,7 +214,8 @@ index 688c68d..fb5a46e 100644 + done + ;; +esac -+ + +-rm -f try.c a.out +case "$libc" in +'') +# If you have glibc, then report the version for ./myconfig bug reporting. @@ -157,29 +241,13 @@ index 688c68d..fb5a46e 100644 + done + ;; +esac -+ - # Are we using ELF? Thanks to Kenneth Albanowski - # for this test. - cat >try.c <<'EOM' -@@ -202,7 +241,7 @@ main() { - exit(0); /* succeed (yes, it's ELF) */ - } - EOM --if ${cc:-gcc} try.c >/dev/null 2>&1 && $run ./a.out; then -+if ${cc:-gcc} $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then - cat <<'EOM' >&4 - - You appear to have ELF support. I'll try to use it for dynamic loading. -@@ -268,7 +307,7 @@ fi - - rm -f try.c a.out -if /bin/sh -c exit; then +if ${sh:-/bin/sh} -c exit; then echo '' echo 'You appear to have a working bash. Good.' else -@@ -335,7 +374,7 @@ fi +@@ -335,7 +288,7 @@ fi #'osfmach3ppc') ccdlflags='-Wl,-E' ;; #esac @@ -188,7 +256,7 @@ index 688c68d..fb5a46e 100644 sparc*) case "$cccdlflags" in *-fpic*) cccdlflags="`echo $cccdlflags|sed 's/-fpic/-fPIC/'`" ;; -@@ -350,17 +389,55 @@ esac +@@ -350,17 +303,55 @@ esac # version of -lgdbm which is a bad idea. So if we have 'nm' # make sure it can read the file # NI-S 2003/08/07 @@ -254,7 +322,7 @@ index 688c68d..fb5a46e 100644 # This script UU/usethreads.cbu will get 'called-back' by Configure # after it has prompted the user for whether to use threads. -@@ -414,16 +491,6 @@ $define|true|[yY]*) +@@ -414,16 +405,6 @@ $define|true|[yY]*) ;; esac @@ -271,7 +339,7 @@ index 688c68d..fb5a46e 100644 # If using g++, the Configure scan for dlopen() and (especially) # dlerror() might fail, easier just to forcibly hint them in. case "$cc" in -@@ -447,7 +514,7 @@ then +@@ -447,7 +428,7 @@ then DBLIB="$DBDIR/libdb.so" if [ -f $DBLIB ] then @@ -280,15 +348,3 @@ index 688c68d..fb5a46e 100644 then if ldd $DBLIB | grep pthread >/dev/null then -diff --git a/patchlevel.h b/patchlevel.h -index be508d1..d71558a 100644 ---- a/patchlevel.h -+++ b/patchlevel.h -@@ -137,6 +137,7 @@ static const char * const local_patches[] = { - ,"uncommitted-changes" - #endif - PERL_GIT_UNPUSHED_COMMITS /* do not remove this line */ -+ ,"Devel::PatchPerl 1.38" - ,NULL - }; - diff --git a/5.016.003-64bit/Dockerfile b/5.016.003-64bit/Dockerfile index f029d8e..fa0d7d9 100644 --- a/5.016.003-64bit/Dockerfile +++ b/5.016.003-64bit/Dockerfile @@ -10,7 +10,7 @@ COPY *.patch /usr/src/perl/ WORKDIR /usr/src/perl RUN curl -SL https://cpan.metacpan.org/authors/id/R/RJ/RJBS/perl-5.16.3.tar.bz2 -o perl-5.16.3.tar.bz2 \ - && echo '060bc17cf9f142d043f9bf7b861422ec624875ea *perl-5.16.3.tar.bz2' | sha1sum -c - \ + && echo 'bb7bc735e6813b177dcfccd480defcde7eddefa173b5967eac11babd1bfa98e8 *perl-5.16.3.tar.bz2' | sha256sum -c - \ && tar --strip-components=1 -xjf perl-5.16.3.tar.bz2 -C /usr/src/perl \ && rm perl-5.16.3.tar.bz2 \ && cat *.patch | patch -p1 \ diff --git a/5.018.004-64bit,threaded/DevelPatchPerl.patch b/5.018.004-64bit,threaded/DevelPatchPerl.patch index 4269b56..6381f99 100644 --- a/5.018.004-64bit,threaded/DevelPatchPerl.patch +++ b/5.018.004-64bit,threaded/DevelPatchPerl.patch @@ -40,7 +40,7 @@ index b707911..2588f0b 100644 or die "Cannot exec $cpp"; } diff --git a/hints/linux.sh b/hints/linux.sh -index a148248..fb5a46e 100644 +index a148248..3f38ea0 100644 --- a/hints/linux.sh +++ b/hints/linux.sh @@ -39,7 +39,7 @@ i_libutil='undef' @@ -111,10 +111,93 @@ index a148248..fb5a46e 100644 cut -f2- -d= | tr ':' $trnl | grep -v 'gcc' | sed -e 's:/$::'` set X $plibpth # Collapse all entries on one line shift -@@ -182,6 +178,49 @@ case "$plibpth" in +@@ -182,93 +178,50 @@ case "$plibpth" in ;; esac +-# Are we using ELF? Thanks to Kenneth Albanowski +-# for this test. +-cat >try.c <<'EOM' +-/* Test for whether ELF binaries are produced */ +-#include +-#include +-#include +-main() { +- char buffer[4]; +- int i=open("a.out",O_RDONLY); +- if(i==-1) +- exit(1); /* fail */ +- if(read(i,&buffer[0],4)<4) +- exit(1); /* fail */ +- if(buffer[0] != 127 || buffer[1] != 'E' || +- buffer[2] != 'L' || buffer[3] != 'F') +- exit(1); /* fail */ +- exit(0); /* succeed (yes, it's ELF) */ +-} +-EOM +-if ${cc:-gcc} try.c >/dev/null 2>&1 && $run ./a.out; then +- cat <<'EOM' >&4 +- +-You appear to have ELF support. I'll try to use it for dynamic loading. +-If dynamic loading doesn't work, read hints/linux.sh for further information. +-EOM +- +-else +- cat <<'EOM' >&4 +- +-You don't have an ELF gcc. I will use dld if possible. If you are +-using a version of DLD earlier than 3.2.6, or don't have it at all, you +-should probably upgrade. If you are forced to use 3.2.4, you should +-uncomment a couple of lines in hints/linux.sh and restart Configure so +-that shared libraries will be disallowed. +- +-EOM +- lddlflags="-r $lddlflags" +- # These empty values are so that Configure doesn't put in the +- # Linux ELF values. +- ccdlflags=' ' +- cccdlflags=' ' +- ccflags="-DOVR_DBL_DIG=14 $ccflags" +- so='sa' +- dlext='o' +- nm_so_opt=' ' +- ## If you are using DLD 3.2.4 which does not support shared libs, +- ## uncomment the next two lines: +- #ldflags="-static" +- #so='none' +- +- # In addition, on some systems there is a problem with perl and NDBM +- # which causes AnyDBM and NDBM_File to lock up. This is evidenced +- # in the tests as AnyDBM just freezing. Apparently, this only +- # happens on a.out systems, so we disable NDBM for all a.out linux +- # systems. If someone can suggest a more robust test +- # that would be appreciated. +- # +- # More info: +- # Date: Wed, 7 Feb 1996 03:21:04 +0900 +- # From: Jeffrey Friedl +- # +- # I tried compiling with DBM support and sure enough things locked up +- # just as advertised. Checking into it, I found that the lockup was +- # during the call to dbm_open. Not *in* dbm_open -- but between the call +- # to and the jump into. +- # +- # To make a long story short, making sure that the *.a and *.sa pairs of +- # /usr/lib/lib{m,db,gdbm}.{a,sa} +- # were perfectly in sync took care of it. +- # +- # This will generate a harmless Whoa There! message +- case "$d_dbm_open" in +- '') cat <<'EOM' >&4 +- +-Disabling ndbm. This will generate a Whoa There message in Configure. +-Read hints/linux.sh for further information. +-EOM +- # You can override this with Configure -Dd_dbm_open +- d_dbm_open=undef +- ;; +- esac +-fi +# libquadmath is sometimes installed as gcc internal library, +# so contrary to our usual policy of *not* looking at gcc internal +# directories we now *do* look at them, in case they contain @@ -131,7 +214,8 @@ index a148248..fb5a46e 100644 + done + ;; +esac -+ + +-rm -f try.c a.out +case "$libc" in +'') +# If you have glibc, then report the version for ./myconfig bug reporting. @@ -157,29 +241,13 @@ index a148248..fb5a46e 100644 + done + ;; +esac -+ - # Are we using ELF? Thanks to Kenneth Albanowski - # for this test. - cat >try.c <<'EOM' -@@ -202,7 +241,7 @@ main() { - exit(0); /* succeed (yes, it's ELF) */ - } - EOM --if ${cc:-gcc} try.c >/dev/null 2>&1 && $run ./a.out; then -+if ${cc:-gcc} $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then - cat <<'EOM' >&4 - - You appear to have ELF support. I'll try to use it for dynamic loading. -@@ -268,7 +307,7 @@ fi - - rm -f try.c a.out -if /bin/sh -c exit; then +if ${sh:-/bin/sh} -c exit; then echo '' echo 'You appear to have a working bash. Good.' else -@@ -335,7 +374,7 @@ fi +@@ -335,7 +288,7 @@ fi #'osfmach3ppc') ccdlflags='-Wl,-E' ;; #esac @@ -188,7 +256,7 @@ index a148248..fb5a46e 100644 sparc*) case "$cccdlflags" in *-fpic*) cccdlflags="`echo $cccdlflags|sed 's/-fpic/-fPIC/'`" ;; -@@ -350,17 +389,55 @@ esac +@@ -350,17 +303,55 @@ esac # version of -lgdbm which is a bad idea. So if we have 'nm' # make sure it can read the file # NI-S 2003/08/07 @@ -254,7 +322,7 @@ index a148248..fb5a46e 100644 # This script UU/usethreads.cbu will get 'called-back' by Configure # after it has prompted the user for whether to use threads. -@@ -437,7 +514,7 @@ then +@@ -437,7 +428,7 @@ then DBLIB="$DBDIR/libdb.so" if [ -f $DBLIB ] then @@ -263,15 +331,3 @@ index a148248..fb5a46e 100644 then if ldd $DBLIB | grep pthread >/dev/null then -diff --git a/patchlevel.h b/patchlevel.h -index cb033ea..78c727d 100644 ---- a/patchlevel.h -+++ b/patchlevel.h -@@ -137,6 +137,7 @@ static const char * const local_patches[] = { - ,"uncommitted-changes" - #endif - PERL_GIT_UNPUSHED_COMMITS /* do not remove this line */ -+ ,"Devel::PatchPerl 1.38" - ,NULL - }; - diff --git a/5.018.004-64bit,threaded/Dockerfile b/5.018.004-64bit,threaded/Dockerfile index d90d973..0e643af 100644 --- a/5.018.004-64bit,threaded/Dockerfile +++ b/5.018.004-64bit,threaded/Dockerfile @@ -10,7 +10,7 @@ COPY *.patch /usr/src/perl/ WORKDIR /usr/src/perl RUN curl -SL https://cpan.metacpan.org/authors/id/R/RJ/RJBS/perl-5.18.4.tar.bz2 -o perl-5.18.4.tar.bz2 \ - && echo '69c34558a0a939a7adbbc1de48c06ea418d81e27 *perl-5.18.4.tar.bz2' | sha1sum -c - \ + && echo '1fb4d27b75cd244e849f253320260efe1750641aaff4a18ce0d67556ff1b96a5 *perl-5.18.4.tar.bz2' | sha256sum -c - \ && tar --strip-components=1 -xjf perl-5.18.4.tar.bz2 -C /usr/src/perl \ && rm perl-5.18.4.tar.bz2 \ && cat *.patch | patch -p1 \ diff --git a/5.018.004-64bit/DevelPatchPerl.patch b/5.018.004-64bit/DevelPatchPerl.patch index 4269b56..6381f99 100644 --- a/5.018.004-64bit/DevelPatchPerl.patch +++ b/5.018.004-64bit/DevelPatchPerl.patch @@ -40,7 +40,7 @@ index b707911..2588f0b 100644 or die "Cannot exec $cpp"; } diff --git a/hints/linux.sh b/hints/linux.sh -index a148248..fb5a46e 100644 +index a148248..3f38ea0 100644 --- a/hints/linux.sh +++ b/hints/linux.sh @@ -39,7 +39,7 @@ i_libutil='undef' @@ -111,10 +111,93 @@ index a148248..fb5a46e 100644 cut -f2- -d= | tr ':' $trnl | grep -v 'gcc' | sed -e 's:/$::'` set X $plibpth # Collapse all entries on one line shift -@@ -182,6 +178,49 @@ case "$plibpth" in +@@ -182,93 +178,50 @@ case "$plibpth" in ;; esac +-# Are we using ELF? Thanks to Kenneth Albanowski +-# for this test. +-cat >try.c <<'EOM' +-/* Test for whether ELF binaries are produced */ +-#include +-#include +-#include +-main() { +- char buffer[4]; +- int i=open("a.out",O_RDONLY); +- if(i==-1) +- exit(1); /* fail */ +- if(read(i,&buffer[0],4)<4) +- exit(1); /* fail */ +- if(buffer[0] != 127 || buffer[1] != 'E' || +- buffer[2] != 'L' || buffer[3] != 'F') +- exit(1); /* fail */ +- exit(0); /* succeed (yes, it's ELF) */ +-} +-EOM +-if ${cc:-gcc} try.c >/dev/null 2>&1 && $run ./a.out; then +- cat <<'EOM' >&4 +- +-You appear to have ELF support. I'll try to use it for dynamic loading. +-If dynamic loading doesn't work, read hints/linux.sh for further information. +-EOM +- +-else +- cat <<'EOM' >&4 +- +-You don't have an ELF gcc. I will use dld if possible. If you are +-using a version of DLD earlier than 3.2.6, or don't have it at all, you +-should probably upgrade. If you are forced to use 3.2.4, you should +-uncomment a couple of lines in hints/linux.sh and restart Configure so +-that shared libraries will be disallowed. +- +-EOM +- lddlflags="-r $lddlflags" +- # These empty values are so that Configure doesn't put in the +- # Linux ELF values. +- ccdlflags=' ' +- cccdlflags=' ' +- ccflags="-DOVR_DBL_DIG=14 $ccflags" +- so='sa' +- dlext='o' +- nm_so_opt=' ' +- ## If you are using DLD 3.2.4 which does not support shared libs, +- ## uncomment the next two lines: +- #ldflags="-static" +- #so='none' +- +- # In addition, on some systems there is a problem with perl and NDBM +- # which causes AnyDBM and NDBM_File to lock up. This is evidenced +- # in the tests as AnyDBM just freezing. Apparently, this only +- # happens on a.out systems, so we disable NDBM for all a.out linux +- # systems. If someone can suggest a more robust test +- # that would be appreciated. +- # +- # More info: +- # Date: Wed, 7 Feb 1996 03:21:04 +0900 +- # From: Jeffrey Friedl +- # +- # I tried compiling with DBM support and sure enough things locked up +- # just as advertised. Checking into it, I found that the lockup was +- # during the call to dbm_open. Not *in* dbm_open -- but between the call +- # to and the jump into. +- # +- # To make a long story short, making sure that the *.a and *.sa pairs of +- # /usr/lib/lib{m,db,gdbm}.{a,sa} +- # were perfectly in sync took care of it. +- # +- # This will generate a harmless Whoa There! message +- case "$d_dbm_open" in +- '') cat <<'EOM' >&4 +- +-Disabling ndbm. This will generate a Whoa There message in Configure. +-Read hints/linux.sh for further information. +-EOM +- # You can override this with Configure -Dd_dbm_open +- d_dbm_open=undef +- ;; +- esac +-fi +# libquadmath is sometimes installed as gcc internal library, +# so contrary to our usual policy of *not* looking at gcc internal +# directories we now *do* look at them, in case they contain @@ -131,7 +214,8 @@ index a148248..fb5a46e 100644 + done + ;; +esac -+ + +-rm -f try.c a.out +case "$libc" in +'') +# If you have glibc, then report the version for ./myconfig bug reporting. @@ -157,29 +241,13 @@ index a148248..fb5a46e 100644 + done + ;; +esac -+ - # Are we using ELF? Thanks to Kenneth Albanowski - # for this test. - cat >try.c <<'EOM' -@@ -202,7 +241,7 @@ main() { - exit(0); /* succeed (yes, it's ELF) */ - } - EOM --if ${cc:-gcc} try.c >/dev/null 2>&1 && $run ./a.out; then -+if ${cc:-gcc} $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then - cat <<'EOM' >&4 - - You appear to have ELF support. I'll try to use it for dynamic loading. -@@ -268,7 +307,7 @@ fi - - rm -f try.c a.out -if /bin/sh -c exit; then +if ${sh:-/bin/sh} -c exit; then echo '' echo 'You appear to have a working bash. Good.' else -@@ -335,7 +374,7 @@ fi +@@ -335,7 +288,7 @@ fi #'osfmach3ppc') ccdlflags='-Wl,-E' ;; #esac @@ -188,7 +256,7 @@ index a148248..fb5a46e 100644 sparc*) case "$cccdlflags" in *-fpic*) cccdlflags="`echo $cccdlflags|sed 's/-fpic/-fPIC/'`" ;; -@@ -350,17 +389,55 @@ esac +@@ -350,17 +303,55 @@ esac # version of -lgdbm which is a bad idea. So if we have 'nm' # make sure it can read the file # NI-S 2003/08/07 @@ -254,7 +322,7 @@ index a148248..fb5a46e 100644 # This script UU/usethreads.cbu will get 'called-back' by Configure # after it has prompted the user for whether to use threads. -@@ -437,7 +514,7 @@ then +@@ -437,7 +428,7 @@ then DBLIB="$DBDIR/libdb.so" if [ -f $DBLIB ] then @@ -263,15 +331,3 @@ index a148248..fb5a46e 100644 then if ldd $DBLIB | grep pthread >/dev/null then -diff --git a/patchlevel.h b/patchlevel.h -index cb033ea..78c727d 100644 ---- a/patchlevel.h -+++ b/patchlevel.h -@@ -137,6 +137,7 @@ static const char * const local_patches[] = { - ,"uncommitted-changes" - #endif - PERL_GIT_UNPUSHED_COMMITS /* do not remove this line */ -+ ,"Devel::PatchPerl 1.38" - ,NULL - }; - diff --git a/5.018.004-64bit/Dockerfile b/5.018.004-64bit/Dockerfile index 90c5966..aa47ed6 100644 --- a/5.018.004-64bit/Dockerfile +++ b/5.018.004-64bit/Dockerfile @@ -10,7 +10,7 @@ COPY *.patch /usr/src/perl/ WORKDIR /usr/src/perl RUN curl -SL https://cpan.metacpan.org/authors/id/R/RJ/RJBS/perl-5.18.4.tar.bz2 -o perl-5.18.4.tar.bz2 \ - && echo '69c34558a0a939a7adbbc1de48c06ea418d81e27 *perl-5.18.4.tar.bz2' | sha1sum -c - \ + && echo '1fb4d27b75cd244e849f253320260efe1750641aaff4a18ce0d67556ff1b96a5 *perl-5.18.4.tar.bz2' | sha256sum -c - \ && tar --strip-components=1 -xjf perl-5.18.4.tar.bz2 -C /usr/src/perl \ && rm perl-5.18.4.tar.bz2 \ && cat *.patch | patch -p1 \ diff --git a/5.020.003-64bit,threaded/DevelPatchPerl.patch b/5.020.003-64bit,threaded/DevelPatchPerl.patch index 9511940..363cf79 100644 --- a/5.020.003-64bit,threaded/DevelPatchPerl.patch +++ b/5.020.003-64bit,threaded/DevelPatchPerl.patch @@ -1,5 +1,5 @@ diff --git a/hints/linux.sh b/hints/linux.sh -index 956adfc..fb5a46e 100644 +index 956adfc..3f38ea0 100644 --- a/hints/linux.sh +++ b/hints/linux.sh @@ -178,6 +178,23 @@ case "$plibpth" in @@ -26,7 +26,100 @@ index 956adfc..fb5a46e 100644 case "$libc" in '') # If you have glibc, then report the version for ./myconfig bug reporting. -@@ -497,7 +514,7 @@ then +@@ -204,92 +221,6 @@ case "$libc" in + ;; + esac + +-# Are we using ELF? Thanks to Kenneth Albanowski +-# for this test. +-cat >try.c <<'EOM' +-/* Test for whether ELF binaries are produced */ +-#include +-#include +-#include +-main() { +- char buffer[4]; +- int i=open("a.out",O_RDONLY); +- if(i==-1) +- exit(1); /* fail */ +- if(read(i,&buffer[0],4)<4) +- exit(1); /* fail */ +- if(buffer[0] != 127 || buffer[1] != 'E' || +- buffer[2] != 'L' || buffer[3] != 'F') +- exit(1); /* fail */ +- exit(0); /* succeed (yes, it's ELF) */ +-} +-EOM +-if ${cc:-gcc} $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then +- cat <<'EOM' >&4 +- +-You appear to have ELF support. I'll try to use it for dynamic loading. +-If dynamic loading doesn't work, read hints/linux.sh for further information. +-EOM +- +-else +- cat <<'EOM' >&4 +- +-You don't have an ELF gcc. I will use dld if possible. If you are +-using a version of DLD earlier than 3.2.6, or don't have it at all, you +-should probably upgrade. If you are forced to use 3.2.4, you should +-uncomment a couple of lines in hints/linux.sh and restart Configure so +-that shared libraries will be disallowed. +- +-EOM +- lddlflags="-r $lddlflags" +- # These empty values are so that Configure doesn't put in the +- # Linux ELF values. +- ccdlflags=' ' +- cccdlflags=' ' +- ccflags="-DOVR_DBL_DIG=14 $ccflags" +- so='sa' +- dlext='o' +- nm_so_opt=' ' +- ## If you are using DLD 3.2.4 which does not support shared libs, +- ## uncomment the next two lines: +- #ldflags="-static" +- #so='none' +- +- # In addition, on some systems there is a problem with perl and NDBM +- # which causes AnyDBM and NDBM_File to lock up. This is evidenced +- # in the tests as AnyDBM just freezing. Apparently, this only +- # happens on a.out systems, so we disable NDBM for all a.out linux +- # systems. If someone can suggest a more robust test +- # that would be appreciated. +- # +- # More info: +- # Date: Wed, 7 Feb 1996 03:21:04 +0900 +- # From: Jeffrey Friedl +- # +- # I tried compiling with DBM support and sure enough things locked up +- # just as advertised. Checking into it, I found that the lockup was +- # during the call to dbm_open. Not *in* dbm_open -- but between the call +- # to and the jump into. +- # +- # To make a long story short, making sure that the *.a and *.sa pairs of +- # /usr/lib/lib{m,db,gdbm}.{a,sa} +- # were perfectly in sync took care of it. +- # +- # This will generate a harmless Whoa There! message +- case "$d_dbm_open" in +- '') cat <<'EOM' >&4 +- +-Disabling ndbm. This will generate a Whoa There message in Configure. +-Read hints/linux.sh for further information. +-EOM +- # You can override this with Configure -Dd_dbm_open +- d_dbm_open=undef +- ;; +- esac +-fi +- +-rm -f try.c a.out +- + if ${sh:-/bin/sh} -c exit; then + echo '' + echo 'You appear to have a working bash. Good.' +@@ -497,7 +428,7 @@ then DBLIB="$DBDIR/libdb.so" if [ -f $DBLIB ] then @@ -35,15 +128,3 @@ index 956adfc..fb5a46e 100644 then if ldd $DBLIB | grep pthread >/dev/null then -diff --git a/patchlevel.h b/patchlevel.h -index f416602..e8062d1 100644 ---- a/patchlevel.h -+++ b/patchlevel.h -@@ -137,6 +137,7 @@ static const char * const local_patches[] = { - ,"uncommitted-changes" - #endif - PERL_GIT_UNPUSHED_COMMITS /* do not remove this line */ -+ ,"Devel::PatchPerl 1.38" - ,NULL - }; - diff --git a/5.020.003-64bit,threaded/Dockerfile b/5.020.003-64bit,threaded/Dockerfile index 11ce1e2..9161563 100644 --- a/5.020.003-64bit,threaded/Dockerfile +++ b/5.020.003-64bit,threaded/Dockerfile @@ -10,7 +10,7 @@ COPY *.patch /usr/src/perl/ WORKDIR /usr/src/perl RUN curl -SL https://cpan.metacpan.org/authors/id/S/SH/SHAY/perl-5.20.3.tar.bz2 -o perl-5.20.3.tar.bz2 \ - && echo 'eedf9e3be3c83bef15911996ed18703cffe4d113 *perl-5.20.3.tar.bz2' | sha1sum -c - \ + && echo '1b40068166c242e34a536836286e70b78410602a80615143301e52aa2901493b *perl-5.20.3.tar.bz2' | sha256sum -c - \ && tar --strip-components=1 -xjf perl-5.20.3.tar.bz2 -C /usr/src/perl \ && rm perl-5.20.3.tar.bz2 \ && cat *.patch | patch -p1 \ diff --git a/5.020.003-64bit/DevelPatchPerl.patch b/5.020.003-64bit/DevelPatchPerl.patch index 9511940..363cf79 100644 --- a/5.020.003-64bit/DevelPatchPerl.patch +++ b/5.020.003-64bit/DevelPatchPerl.patch @@ -1,5 +1,5 @@ diff --git a/hints/linux.sh b/hints/linux.sh -index 956adfc..fb5a46e 100644 +index 956adfc..3f38ea0 100644 --- a/hints/linux.sh +++ b/hints/linux.sh @@ -178,6 +178,23 @@ case "$plibpth" in @@ -26,7 +26,100 @@ index 956adfc..fb5a46e 100644 case "$libc" in '') # If you have glibc, then report the version for ./myconfig bug reporting. -@@ -497,7 +514,7 @@ then +@@ -204,92 +221,6 @@ case "$libc" in + ;; + esac + +-# Are we using ELF? Thanks to Kenneth Albanowski +-# for this test. +-cat >try.c <<'EOM' +-/* Test for whether ELF binaries are produced */ +-#include +-#include +-#include +-main() { +- char buffer[4]; +- int i=open("a.out",O_RDONLY); +- if(i==-1) +- exit(1); /* fail */ +- if(read(i,&buffer[0],4)<4) +- exit(1); /* fail */ +- if(buffer[0] != 127 || buffer[1] != 'E' || +- buffer[2] != 'L' || buffer[3] != 'F') +- exit(1); /* fail */ +- exit(0); /* succeed (yes, it's ELF) */ +-} +-EOM +-if ${cc:-gcc} $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then +- cat <<'EOM' >&4 +- +-You appear to have ELF support. I'll try to use it for dynamic loading. +-If dynamic loading doesn't work, read hints/linux.sh for further information. +-EOM +- +-else +- cat <<'EOM' >&4 +- +-You don't have an ELF gcc. I will use dld if possible. If you are +-using a version of DLD earlier than 3.2.6, or don't have it at all, you +-should probably upgrade. If you are forced to use 3.2.4, you should +-uncomment a couple of lines in hints/linux.sh and restart Configure so +-that shared libraries will be disallowed. +- +-EOM +- lddlflags="-r $lddlflags" +- # These empty values are so that Configure doesn't put in the +- # Linux ELF values. +- ccdlflags=' ' +- cccdlflags=' ' +- ccflags="-DOVR_DBL_DIG=14 $ccflags" +- so='sa' +- dlext='o' +- nm_so_opt=' ' +- ## If you are using DLD 3.2.4 which does not support shared libs, +- ## uncomment the next two lines: +- #ldflags="-static" +- #so='none' +- +- # In addition, on some systems there is a problem with perl and NDBM +- # which causes AnyDBM and NDBM_File to lock up. This is evidenced +- # in the tests as AnyDBM just freezing. Apparently, this only +- # happens on a.out systems, so we disable NDBM for all a.out linux +- # systems. If someone can suggest a more robust test +- # that would be appreciated. +- # +- # More info: +- # Date: Wed, 7 Feb 1996 03:21:04 +0900 +- # From: Jeffrey Friedl +- # +- # I tried compiling with DBM support and sure enough things locked up +- # just as advertised. Checking into it, I found that the lockup was +- # during the call to dbm_open. Not *in* dbm_open -- but between the call +- # to and the jump into. +- # +- # To make a long story short, making sure that the *.a and *.sa pairs of +- # /usr/lib/lib{m,db,gdbm}.{a,sa} +- # were perfectly in sync took care of it. +- # +- # This will generate a harmless Whoa There! message +- case "$d_dbm_open" in +- '') cat <<'EOM' >&4 +- +-Disabling ndbm. This will generate a Whoa There message in Configure. +-Read hints/linux.sh for further information. +-EOM +- # You can override this with Configure -Dd_dbm_open +- d_dbm_open=undef +- ;; +- esac +-fi +- +-rm -f try.c a.out +- + if ${sh:-/bin/sh} -c exit; then + echo '' + echo 'You appear to have a working bash. Good.' +@@ -497,7 +428,7 @@ then DBLIB="$DBDIR/libdb.so" if [ -f $DBLIB ] then @@ -35,15 +128,3 @@ index 956adfc..fb5a46e 100644 then if ldd $DBLIB | grep pthread >/dev/null then -diff --git a/patchlevel.h b/patchlevel.h -index f416602..e8062d1 100644 ---- a/patchlevel.h -+++ b/patchlevel.h -@@ -137,6 +137,7 @@ static const char * const local_patches[] = { - ,"uncommitted-changes" - #endif - PERL_GIT_UNPUSHED_COMMITS /* do not remove this line */ -+ ,"Devel::PatchPerl 1.38" - ,NULL - }; - diff --git a/5.020.003-64bit/Dockerfile b/5.020.003-64bit/Dockerfile index f2f98a2..029a8d1 100644 --- a/5.020.003-64bit/Dockerfile +++ b/5.020.003-64bit/Dockerfile @@ -10,7 +10,7 @@ COPY *.patch /usr/src/perl/ WORKDIR /usr/src/perl RUN curl -SL https://cpan.metacpan.org/authors/id/S/SH/SHAY/perl-5.20.3.tar.bz2 -o perl-5.20.3.tar.bz2 \ - && echo 'eedf9e3be3c83bef15911996ed18703cffe4d113 *perl-5.20.3.tar.bz2' | sha1sum -c - \ + && echo '1b40068166c242e34a536836286e70b78410602a80615143301e52aa2901493b *perl-5.20.3.tar.bz2' | sha256sum -c - \ && tar --strip-components=1 -xjf perl-5.20.3.tar.bz2 -C /usr/src/perl \ && rm perl-5.20.3.tar.bz2 \ && cat *.patch | patch -p1 \ diff --git a/5.022.002-64bit,threaded/DevelPatchPerl.patch b/5.022.002-64bit,threaded/DevelPatchPerl.patch index 2f19889..4c69d78 100644 --- a/5.022.002-64bit,threaded/DevelPatchPerl.patch +++ b/5.022.002-64bit,threaded/DevelPatchPerl.patch @@ -1,12 +1,97 @@ -diff --git a/patchlevel.h b/patchlevel.h -index bfd796b..69d5fb0 100644 ---- a/patchlevel.h -+++ b/patchlevel.h -@@ -137,6 +137,7 @@ static const char * const local_patches[] = { - ,"uncommitted-changes" - #endif - PERL_GIT_UNPUSHED_COMMITS /* do not remove this line */ -+ ,"Devel::PatchPerl 1.38" - ,NULL - }; +diff --git a/hints/linux.sh b/hints/linux.sh +index fb5a46e..3f38ea0 100644 +--- a/hints/linux.sh ++++ b/hints/linux.sh +@@ -221,92 +221,6 @@ case "$libc" in + ;; + esac +-# Are we using ELF? Thanks to Kenneth Albanowski +-# for this test. +-cat >try.c <<'EOM' +-/* Test for whether ELF binaries are produced */ +-#include +-#include +-#include +-main() { +- char buffer[4]; +- int i=open("a.out",O_RDONLY); +- if(i==-1) +- exit(1); /* fail */ +- if(read(i,&buffer[0],4)<4) +- exit(1); /* fail */ +- if(buffer[0] != 127 || buffer[1] != 'E' || +- buffer[2] != 'L' || buffer[3] != 'F') +- exit(1); /* fail */ +- exit(0); /* succeed (yes, it's ELF) */ +-} +-EOM +-if ${cc:-gcc} $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then +- cat <<'EOM' >&4 +- +-You appear to have ELF support. I'll try to use it for dynamic loading. +-If dynamic loading doesn't work, read hints/linux.sh for further information. +-EOM +- +-else +- cat <<'EOM' >&4 +- +-You don't have an ELF gcc. I will use dld if possible. If you are +-using a version of DLD earlier than 3.2.6, or don't have it at all, you +-should probably upgrade. If you are forced to use 3.2.4, you should +-uncomment a couple of lines in hints/linux.sh and restart Configure so +-that shared libraries will be disallowed. +- +-EOM +- lddlflags="-r $lddlflags" +- # These empty values are so that Configure doesn't put in the +- # Linux ELF values. +- ccdlflags=' ' +- cccdlflags=' ' +- ccflags="-DOVR_DBL_DIG=14 $ccflags" +- so='sa' +- dlext='o' +- nm_so_opt=' ' +- ## If you are using DLD 3.2.4 which does not support shared libs, +- ## uncomment the next two lines: +- #ldflags="-static" +- #so='none' +- +- # In addition, on some systems there is a problem with perl and NDBM +- # which causes AnyDBM and NDBM_File to lock up. This is evidenced +- # in the tests as AnyDBM just freezing. Apparently, this only +- # happens on a.out systems, so we disable NDBM for all a.out linux +- # systems. If someone can suggest a more robust test +- # that would be appreciated. +- # +- # More info: +- # Date: Wed, 7 Feb 1996 03:21:04 +0900 +- # From: Jeffrey Friedl +- # +- # I tried compiling with DBM support and sure enough things locked up +- # just as advertised. Checking into it, I found that the lockup was +- # during the call to dbm_open. Not *in* dbm_open -- but between the call +- # to and the jump into. +- # +- # To make a long story short, making sure that the *.a and *.sa pairs of +- # /usr/lib/lib{m,db,gdbm}.{a,sa} +- # were perfectly in sync took care of it. +- # +- # This will generate a harmless Whoa There! message +- case "$d_dbm_open" in +- '') cat <<'EOM' >&4 +- +-Disabling ndbm. This will generate a Whoa There message in Configure. +-Read hints/linux.sh for further information. +-EOM +- # You can override this with Configure -Dd_dbm_open +- d_dbm_open=undef +- ;; +- esac +-fi +- +-rm -f try.c a.out +- + if ${sh:-/bin/sh} -c exit; then + echo '' + echo 'You appear to have a working bash. Good.' diff --git a/5.022.002-64bit,threaded/Dockerfile b/5.022.002-64bit,threaded/Dockerfile index f160c29..0093a17 100644 --- a/5.022.002-64bit,threaded/Dockerfile +++ b/5.022.002-64bit,threaded/Dockerfile @@ -10,7 +10,7 @@ COPY *.patch /usr/src/perl/ WORKDIR /usr/src/perl RUN curl -SL https://cpan.metacpan.org/authors/id/S/SH/SHAY/perl-5.22.2.tar.bz2 -o perl-5.22.2.tar.bz2 \ - && echo 'e2f465446dcd45a7fa3da696037f9ebe73e78e55 *perl-5.22.2.tar.bz2' | sha1sum -c - \ + && echo 'f2322b9b04fe0cdbca9fe755360da04892cb6483d44959457cfebc0bcddc8058 *perl-5.22.2.tar.bz2' | sha256sum -c - \ && tar --strip-components=1 -xjf perl-5.22.2.tar.bz2 -C /usr/src/perl \ && rm perl-5.22.2.tar.bz2 \ && cat *.patch | patch -p1 \ diff --git a/5.022.002-64bit/DevelPatchPerl.patch b/5.022.002-64bit/DevelPatchPerl.patch index 2f19889..4c69d78 100644 --- a/5.022.002-64bit/DevelPatchPerl.patch +++ b/5.022.002-64bit/DevelPatchPerl.patch @@ -1,12 +1,97 @@ -diff --git a/patchlevel.h b/patchlevel.h -index bfd796b..69d5fb0 100644 ---- a/patchlevel.h -+++ b/patchlevel.h -@@ -137,6 +137,7 @@ static const char * const local_patches[] = { - ,"uncommitted-changes" - #endif - PERL_GIT_UNPUSHED_COMMITS /* do not remove this line */ -+ ,"Devel::PatchPerl 1.38" - ,NULL - }; +diff --git a/hints/linux.sh b/hints/linux.sh +index fb5a46e..3f38ea0 100644 +--- a/hints/linux.sh ++++ b/hints/linux.sh +@@ -221,92 +221,6 @@ case "$libc" in + ;; + esac +-# Are we using ELF? Thanks to Kenneth Albanowski +-# for this test. +-cat >try.c <<'EOM' +-/* Test for whether ELF binaries are produced */ +-#include +-#include +-#include +-main() { +- char buffer[4]; +- int i=open("a.out",O_RDONLY); +- if(i==-1) +- exit(1); /* fail */ +- if(read(i,&buffer[0],4)<4) +- exit(1); /* fail */ +- if(buffer[0] != 127 || buffer[1] != 'E' || +- buffer[2] != 'L' || buffer[3] != 'F') +- exit(1); /* fail */ +- exit(0); /* succeed (yes, it's ELF) */ +-} +-EOM +-if ${cc:-gcc} $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then +- cat <<'EOM' >&4 +- +-You appear to have ELF support. I'll try to use it for dynamic loading. +-If dynamic loading doesn't work, read hints/linux.sh for further information. +-EOM +- +-else +- cat <<'EOM' >&4 +- +-You don't have an ELF gcc. I will use dld if possible. If you are +-using a version of DLD earlier than 3.2.6, or don't have it at all, you +-should probably upgrade. If you are forced to use 3.2.4, you should +-uncomment a couple of lines in hints/linux.sh and restart Configure so +-that shared libraries will be disallowed. +- +-EOM +- lddlflags="-r $lddlflags" +- # These empty values are so that Configure doesn't put in the +- # Linux ELF values. +- ccdlflags=' ' +- cccdlflags=' ' +- ccflags="-DOVR_DBL_DIG=14 $ccflags" +- so='sa' +- dlext='o' +- nm_so_opt=' ' +- ## If you are using DLD 3.2.4 which does not support shared libs, +- ## uncomment the next two lines: +- #ldflags="-static" +- #so='none' +- +- # In addition, on some systems there is a problem with perl and NDBM +- # which causes AnyDBM and NDBM_File to lock up. This is evidenced +- # in the tests as AnyDBM just freezing. Apparently, this only +- # happens on a.out systems, so we disable NDBM for all a.out linux +- # systems. If someone can suggest a more robust test +- # that would be appreciated. +- # +- # More info: +- # Date: Wed, 7 Feb 1996 03:21:04 +0900 +- # From: Jeffrey Friedl +- # +- # I tried compiling with DBM support and sure enough things locked up +- # just as advertised. Checking into it, I found that the lockup was +- # during the call to dbm_open. Not *in* dbm_open -- but between the call +- # to and the jump into. +- # +- # To make a long story short, making sure that the *.a and *.sa pairs of +- # /usr/lib/lib{m,db,gdbm}.{a,sa} +- # were perfectly in sync took care of it. +- # +- # This will generate a harmless Whoa There! message +- case "$d_dbm_open" in +- '') cat <<'EOM' >&4 +- +-Disabling ndbm. This will generate a Whoa There message in Configure. +-Read hints/linux.sh for further information. +-EOM +- # You can override this with Configure -Dd_dbm_open +- d_dbm_open=undef +- ;; +- esac +-fi +- +-rm -f try.c a.out +- + if ${sh:-/bin/sh} -c exit; then + echo '' + echo 'You appear to have a working bash. Good.' diff --git a/5.022.002-64bit/Dockerfile b/5.022.002-64bit/Dockerfile index 4bb46e1..1c7299c 100644 --- a/5.022.002-64bit/Dockerfile +++ b/5.022.002-64bit/Dockerfile @@ -10,7 +10,7 @@ COPY *.patch /usr/src/perl/ WORKDIR /usr/src/perl RUN curl -SL https://cpan.metacpan.org/authors/id/S/SH/SHAY/perl-5.22.2.tar.bz2 -o perl-5.22.2.tar.bz2 \ - && echo 'e2f465446dcd45a7fa3da696037f9ebe73e78e55 *perl-5.22.2.tar.bz2' | sha1sum -c - \ + && echo 'f2322b9b04fe0cdbca9fe755360da04892cb6483d44959457cfebc0bcddc8058 *perl-5.22.2.tar.bz2' | sha256sum -c - \ && tar --strip-components=1 -xjf perl-5.22.2.tar.bz2 -C /usr/src/perl \ && rm perl-5.22.2.tar.bz2 \ && cat *.patch | patch -p1 \ diff --git a/5.024.000-64bit,threaded/DevelPatchPerl.patch b/5.024.000-64bit,threaded/DevelPatchPerl.patch index 927e2cf..c1ffa20 100644 --- a/5.024.000-64bit,threaded/DevelPatchPerl.patch +++ b/5.024.000-64bit,threaded/DevelPatchPerl.patch @@ -1,12 +1,1713 @@ -diff --git a/patchlevel.h b/patchlevel.h -index bcb921f..a171acb 100644 ---- a/patchlevel.h -+++ b/patchlevel.h -@@ -137,6 +137,7 @@ static const char * const local_patches[] = { - ,"uncommitted-changes" - #endif - PERL_GIT_UNPUSHED_COMMITS /* do not remove this line */ -+ ,"Devel::PatchPerl 1.42" - ,NULL - }; +diff --git a/dist/Time-HiRes/HiRes.pm b/dist/Time-HiRes/HiRes.pm +index ad9a65c..a3ddd59 100644 +--- a/dist/Time-HiRes/HiRes.pm ++++ b/dist/Time-HiRes/HiRes.pm +@@ -23,12 +23,12 @@ our @EXPORT_OK = qw (usleep sleep ualarm alarm gettimeofday time tv_interval + ITIMER_REAL ITIMER_VIRTUAL ITIMER_PROF ITIMER_REALPROF + TIMER_ABSTIME + d_usleep d_ualarm d_gettimeofday d_getitimer d_setitimer +- d_nanosleep d_clock_gettime d_clock_getres ++ d_nanosleep d_clock_gettime d_clock_getres d_hires_utime + d_clock d_clock_nanosleep +- stat lstat ++ stat lstat utime + ); +-our $VERSION = '1.9733'; ++our $VERSION = '1.9741'; + our $XS_VERSION = $VERSION; + $VERSION = eval $VERSION; + +@@ -60,6 +60,7 @@ sub import { + ($i eq 'clock' && !&d_clock) || + ($i eq 'nanosleep' && !&d_nanosleep) || + ($i eq 'usleep' && !&d_usleep) || ++ ($i eq 'utime' && !&d_hires_utime) || + ($i eq 'ualarm' && !&d_ualarm)) { + require Carp; + Carp::croak("Time::HiRes::$i(): unimplemented in this platform"); +@@ -92,7 +93,7 @@ Time::HiRes - High resolution alarm, sleep, gettimeofday, interval timers + + use Time::HiRes qw( usleep ualarm gettimeofday tv_interval nanosleep + clock_gettime clock_getres clock_nanosleep clock +- stat lstat ); ++ stat lstat utime); + + usleep ($microseconds); + nanosleep ($nanoseconds); +@@ -137,6 +138,9 @@ Time::HiRes - High resolution alarm, sleep, gettimeofday, interval timers + my @stat = stat(FH); + my @stat = lstat("file"); + ++ use Time::HiRes qw( utime ); ++ utime $floating_seconds, $floating_seconds, file...; ++ + =head1 DESCRIPTION + + The C module implements a Perl interface to the +@@ -446,6 +450,26 @@ if the operations are + the access time stamp from t2 need not be greater-than the modify + time stamp from t1: it may be equal or I. + ++=item utime LIST ++ ++As L ++but with the ability to set the access/modify file timestamps ++in subsecond resolution, if the operating system and the filesystem ++both support such timestamps. To override the standard utime(): ++ ++ use Time::HiRes qw(utime); ++ ++Test for the value of &Time::HiRes::d_hires_utime to find out whether ++the operating system supports setting subsecond file timestamps. ++ ++As with CORE::utime(), passing undef as both the atime and mtime will ++call the syscall with a NULL argument. ++ ++The actual achievable subsecond resolution depends on the combination ++of the operating system and the filesystem. ++ ++Returns the number of files successfully changed. ++ + =back + + =head1 EXAMPLES +@@ -535,7 +559,7 @@ VMS have emulations for it.) + Here is an example of using C from C: + + NV (*myNVtime)(); /* Returns -1 on failure. */ +- SV **svp = hv_fetch(PL_modglobal, "Time::NVtime", 12, 0); ++ SV **svp = hv_fetchs(PL_modglobal, "Time::NVtime", 0); + if (!svp) croak("Time::HiRes is required"); + if (!SvIOK(*svp)) croak("Time::NVtime isn't a function pointer"); + myNVtime = INT2PTR(NV(*)(), SvIV(*svp)); +@@ -586,9 +610,13 @@ might help in this (in case your system supports CLOCK_MONOTONIC). + Some systems have APIs but not implementations: for example QNX and Haiku + have the interval timer APIs but not the functionality. + +-In OS X clock_getres(), clock_gettime() and clock_nanosleep() are +-emulated using the Mach timers; as a side effect of being emulated +-the CLOCK_REALTIME and CLOCK_MONOTONIC are the same timer. ++In pre-Sierra macOS (pre-10.12, OS X) clock_getres(), clock_gettime() ++and clock_nanosleep() are emulated using the Mach timers; as a side ++effect of being emulated the CLOCK_REALTIME and CLOCK_MONOTONIC are ++the same timer. ++ ++gnukfreebsd seems to have non-functional futimens() and utimensat() ++(at least as of 10.1): therefore the hires utime() does not work. + + =head1 SEE ALSO + +diff --git a/dist/Time-HiRes/HiRes.xs b/dist/Time-HiRes/HiRes.xs +index 38ca0dc..6b0dba8 100644 +--- a/dist/Time-HiRes/HiRes.xs ++++ b/dist/Time-HiRes/HiRes.xs +@@ -87,6 +87,10 @@ extern "C" { + # undef ITIMER_REALPROF + #endif + ++#ifndef TIME_HIRES_CLOCKID_T ++typedef int clockid_t; ++#endif ++ + #if defined(TIME_HIRES_CLOCK_GETTIME) && defined(_STRUCT_ITIMERSPEC) + + /* HP-UX has CLOCK_XXX values but as enums, not as defines. +@@ -747,21 +751,33 @@ hrstatns(UV *atime_nsec, UV *mtime_nsec, UV *ctime_nsec) + #endif /* !TIME_HIRES_STAT */ + } + +-/* Until Apple implements clock_gettime() (ditto clock_getres()) +- * we will emulate it using Mach interfaces. */ +-#if defined(PERL_DARWIN) && !defined(CLOCK_REALTIME) +- +-# include ++/* Until Apple implements clock_gettime() ++ * (ditto clock_getres() and clock_nanosleep()) ++ * we will emulate them using the Mach kernel interfaces. */ ++#if defined(PERL_DARWIN) && \ ++ (defined(TIME_HIRES_CLOCK_GETTIME_EMULATION) || \ ++ defined(TIME_HIRES_CLOCK_GETRES_EMULATION) || \ ++ defined(TIME_HIRES_CLOCK_NANOSLEEP_EMULATION)) + ++#ifndef CLOCK_REALTIME + # define CLOCK_REALTIME 0x01 + # define CLOCK_MONOTONIC 0x02 ++#endif + ++#ifndef TIMER_ABSTIME + # define TIMER_ABSTIME 0x01 ++#endif + + #ifdef USE_ITHREADS ++# define PERL_DARWIN_MUTEX ++#endif ++ ++#ifdef PERL_DARWIN_MUTEX + STATIC perl_mutex darwin_time_mutex; + #endif + ++#include ++ + static uint64_t absolute_time_init; + static mach_timebase_info_data_t timebase_info; + static struct timespec timespec_init; +@@ -769,7 +785,7 @@ static struct timespec timespec_init; + static int darwin_time_init() { + struct timeval tv; + int success = 1; +-#ifdef USE_ITHREADS ++#ifdef PERL_DARWIN_MUTEX + MUTEX_LOCK(&darwin_time_mutex); + #endif + if (absolute_time_init == 0) { +@@ -784,13 +800,14 @@ static int darwin_time_init() { + } + } + } +-#ifdef USE_ITHREADS ++#ifdef PERL_DARWIN_MUTEX + MUTEX_UNLOCK(&darwin_time_mutex); + #endif + return success; + } + +-static int clock_gettime(int clock_id, struct timespec *ts) { ++#ifdef TIME_HIRES_CLOCK_GETTIME_EMULATION ++static int th_clock_gettime(clockid_t clock_id, struct timespec *ts) { + if (darwin_time_init() && timebase_info.denom) { + switch (clock_id) { + case CLOCK_REALTIME: +@@ -822,7 +839,12 @@ static int clock_gettime(int clock_id, struct timespec *ts) { + return -1; + } + +-static int clock_getres(int clock_id, struct timespec *ts) { ++#define clock_gettime(clock_id, ts) th_clock_gettime((clock_id), (ts)) ++ ++#endif /* TIME_HIRES_CLOCK_GETTIME_EMULATION */ ++ ++#ifdef TIME_HIRES_CLOCK_GETRES_EMULATION ++static int th_clock_getres(clockid_t clock_id, struct timespec *ts) { + if (darwin_time_init() && timebase_info.denom) { + switch (clock_id) { + case CLOCK_REALTIME: +@@ -842,7 +864,11 @@ static int clock_getres(int clock_id, struct timespec *ts) { + return -1; + } + +-static int clock_nanosleep(int clock_id, int flags, ++#define clock_getres(clock_id, ts) th_clock_getres((clock_id), (ts)) ++#endif /* TIME_HIRES_CLOCK_GETRES_EMULATION */ ++ ++#ifdef TIME_HIRES_CLOCK_NANOSLEEP_EMULATION ++static int th_clock_nanosleep(clockid_t clock_id, int flags, + const struct timespec *rqtp, + struct timespec *rmtp) { + if (darwin_time_init()) { +@@ -880,6 +906,11 @@ static int clock_nanosleep(int clock_id, int flags, + return -1; + } + ++#define clock_nanosleep(clock_id, flags, rqtp, rmtp) \ ++ th_clock_nanosleep((clock_id), (flags), (rqtp), (rmtp)) ++ ++#endif /* TIME_HIRES_CLOCK_NANOSLEEP_EMULATION */ ++ + #endif /* PERL_DARWIN */ + + #include "const-c.inc" +@@ -921,6 +952,22 @@ nsec_without_unslept(struct timespec *sleepfor, + + #endif + ++/* In case Perl and/or Devel::PPPort are too old, minimally emulate ++ * IS_SAFE_PATHNAME() (which looks for zero bytes in the pathname). */ ++#ifndef IS_SAFE_PATHNAME ++#if PERL_VERSION >= 12 /* Perl_ck_warner is 5.10.0 -> */ ++#ifdef WARN_SYSCALLS ++#define WARNEMUCAT WARN_SYSCALLS /* 5.22.0 -> */ ++#else ++#define WARNEMUCAT WARN_MISC ++#endif ++#define WARNEMU(opname) Perl_ck_warner(aTHX_ packWARN(WARNEMUCAT), "Invalid \\0 character in pathname for %s",opname) ++#else ++#define WARNEMU(opname) Perl_warn(aTHX_ "Invalid \\0 character in pathname for %s",opname) ++#endif ++#define IS_SAFE_PATHNAME(pv, len, opname) (((len)>1)&&memchr((pv), 0, (len)-1)?(SETERRNO(ENOENT, LIB_INVARG),WARNEMU(opname),FALSE):(TRUE)) ++#endif ++ + MODULE = Time::HiRes PACKAGE = Time::HiRes + + PROTOTYPES: ENABLE +@@ -941,7 +988,7 @@ BOOT: + # endif + #endif + #if defined(PERL_DARWIN) +-# ifdef USE_ITHREADS ++# if defined(USE_ITHREADS) && defined(PERL_DARWIN_MUTEX) + MUTEX_INIT(&darwin_time_mutex); + # endif + #endif +@@ -978,7 +1025,8 @@ usleep(useconds) + useconds -= NV_1E6 * seconds; + } + } else if (useconds < 0.0) +- croak("Time::HiRes::usleep(%"NVgf"): negative time not invented yet", useconds); ++ croak("Time::HiRes::usleep(%" NVgf ++ "): negative time not invented yet", useconds); + usleep((U32)useconds); + } else + PerlProc_pause(); +@@ -1000,7 +1048,8 @@ nanosleep(nsec) + struct timespec sleepfor, unslept; + CODE: + if (nsec < 0.0) +- croak("Time::HiRes::nanosleep(%"NVgf"): negative time not invented yet", nsec); ++ croak("Time::HiRes::nanosleep(%" NVgf ++ "): negative time not invented yet", nsec); + nanosleep_init(nsec, &sleepfor, &unslept); + if (nanosleep(&sleepfor, &unslept) == 0) { + RETVAL = nsec; +@@ -1045,11 +1094,15 @@ sleep(...) + useconds = -(IV)useconds; + #endif /* #if defined(__sparc64__) && defined(__GNUC__) */ + if ((IV)useconds < 0) +- croak("Time::HiRes::sleep(%"NVgf"): internal error: useconds < 0 (unsigned %"UVuf" signed %"IVdf")", seconds, useconds, (IV)useconds); ++ croak("Time::HiRes::sleep(%" NVgf ++ "): internal error: useconds < 0 (unsigned %" UVuf ++ " signed %" IVdf ")", ++ seconds, useconds, (IV)useconds); + } + usleep(useconds); + } else +- croak("Time::HiRes::sleep(%"NVgf"): negative time not invented yet", seconds); ++ croak("Time::HiRes::sleep(%" NVgf ++ "): negative time not invented yet", seconds); + } else + PerlProc_pause(); + gettimeofday(&Tb, NULL); +@@ -1097,7 +1150,9 @@ ualarm(useconds,uinterval=0) + } + #else + if (useconds >= IV_1E6 || uinterval >= IV_1E6) +- croak("Time::HiRes::ualarm(%d, %d): useconds or uinterval equal to or more than %"IVdf, useconds, uinterval, IV_1E6); ++ croak("Time::HiRes::ualarm(%d, %d): useconds or uinterval" ++ " equal to or more than %" IVdf, ++ useconds, uinterval, IV_1E6); + RETVAL = ualarm(useconds, uinterval); + #endif + +@@ -1110,7 +1165,8 @@ alarm(seconds,interval=0) + NV interval + CODE: + if (seconds < 0.0 || interval < 0.0) +- croak("Time::HiRes::alarm(%"NVgf", %"NVgf"): negative time not invented yet", seconds, interval); ++ croak("Time::HiRes::alarm(%" NVgf ", %" NVgf ++ "): negative time not invented yet", seconds, interval); + { + IV iseconds = (IV)seconds; + IV iinterval = (IV)interval; +@@ -1118,7 +1174,9 @@ alarm(seconds,interval=0) + NV finterval = interval - iinterval; + IV useconds, uinterval; + if (fseconds >= 1.0 || finterval >= 1.0) +- croak("Time::HiRes::alarm(%"NVgf", %"NVgf"): seconds or interval too large to split correctly", seconds, interval); ++ croak("Time::HiRes::alarm(%" NVgf ", %" NVgf ++ "): seconds or interval too large to split correctly", ++ seconds, interval); + useconds = IV_1E6 * fseconds; + uinterval = IV_1E6 * finterval; + #if defined(HAS_SETITIMER) && defined(ITIMER_REAL) +@@ -1138,7 +1196,9 @@ alarm(seconds,interval=0) + } + #else + if (iseconds || iinterval) +- croak("Time::HiRes::alarm(%"NVgf", %"NVgf"): seconds or interval equal to or more than 1.0 ", seconds, interval); ++ croak("Time::HiRes::alarm(%" NVgf ", %" NVgf ++ "): seconds or interval equal to or more than 1.0 ", ++ seconds, interval); + RETVAL = (NV)ualarm( useconds, uinterval ) / NV_1E6; + #endif + } +@@ -1266,7 +1326,9 @@ setitimer(which, seconds, interval = 0) + struct itimerval oldit; + PPCODE: + if (seconds < 0.0 || interval < 0.0) +- croak("Time::HiRes::setitimer(%"IVdf", %"NVgf", %"NVgf"): negative time not invented yet", (IV)which, seconds, interval); ++ croak("Time::HiRes::setitimer(%" IVdf ", %" NVgf ", %" NVgf ++ "): negative time not invented yet", ++ (IV)which, seconds, interval); + newit.it_value.tv_sec = (IV)seconds; + newit.it_value.tv_usec = + (IV)((seconds - (NV)newit.it_value.tv_sec) * NV_1E6); +@@ -1317,11 +1379,89 @@ getitimer(which) + + #endif /* #if defined(HAS_GETITIMER) && defined(HAS_SETITIMER) */ + ++#if defined(TIME_HIRES_UTIME) ++ ++I32 ++utime(accessed, modified, ...) ++PROTOTYPE: $$@ ++ PREINIT: ++ SV* accessed; ++ SV* modified; ++ SV* file; ++ ++ struct timespec utbuf[2]; ++ struct timespec *utbufp = utbuf; ++ int tot; ++ ++ CODE: ++ accessed = ST(0); ++ modified = ST(1); ++ items -= 2; ++ tot = 0; ++ ++ if ( accessed == &PL_sv_undef && modified == &PL_sv_undef ) ++ utbufp = NULL; ++ else { ++ if (SvNV(accessed) < 0.0 || SvNV(modified) < 0.0) ++ croak("Time::HiRes::utime(%" NVgf ", %" NVgf ++ "): negative time not invented yet", ++ SvNV(accessed), SvNV(modified)); ++ Zero(&utbuf, sizeof utbuf, char); ++ utbuf[0].tv_sec = (Time_t)SvNV(accessed); /* time accessed */ ++ utbuf[0].tv_nsec = (long)( ( SvNV(accessed) - utbuf[0].tv_sec ) * 1e9 ); ++ utbuf[1].tv_sec = (Time_t)SvNV(modified); /* time modified */ ++ utbuf[1].tv_nsec = (long)( ( SvNV(modified) - utbuf[1].tv_sec ) * 1e9 ); ++ } ++ ++ while (items > 0) { ++ file = POPs; items--; ++ ++ if (SvROK(file) && GvIO(SvRV(file)) && IoIFP(sv_2io(SvRV(file)))) { ++ int fd = PerlIO_fileno(IoIFP(sv_2io(file))); ++ if (fd < 0) ++ SETERRNO(EBADF,RMS_IFI); ++ else ++#ifdef HAS_FUTIMENS ++ if (futimens(fd, utbufp) == 0) ++ tot++; ++#else /* HAS_FUTIMES */ ++ croak("futimens unimplemented in this platform"); ++#endif /* HAS_FUTIMES */ ++ } ++ else { ++#ifdef HAS_UTIMENSAT ++ STRLEN len; ++ char * name = SvPV(file, len); ++ if (IS_SAFE_PATHNAME(name, len, "utime") && ++ utimensat(AT_FDCWD, name, utbufp, 0) == 0) ++ tot++; ++#else /* HAS_UTIMENSAT */ ++ croak("utimensat unimplemented in this platform"); ++#endif /* HAS_UTIMENSAT */ ++ } ++ } /* while items */ ++ RETVAL = tot; ++ ++ OUTPUT: ++ RETVAL ++ ++#else /* #if defined(TIME_HIRES_UTIME) */ ++ ++I32 ++utime(accessed, modified, ...) ++ CODE: ++ croak("Time::HiRes::utime(): unimplemented in this platform"); ++ RETVAL = 0; ++ OUTPUT: ++ RETVAL ++ ++#endif /* #if defined(TIME_HIRES_UTIME) */ ++ + #if defined(TIME_HIRES_CLOCK_GETTIME) + + NV + clock_gettime(clock_id = CLOCK_REALTIME) +- int clock_id ++ clockid_t clock_id + PREINIT: + struct timespec ts; + int status = -1; +@@ -1340,7 +1480,7 @@ clock_gettime(clock_id = CLOCK_REALTIME) + + NV + clock_gettime(clock_id = 0) +- int clock_id ++ clockid_t clock_id + CODE: + PERL_UNUSED_ARG(clock_id); + croak("Time::HiRes::clock_gettime(): unimplemented in this platform"); +@@ -1354,7 +1494,7 @@ clock_gettime(clock_id = 0) + + NV + clock_getres(clock_id = CLOCK_REALTIME) +- int clock_id ++ clockid_t clock_id + PREINIT: + int status = -1; + struct timespec ts; +@@ -1373,7 +1513,7 @@ clock_getres(clock_id = CLOCK_REALTIME) + + NV + clock_getres(clock_id = 0) +- int clock_id ++ clockid_t clock_id + CODE: + PERL_UNUSED_ARG(clock_id); + croak("Time::HiRes::clock_getres(): unimplemented in this platform"); +@@ -1387,14 +1527,15 @@ clock_getres(clock_id = 0) + + NV + clock_nanosleep(clock_id, nsec, flags = 0) +- int clock_id ++ clockid_t clock_id + NV nsec + int flags + PREINIT: + struct timespec sleepfor, unslept; + CODE: + if (nsec < 0.0) +- croak("Time::HiRes::clock_nanosleep(..., %"NVgf"): negative time not invented yet", nsec); ++ croak("Time::HiRes::clock_nanosleep(..., %" NVgf ++ "): negative time not invented yet", nsec); + nanosleep_init(nsec, &sleepfor, &unslept); + if (clock_nanosleep(clock_id, flags, &sleepfor, &unslept) == 0) { + RETVAL = nsec; +@@ -1408,7 +1549,7 @@ clock_nanosleep(clock_id, nsec, flags = 0) + + NV + clock_nanosleep(clock_id, nsec, flags = 0) +- int clock_id ++ clockid_t clock_id + NV nsec + int flags + CODE: +diff --git a/dist/Time-HiRes/Makefile.PL b/dist/Time-HiRes/Makefile.PL +index 087ab79..ccad6a3 100644 +--- a/dist/Time-HiRes/Makefile.PL ++++ b/dist/Time-HiRes/Makefile.PL +@@ -88,7 +88,7 @@ sub try_compile_and_link { + my $obj_ext = $Config{obj_ext} || ".o"; + unlink("$tmp.c", "$tmp$obj_ext"); + +- if (open(TMPC, ">$tmp.c")) { ++ if (open(TMPC, '>', "$tmp.c")) { + print TMPC $c; + close(TMPC); + +@@ -132,7 +132,7 @@ __EOD__ + unless defined $cccmd; + + if ($^O eq 'VMS') { +- open( CMDFILE, ">$tmp.com" ); ++ open( CMDFILE, '>', "$tmp.com" ); + print CMDFILE "\$ SET MESSAGE/NOFACILITY/NOSEVERITY/NOIDENT/NOTEXT\n"; + print CMDFILE "\$ $cccmd\n"; + print CMDFILE "\$ IF \$SEVERITY .NE. 1 THEN EXIT 44\n"; # escalate +@@ -290,6 +290,7 @@ sub has_clock_xxx_syscall { + #include "EXTERN.h" + #include "perl.h" + #include "XSUB.h" ++#include + #include <$SYSCALL_H> + int main(int argc, char** argv) + { +@@ -309,6 +310,7 @@ sub has_clock_xxx { + #include "EXTERN.h" + #include "perl.h" + #include "XSUB.h" ++#include + int main(int argc, char** argv) + { + struct timespec ts; +@@ -325,6 +327,7 @@ sub has_clock { + #include "EXTERN.h" + #include "perl.h" + #include "XSUB.h" ++#include + int main(int argc, char** argv) + { + clock_t tictoc; +@@ -348,12 +351,63 @@ int main(int argc, char** argv) + struct timespec ts2; + ts1.tv_sec = 0; + ts1.tv_nsec = 750000000;; +- ret = clock_nanosleep(CLOCK_MONOTONIC, 0, &ts1, &ts2); ++ /* All implementations are supposed to support CLOCK_REALTIME. */ ++ ret = clock_nanosleep(CLOCK_REALTIME, 0, &ts1, &ts2); ++ ret == 0 ? exit(0) : exit(errno ? errno : -1); ++} ++EOM ++} ++ ++sub has_futimens { ++ return 1 if ++ try_compile_and_link(< ++int main(int argc, char** argv) ++{ ++ int ret; ++ struct timespec ts[2]; ++ ret = futimens(0, ts); + ret == 0 ? exit(0) : exit(errno ? errno : -1); + } + EOM + } + ++sub has_utimensat{ ++ return 1 if ++ try_compile_and_link(< ++#include ++int main(int argc, char** argv) ++{ ++ int ret; ++ struct timespec ts[2]; ++ ret = utimensat(AT_FDCWD, 0, ts, 0); ++ ret == 0 ? exit(0) : exit(errno ? errno : -1); ++} ++EOM ++} ++ ++sub has_clockid_t{ ++ return 1 if ++ try_compile_and_link(< ++int main(int argc, char** argv) ++{ ++ clockid_t id = CLOCK_REALTIME; ++ exit(id == CLOCK_REALTIME ? 1 : 0); ++} ++EOM ++} ++ + sub DEFINE { + my ($def, $val) = @_; + my $define = defined $val ? "$def=$val" : $def ; +@@ -534,6 +588,16 @@ EOD + print "(It would not be portable anyway.)\n"; + } + ++ print "Looking for clockid_t... "; ++ my $has_clockid_t; ++ if (has_clockid_t()) { ++ print "found.\n"; ++ $has_clockid_t++; ++ $DEFINE .= ' -DTIME_HIRES_CLOCKID_T'; ++ } else { ++ print "NOT found, will use int.\n"; ++ } ++ + print "Looking for clock_gettime()... "; + my $has_clock_gettime; + my $has_clock_gettime_emulation; +@@ -548,7 +612,7 @@ EOD + } elsif ($^O eq 'darwin') { + $has_clock_gettime_emulation++; + $has_clock_gettime++; +- $DEFINE .= ' -DTIME_HIRES_CLOCK_GETTIME'; ++ $DEFINE .= ' -DTIME_HIRES_CLOCK_GETTIME -DTIME_HIRES_CLOCK_GETTIME_EMULATION'; + } + + if ($has_clock_gettime) { +@@ -577,7 +641,7 @@ EOD + } elsif ($^O eq 'darwin') { + $has_clock_getres_emulation++; + $has_clock_getres++; +- $DEFINE .= ' -DTIME_HIRES_CLOCK_GETRES'; ++ $DEFINE .= ' -DTIME_HIRES_CLOCK_GETRES -DTIME_HIRES_CLOCK_GETRES_EMULATION'; + } + + if ($has_clock_getres) { +@@ -603,7 +667,7 @@ EOD + } elsif ($^O eq 'darwin') { + $has_clock_nanosleep++; + $has_clock_nanosleep_emulation++; +- $DEFINE .= ' -DTIME_HIRES_CLOCK_NANOSLEEP'; ++ $DEFINE .= ' -DTIME_HIRES_CLOCK_NANOSLEEP -DTIME_HIRES_CLOCK_NANOSLEEP_EMULATION'; + } + + if ($has_clock_nanosleep) { +@@ -631,6 +695,36 @@ EOD + print "NOT found.\n"; + } + ++ print "Looking for futimens()... "; ++ my $has_futimens; ++ if (has_futimens()) { ++ $has_futimens++; ++ $DEFINE .= ' -DHAS_FUTIMENS'; ++ } ++ ++ if ($has_futimens) { ++ print "found.\n"; ++ } else { ++ print "NOT found.\n"; ++ } ++ ++ print "Looking for utimensat()... "; ++ my $has_utimensat; ++ if (has_utimensat()) { ++ $has_utimensat++; ++ $DEFINE .= ' -DHAS_UTIMENSAT'; ++ } ++ ++ if ($has_utimensat) { ++ print "found.\n"; ++ } else { ++ print "NOT found.\n"; ++ } ++ ++ if ($has_futimens or $has_utimensat) { ++ $DEFINE .= ' -DTIME_HIRES_UTIME'; ++ } ++ + print "Looking for stat() subsecond timestamps...\n"; + + print "Trying struct stat st_atimespec.tv_nsec..."; +@@ -644,7 +738,7 @@ int main(int argc, char** argv) { + } + EOM + $has_stat_st_xtimespec++; +- DEFINE('TIME_HIRES_STAT', 1); ++ DEFINE('TIME_HIRES_STAT_ST_XTIMESPEC'); # 1 + } + + if ($has_stat_st_xtimespec) { +@@ -664,7 +758,7 @@ int main(int argc, char** argv) { + } + EOM + $has_stat_st_xtimensec++; +- DEFINE('TIME_HIRES_STAT', 2); ++ DEFINE('TIME_HIRES_STAT_ST_XTIMENSEC'); # 2 + } + + if ($has_stat_st_xtimensec) { +@@ -684,7 +778,7 @@ int main(int argc, char** argv) { + } + EOM + $has_stat_st_xtime_n++; +- DEFINE('TIME_HIRES_STAT', 3); ++ DEFINE('TIME_HIRES_STAT_ST_XTIME_N'); # 3 + } + + if ($has_stat_st_xtime_n) { +@@ -704,7 +798,7 @@ int main(int argc, char** argv) { + } + EOM + $has_stat_st_xtim++; +- DEFINE('TIME_HIRES_STAT', 4); ++ DEFINE('TIME_HIRES_STAT_XTIM'); # 4 + } + + if ($has_stat_st_xtim) { +@@ -724,7 +818,7 @@ int main(int argc, char** argv) { + } + EOM + $has_stat_st_uxtime++; +- DEFINE('TIME_HIRES_STAT', 5); ++ DEFINE('TIME_HIRES_STAT_ST_UXTIME'); # 5 + } + + if ($has_stat_st_uxtime) { +@@ -733,6 +827,19 @@ EOM + print "NOT found.\n"; + } + ++ # See HiRes.xs hrstatns() ++ if ($has_stat_st_xtimespec) { ++ DEFINE('TIME_HIRES_STAT', 1); ++ } elsif ($has_stat_st_xtimensec) { ++ DEFINE('TIME_HIRES_STAT', 2); ++ } elsif ($has_stat_st_xtime_n) { ++ DEFINE('TIME_HIRES_STAT', 3); ++ } elsif ($has_stat_st_xtim) { ++ DEFINE('TIME_HIRES_STAT', 4); ++ } elsif ($has_stat_st_uxtime) { ++ DEFINE('TIME_HIRES_STAT', 5); ++ } ++ + if ($DEFINE =~ /-DTIME_HIRES_STAT=\d+/) { + print "You seem to have stat() subsecond timestamps.\n"; + print "(Your struct stat has them, but the filesystems must help.)\n"; +@@ -757,7 +864,7 @@ EOM + + if ($DEFINE) { + $DEFINE =~ s/^\s+//; +- if (open(XDEFINE, ">xdefine")) { ++ if (open(XDEFINE, '>', 'xdefine')) { + print XDEFINE $DEFINE, "\n"; + close(XDEFINE); + } +@@ -791,7 +898,7 @@ sub doMakefile { + 'DynaLoader' => 0, + 'Exporter' => 0, + 'ExtUtils::MakeMaker' => 0, +- 'Test::More' => "0.82", ++ 'Test::More' => 0, + 'strict' => 0, + }, + 'dist' => { +@@ -869,7 +976,8 @@ sub doConstants { + ); + foreach (qw (d_usleep d_ualarm d_gettimeofday d_getitimer d_setitimer + d_nanosleep d_clock_gettime d_clock_getres +- d_clock d_clock_nanosleep d_hires_stat)) { ++ d_clock d_clock_nanosleep d_hires_stat ++ d_futimens d_utimensat d_hires_utime)) { + my $macro = $_; + if ($macro =~ /^(d_nanosleep|d_clock)$/) { + $macro =~ s/^d_(.+)/TIME_HIRES_\U$1/; +@@ -879,6 +987,13 @@ sub doConstants { + push @names, {name => $_, macro => "TIME_HIRES_STAT", value => $d_hires_stat, + default => ["IV", "0"]}; + next; ++ } elsif ($macro =~ /^(d_hires_utime)$/) { ++ my $d_hires_utime = ++ ($DEFINE =~ /-DHAS_FUTIMENS/ || ++ $DEFINE =~ /-DHAS_UTIMENSAT/) ? 1 : 0; ++ push @names, {name => $_, macro => "TIME_HIRES_UTIME", value => $d_hires_utime, ++ default => ["IV", "0"]}; ++ next; + } elsif ($macro =~ /^(d_clock_gettime|d_clock_getres|d_clock_nanosleep)$/) { + $macro =~ s/^d_(.+)/TIME_HIRES_\U$1/; + my $val = ($DEFINE =~ /-D$macro\b/) ? 1 : 0; +@@ -900,8 +1015,8 @@ sub doConstants { + foreach $file ('const-c.inc', 'const-xs.inc') { + my $fallback = File::Spec->catfile('fallback', $file); + local $/; +- open IN, "<$fallback" or die "Can't open $fallback: $!"; +- open OUT, ">$file" or die "Can't open $file: $!"; ++ open IN, '<', $fallback or die "Can't open $fallback: $!"; ++ open OUT, '>', $file or die "Can't open $file: $!"; + print OUT or die $!; + close OUT or die "Can't close $file: $!"; + close IN or die "Can't close $fallback: $!"; +@@ -920,7 +1035,7 @@ sub main { + DEFINE('SELECT_IS_BROKEN'); + $LIBS = []; + print "System is $^O, skipping full configure...\n"; +- open(XDEFINE, ">xdefine") or die "$0: Cannot create xdefine: $!\n"; ++ open(XDEFINE, '>', 'xdefine') or die "$0: Cannot create xdefine: $!\n"; + close(XDEFINE); + } else { + init(); +diff --git a/dist/Time-HiRes/fallback/const-c.inc b/dist/Time-HiRes/fallback/const-c.inc +index a862617..524db16 100644 +--- a/dist/Time-HiRes/fallback/const-c.inc ++++ b/dist/Time-HiRes/fallback/const-c.inc +@@ -19,6 +19,7 @@ typedef double NV; /* 5.6 and later define NVTYPE, and typedef NV to it. */ + #ifndef pTHX_ + #define pTHX_ /* 5.6 or later define this for threading support. */ + #endif ++ + static int + constant_11 (pTHX_ const char *name, IV *iv_return) { + /* When generated this function returned values for the list of names given +@@ -86,6 +87,51 @@ constant_11 (pTHX_ const char *name, IV *iv_return) { + return PERL_constant_NOTFOUND; + } + ++static int ++constant_13 (pTHX_ const char *name, IV *iv_return) { ++ /* When generated this function returned values for the list of names given ++ here. However, subsequent manual editing may have added or removed some. ++ CLOCK_HIGHRES TIMER_ABSTIME d_hires_utime */ ++ /* Offset 1 gives the best switch position. */ ++ switch (name[1]) { ++ case 'I': ++ if (memEQ(name, "TIMER_ABSTIME", 13)) { ++ /* ^ */ ++#ifdef TIMER_ABSTIME ++ *iv_return = TIMER_ABSTIME; ++ return PERL_constant_ISIV; ++#else ++ return PERL_constant_NOTDEF; ++#endif ++ } ++ break; ++ case 'L': ++ if (memEQ(name, "CLOCK_HIGHRES", 13)) { ++ /* ^ */ ++#ifdef CLOCK_HIGHRES ++ *iv_return = CLOCK_HIGHRES; ++ return PERL_constant_ISIV; ++#else ++ return PERL_constant_NOTDEF; ++#endif ++ } ++ break; ++ case '_': ++ if (memEQ(name, "d_hires_utime", 13)) { ++ /* ^ */ ++#ifdef TIME_HIRES_UTIME ++ *iv_return = 1; ++ return PERL_constant_ISIV; ++#else ++ *iv_return = 0; ++ return PERL_constant_ISIV; ++#endif ++ } ++ break; ++ } ++ return PERL_constant_NOTFOUND; ++} ++ + static int + constant_14 (pTHX_ const char *name, IV *iv_return) { + /* When generated this function returned values for the list of names given +@@ -250,16 +296,17 @@ my @names = (qw(CLOCKS_PER_SEC CLOCK_HIGHRES CLOCK_MONOTONIC + {name=>"d_getitimer", type=>"IV", macro=>"HAS_GETITIMER", value=>"1", default=>["IV", "0"]}, + {name=>"d_gettimeofday", type=>"IV", macro=>"HAS_GETTIMEOFDAY", value=>"1", default=>["IV", "0"]}, + {name=>"d_hires_stat", type=>"IV", macro=>"TIME_HIRES_STAT", value=>"1", default=>["IV", "0"]}, ++ {name=>"d_hires_utime", type=>"IV", macro=>"TIME_HIRES_UTIME", value=>"1", default=>["IV", "0"]}, + {name=>"d_nanosleep", type=>"IV", macro=>"TIME_HIRES_NANOSLEEP", value=>"1", default=>["IV", "0"]}, + {name=>"d_setitimer", type=>"IV", macro=>"HAS_SETITIMER", value=>"1", default=>["IV", "0"]}, + {name=>"d_ualarm", type=>"IV", macro=>"HAS_UALARM", value=>"1", default=>["IV", "0"]}, + {name=>"d_usleep", type=>"IV", macro=>"HAS_USLEEP", value=>"1", default=>["IV", "0"]}); + +-print constant_types(); # macro defs ++print constant_types(), "\n"; # macro defs + foreach (C_constant ("Time::HiRes", 'constant', 'IV', $types, undef, 3, @names) ) { + print $_, "\n"; # C constant subs + } +-print "#### XS Section:\n"; ++print "\n#### XS Section:\n"; + print XS_constant ("Time::HiRes", $types); + __END__ + */ +@@ -322,33 +369,7 @@ __END__ + } + break; + case 13: +- /* Names all of length 13. */ +- /* CLOCK_HIGHRES TIMER_ABSTIME */ +- /* Offset 2 gives the best switch position. */ +- switch (name[2]) { +- case 'M': +- if (memEQ(name, "TIMER_ABSTIME", 13)) { +- /* ^ */ +-#ifdef TIMER_ABSTIME +- *iv_return = TIMER_ABSTIME; +- return PERL_constant_ISIV; +-#else +- return PERL_constant_NOTDEF; +-#endif +- } +- break; +- case 'O': +- if (memEQ(name, "CLOCK_HIGHRES", 13)) { +- /* ^ */ +-#ifdef CLOCK_HIGHRES +- *iv_return = CLOCK_HIGHRES; +- return PERL_constant_ISIV; +-#else +- return PERL_constant_NOTDEF; +-#endif +- } +- break; +- } ++ return constant_13 (aTHX_ name, iv_return); + break; + case 14: + return constant_14 (aTHX_ name, iv_return); +diff --git a/dist/Time-HiRes/t/Watchdog.pm b/dist/Time-HiRes/t/Watchdog.pm +index 83e8543..44ec808 100644 +--- a/dist/Time-HiRes/t/Watchdog.pm ++++ b/dist/Time-HiRes/t/Watchdog.pm +@@ -10,44 +10,44 @@ my $watchdog_pid; + my $TheEnd; + + if ($Config{d_fork}) { +- note "I am the main process $$, starting the watchdog process..."; ++ print("# I am the main process $$, starting the watchdog process...\n"); + $watchdog_pid = fork(); + if (defined $watchdog_pid) { + if ($watchdog_pid == 0) { # We are the kid, set up the watchdog. + my $ppid = getppid(); +- note "I am the watchdog process $$, sleeping for $waitfor seconds..."; ++ print("# I am the watchdog process $$, sleeping for $waitfor seconds...\n"); + sleep($waitfor - 2); # Workaround for perlbug #49073 + sleep(2); # Wait for parent to exit + if (kill(0, $ppid)) { # Check if parent still exists + warn "\n$0: overall time allowed for tests (${waitfor}s) exceeded!\n"; +- note "Terminating main process $ppid..."; ++ print("Terminating main process $ppid...\n"); + kill('KILL', $ppid); +- note "This is the watchdog process $$, over and out."; ++ print("# This is the watchdog process $$, over and out.\n"); + } + exit(0); + } else { +- note "The watchdog process $watchdog_pid launched, continuing testing..."; ++ print("# The watchdog process $watchdog_pid launched, continuing testing...\n"); + $TheEnd = time() + $waitfor; + } + } else { + warn "$0: fork failed: $!\n"; + } + } else { +- note "No watchdog process (need fork)"; ++ print("# No watchdog process (need fork)\n"); + } + + END { + if ($watchdog_pid) { # Only in the main process. + my $left = $TheEnd - time(); +- note sprintf "I am the main process $$, terminating the watchdog process $watchdog_pid before it terminates me in %d seconds (testing took %d seconds).", $left, $waitfor - $left; ++ printf("# I am the main process $$, terminating the watchdog process $watchdog_pid before it terminates me in %d seconds (testing took %d seconds).\n", $left, $waitfor - $left); + if (kill(0, $watchdog_pid)) { + local $? = 0; + my $kill = kill('KILL', $watchdog_pid); # We are done, the watchdog can go. + wait(); +- note sprintf "kill KILL $watchdog_pid = %d", $kill; ++ printf("# kill KILL $watchdog_pid = %d\n", $kill); + } + unlink("ktrace.out"); # Used in BSD system call tracing. +- note "All done."; ++ print("# All done.\n"); + } + } + +diff --git a/dist/Time-HiRes/t/alarm.t b/dist/Time-HiRes/t/alarm.t +index 841694f..4935410 100644 +--- a/dist/Time-HiRes/t/alarm.t ++++ b/dist/Time-HiRes/t/alarm.t +@@ -1,6 +1,6 @@ + use strict; + +-use Test::More 0.82 tests => 10; ++use Test::More tests => 10; + use t::Watchdog; + + BEGIN { require_ok "Time::HiRes"; } +@@ -10,7 +10,7 @@ use Config; + my $limit = 0.25; # 25% is acceptable slosh for testing timers + + my $xdefine = ''; +-if (open(XDEFINE, "xdefine")) { ++if (open(XDEFINE, "<", "xdefine")) { + chomp($xdefine = || ""); + close(XDEFINE); + } +@@ -29,12 +29,14 @@ SKIP: { + + my ($r, $i, $not, $ok); + ++ $not = ""; ++ + $r = [Time::HiRes::gettimeofday()]; + $i = 5; + my $oldaction; + if ($use_sigaction) { + $oldaction = new POSIX::SigAction; +- note sprintf "sigaction tick, ALRM = %d", &POSIX::SIGALRM; ++ printf("# sigaction tick, ALRM = %d\n", &POSIX::SIGALRM); + + # Perl's deferred signals may be too wimpy to break through + # a restartable select(), so use POSIX::sigaction if available. +@@ -44,7 +46,7 @@ SKIP: { + $oldaction) + or die "Error setting SIGALRM handler with sigaction: $!\n"; + } else { +- note "SIG tick"; ++ print("# SIG tick\n"); + $SIG{ALRM} = "tick"; + } + +@@ -56,8 +58,8 @@ SKIP: { + Time::HiRes::alarm(0.3); + select (undef, undef, undef, 3); + my $ival = Time::HiRes::tv_interval ($r); +- note "Select returned! $i $ival"; +- note abs($ival/3 - 1); ++ print("# Select returned! $i $ival\n"); ++ printf("# %s\n", abs($ival/3 - 1)); + # Whether select() gets restarted after signals is + # implementation dependent. If it is restarted, we + # will get about 3.3 seconds: 3 from the select, 0.3 +@@ -86,7 +88,7 @@ SKIP: { + sub tick { + $i--; + my $ival = Time::HiRes::tv_interval ($r); +- note "Tick! $i $ival"; ++ print("# Tick! $i $ival\n"); + my $exp = 0.3 * (5 - $i); + if ($exp == 0) { + $not = "tick: divisor became zero"; +@@ -106,8 +108,8 @@ SKIP: { + Time::HiRes::alarm(0); # can't cancel usig %SIG + } + ++ print("# $not\n"); + ok !$not; +- note $not || $ok; + } + + SKIP: { +@@ -126,7 +128,7 @@ SKIP: { + # http://groups.google.com/group/perl.perl5.porters/browse_thread/thread/adaffaaf939b042e/20dafc298df737f0%2320dafc298df737f0?sa=X&oi=groupsr&start=0&num=3 + # Perl changes [18765] and [18770], perl bug [perl #20920] + +- note "Finding delay loop..."; ++ print("# Finding delay loop...\n"); + + my $T = 0.01; + my $DelayN = 1024; +@@ -137,7 +139,7 @@ SKIP: { + for ($i = 0; $i < $DelayN; $i++) { } + my $t1 = Time::HiRes::time(); + my $dt = $t1 - $t0; +- note "N = $DelayN, t1 = $t1, t0 = $t0, dt = $dt"; ++ print("# N = $DelayN, t1 = $t1, t0 = $t0, dt = $dt\n"); + last N if $dt > $T; + $DelayN *= 2; + } while (1); +@@ -169,7 +171,7 @@ SKIP: { + + $SIG{ALRM} = sub { + $a++; +- note "Alarm $a - ", Time::HiRes::time(); ++ printf("# Alarm $a - %s\n", Time::HiRes::time()); + Time::HiRes::alarm(0) if $a >= $A; # Disarm the alarm. + $Delay->(2); # Try burning CPU at least for 2T seconds. + }; +@@ -204,18 +206,18 @@ SKIP: { + my $alrm = 0; + $SIG{ALRM} = sub { $alrm++ }; + my $got = Time::HiRes::alarm(2.7); +- ok $got == 0 or note $got; ++ ok $got == 0 or print("# $got\n"); + + my $t0 = Time::HiRes::time(); + 1 while Time::HiRes::time() - $t0 <= 1; + + $got = Time::HiRes::alarm(0); +- ok $got > 0 && $got < 1.8 or note $got; ++ ok $got > 0 && $got < 1.8 or print("# $got\n"); + +- ok $alrm == 0 or note $alrm; ++ ok $alrm == 0 or print("# $alrm\n"); + + $got = Time::HiRes::alarm(0); +- ok $got == 0 or note $got; ++ ok $got == 0 or print("# $got\n"); + } + } + +diff --git a/dist/Time-HiRes/t/clock.t b/dist/Time-HiRes/t/clock.t +index 6d11dd2..346ca57 100644 +--- a/dist/Time-HiRes/t/clock.t ++++ b/dist/Time-HiRes/t/clock.t +@@ -1,6 +1,6 @@ + use strict; + +-use Test::More 0.82 tests => 5; ++use Test::More tests => 5; + use t::Watchdog; + + BEGIN { require_ok "Time::HiRes"; } +@@ -13,10 +13,10 @@ sub has_symbol { + return $@ eq ''; + } + +-note sprintf "have_clock_gettime = %d", &Time::HiRes::d_clock_gettime; +-note sprintf "have_clock_getres = %d", &Time::HiRes::d_clock_getres; +-note sprintf "have_clock_nanosleep = %d", &Time::HiRes::d_clock_nanosleep; +-note sprintf "have_clock = %d", &Time::HiRes::d_clock; ++printf("# have_clock_gettime = %d\n", &Time::HiRes::d_clock_gettime); ++printf("# have_clock_getres = %d\n", &Time::HiRes::d_clock_getres); ++printf("# have_clock_nanosleep = %d\n", &Time::HiRes::d_clock_nanosleep); ++printf("# have_clock = %d\n", &Time::HiRes::d_clock); + + # Ideally, we'd like to test that the timers are rather precise. + # However, if the system is busy, there are no guarantees on how +@@ -36,25 +36,25 @@ SKIP: { + my $ok = 0; + TRY: { + for my $try (1..3) { +- note "CLOCK_REALTIME: try = $try"; ++ print("# CLOCK_REALTIME: try = $try\n"); + my $t0 = Time::HiRes::clock_gettime(&CLOCK_REALTIME); + my $T = 1.5; + Time::HiRes::sleep($T); + my $t1 = Time::HiRes::clock_gettime(&CLOCK_REALTIME); + if ($t0 > 0 && $t1 > $t0) { +- note "t1 = $t1, t0 = $t0"; ++ print("# t1 = $t1, t0 = $t0\n"); + my $dt = $t1 - $t0; + my $rt = abs(1 - $dt / $T); +- note "dt = $dt, rt = $rt"; ++ print("# dt = $dt, rt = $rt\n"); + if ($rt <= 2 * $limit) { + $ok = 1; + last TRY; + } + } else { +- note "Error: t0 = $t0, t1 = $t1"; ++ print("# Error: t0 = $t0, t1 = $t1\n"); + } + my $r = rand() + rand(); +- note sprintf "Sleeping for %.6f seconds...\n", $r; ++ printf("# Sleeping for %.6f seconds...\n", $r); + Time::HiRes::sleep($r); + } + } +@@ -64,7 +64,7 @@ SKIP: { + SKIP: { + skip "no clock_getres", 1 unless &Time::HiRes::d_clock_getres; + my $tr = Time::HiRes::clock_getres(); +- ok $tr > 0 or note "tr = $tr"; ++ ok $tr > 0 or print("# tr = $tr\n"); + } + + SKIP: { +@@ -73,17 +73,17 @@ SKIP: { + my $s = 1.5e9; + my $t = Time::HiRes::clock_nanosleep(&CLOCK_REALTIME, $s); + my $r = abs(1 - $t / $s); +- ok $r < 2 * $limit or note "t = $t, r = $r"; ++ ok $r < 2 * $limit or print("# t = $t, r = $r\n"); + } + + SKIP: { + skip "no clock", 1 unless &Time::HiRes::d_clock; + my @clock = Time::HiRes::clock(); +- note "clock = @clock"; ++ print("# clock = @clock\n"); + for my $i (1..3) { + for (my $j = 0; $j < 1e6; $j++) { } + push @clock, Time::HiRes::clock(); +- note "clock = @clock"; ++ print("# clock = @clock\n"); + } + ok $clock[0] >= 0 && + $clock[1] > $clock[0] && +diff --git a/dist/Time-HiRes/t/gettimeofday.t b/dist/Time-HiRes/t/gettimeofday.t +index 8f7c5f3..69defe8 100644 +--- a/dist/Time-HiRes/t/gettimeofday.t ++++ b/dist/Time-HiRes/t/gettimeofday.t +@@ -8,26 +8,26 @@ BEGIN { + } + } + +-use Test::More 0.82 tests => 6; ++use Test::More tests => 6; + use t::Watchdog; + + my @one = Time::HiRes::gettimeofday(); +-note 'gettimeofday returned ', 0+@one, ' args'; ++printf("# gettimeofday returned %d args\n", 0+@one); + ok @one == 2; +-ok $one[0] > 850_000_000 or note "@one too small"; ++ok $one[0] > 850_000_000 or print("# @one too small\n"); + + sleep 1; + + my @two = Time::HiRes::gettimeofday(); + ok $two[0] > $one[0] || ($two[0] == $one[0] && $two[1] > $one[1]) +- or note "@two is not greater than @one"; ++ or print("# @two is not greater than @one\n"); + + my $f = Time::HiRes::time(); +-ok $f > 850_000_000 or note "$f too small"; +-ok $f - $two[0] < 2 or note "$f - $two[0] >= 2"; ++ok $f > 850_000_000 or print("# $f too small\n"); ++ok $f - $two[0] < 2 or print("# $f - $two[0] >= 2\n"); + + my $r = [Time::HiRes::gettimeofday()]; + my $g = Time::HiRes::tv_interval $r; +-ok $g < 2 or note $g; ++ok $g < 2 or print("# $g\n"); + + 1; +diff --git a/dist/Time-HiRes/t/itimer.t b/dist/Time-HiRes/t/itimer.t +index 9eb2b93..31cdd67 100644 +--- a/dist/Time-HiRes/t/itimer.t ++++ b/dist/Time-HiRes/t/itimer.t +@@ -25,7 +25,7 @@ BEGIN { + } + } + +-use Test::More 0.82 tests => 2; ++use Test::More tests => 2; + use t::Watchdog; + + my $limit = 0.25; # 25% is acceptable slosh for testing timers +@@ -35,11 +35,11 @@ my $r = [Time::HiRes::gettimeofday()]; + + $SIG{VTALRM} = sub { + $i ? $i-- : Time::HiRes::setitimer(&Time::HiRes::ITIMER_VIRTUAL, 0); +- note "Tick! $i ", Time::HiRes::tv_interval($r); ++ printf("# Tick! $i %s\n", Time::HiRes::tv_interval($r)); + }; + +-note "setitimer: ", join(" ", +- Time::HiRes::setitimer(&Time::HiRes::ITIMER_VIRTUAL, 0.5, 0.4)); ++printf("# setitimer: %s\n", join(" ", ++ Time::HiRes::setitimer(&Time::HiRes::ITIMER_VIRTUAL, 0.5, 0.4))); + + # Assume interval timer granularity of $limit * 0.5 seconds. Too bold? + my $virt = Time::HiRes::getitimer(&Time::HiRes::ITIMER_VIRTUAL); +@@ -47,19 +47,19 @@ ok(defined $virt && abs($virt / 0.5) - 1 < $limit, + "ITIMER_VIRTUAL defined with sufficient granularity") + or diag "virt=" . (defined $virt ? $virt : 'undef'); + +-note "getitimer: ", join(" ", +- Time::HiRes::getitimer(&Time::HiRes::ITIMER_VIRTUAL)); ++printf("# getitimer: %s\n", join(" ", ++ Time::HiRes::getitimer(&Time::HiRes::ITIMER_VIRTUAL))); + + while (Time::HiRes::getitimer(&Time::HiRes::ITIMER_VIRTUAL)) { + my $j; + for (1..1000) { $j++ } # Can't be unbreakable, must test getitimer(). + } + +-note "getitimer: ", join(" ", +- Time::HiRes::getitimer(&Time::HiRes::ITIMER_VIRTUAL)); ++printf("# getitimer: %s\n", join(" ", ++ Time::HiRes::getitimer(&Time::HiRes::ITIMER_VIRTUAL))); + + $virt = Time::HiRes::getitimer(&Time::HiRes::ITIMER_VIRTUAL); +-note "at end, i=$i"; ++print("# at end, i=$i\n"); + is($virt, 0, "time left should be zero"); + + $SIG{VTALRM} = 'DEFAULT'; +diff --git a/dist/Time-HiRes/t/nanosleep.t b/dist/Time-HiRes/t/nanosleep.t +index aef9db6..c17a7e4 100644 +--- a/dist/Time-HiRes/t/nanosleep.t ++++ b/dist/Time-HiRes/t/nanosleep.t +@@ -8,7 +8,7 @@ BEGIN { + } + } + +-use Test::More 0.82 tests => 3; ++use Test::More tests => 3; + use t::Watchdog; + + eval { Time::HiRes::nanosleep(-5) }; +@@ -21,7 +21,7 @@ my $two = CORE::time; + Time::HiRes::nanosleep(10_000_000); + my $three = CORE::time; + ok $one == $two || $two == $three +- or note "slept too long, $one $two $three"; ++ or print("# slept too long, $one $two $three\n"); + + SKIP: { + skip "no gettimeofday", 1 unless &Time::HiRes::d_gettimeofday; +@@ -29,7 +29,7 @@ SKIP: { + Time::HiRes::nanosleep(500_000_000); + my $f2 = Time::HiRes::time(); + my $d = $f2 - $f; +- ok $d > 0.4 && $d < 0.9 or note "slept $d secs $f to $f2"; ++ ok $d > 0.4 && $d < 0.9 or print("# slept $d secs $f to $f2\n"); + } + + 1; +diff --git a/dist/Time-HiRes/t/sleep.t b/dist/Time-HiRes/t/sleep.t +index e7cc627..b84b4c6 100644 +--- a/dist/Time-HiRes/t/sleep.t ++++ b/dist/Time-HiRes/t/sleep.t +@@ -1,6 +1,6 @@ + use strict; + +-use Test::More 0.82 tests => 4; ++use Test::More tests => 4; + use t::Watchdog; + + BEGIN { require_ok "Time::HiRes"; } +@@ -8,7 +8,7 @@ BEGIN { require_ok "Time::HiRes"; } + use Config; + + my $xdefine = ''; +-if (open(XDEFINE, "xdefine")) { ++if (open(XDEFINE, "<", "xdefine")) { + chomp($xdefine = || ""); + close(XDEFINE); + } +@@ -26,12 +26,12 @@ like $@, qr/::sleep\(-1\): negative time not invented yet/, + SKIP: { + skip "no subsecond alarm", 2 unless $can_subsecond_alarm; + my $f = Time::HiRes::time; +- note "time...$f"; ++ print("# time...$f\n"); + ok 1; + + my $r = [Time::HiRes::gettimeofday()]; + Time::HiRes::sleep (0.5); +- note "sleep...", Time::HiRes::tv_interval($r); ++ printf("# sleep...%s\n", Time::HiRes::tv_interval($r)); + ok 1; + } + +diff --git a/dist/Time-HiRes/t/stat.t b/dist/Time-HiRes/t/stat.t +index 68a6fb6..a59a342 100644 +--- a/dist/Time-HiRes/t/stat.t ++++ b/dist/Time-HiRes/t/stat.t +@@ -13,14 +13,14 @@ BEGIN { + } + } + +-use Test::More 0.82 tests => 43; ++use Test::More tests => 43; + use t::Watchdog; + + my @atime; + my @mtime; + for (1..5) { + Time::HiRes::sleep(rand(0.1) + 0.1); +- open(X, ">$$"); ++ open(X, '>', $$); + print X $$; + close(X); + my($a, $stat, $b) = ("a", [Time::HiRes::stat($$)], "b"); +@@ -33,7 +33,7 @@ for (1..5) { + is $b, "b"; + is_deeply $lstat, $stat; + Time::HiRes::sleep(rand(0.1) + 0.1); +- open(X, "<$$"); ++ open(X, '<', $$); + ; + close(X); + $stat = [Time::HiRes::stat($$)]; +@@ -42,8 +42,8 @@ for (1..5) { + is_deeply $lstat, $stat; + } + 1 while unlink $$; +-note "mtime = @mtime"; +-note "atime = @atime"; ++print("# mtime = @mtime\n"); ++print("# atime = @atime\n"); + my $ai = 0; + my $mi = 0; + my $ss = 0; +@@ -63,7 +63,7 @@ for (my $i = 1; $i < @mtime; $i++) { + $ss++; + } + } +-note "ai = $ai, mi = $mi, ss = $ss"; ++print("# ai = $ai, mi = $mi, ss = $ss\n"); + # Need at least 75% of monotonical increase and + # 20% of subsecond results. Yes, this is guessing. + SKIP: { +@@ -75,7 +75,7 @@ SKIP: { + my $targetname = "tgt$$"; + my $linkname = "link$$"; + SKIP: { +- open(X, ">$targetname"); ++ open(X, '>', $targetname); + print X $$; + close(X); + eval { symlink $targetname, $linkname or die "can't symlink: $!"; }; +diff --git a/dist/Time-HiRes/t/time.t b/dist/Time-HiRes/t/time.t +index feec479..6f219f9 100644 +--- a/dist/Time-HiRes/t/time.t ++++ b/dist/Time-HiRes/t/time.t +@@ -1,6 +1,6 @@ + use strict; + +-use Test::More 0.82 tests => 2; ++use Test::More tests => 2; + use t::Watchdog; + + BEGIN { require_ok "Time::HiRes"; } +@@ -16,8 +16,8 @@ SKIP: { + # (CORE::time() may be rounding down, up, or closest), + # but allow 10% of slop. + ok abs($s) / $n <= 1.10 +- or note "Time::HiRes::time() not close to CORE::time()"; +- note "s = $s, n = $n, s/n = ", abs($s)/$n; ++ or print("# Time::HiRes::time() not close to CORE::time()\n"); ++ printf("# s = $s, n = $n, s/n = %s\n", abs($s)/$n); + } + + 1; +diff --git a/dist/Time-HiRes/t/tv_interval.t b/dist/Time-HiRes/t/tv_interval.t +index bffcf39..8ac876d 100644 +--- a/dist/Time-HiRes/t/tv_interval.t ++++ b/dist/Time-HiRes/t/tv_interval.t +@@ -1,10 +1,10 @@ + use strict; + +-use Test::More 0.82 tests => 2; ++use Test::More tests => 2; + + BEGIN { require_ok "Time::HiRes"; } + + my $f = Time::HiRes::tv_interval [5, 100_000], [10, 500_000]; +-ok abs($f - 5.4) < 0.001 or note $f; ++ok abs($f - 5.4) < 0.001 or print("# $f\n"); + + 1; +diff --git a/dist/Time-HiRes/t/ualarm.t b/dist/Time-HiRes/t/ualarm.t +index 12ef4b5..b50a175 100644 +--- a/dist/Time-HiRes/t/ualarm.t ++++ b/dist/Time-HiRes/t/ualarm.t +@@ -8,7 +8,7 @@ BEGIN { + } + } + +-use Test::More 0.82 tests => 12; ++use Test::More tests => 12; + use t::Watchdog; + + use Config; +@@ -24,13 +24,13 @@ SKIP: { + $tick = 0; Time::HiRes::ualarm(10_000); while ($tick == 0) { } + my $three = CORE::time; + ok $one == $two || $two == $three +- or note "slept too long, $one $two $three"; +- note "tick = $tick, one = $one, two = $two, three = $three"; ++ or print("# slept too long, $one $two $three\n"); ++ print("# tick = $tick, one = $one, two = $two, three = $three\n"); + + $tick = 0; Time::HiRes::ualarm(10_000, 10_000); while ($tick < 3) { } + ok 1; + Time::HiRes::ualarm(0); +- note "tick = $tick, one = $one, two = $two, three = $three"; ++ print("# tick = $tick, one = $one, two = $two, three = $three\n"); + } + + eval { Time::HiRes::ualarm(-4) }; +@@ -59,24 +59,24 @@ for my $n (100_000, 1_100_000, 2_200_000, 4_300_000) { + my $alarmed = 0; + local $SIG{ ALRM } = sub { $alarmed++ }; + my $t0 = Time::HiRes::time(); +- note "t0 = $t0"; +- note "ualarm($n)"; ++ print("# t0 = $t0\n"); ++ print("# ualarm($n)\n"); + Time::HiRes::ualarm($n); 1 while $alarmed == 0; + my $t1 = Time::HiRes::time(); +- note "t1 = $t1"; ++ print("# t1 = $t1\n"); + my $dt = $t1 - $t0; +- note "dt = $dt"; ++ print("# dt = $dt\n"); + my $r = $dt / ($n/1e6); +- note "r = $r"; ++ print("# r = $r\n"); + $ok = + ($n < 1_000_000 || # Too much noise. + ($r >= 0.8 && $r <= 1.6)); + last if $ok; + my $nap = bellish(3, 15); +- note sprintf "Retrying in %.1f seconds...\n", $nap; ++ printf("# Retrying in %.1f seconds...\n", $nap); + Time::HiRes::sleep($nap); + } +- ok $ok or note "ualarm($n) close enough"; ++ ok $ok or print("# ualarm($n) close enough\n"); + } + + { +@@ -93,12 +93,12 @@ for my $n (100_000, 1_100_000, 2_200_000, 4_300_000) { + } while $t1 - $t0 <= 0.3; + my $got1 = Time::HiRes::ualarm(0); + +- note "t0 = $t0"; +- note "got0 = $got0"; +- note "t1 = $t1"; +- note "t1 - t0 = ", ($t1 - $t0); +- note "got1 = $got1"; +- ok $got0 == 0 or note $got0; ++ print("# t0 = $t0\n"); ++ print("# got0 = $got0\n"); ++ print("# t1 = $t1\n"); ++ printf("# t1 - t0 = %s\n", ($t1 - $t0)); ++ print("# got1 = $got1\n"); ++ ok $got0 == 0 or print("# $got0\n"); + SKIP: { + skip "alarm interval exceeded", 2 if $t1 - $t0 >= 0.5; + ok $got1 > 0; +@@ -106,7 +106,7 @@ for my $n (100_000, 1_100_000, 2_200_000, 4_300_000) { + } + ok $got1 < 300_000; + my $got2 = Time::HiRes::ualarm(0); +- ok $got2 == 0 or note $got2; ++ ok $got2 == 0 or print("# $got2\n"); + } + + 1; +diff --git a/dist/Time-HiRes/t/usleep.t b/dist/Time-HiRes/t/usleep.t +index 0d6bacf..bdf372b 100644 +--- a/dist/Time-HiRes/t/usleep.t ++++ b/dist/Time-HiRes/t/usleep.t +@@ -8,7 +8,7 @@ BEGIN { + } + } + +-use Test::More 0.82 tests => 6; ++use Test::More tests => 6; + use t::Watchdog; + + eval { Time::HiRes::usleep(-2) }; +@@ -23,7 +23,7 @@ my $two = CORE::time; + Time::HiRes::usleep(10_000); + my $three = CORE::time; + ok $one == $two || $two == $three +-or note "slept too long, $one $two $three"; ++or print("# slept too long, $one $two $three\n"); + + SKIP: { + skip "no gettimeofday", 1 unless &Time::HiRes::d_gettimeofday; +@@ -31,7 +31,7 @@ SKIP: { + Time::HiRes::usleep(500_000); + my $f2 = Time::HiRes::time(); + my $d = $f2 - $f; +- ok $d > 0.4 && $d < 0.9 or note "slept $d secs $f to $f2"; ++ ok $d > 0.4 && $d < 0.9 or print("# slept $d secs $f to $f2\n"); + } + + SKIP: { +@@ -39,7 +39,7 @@ SKIP: { + my $r = [ Time::HiRes::gettimeofday() ]; + Time::HiRes::sleep( 0.5 ); + my $f = Time::HiRes::tv_interval $r; +- ok $f > 0.4 && $f < 0.9 or note "slept $f instead of 0.5 secs."; ++ ok $f > 0.4 && $f < 0.9 or print("# slept $f instead of 0.5 secs.\n"); + } + + SKIP: { +@@ -59,7 +59,7 @@ SKIP: { + + SKIP: { + skip $msg, 1 unless $td < $sleep * (1 + $limit); +- ok $a < $limit or note $msg; ++ ok $a < $limit or print("# $msg\n"); + } + + $t0 = Time::HiRes::gettimeofday(); +@@ -71,7 +71,7 @@ SKIP: { + + SKIP: { + skip $msg, 1 unless $td < $sleep * (1 + $limit); +- ok $a < $limit or note $msg; ++ ok $a < $limit or print("# $msg\n"); + } + } + +diff --git a/dist/Time-HiRes/typemap b/dist/Time-HiRes/typemap +index 1124eb6..3fa91f3 100644 +--- a/dist/Time-HiRes/typemap ++++ b/dist/Time-HiRes/typemap +@@ -28,6 +28,8 @@ AV * T_AVREF + HV * T_HVREF + CV * T_CVREF + ++clockid_t T_IV ++ + IV T_IV + UV T_UV + NV T_NV +diff --git a/hints/linux.sh b/hints/linux.sh +index fb5a46e..3f38ea0 100644 +--- a/hints/linux.sh ++++ b/hints/linux.sh +@@ -221,92 +221,6 @@ case "$libc" in + ;; + esac + +-# Are we using ELF? Thanks to Kenneth Albanowski +-# for this test. +-cat >try.c <<'EOM' +-/* Test for whether ELF binaries are produced */ +-#include +-#include +-#include +-main() { +- char buffer[4]; +- int i=open("a.out",O_RDONLY); +- if(i==-1) +- exit(1); /* fail */ +- if(read(i,&buffer[0],4)<4) +- exit(1); /* fail */ +- if(buffer[0] != 127 || buffer[1] != 'E' || +- buffer[2] != 'L' || buffer[3] != 'F') +- exit(1); /* fail */ +- exit(0); /* succeed (yes, it's ELF) */ +-} +-EOM +-if ${cc:-gcc} $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then +- cat <<'EOM' >&4 +- +-You appear to have ELF support. I'll try to use it for dynamic loading. +-If dynamic loading doesn't work, read hints/linux.sh for further information. +-EOM +- +-else +- cat <<'EOM' >&4 +- +-You don't have an ELF gcc. I will use dld if possible. If you are +-using a version of DLD earlier than 3.2.6, or don't have it at all, you +-should probably upgrade. If you are forced to use 3.2.4, you should +-uncomment a couple of lines in hints/linux.sh and restart Configure so +-that shared libraries will be disallowed. +- +-EOM +- lddlflags="-r $lddlflags" +- # These empty values are so that Configure doesn't put in the +- # Linux ELF values. +- ccdlflags=' ' +- cccdlflags=' ' +- ccflags="-DOVR_DBL_DIG=14 $ccflags" +- so='sa' +- dlext='o' +- nm_so_opt=' ' +- ## If you are using DLD 3.2.4 which does not support shared libs, +- ## uncomment the next two lines: +- #ldflags="-static" +- #so='none' +- +- # In addition, on some systems there is a problem with perl and NDBM +- # which causes AnyDBM and NDBM_File to lock up. This is evidenced +- # in the tests as AnyDBM just freezing. Apparently, this only +- # happens on a.out systems, so we disable NDBM for all a.out linux +- # systems. If someone can suggest a more robust test +- # that would be appreciated. +- # +- # More info: +- # Date: Wed, 7 Feb 1996 03:21:04 +0900 +- # From: Jeffrey Friedl +- # +- # I tried compiling with DBM support and sure enough things locked up +- # just as advertised. Checking into it, I found that the lockup was +- # during the call to dbm_open. Not *in* dbm_open -- but between the call +- # to and the jump into. +- # +- # To make a long story short, making sure that the *.a and *.sa pairs of +- # /usr/lib/lib{m,db,gdbm}.{a,sa} +- # were perfectly in sync took care of it. +- # +- # This will generate a harmless Whoa There! message +- case "$d_dbm_open" in +- '') cat <<'EOM' >&4 +- +-Disabling ndbm. This will generate a Whoa There message in Configure. +-Read hints/linux.sh for further information. +-EOM +- # You can override this with Configure -Dd_dbm_open +- d_dbm_open=undef +- ;; +- esac +-fi +- +-rm -f try.c a.out +- + if ${sh:-/bin/sh} -c exit; then + echo '' + echo 'You appear to have a working bash. Good.' diff --git a/5.024.000-64bit,threaded/Dockerfile b/5.024.000-64bit,threaded/Dockerfile index 410035a..ef8dc7c 100644 --- a/5.024.000-64bit,threaded/Dockerfile +++ b/5.024.000-64bit,threaded/Dockerfile @@ -10,7 +10,7 @@ COPY *.patch /usr/src/perl/ WORKDIR /usr/src/perl RUN curl -SL https://cpan.metacpan.org/authors/id/R/RJ/RJBS/perl-5.24.0.tar.bz2 -o perl-5.24.0.tar.bz2 \ - && echo '298fa605138c1a00dab95643130ae0edab369b4d *perl-5.24.0.tar.bz2' | sha1sum -c - \ + && echo '62328a53d157e8153b33e137594155f6f8b64418f7f9238210feb809585290e0 *perl-5.24.0.tar.bz2' | sha256sum -c - \ && tar --strip-components=1 -xjf perl-5.24.0.tar.bz2 -C /usr/src/perl \ && rm perl-5.24.0.tar.bz2 \ && cat *.patch | patch -p1 \ diff --git a/5.024.000-64bit/DevelPatchPerl.patch b/5.024.000-64bit/DevelPatchPerl.patch index 927e2cf..c1ffa20 100644 --- a/5.024.000-64bit/DevelPatchPerl.patch +++ b/5.024.000-64bit/DevelPatchPerl.patch @@ -1,12 +1,1713 @@ -diff --git a/patchlevel.h b/patchlevel.h -index bcb921f..a171acb 100644 ---- a/patchlevel.h -+++ b/patchlevel.h -@@ -137,6 +137,7 @@ static const char * const local_patches[] = { - ,"uncommitted-changes" - #endif - PERL_GIT_UNPUSHED_COMMITS /* do not remove this line */ -+ ,"Devel::PatchPerl 1.42" - ,NULL - }; +diff --git a/dist/Time-HiRes/HiRes.pm b/dist/Time-HiRes/HiRes.pm +index ad9a65c..a3ddd59 100644 +--- a/dist/Time-HiRes/HiRes.pm ++++ b/dist/Time-HiRes/HiRes.pm +@@ -23,12 +23,12 @@ our @EXPORT_OK = qw (usleep sleep ualarm alarm gettimeofday time tv_interval + ITIMER_REAL ITIMER_VIRTUAL ITIMER_PROF ITIMER_REALPROF + TIMER_ABSTIME + d_usleep d_ualarm d_gettimeofday d_getitimer d_setitimer +- d_nanosleep d_clock_gettime d_clock_getres ++ d_nanosleep d_clock_gettime d_clock_getres d_hires_utime + d_clock d_clock_nanosleep +- stat lstat ++ stat lstat utime + ); +-our $VERSION = '1.9733'; ++our $VERSION = '1.9741'; + our $XS_VERSION = $VERSION; + $VERSION = eval $VERSION; + +@@ -60,6 +60,7 @@ sub import { + ($i eq 'clock' && !&d_clock) || + ($i eq 'nanosleep' && !&d_nanosleep) || + ($i eq 'usleep' && !&d_usleep) || ++ ($i eq 'utime' && !&d_hires_utime) || + ($i eq 'ualarm' && !&d_ualarm)) { + require Carp; + Carp::croak("Time::HiRes::$i(): unimplemented in this platform"); +@@ -92,7 +93,7 @@ Time::HiRes - High resolution alarm, sleep, gettimeofday, interval timers + + use Time::HiRes qw( usleep ualarm gettimeofday tv_interval nanosleep + clock_gettime clock_getres clock_nanosleep clock +- stat lstat ); ++ stat lstat utime); + + usleep ($microseconds); + nanosleep ($nanoseconds); +@@ -137,6 +138,9 @@ Time::HiRes - High resolution alarm, sleep, gettimeofday, interval timers + my @stat = stat(FH); + my @stat = lstat("file"); + ++ use Time::HiRes qw( utime ); ++ utime $floating_seconds, $floating_seconds, file...; ++ + =head1 DESCRIPTION + + The C module implements a Perl interface to the +@@ -446,6 +450,26 @@ if the operations are + the access time stamp from t2 need not be greater-than the modify + time stamp from t1: it may be equal or I. + ++=item utime LIST ++ ++As L ++but with the ability to set the access/modify file timestamps ++in subsecond resolution, if the operating system and the filesystem ++both support such timestamps. To override the standard utime(): ++ ++ use Time::HiRes qw(utime); ++ ++Test for the value of &Time::HiRes::d_hires_utime to find out whether ++the operating system supports setting subsecond file timestamps. ++ ++As with CORE::utime(), passing undef as both the atime and mtime will ++call the syscall with a NULL argument. ++ ++The actual achievable subsecond resolution depends on the combination ++of the operating system and the filesystem. ++ ++Returns the number of files successfully changed. ++ + =back + + =head1 EXAMPLES +@@ -535,7 +559,7 @@ VMS have emulations for it.) + Here is an example of using C from C: + + NV (*myNVtime)(); /* Returns -1 on failure. */ +- SV **svp = hv_fetch(PL_modglobal, "Time::NVtime", 12, 0); ++ SV **svp = hv_fetchs(PL_modglobal, "Time::NVtime", 0); + if (!svp) croak("Time::HiRes is required"); + if (!SvIOK(*svp)) croak("Time::NVtime isn't a function pointer"); + myNVtime = INT2PTR(NV(*)(), SvIV(*svp)); +@@ -586,9 +610,13 @@ might help in this (in case your system supports CLOCK_MONOTONIC). + Some systems have APIs but not implementations: for example QNX and Haiku + have the interval timer APIs but not the functionality. + +-In OS X clock_getres(), clock_gettime() and clock_nanosleep() are +-emulated using the Mach timers; as a side effect of being emulated +-the CLOCK_REALTIME and CLOCK_MONOTONIC are the same timer. ++In pre-Sierra macOS (pre-10.12, OS X) clock_getres(), clock_gettime() ++and clock_nanosleep() are emulated using the Mach timers; as a side ++effect of being emulated the CLOCK_REALTIME and CLOCK_MONOTONIC are ++the same timer. ++ ++gnukfreebsd seems to have non-functional futimens() and utimensat() ++(at least as of 10.1): therefore the hires utime() does not work. + + =head1 SEE ALSO + +diff --git a/dist/Time-HiRes/HiRes.xs b/dist/Time-HiRes/HiRes.xs +index 38ca0dc..6b0dba8 100644 +--- a/dist/Time-HiRes/HiRes.xs ++++ b/dist/Time-HiRes/HiRes.xs +@@ -87,6 +87,10 @@ extern "C" { + # undef ITIMER_REALPROF + #endif + ++#ifndef TIME_HIRES_CLOCKID_T ++typedef int clockid_t; ++#endif ++ + #if defined(TIME_HIRES_CLOCK_GETTIME) && defined(_STRUCT_ITIMERSPEC) + + /* HP-UX has CLOCK_XXX values but as enums, not as defines. +@@ -747,21 +751,33 @@ hrstatns(UV *atime_nsec, UV *mtime_nsec, UV *ctime_nsec) + #endif /* !TIME_HIRES_STAT */ + } + +-/* Until Apple implements clock_gettime() (ditto clock_getres()) +- * we will emulate it using Mach interfaces. */ +-#if defined(PERL_DARWIN) && !defined(CLOCK_REALTIME) +- +-# include ++/* Until Apple implements clock_gettime() ++ * (ditto clock_getres() and clock_nanosleep()) ++ * we will emulate them using the Mach kernel interfaces. */ ++#if defined(PERL_DARWIN) && \ ++ (defined(TIME_HIRES_CLOCK_GETTIME_EMULATION) || \ ++ defined(TIME_HIRES_CLOCK_GETRES_EMULATION) || \ ++ defined(TIME_HIRES_CLOCK_NANOSLEEP_EMULATION)) + ++#ifndef CLOCK_REALTIME + # define CLOCK_REALTIME 0x01 + # define CLOCK_MONOTONIC 0x02 ++#endif + ++#ifndef TIMER_ABSTIME + # define TIMER_ABSTIME 0x01 ++#endif + + #ifdef USE_ITHREADS ++# define PERL_DARWIN_MUTEX ++#endif ++ ++#ifdef PERL_DARWIN_MUTEX + STATIC perl_mutex darwin_time_mutex; + #endif + ++#include ++ + static uint64_t absolute_time_init; + static mach_timebase_info_data_t timebase_info; + static struct timespec timespec_init; +@@ -769,7 +785,7 @@ static struct timespec timespec_init; + static int darwin_time_init() { + struct timeval tv; + int success = 1; +-#ifdef USE_ITHREADS ++#ifdef PERL_DARWIN_MUTEX + MUTEX_LOCK(&darwin_time_mutex); + #endif + if (absolute_time_init == 0) { +@@ -784,13 +800,14 @@ static int darwin_time_init() { + } + } + } +-#ifdef USE_ITHREADS ++#ifdef PERL_DARWIN_MUTEX + MUTEX_UNLOCK(&darwin_time_mutex); + #endif + return success; + } + +-static int clock_gettime(int clock_id, struct timespec *ts) { ++#ifdef TIME_HIRES_CLOCK_GETTIME_EMULATION ++static int th_clock_gettime(clockid_t clock_id, struct timespec *ts) { + if (darwin_time_init() && timebase_info.denom) { + switch (clock_id) { + case CLOCK_REALTIME: +@@ -822,7 +839,12 @@ static int clock_gettime(int clock_id, struct timespec *ts) { + return -1; + } + +-static int clock_getres(int clock_id, struct timespec *ts) { ++#define clock_gettime(clock_id, ts) th_clock_gettime((clock_id), (ts)) ++ ++#endif /* TIME_HIRES_CLOCK_GETTIME_EMULATION */ ++ ++#ifdef TIME_HIRES_CLOCK_GETRES_EMULATION ++static int th_clock_getres(clockid_t clock_id, struct timespec *ts) { + if (darwin_time_init() && timebase_info.denom) { + switch (clock_id) { + case CLOCK_REALTIME: +@@ -842,7 +864,11 @@ static int clock_getres(int clock_id, struct timespec *ts) { + return -1; + } + +-static int clock_nanosleep(int clock_id, int flags, ++#define clock_getres(clock_id, ts) th_clock_getres((clock_id), (ts)) ++#endif /* TIME_HIRES_CLOCK_GETRES_EMULATION */ ++ ++#ifdef TIME_HIRES_CLOCK_NANOSLEEP_EMULATION ++static int th_clock_nanosleep(clockid_t clock_id, int flags, + const struct timespec *rqtp, + struct timespec *rmtp) { + if (darwin_time_init()) { +@@ -880,6 +906,11 @@ static int clock_nanosleep(int clock_id, int flags, + return -1; + } + ++#define clock_nanosleep(clock_id, flags, rqtp, rmtp) \ ++ th_clock_nanosleep((clock_id), (flags), (rqtp), (rmtp)) ++ ++#endif /* TIME_HIRES_CLOCK_NANOSLEEP_EMULATION */ ++ + #endif /* PERL_DARWIN */ + + #include "const-c.inc" +@@ -921,6 +952,22 @@ nsec_without_unslept(struct timespec *sleepfor, + + #endif + ++/* In case Perl and/or Devel::PPPort are too old, minimally emulate ++ * IS_SAFE_PATHNAME() (which looks for zero bytes in the pathname). */ ++#ifndef IS_SAFE_PATHNAME ++#if PERL_VERSION >= 12 /* Perl_ck_warner is 5.10.0 -> */ ++#ifdef WARN_SYSCALLS ++#define WARNEMUCAT WARN_SYSCALLS /* 5.22.0 -> */ ++#else ++#define WARNEMUCAT WARN_MISC ++#endif ++#define WARNEMU(opname) Perl_ck_warner(aTHX_ packWARN(WARNEMUCAT), "Invalid \\0 character in pathname for %s",opname) ++#else ++#define WARNEMU(opname) Perl_warn(aTHX_ "Invalid \\0 character in pathname for %s",opname) ++#endif ++#define IS_SAFE_PATHNAME(pv, len, opname) (((len)>1)&&memchr((pv), 0, (len)-1)?(SETERRNO(ENOENT, LIB_INVARG),WARNEMU(opname),FALSE):(TRUE)) ++#endif ++ + MODULE = Time::HiRes PACKAGE = Time::HiRes + + PROTOTYPES: ENABLE +@@ -941,7 +988,7 @@ BOOT: + # endif + #endif + #if defined(PERL_DARWIN) +-# ifdef USE_ITHREADS ++# if defined(USE_ITHREADS) && defined(PERL_DARWIN_MUTEX) + MUTEX_INIT(&darwin_time_mutex); + # endif + #endif +@@ -978,7 +1025,8 @@ usleep(useconds) + useconds -= NV_1E6 * seconds; + } + } else if (useconds < 0.0) +- croak("Time::HiRes::usleep(%"NVgf"): negative time not invented yet", useconds); ++ croak("Time::HiRes::usleep(%" NVgf ++ "): negative time not invented yet", useconds); + usleep((U32)useconds); + } else + PerlProc_pause(); +@@ -1000,7 +1048,8 @@ nanosleep(nsec) + struct timespec sleepfor, unslept; + CODE: + if (nsec < 0.0) +- croak("Time::HiRes::nanosleep(%"NVgf"): negative time not invented yet", nsec); ++ croak("Time::HiRes::nanosleep(%" NVgf ++ "): negative time not invented yet", nsec); + nanosleep_init(nsec, &sleepfor, &unslept); + if (nanosleep(&sleepfor, &unslept) == 0) { + RETVAL = nsec; +@@ -1045,11 +1094,15 @@ sleep(...) + useconds = -(IV)useconds; + #endif /* #if defined(__sparc64__) && defined(__GNUC__) */ + if ((IV)useconds < 0) +- croak("Time::HiRes::sleep(%"NVgf"): internal error: useconds < 0 (unsigned %"UVuf" signed %"IVdf")", seconds, useconds, (IV)useconds); ++ croak("Time::HiRes::sleep(%" NVgf ++ "): internal error: useconds < 0 (unsigned %" UVuf ++ " signed %" IVdf ")", ++ seconds, useconds, (IV)useconds); + } + usleep(useconds); + } else +- croak("Time::HiRes::sleep(%"NVgf"): negative time not invented yet", seconds); ++ croak("Time::HiRes::sleep(%" NVgf ++ "): negative time not invented yet", seconds); + } else + PerlProc_pause(); + gettimeofday(&Tb, NULL); +@@ -1097,7 +1150,9 @@ ualarm(useconds,uinterval=0) + } + #else + if (useconds >= IV_1E6 || uinterval >= IV_1E6) +- croak("Time::HiRes::ualarm(%d, %d): useconds or uinterval equal to or more than %"IVdf, useconds, uinterval, IV_1E6); ++ croak("Time::HiRes::ualarm(%d, %d): useconds or uinterval" ++ " equal to or more than %" IVdf, ++ useconds, uinterval, IV_1E6); + RETVAL = ualarm(useconds, uinterval); + #endif + +@@ -1110,7 +1165,8 @@ alarm(seconds,interval=0) + NV interval + CODE: + if (seconds < 0.0 || interval < 0.0) +- croak("Time::HiRes::alarm(%"NVgf", %"NVgf"): negative time not invented yet", seconds, interval); ++ croak("Time::HiRes::alarm(%" NVgf ", %" NVgf ++ "): negative time not invented yet", seconds, interval); + { + IV iseconds = (IV)seconds; + IV iinterval = (IV)interval; +@@ -1118,7 +1174,9 @@ alarm(seconds,interval=0) + NV finterval = interval - iinterval; + IV useconds, uinterval; + if (fseconds >= 1.0 || finterval >= 1.0) +- croak("Time::HiRes::alarm(%"NVgf", %"NVgf"): seconds or interval too large to split correctly", seconds, interval); ++ croak("Time::HiRes::alarm(%" NVgf ", %" NVgf ++ "): seconds or interval too large to split correctly", ++ seconds, interval); + useconds = IV_1E6 * fseconds; + uinterval = IV_1E6 * finterval; + #if defined(HAS_SETITIMER) && defined(ITIMER_REAL) +@@ -1138,7 +1196,9 @@ alarm(seconds,interval=0) + } + #else + if (iseconds || iinterval) +- croak("Time::HiRes::alarm(%"NVgf", %"NVgf"): seconds or interval equal to or more than 1.0 ", seconds, interval); ++ croak("Time::HiRes::alarm(%" NVgf ", %" NVgf ++ "): seconds or interval equal to or more than 1.0 ", ++ seconds, interval); + RETVAL = (NV)ualarm( useconds, uinterval ) / NV_1E6; + #endif + } +@@ -1266,7 +1326,9 @@ setitimer(which, seconds, interval = 0) + struct itimerval oldit; + PPCODE: + if (seconds < 0.0 || interval < 0.0) +- croak("Time::HiRes::setitimer(%"IVdf", %"NVgf", %"NVgf"): negative time not invented yet", (IV)which, seconds, interval); ++ croak("Time::HiRes::setitimer(%" IVdf ", %" NVgf ", %" NVgf ++ "): negative time not invented yet", ++ (IV)which, seconds, interval); + newit.it_value.tv_sec = (IV)seconds; + newit.it_value.tv_usec = + (IV)((seconds - (NV)newit.it_value.tv_sec) * NV_1E6); +@@ -1317,11 +1379,89 @@ getitimer(which) + + #endif /* #if defined(HAS_GETITIMER) && defined(HAS_SETITIMER) */ + ++#if defined(TIME_HIRES_UTIME) ++ ++I32 ++utime(accessed, modified, ...) ++PROTOTYPE: $$@ ++ PREINIT: ++ SV* accessed; ++ SV* modified; ++ SV* file; ++ ++ struct timespec utbuf[2]; ++ struct timespec *utbufp = utbuf; ++ int tot; ++ ++ CODE: ++ accessed = ST(0); ++ modified = ST(1); ++ items -= 2; ++ tot = 0; ++ ++ if ( accessed == &PL_sv_undef && modified == &PL_sv_undef ) ++ utbufp = NULL; ++ else { ++ if (SvNV(accessed) < 0.0 || SvNV(modified) < 0.0) ++ croak("Time::HiRes::utime(%" NVgf ", %" NVgf ++ "): negative time not invented yet", ++ SvNV(accessed), SvNV(modified)); ++ Zero(&utbuf, sizeof utbuf, char); ++ utbuf[0].tv_sec = (Time_t)SvNV(accessed); /* time accessed */ ++ utbuf[0].tv_nsec = (long)( ( SvNV(accessed) - utbuf[0].tv_sec ) * 1e9 ); ++ utbuf[1].tv_sec = (Time_t)SvNV(modified); /* time modified */ ++ utbuf[1].tv_nsec = (long)( ( SvNV(modified) - utbuf[1].tv_sec ) * 1e9 ); ++ } ++ ++ while (items > 0) { ++ file = POPs; items--; ++ ++ if (SvROK(file) && GvIO(SvRV(file)) && IoIFP(sv_2io(SvRV(file)))) { ++ int fd = PerlIO_fileno(IoIFP(sv_2io(file))); ++ if (fd < 0) ++ SETERRNO(EBADF,RMS_IFI); ++ else ++#ifdef HAS_FUTIMENS ++ if (futimens(fd, utbufp) == 0) ++ tot++; ++#else /* HAS_FUTIMES */ ++ croak("futimens unimplemented in this platform"); ++#endif /* HAS_FUTIMES */ ++ } ++ else { ++#ifdef HAS_UTIMENSAT ++ STRLEN len; ++ char * name = SvPV(file, len); ++ if (IS_SAFE_PATHNAME(name, len, "utime") && ++ utimensat(AT_FDCWD, name, utbufp, 0) == 0) ++ tot++; ++#else /* HAS_UTIMENSAT */ ++ croak("utimensat unimplemented in this platform"); ++#endif /* HAS_UTIMENSAT */ ++ } ++ } /* while items */ ++ RETVAL = tot; ++ ++ OUTPUT: ++ RETVAL ++ ++#else /* #if defined(TIME_HIRES_UTIME) */ ++ ++I32 ++utime(accessed, modified, ...) ++ CODE: ++ croak("Time::HiRes::utime(): unimplemented in this platform"); ++ RETVAL = 0; ++ OUTPUT: ++ RETVAL ++ ++#endif /* #if defined(TIME_HIRES_UTIME) */ ++ + #if defined(TIME_HIRES_CLOCK_GETTIME) + + NV + clock_gettime(clock_id = CLOCK_REALTIME) +- int clock_id ++ clockid_t clock_id + PREINIT: + struct timespec ts; + int status = -1; +@@ -1340,7 +1480,7 @@ clock_gettime(clock_id = CLOCK_REALTIME) + + NV + clock_gettime(clock_id = 0) +- int clock_id ++ clockid_t clock_id + CODE: + PERL_UNUSED_ARG(clock_id); + croak("Time::HiRes::clock_gettime(): unimplemented in this platform"); +@@ -1354,7 +1494,7 @@ clock_gettime(clock_id = 0) + + NV + clock_getres(clock_id = CLOCK_REALTIME) +- int clock_id ++ clockid_t clock_id + PREINIT: + int status = -1; + struct timespec ts; +@@ -1373,7 +1513,7 @@ clock_getres(clock_id = CLOCK_REALTIME) + + NV + clock_getres(clock_id = 0) +- int clock_id ++ clockid_t clock_id + CODE: + PERL_UNUSED_ARG(clock_id); + croak("Time::HiRes::clock_getres(): unimplemented in this platform"); +@@ -1387,14 +1527,15 @@ clock_getres(clock_id = 0) + + NV + clock_nanosleep(clock_id, nsec, flags = 0) +- int clock_id ++ clockid_t clock_id + NV nsec + int flags + PREINIT: + struct timespec sleepfor, unslept; + CODE: + if (nsec < 0.0) +- croak("Time::HiRes::clock_nanosleep(..., %"NVgf"): negative time not invented yet", nsec); ++ croak("Time::HiRes::clock_nanosleep(..., %" NVgf ++ "): negative time not invented yet", nsec); + nanosleep_init(nsec, &sleepfor, &unslept); + if (clock_nanosleep(clock_id, flags, &sleepfor, &unslept) == 0) { + RETVAL = nsec; +@@ -1408,7 +1549,7 @@ clock_nanosleep(clock_id, nsec, flags = 0) + + NV + clock_nanosleep(clock_id, nsec, flags = 0) +- int clock_id ++ clockid_t clock_id + NV nsec + int flags + CODE: +diff --git a/dist/Time-HiRes/Makefile.PL b/dist/Time-HiRes/Makefile.PL +index 087ab79..ccad6a3 100644 +--- a/dist/Time-HiRes/Makefile.PL ++++ b/dist/Time-HiRes/Makefile.PL +@@ -88,7 +88,7 @@ sub try_compile_and_link { + my $obj_ext = $Config{obj_ext} || ".o"; + unlink("$tmp.c", "$tmp$obj_ext"); + +- if (open(TMPC, ">$tmp.c")) { ++ if (open(TMPC, '>', "$tmp.c")) { + print TMPC $c; + close(TMPC); + +@@ -132,7 +132,7 @@ __EOD__ + unless defined $cccmd; + + if ($^O eq 'VMS') { +- open( CMDFILE, ">$tmp.com" ); ++ open( CMDFILE, '>', "$tmp.com" ); + print CMDFILE "\$ SET MESSAGE/NOFACILITY/NOSEVERITY/NOIDENT/NOTEXT\n"; + print CMDFILE "\$ $cccmd\n"; + print CMDFILE "\$ IF \$SEVERITY .NE. 1 THEN EXIT 44\n"; # escalate +@@ -290,6 +290,7 @@ sub has_clock_xxx_syscall { + #include "EXTERN.h" + #include "perl.h" + #include "XSUB.h" ++#include + #include <$SYSCALL_H> + int main(int argc, char** argv) + { +@@ -309,6 +310,7 @@ sub has_clock_xxx { + #include "EXTERN.h" + #include "perl.h" + #include "XSUB.h" ++#include + int main(int argc, char** argv) + { + struct timespec ts; +@@ -325,6 +327,7 @@ sub has_clock { + #include "EXTERN.h" + #include "perl.h" + #include "XSUB.h" ++#include + int main(int argc, char** argv) + { + clock_t tictoc; +@@ -348,12 +351,63 @@ int main(int argc, char** argv) + struct timespec ts2; + ts1.tv_sec = 0; + ts1.tv_nsec = 750000000;; +- ret = clock_nanosleep(CLOCK_MONOTONIC, 0, &ts1, &ts2); ++ /* All implementations are supposed to support CLOCK_REALTIME. */ ++ ret = clock_nanosleep(CLOCK_REALTIME, 0, &ts1, &ts2); ++ ret == 0 ? exit(0) : exit(errno ? errno : -1); ++} ++EOM ++} ++ ++sub has_futimens { ++ return 1 if ++ try_compile_and_link(< ++int main(int argc, char** argv) ++{ ++ int ret; ++ struct timespec ts[2]; ++ ret = futimens(0, ts); + ret == 0 ? exit(0) : exit(errno ? errno : -1); + } + EOM + } + ++sub has_utimensat{ ++ return 1 if ++ try_compile_and_link(< ++#include ++int main(int argc, char** argv) ++{ ++ int ret; ++ struct timespec ts[2]; ++ ret = utimensat(AT_FDCWD, 0, ts, 0); ++ ret == 0 ? exit(0) : exit(errno ? errno : -1); ++} ++EOM ++} ++ ++sub has_clockid_t{ ++ return 1 if ++ try_compile_and_link(< ++int main(int argc, char** argv) ++{ ++ clockid_t id = CLOCK_REALTIME; ++ exit(id == CLOCK_REALTIME ? 1 : 0); ++} ++EOM ++} ++ + sub DEFINE { + my ($def, $val) = @_; + my $define = defined $val ? "$def=$val" : $def ; +@@ -534,6 +588,16 @@ EOD + print "(It would not be portable anyway.)\n"; + } + ++ print "Looking for clockid_t... "; ++ my $has_clockid_t; ++ if (has_clockid_t()) { ++ print "found.\n"; ++ $has_clockid_t++; ++ $DEFINE .= ' -DTIME_HIRES_CLOCKID_T'; ++ } else { ++ print "NOT found, will use int.\n"; ++ } ++ + print "Looking for clock_gettime()... "; + my $has_clock_gettime; + my $has_clock_gettime_emulation; +@@ -548,7 +612,7 @@ EOD + } elsif ($^O eq 'darwin') { + $has_clock_gettime_emulation++; + $has_clock_gettime++; +- $DEFINE .= ' -DTIME_HIRES_CLOCK_GETTIME'; ++ $DEFINE .= ' -DTIME_HIRES_CLOCK_GETTIME -DTIME_HIRES_CLOCK_GETTIME_EMULATION'; + } + + if ($has_clock_gettime) { +@@ -577,7 +641,7 @@ EOD + } elsif ($^O eq 'darwin') { + $has_clock_getres_emulation++; + $has_clock_getres++; +- $DEFINE .= ' -DTIME_HIRES_CLOCK_GETRES'; ++ $DEFINE .= ' -DTIME_HIRES_CLOCK_GETRES -DTIME_HIRES_CLOCK_GETRES_EMULATION'; + } + + if ($has_clock_getres) { +@@ -603,7 +667,7 @@ EOD + } elsif ($^O eq 'darwin') { + $has_clock_nanosleep++; + $has_clock_nanosleep_emulation++; +- $DEFINE .= ' -DTIME_HIRES_CLOCK_NANOSLEEP'; ++ $DEFINE .= ' -DTIME_HIRES_CLOCK_NANOSLEEP -DTIME_HIRES_CLOCK_NANOSLEEP_EMULATION'; + } + + if ($has_clock_nanosleep) { +@@ -631,6 +695,36 @@ EOD + print "NOT found.\n"; + } + ++ print "Looking for futimens()... "; ++ my $has_futimens; ++ if (has_futimens()) { ++ $has_futimens++; ++ $DEFINE .= ' -DHAS_FUTIMENS'; ++ } ++ ++ if ($has_futimens) { ++ print "found.\n"; ++ } else { ++ print "NOT found.\n"; ++ } ++ ++ print "Looking for utimensat()... "; ++ my $has_utimensat; ++ if (has_utimensat()) { ++ $has_utimensat++; ++ $DEFINE .= ' -DHAS_UTIMENSAT'; ++ } ++ ++ if ($has_utimensat) { ++ print "found.\n"; ++ } else { ++ print "NOT found.\n"; ++ } ++ ++ if ($has_futimens or $has_utimensat) { ++ $DEFINE .= ' -DTIME_HIRES_UTIME'; ++ } ++ + print "Looking for stat() subsecond timestamps...\n"; + + print "Trying struct stat st_atimespec.tv_nsec..."; +@@ -644,7 +738,7 @@ int main(int argc, char** argv) { + } + EOM + $has_stat_st_xtimespec++; +- DEFINE('TIME_HIRES_STAT', 1); ++ DEFINE('TIME_HIRES_STAT_ST_XTIMESPEC'); # 1 + } + + if ($has_stat_st_xtimespec) { +@@ -664,7 +758,7 @@ int main(int argc, char** argv) { + } + EOM + $has_stat_st_xtimensec++; +- DEFINE('TIME_HIRES_STAT', 2); ++ DEFINE('TIME_HIRES_STAT_ST_XTIMENSEC'); # 2 + } + + if ($has_stat_st_xtimensec) { +@@ -684,7 +778,7 @@ int main(int argc, char** argv) { + } + EOM + $has_stat_st_xtime_n++; +- DEFINE('TIME_HIRES_STAT', 3); ++ DEFINE('TIME_HIRES_STAT_ST_XTIME_N'); # 3 + } + + if ($has_stat_st_xtime_n) { +@@ -704,7 +798,7 @@ int main(int argc, char** argv) { + } + EOM + $has_stat_st_xtim++; +- DEFINE('TIME_HIRES_STAT', 4); ++ DEFINE('TIME_HIRES_STAT_XTIM'); # 4 + } + + if ($has_stat_st_xtim) { +@@ -724,7 +818,7 @@ int main(int argc, char** argv) { + } + EOM + $has_stat_st_uxtime++; +- DEFINE('TIME_HIRES_STAT', 5); ++ DEFINE('TIME_HIRES_STAT_ST_UXTIME'); # 5 + } + + if ($has_stat_st_uxtime) { +@@ -733,6 +827,19 @@ EOM + print "NOT found.\n"; + } + ++ # See HiRes.xs hrstatns() ++ if ($has_stat_st_xtimespec) { ++ DEFINE('TIME_HIRES_STAT', 1); ++ } elsif ($has_stat_st_xtimensec) { ++ DEFINE('TIME_HIRES_STAT', 2); ++ } elsif ($has_stat_st_xtime_n) { ++ DEFINE('TIME_HIRES_STAT', 3); ++ } elsif ($has_stat_st_xtim) { ++ DEFINE('TIME_HIRES_STAT', 4); ++ } elsif ($has_stat_st_uxtime) { ++ DEFINE('TIME_HIRES_STAT', 5); ++ } ++ + if ($DEFINE =~ /-DTIME_HIRES_STAT=\d+/) { + print "You seem to have stat() subsecond timestamps.\n"; + print "(Your struct stat has them, but the filesystems must help.)\n"; +@@ -757,7 +864,7 @@ EOM + + if ($DEFINE) { + $DEFINE =~ s/^\s+//; +- if (open(XDEFINE, ">xdefine")) { ++ if (open(XDEFINE, '>', 'xdefine')) { + print XDEFINE $DEFINE, "\n"; + close(XDEFINE); + } +@@ -791,7 +898,7 @@ sub doMakefile { + 'DynaLoader' => 0, + 'Exporter' => 0, + 'ExtUtils::MakeMaker' => 0, +- 'Test::More' => "0.82", ++ 'Test::More' => 0, + 'strict' => 0, + }, + 'dist' => { +@@ -869,7 +976,8 @@ sub doConstants { + ); + foreach (qw (d_usleep d_ualarm d_gettimeofday d_getitimer d_setitimer + d_nanosleep d_clock_gettime d_clock_getres +- d_clock d_clock_nanosleep d_hires_stat)) { ++ d_clock d_clock_nanosleep d_hires_stat ++ d_futimens d_utimensat d_hires_utime)) { + my $macro = $_; + if ($macro =~ /^(d_nanosleep|d_clock)$/) { + $macro =~ s/^d_(.+)/TIME_HIRES_\U$1/; +@@ -879,6 +987,13 @@ sub doConstants { + push @names, {name => $_, macro => "TIME_HIRES_STAT", value => $d_hires_stat, + default => ["IV", "0"]}; + next; ++ } elsif ($macro =~ /^(d_hires_utime)$/) { ++ my $d_hires_utime = ++ ($DEFINE =~ /-DHAS_FUTIMENS/ || ++ $DEFINE =~ /-DHAS_UTIMENSAT/) ? 1 : 0; ++ push @names, {name => $_, macro => "TIME_HIRES_UTIME", value => $d_hires_utime, ++ default => ["IV", "0"]}; ++ next; + } elsif ($macro =~ /^(d_clock_gettime|d_clock_getres|d_clock_nanosleep)$/) { + $macro =~ s/^d_(.+)/TIME_HIRES_\U$1/; + my $val = ($DEFINE =~ /-D$macro\b/) ? 1 : 0; +@@ -900,8 +1015,8 @@ sub doConstants { + foreach $file ('const-c.inc', 'const-xs.inc') { + my $fallback = File::Spec->catfile('fallback', $file); + local $/; +- open IN, "<$fallback" or die "Can't open $fallback: $!"; +- open OUT, ">$file" or die "Can't open $file: $!"; ++ open IN, '<', $fallback or die "Can't open $fallback: $!"; ++ open OUT, '>', $file or die "Can't open $file: $!"; + print OUT or die $!; + close OUT or die "Can't close $file: $!"; + close IN or die "Can't close $fallback: $!"; +@@ -920,7 +1035,7 @@ sub main { + DEFINE('SELECT_IS_BROKEN'); + $LIBS = []; + print "System is $^O, skipping full configure...\n"; +- open(XDEFINE, ">xdefine") or die "$0: Cannot create xdefine: $!\n"; ++ open(XDEFINE, '>', 'xdefine') or die "$0: Cannot create xdefine: $!\n"; + close(XDEFINE); + } else { + init(); +diff --git a/dist/Time-HiRes/fallback/const-c.inc b/dist/Time-HiRes/fallback/const-c.inc +index a862617..524db16 100644 +--- a/dist/Time-HiRes/fallback/const-c.inc ++++ b/dist/Time-HiRes/fallback/const-c.inc +@@ -19,6 +19,7 @@ typedef double NV; /* 5.6 and later define NVTYPE, and typedef NV to it. */ + #ifndef pTHX_ + #define pTHX_ /* 5.6 or later define this for threading support. */ + #endif ++ + static int + constant_11 (pTHX_ const char *name, IV *iv_return) { + /* When generated this function returned values for the list of names given +@@ -86,6 +87,51 @@ constant_11 (pTHX_ const char *name, IV *iv_return) { + return PERL_constant_NOTFOUND; + } + ++static int ++constant_13 (pTHX_ const char *name, IV *iv_return) { ++ /* When generated this function returned values for the list of names given ++ here. However, subsequent manual editing may have added or removed some. ++ CLOCK_HIGHRES TIMER_ABSTIME d_hires_utime */ ++ /* Offset 1 gives the best switch position. */ ++ switch (name[1]) { ++ case 'I': ++ if (memEQ(name, "TIMER_ABSTIME", 13)) { ++ /* ^ */ ++#ifdef TIMER_ABSTIME ++ *iv_return = TIMER_ABSTIME; ++ return PERL_constant_ISIV; ++#else ++ return PERL_constant_NOTDEF; ++#endif ++ } ++ break; ++ case 'L': ++ if (memEQ(name, "CLOCK_HIGHRES", 13)) { ++ /* ^ */ ++#ifdef CLOCK_HIGHRES ++ *iv_return = CLOCK_HIGHRES; ++ return PERL_constant_ISIV; ++#else ++ return PERL_constant_NOTDEF; ++#endif ++ } ++ break; ++ case '_': ++ if (memEQ(name, "d_hires_utime", 13)) { ++ /* ^ */ ++#ifdef TIME_HIRES_UTIME ++ *iv_return = 1; ++ return PERL_constant_ISIV; ++#else ++ *iv_return = 0; ++ return PERL_constant_ISIV; ++#endif ++ } ++ break; ++ } ++ return PERL_constant_NOTFOUND; ++} ++ + static int + constant_14 (pTHX_ const char *name, IV *iv_return) { + /* When generated this function returned values for the list of names given +@@ -250,16 +296,17 @@ my @names = (qw(CLOCKS_PER_SEC CLOCK_HIGHRES CLOCK_MONOTONIC + {name=>"d_getitimer", type=>"IV", macro=>"HAS_GETITIMER", value=>"1", default=>["IV", "0"]}, + {name=>"d_gettimeofday", type=>"IV", macro=>"HAS_GETTIMEOFDAY", value=>"1", default=>["IV", "0"]}, + {name=>"d_hires_stat", type=>"IV", macro=>"TIME_HIRES_STAT", value=>"1", default=>["IV", "0"]}, ++ {name=>"d_hires_utime", type=>"IV", macro=>"TIME_HIRES_UTIME", value=>"1", default=>["IV", "0"]}, + {name=>"d_nanosleep", type=>"IV", macro=>"TIME_HIRES_NANOSLEEP", value=>"1", default=>["IV", "0"]}, + {name=>"d_setitimer", type=>"IV", macro=>"HAS_SETITIMER", value=>"1", default=>["IV", "0"]}, + {name=>"d_ualarm", type=>"IV", macro=>"HAS_UALARM", value=>"1", default=>["IV", "0"]}, + {name=>"d_usleep", type=>"IV", macro=>"HAS_USLEEP", value=>"1", default=>["IV", "0"]}); + +-print constant_types(); # macro defs ++print constant_types(), "\n"; # macro defs + foreach (C_constant ("Time::HiRes", 'constant', 'IV', $types, undef, 3, @names) ) { + print $_, "\n"; # C constant subs + } +-print "#### XS Section:\n"; ++print "\n#### XS Section:\n"; + print XS_constant ("Time::HiRes", $types); + __END__ + */ +@@ -322,33 +369,7 @@ __END__ + } + break; + case 13: +- /* Names all of length 13. */ +- /* CLOCK_HIGHRES TIMER_ABSTIME */ +- /* Offset 2 gives the best switch position. */ +- switch (name[2]) { +- case 'M': +- if (memEQ(name, "TIMER_ABSTIME", 13)) { +- /* ^ */ +-#ifdef TIMER_ABSTIME +- *iv_return = TIMER_ABSTIME; +- return PERL_constant_ISIV; +-#else +- return PERL_constant_NOTDEF; +-#endif +- } +- break; +- case 'O': +- if (memEQ(name, "CLOCK_HIGHRES", 13)) { +- /* ^ */ +-#ifdef CLOCK_HIGHRES +- *iv_return = CLOCK_HIGHRES; +- return PERL_constant_ISIV; +-#else +- return PERL_constant_NOTDEF; +-#endif +- } +- break; +- } ++ return constant_13 (aTHX_ name, iv_return); + break; + case 14: + return constant_14 (aTHX_ name, iv_return); +diff --git a/dist/Time-HiRes/t/Watchdog.pm b/dist/Time-HiRes/t/Watchdog.pm +index 83e8543..44ec808 100644 +--- a/dist/Time-HiRes/t/Watchdog.pm ++++ b/dist/Time-HiRes/t/Watchdog.pm +@@ -10,44 +10,44 @@ my $watchdog_pid; + my $TheEnd; + + if ($Config{d_fork}) { +- note "I am the main process $$, starting the watchdog process..."; ++ print("# I am the main process $$, starting the watchdog process...\n"); + $watchdog_pid = fork(); + if (defined $watchdog_pid) { + if ($watchdog_pid == 0) { # We are the kid, set up the watchdog. + my $ppid = getppid(); +- note "I am the watchdog process $$, sleeping for $waitfor seconds..."; ++ print("# I am the watchdog process $$, sleeping for $waitfor seconds...\n"); + sleep($waitfor - 2); # Workaround for perlbug #49073 + sleep(2); # Wait for parent to exit + if (kill(0, $ppid)) { # Check if parent still exists + warn "\n$0: overall time allowed for tests (${waitfor}s) exceeded!\n"; +- note "Terminating main process $ppid..."; ++ print("Terminating main process $ppid...\n"); + kill('KILL', $ppid); +- note "This is the watchdog process $$, over and out."; ++ print("# This is the watchdog process $$, over and out.\n"); + } + exit(0); + } else { +- note "The watchdog process $watchdog_pid launched, continuing testing..."; ++ print("# The watchdog process $watchdog_pid launched, continuing testing...\n"); + $TheEnd = time() + $waitfor; + } + } else { + warn "$0: fork failed: $!\n"; + } + } else { +- note "No watchdog process (need fork)"; ++ print("# No watchdog process (need fork)\n"); + } + + END { + if ($watchdog_pid) { # Only in the main process. + my $left = $TheEnd - time(); +- note sprintf "I am the main process $$, terminating the watchdog process $watchdog_pid before it terminates me in %d seconds (testing took %d seconds).", $left, $waitfor - $left; ++ printf("# I am the main process $$, terminating the watchdog process $watchdog_pid before it terminates me in %d seconds (testing took %d seconds).\n", $left, $waitfor - $left); + if (kill(0, $watchdog_pid)) { + local $? = 0; + my $kill = kill('KILL', $watchdog_pid); # We are done, the watchdog can go. + wait(); +- note sprintf "kill KILL $watchdog_pid = %d", $kill; ++ printf("# kill KILL $watchdog_pid = %d\n", $kill); + } + unlink("ktrace.out"); # Used in BSD system call tracing. +- note "All done."; ++ print("# All done.\n"); + } + } + +diff --git a/dist/Time-HiRes/t/alarm.t b/dist/Time-HiRes/t/alarm.t +index 841694f..4935410 100644 +--- a/dist/Time-HiRes/t/alarm.t ++++ b/dist/Time-HiRes/t/alarm.t +@@ -1,6 +1,6 @@ + use strict; + +-use Test::More 0.82 tests => 10; ++use Test::More tests => 10; + use t::Watchdog; + + BEGIN { require_ok "Time::HiRes"; } +@@ -10,7 +10,7 @@ use Config; + my $limit = 0.25; # 25% is acceptable slosh for testing timers + + my $xdefine = ''; +-if (open(XDEFINE, "xdefine")) { ++if (open(XDEFINE, "<", "xdefine")) { + chomp($xdefine = || ""); + close(XDEFINE); + } +@@ -29,12 +29,14 @@ SKIP: { + + my ($r, $i, $not, $ok); + ++ $not = ""; ++ + $r = [Time::HiRes::gettimeofday()]; + $i = 5; + my $oldaction; + if ($use_sigaction) { + $oldaction = new POSIX::SigAction; +- note sprintf "sigaction tick, ALRM = %d", &POSIX::SIGALRM; ++ printf("# sigaction tick, ALRM = %d\n", &POSIX::SIGALRM); + + # Perl's deferred signals may be too wimpy to break through + # a restartable select(), so use POSIX::sigaction if available. +@@ -44,7 +46,7 @@ SKIP: { + $oldaction) + or die "Error setting SIGALRM handler with sigaction: $!\n"; + } else { +- note "SIG tick"; ++ print("# SIG tick\n"); + $SIG{ALRM} = "tick"; + } + +@@ -56,8 +58,8 @@ SKIP: { + Time::HiRes::alarm(0.3); + select (undef, undef, undef, 3); + my $ival = Time::HiRes::tv_interval ($r); +- note "Select returned! $i $ival"; +- note abs($ival/3 - 1); ++ print("# Select returned! $i $ival\n"); ++ printf("# %s\n", abs($ival/3 - 1)); + # Whether select() gets restarted after signals is + # implementation dependent. If it is restarted, we + # will get about 3.3 seconds: 3 from the select, 0.3 +@@ -86,7 +88,7 @@ SKIP: { + sub tick { + $i--; + my $ival = Time::HiRes::tv_interval ($r); +- note "Tick! $i $ival"; ++ print("# Tick! $i $ival\n"); + my $exp = 0.3 * (5 - $i); + if ($exp == 0) { + $not = "tick: divisor became zero"; +@@ -106,8 +108,8 @@ SKIP: { + Time::HiRes::alarm(0); # can't cancel usig %SIG + } + ++ print("# $not\n"); + ok !$not; +- note $not || $ok; + } + + SKIP: { +@@ -126,7 +128,7 @@ SKIP: { + # http://groups.google.com/group/perl.perl5.porters/browse_thread/thread/adaffaaf939b042e/20dafc298df737f0%2320dafc298df737f0?sa=X&oi=groupsr&start=0&num=3 + # Perl changes [18765] and [18770], perl bug [perl #20920] + +- note "Finding delay loop..."; ++ print("# Finding delay loop...\n"); + + my $T = 0.01; + my $DelayN = 1024; +@@ -137,7 +139,7 @@ SKIP: { + for ($i = 0; $i < $DelayN; $i++) { } + my $t1 = Time::HiRes::time(); + my $dt = $t1 - $t0; +- note "N = $DelayN, t1 = $t1, t0 = $t0, dt = $dt"; ++ print("# N = $DelayN, t1 = $t1, t0 = $t0, dt = $dt\n"); + last N if $dt > $T; + $DelayN *= 2; + } while (1); +@@ -169,7 +171,7 @@ SKIP: { + + $SIG{ALRM} = sub { + $a++; +- note "Alarm $a - ", Time::HiRes::time(); ++ printf("# Alarm $a - %s\n", Time::HiRes::time()); + Time::HiRes::alarm(0) if $a >= $A; # Disarm the alarm. + $Delay->(2); # Try burning CPU at least for 2T seconds. + }; +@@ -204,18 +206,18 @@ SKIP: { + my $alrm = 0; + $SIG{ALRM} = sub { $alrm++ }; + my $got = Time::HiRes::alarm(2.7); +- ok $got == 0 or note $got; ++ ok $got == 0 or print("# $got\n"); + + my $t0 = Time::HiRes::time(); + 1 while Time::HiRes::time() - $t0 <= 1; + + $got = Time::HiRes::alarm(0); +- ok $got > 0 && $got < 1.8 or note $got; ++ ok $got > 0 && $got < 1.8 or print("# $got\n"); + +- ok $alrm == 0 or note $alrm; ++ ok $alrm == 0 or print("# $alrm\n"); + + $got = Time::HiRes::alarm(0); +- ok $got == 0 or note $got; ++ ok $got == 0 or print("# $got\n"); + } + } + +diff --git a/dist/Time-HiRes/t/clock.t b/dist/Time-HiRes/t/clock.t +index 6d11dd2..346ca57 100644 +--- a/dist/Time-HiRes/t/clock.t ++++ b/dist/Time-HiRes/t/clock.t +@@ -1,6 +1,6 @@ + use strict; + +-use Test::More 0.82 tests => 5; ++use Test::More tests => 5; + use t::Watchdog; + + BEGIN { require_ok "Time::HiRes"; } +@@ -13,10 +13,10 @@ sub has_symbol { + return $@ eq ''; + } + +-note sprintf "have_clock_gettime = %d", &Time::HiRes::d_clock_gettime; +-note sprintf "have_clock_getres = %d", &Time::HiRes::d_clock_getres; +-note sprintf "have_clock_nanosleep = %d", &Time::HiRes::d_clock_nanosleep; +-note sprintf "have_clock = %d", &Time::HiRes::d_clock; ++printf("# have_clock_gettime = %d\n", &Time::HiRes::d_clock_gettime); ++printf("# have_clock_getres = %d\n", &Time::HiRes::d_clock_getres); ++printf("# have_clock_nanosleep = %d\n", &Time::HiRes::d_clock_nanosleep); ++printf("# have_clock = %d\n", &Time::HiRes::d_clock); + + # Ideally, we'd like to test that the timers are rather precise. + # However, if the system is busy, there are no guarantees on how +@@ -36,25 +36,25 @@ SKIP: { + my $ok = 0; + TRY: { + for my $try (1..3) { +- note "CLOCK_REALTIME: try = $try"; ++ print("# CLOCK_REALTIME: try = $try\n"); + my $t0 = Time::HiRes::clock_gettime(&CLOCK_REALTIME); + my $T = 1.5; + Time::HiRes::sleep($T); + my $t1 = Time::HiRes::clock_gettime(&CLOCK_REALTIME); + if ($t0 > 0 && $t1 > $t0) { +- note "t1 = $t1, t0 = $t0"; ++ print("# t1 = $t1, t0 = $t0\n"); + my $dt = $t1 - $t0; + my $rt = abs(1 - $dt / $T); +- note "dt = $dt, rt = $rt"; ++ print("# dt = $dt, rt = $rt\n"); + if ($rt <= 2 * $limit) { + $ok = 1; + last TRY; + } + } else { +- note "Error: t0 = $t0, t1 = $t1"; ++ print("# Error: t0 = $t0, t1 = $t1\n"); + } + my $r = rand() + rand(); +- note sprintf "Sleeping for %.6f seconds...\n", $r; ++ printf("# Sleeping for %.6f seconds...\n", $r); + Time::HiRes::sleep($r); + } + } +@@ -64,7 +64,7 @@ SKIP: { + SKIP: { + skip "no clock_getres", 1 unless &Time::HiRes::d_clock_getres; + my $tr = Time::HiRes::clock_getres(); +- ok $tr > 0 or note "tr = $tr"; ++ ok $tr > 0 or print("# tr = $tr\n"); + } + + SKIP: { +@@ -73,17 +73,17 @@ SKIP: { + my $s = 1.5e9; + my $t = Time::HiRes::clock_nanosleep(&CLOCK_REALTIME, $s); + my $r = abs(1 - $t / $s); +- ok $r < 2 * $limit or note "t = $t, r = $r"; ++ ok $r < 2 * $limit or print("# t = $t, r = $r\n"); + } + + SKIP: { + skip "no clock", 1 unless &Time::HiRes::d_clock; + my @clock = Time::HiRes::clock(); +- note "clock = @clock"; ++ print("# clock = @clock\n"); + for my $i (1..3) { + for (my $j = 0; $j < 1e6; $j++) { } + push @clock, Time::HiRes::clock(); +- note "clock = @clock"; ++ print("# clock = @clock\n"); + } + ok $clock[0] >= 0 && + $clock[1] > $clock[0] && +diff --git a/dist/Time-HiRes/t/gettimeofday.t b/dist/Time-HiRes/t/gettimeofday.t +index 8f7c5f3..69defe8 100644 +--- a/dist/Time-HiRes/t/gettimeofday.t ++++ b/dist/Time-HiRes/t/gettimeofday.t +@@ -8,26 +8,26 @@ BEGIN { + } + } + +-use Test::More 0.82 tests => 6; ++use Test::More tests => 6; + use t::Watchdog; + + my @one = Time::HiRes::gettimeofday(); +-note 'gettimeofday returned ', 0+@one, ' args'; ++printf("# gettimeofday returned %d args\n", 0+@one); + ok @one == 2; +-ok $one[0] > 850_000_000 or note "@one too small"; ++ok $one[0] > 850_000_000 or print("# @one too small\n"); + + sleep 1; + + my @two = Time::HiRes::gettimeofday(); + ok $two[0] > $one[0] || ($two[0] == $one[0] && $two[1] > $one[1]) +- or note "@two is not greater than @one"; ++ or print("# @two is not greater than @one\n"); + + my $f = Time::HiRes::time(); +-ok $f > 850_000_000 or note "$f too small"; +-ok $f - $two[0] < 2 or note "$f - $two[0] >= 2"; ++ok $f > 850_000_000 or print("# $f too small\n"); ++ok $f - $two[0] < 2 or print("# $f - $two[0] >= 2\n"); + + my $r = [Time::HiRes::gettimeofday()]; + my $g = Time::HiRes::tv_interval $r; +-ok $g < 2 or note $g; ++ok $g < 2 or print("# $g\n"); + + 1; +diff --git a/dist/Time-HiRes/t/itimer.t b/dist/Time-HiRes/t/itimer.t +index 9eb2b93..31cdd67 100644 +--- a/dist/Time-HiRes/t/itimer.t ++++ b/dist/Time-HiRes/t/itimer.t +@@ -25,7 +25,7 @@ BEGIN { + } + } + +-use Test::More 0.82 tests => 2; ++use Test::More tests => 2; + use t::Watchdog; + + my $limit = 0.25; # 25% is acceptable slosh for testing timers +@@ -35,11 +35,11 @@ my $r = [Time::HiRes::gettimeofday()]; + + $SIG{VTALRM} = sub { + $i ? $i-- : Time::HiRes::setitimer(&Time::HiRes::ITIMER_VIRTUAL, 0); +- note "Tick! $i ", Time::HiRes::tv_interval($r); ++ printf("# Tick! $i %s\n", Time::HiRes::tv_interval($r)); + }; + +-note "setitimer: ", join(" ", +- Time::HiRes::setitimer(&Time::HiRes::ITIMER_VIRTUAL, 0.5, 0.4)); ++printf("# setitimer: %s\n", join(" ", ++ Time::HiRes::setitimer(&Time::HiRes::ITIMER_VIRTUAL, 0.5, 0.4))); + + # Assume interval timer granularity of $limit * 0.5 seconds. Too bold? + my $virt = Time::HiRes::getitimer(&Time::HiRes::ITIMER_VIRTUAL); +@@ -47,19 +47,19 @@ ok(defined $virt && abs($virt / 0.5) - 1 < $limit, + "ITIMER_VIRTUAL defined with sufficient granularity") + or diag "virt=" . (defined $virt ? $virt : 'undef'); + +-note "getitimer: ", join(" ", +- Time::HiRes::getitimer(&Time::HiRes::ITIMER_VIRTUAL)); ++printf("# getitimer: %s\n", join(" ", ++ Time::HiRes::getitimer(&Time::HiRes::ITIMER_VIRTUAL))); + + while (Time::HiRes::getitimer(&Time::HiRes::ITIMER_VIRTUAL)) { + my $j; + for (1..1000) { $j++ } # Can't be unbreakable, must test getitimer(). + } + +-note "getitimer: ", join(" ", +- Time::HiRes::getitimer(&Time::HiRes::ITIMER_VIRTUAL)); ++printf("# getitimer: %s\n", join(" ", ++ Time::HiRes::getitimer(&Time::HiRes::ITIMER_VIRTUAL))); + + $virt = Time::HiRes::getitimer(&Time::HiRes::ITIMER_VIRTUAL); +-note "at end, i=$i"; ++print("# at end, i=$i\n"); + is($virt, 0, "time left should be zero"); + + $SIG{VTALRM} = 'DEFAULT'; +diff --git a/dist/Time-HiRes/t/nanosleep.t b/dist/Time-HiRes/t/nanosleep.t +index aef9db6..c17a7e4 100644 +--- a/dist/Time-HiRes/t/nanosleep.t ++++ b/dist/Time-HiRes/t/nanosleep.t +@@ -8,7 +8,7 @@ BEGIN { + } + } + +-use Test::More 0.82 tests => 3; ++use Test::More tests => 3; + use t::Watchdog; + + eval { Time::HiRes::nanosleep(-5) }; +@@ -21,7 +21,7 @@ my $two = CORE::time; + Time::HiRes::nanosleep(10_000_000); + my $three = CORE::time; + ok $one == $two || $two == $three +- or note "slept too long, $one $two $three"; ++ or print("# slept too long, $one $two $three\n"); + + SKIP: { + skip "no gettimeofday", 1 unless &Time::HiRes::d_gettimeofday; +@@ -29,7 +29,7 @@ SKIP: { + Time::HiRes::nanosleep(500_000_000); + my $f2 = Time::HiRes::time(); + my $d = $f2 - $f; +- ok $d > 0.4 && $d < 0.9 or note "slept $d secs $f to $f2"; ++ ok $d > 0.4 && $d < 0.9 or print("# slept $d secs $f to $f2\n"); + } + + 1; +diff --git a/dist/Time-HiRes/t/sleep.t b/dist/Time-HiRes/t/sleep.t +index e7cc627..b84b4c6 100644 +--- a/dist/Time-HiRes/t/sleep.t ++++ b/dist/Time-HiRes/t/sleep.t +@@ -1,6 +1,6 @@ + use strict; + +-use Test::More 0.82 tests => 4; ++use Test::More tests => 4; + use t::Watchdog; + + BEGIN { require_ok "Time::HiRes"; } +@@ -8,7 +8,7 @@ BEGIN { require_ok "Time::HiRes"; } + use Config; + + my $xdefine = ''; +-if (open(XDEFINE, "xdefine")) { ++if (open(XDEFINE, "<", "xdefine")) { + chomp($xdefine = || ""); + close(XDEFINE); + } +@@ -26,12 +26,12 @@ like $@, qr/::sleep\(-1\): negative time not invented yet/, + SKIP: { + skip "no subsecond alarm", 2 unless $can_subsecond_alarm; + my $f = Time::HiRes::time; +- note "time...$f"; ++ print("# time...$f\n"); + ok 1; + + my $r = [Time::HiRes::gettimeofday()]; + Time::HiRes::sleep (0.5); +- note "sleep...", Time::HiRes::tv_interval($r); ++ printf("# sleep...%s\n", Time::HiRes::tv_interval($r)); + ok 1; + } + +diff --git a/dist/Time-HiRes/t/stat.t b/dist/Time-HiRes/t/stat.t +index 68a6fb6..a59a342 100644 +--- a/dist/Time-HiRes/t/stat.t ++++ b/dist/Time-HiRes/t/stat.t +@@ -13,14 +13,14 @@ BEGIN { + } + } + +-use Test::More 0.82 tests => 43; ++use Test::More tests => 43; + use t::Watchdog; + + my @atime; + my @mtime; + for (1..5) { + Time::HiRes::sleep(rand(0.1) + 0.1); +- open(X, ">$$"); ++ open(X, '>', $$); + print X $$; + close(X); + my($a, $stat, $b) = ("a", [Time::HiRes::stat($$)], "b"); +@@ -33,7 +33,7 @@ for (1..5) { + is $b, "b"; + is_deeply $lstat, $stat; + Time::HiRes::sleep(rand(0.1) + 0.1); +- open(X, "<$$"); ++ open(X, '<', $$); + ; + close(X); + $stat = [Time::HiRes::stat($$)]; +@@ -42,8 +42,8 @@ for (1..5) { + is_deeply $lstat, $stat; + } + 1 while unlink $$; +-note "mtime = @mtime"; +-note "atime = @atime"; ++print("# mtime = @mtime\n"); ++print("# atime = @atime\n"); + my $ai = 0; + my $mi = 0; + my $ss = 0; +@@ -63,7 +63,7 @@ for (my $i = 1; $i < @mtime; $i++) { + $ss++; + } + } +-note "ai = $ai, mi = $mi, ss = $ss"; ++print("# ai = $ai, mi = $mi, ss = $ss\n"); + # Need at least 75% of monotonical increase and + # 20% of subsecond results. Yes, this is guessing. + SKIP: { +@@ -75,7 +75,7 @@ SKIP: { + my $targetname = "tgt$$"; + my $linkname = "link$$"; + SKIP: { +- open(X, ">$targetname"); ++ open(X, '>', $targetname); + print X $$; + close(X); + eval { symlink $targetname, $linkname or die "can't symlink: $!"; }; +diff --git a/dist/Time-HiRes/t/time.t b/dist/Time-HiRes/t/time.t +index feec479..6f219f9 100644 +--- a/dist/Time-HiRes/t/time.t ++++ b/dist/Time-HiRes/t/time.t +@@ -1,6 +1,6 @@ + use strict; + +-use Test::More 0.82 tests => 2; ++use Test::More tests => 2; + use t::Watchdog; + + BEGIN { require_ok "Time::HiRes"; } +@@ -16,8 +16,8 @@ SKIP: { + # (CORE::time() may be rounding down, up, or closest), + # but allow 10% of slop. + ok abs($s) / $n <= 1.10 +- or note "Time::HiRes::time() not close to CORE::time()"; +- note "s = $s, n = $n, s/n = ", abs($s)/$n; ++ or print("# Time::HiRes::time() not close to CORE::time()\n"); ++ printf("# s = $s, n = $n, s/n = %s\n", abs($s)/$n); + } + + 1; +diff --git a/dist/Time-HiRes/t/tv_interval.t b/dist/Time-HiRes/t/tv_interval.t +index bffcf39..8ac876d 100644 +--- a/dist/Time-HiRes/t/tv_interval.t ++++ b/dist/Time-HiRes/t/tv_interval.t +@@ -1,10 +1,10 @@ + use strict; + +-use Test::More 0.82 tests => 2; ++use Test::More tests => 2; + + BEGIN { require_ok "Time::HiRes"; } + + my $f = Time::HiRes::tv_interval [5, 100_000], [10, 500_000]; +-ok abs($f - 5.4) < 0.001 or note $f; ++ok abs($f - 5.4) < 0.001 or print("# $f\n"); + + 1; +diff --git a/dist/Time-HiRes/t/ualarm.t b/dist/Time-HiRes/t/ualarm.t +index 12ef4b5..b50a175 100644 +--- a/dist/Time-HiRes/t/ualarm.t ++++ b/dist/Time-HiRes/t/ualarm.t +@@ -8,7 +8,7 @@ BEGIN { + } + } + +-use Test::More 0.82 tests => 12; ++use Test::More tests => 12; + use t::Watchdog; + + use Config; +@@ -24,13 +24,13 @@ SKIP: { + $tick = 0; Time::HiRes::ualarm(10_000); while ($tick == 0) { } + my $three = CORE::time; + ok $one == $two || $two == $three +- or note "slept too long, $one $two $three"; +- note "tick = $tick, one = $one, two = $two, three = $three"; ++ or print("# slept too long, $one $two $three\n"); ++ print("# tick = $tick, one = $one, two = $two, three = $three\n"); + + $tick = 0; Time::HiRes::ualarm(10_000, 10_000); while ($tick < 3) { } + ok 1; + Time::HiRes::ualarm(0); +- note "tick = $tick, one = $one, two = $two, three = $three"; ++ print("# tick = $tick, one = $one, two = $two, three = $three\n"); + } + + eval { Time::HiRes::ualarm(-4) }; +@@ -59,24 +59,24 @@ for my $n (100_000, 1_100_000, 2_200_000, 4_300_000) { + my $alarmed = 0; + local $SIG{ ALRM } = sub { $alarmed++ }; + my $t0 = Time::HiRes::time(); +- note "t0 = $t0"; +- note "ualarm($n)"; ++ print("# t0 = $t0\n"); ++ print("# ualarm($n)\n"); + Time::HiRes::ualarm($n); 1 while $alarmed == 0; + my $t1 = Time::HiRes::time(); +- note "t1 = $t1"; ++ print("# t1 = $t1\n"); + my $dt = $t1 - $t0; +- note "dt = $dt"; ++ print("# dt = $dt\n"); + my $r = $dt / ($n/1e6); +- note "r = $r"; ++ print("# r = $r\n"); + $ok = + ($n < 1_000_000 || # Too much noise. + ($r >= 0.8 && $r <= 1.6)); + last if $ok; + my $nap = bellish(3, 15); +- note sprintf "Retrying in %.1f seconds...\n", $nap; ++ printf("# Retrying in %.1f seconds...\n", $nap); + Time::HiRes::sleep($nap); + } +- ok $ok or note "ualarm($n) close enough"; ++ ok $ok or print("# ualarm($n) close enough\n"); + } + + { +@@ -93,12 +93,12 @@ for my $n (100_000, 1_100_000, 2_200_000, 4_300_000) { + } while $t1 - $t0 <= 0.3; + my $got1 = Time::HiRes::ualarm(0); + +- note "t0 = $t0"; +- note "got0 = $got0"; +- note "t1 = $t1"; +- note "t1 - t0 = ", ($t1 - $t0); +- note "got1 = $got1"; +- ok $got0 == 0 or note $got0; ++ print("# t0 = $t0\n"); ++ print("# got0 = $got0\n"); ++ print("# t1 = $t1\n"); ++ printf("# t1 - t0 = %s\n", ($t1 - $t0)); ++ print("# got1 = $got1\n"); ++ ok $got0 == 0 or print("# $got0\n"); + SKIP: { + skip "alarm interval exceeded", 2 if $t1 - $t0 >= 0.5; + ok $got1 > 0; +@@ -106,7 +106,7 @@ for my $n (100_000, 1_100_000, 2_200_000, 4_300_000) { + } + ok $got1 < 300_000; + my $got2 = Time::HiRes::ualarm(0); +- ok $got2 == 0 or note $got2; ++ ok $got2 == 0 or print("# $got2\n"); + } + + 1; +diff --git a/dist/Time-HiRes/t/usleep.t b/dist/Time-HiRes/t/usleep.t +index 0d6bacf..bdf372b 100644 +--- a/dist/Time-HiRes/t/usleep.t ++++ b/dist/Time-HiRes/t/usleep.t +@@ -8,7 +8,7 @@ BEGIN { + } + } + +-use Test::More 0.82 tests => 6; ++use Test::More tests => 6; + use t::Watchdog; + + eval { Time::HiRes::usleep(-2) }; +@@ -23,7 +23,7 @@ my $two = CORE::time; + Time::HiRes::usleep(10_000); + my $three = CORE::time; + ok $one == $two || $two == $three +-or note "slept too long, $one $two $three"; ++or print("# slept too long, $one $two $three\n"); + + SKIP: { + skip "no gettimeofday", 1 unless &Time::HiRes::d_gettimeofday; +@@ -31,7 +31,7 @@ SKIP: { + Time::HiRes::usleep(500_000); + my $f2 = Time::HiRes::time(); + my $d = $f2 - $f; +- ok $d > 0.4 && $d < 0.9 or note "slept $d secs $f to $f2"; ++ ok $d > 0.4 && $d < 0.9 or print("# slept $d secs $f to $f2\n"); + } + + SKIP: { +@@ -39,7 +39,7 @@ SKIP: { + my $r = [ Time::HiRes::gettimeofday() ]; + Time::HiRes::sleep( 0.5 ); + my $f = Time::HiRes::tv_interval $r; +- ok $f > 0.4 && $f < 0.9 or note "slept $f instead of 0.5 secs."; ++ ok $f > 0.4 && $f < 0.9 or print("# slept $f instead of 0.5 secs.\n"); + } + + SKIP: { +@@ -59,7 +59,7 @@ SKIP: { + + SKIP: { + skip $msg, 1 unless $td < $sleep * (1 + $limit); +- ok $a < $limit or note $msg; ++ ok $a < $limit or print("# $msg\n"); + } + + $t0 = Time::HiRes::gettimeofday(); +@@ -71,7 +71,7 @@ SKIP: { + + SKIP: { + skip $msg, 1 unless $td < $sleep * (1 + $limit); +- ok $a < $limit or note $msg; ++ ok $a < $limit or print("# $msg\n"); + } + } + +diff --git a/dist/Time-HiRes/typemap b/dist/Time-HiRes/typemap +index 1124eb6..3fa91f3 100644 +--- a/dist/Time-HiRes/typemap ++++ b/dist/Time-HiRes/typemap +@@ -28,6 +28,8 @@ AV * T_AVREF + HV * T_HVREF + CV * T_CVREF + ++clockid_t T_IV ++ + IV T_IV + UV T_UV + NV T_NV +diff --git a/hints/linux.sh b/hints/linux.sh +index fb5a46e..3f38ea0 100644 +--- a/hints/linux.sh ++++ b/hints/linux.sh +@@ -221,92 +221,6 @@ case "$libc" in + ;; + esac + +-# Are we using ELF? Thanks to Kenneth Albanowski +-# for this test. +-cat >try.c <<'EOM' +-/* Test for whether ELF binaries are produced */ +-#include +-#include +-#include +-main() { +- char buffer[4]; +- int i=open("a.out",O_RDONLY); +- if(i==-1) +- exit(1); /* fail */ +- if(read(i,&buffer[0],4)<4) +- exit(1); /* fail */ +- if(buffer[0] != 127 || buffer[1] != 'E' || +- buffer[2] != 'L' || buffer[3] != 'F') +- exit(1); /* fail */ +- exit(0); /* succeed (yes, it's ELF) */ +-} +-EOM +-if ${cc:-gcc} $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then +- cat <<'EOM' >&4 +- +-You appear to have ELF support. I'll try to use it for dynamic loading. +-If dynamic loading doesn't work, read hints/linux.sh for further information. +-EOM +- +-else +- cat <<'EOM' >&4 +- +-You don't have an ELF gcc. I will use dld if possible. If you are +-using a version of DLD earlier than 3.2.6, or don't have it at all, you +-should probably upgrade. If you are forced to use 3.2.4, you should +-uncomment a couple of lines in hints/linux.sh and restart Configure so +-that shared libraries will be disallowed. +- +-EOM +- lddlflags="-r $lddlflags" +- # These empty values are so that Configure doesn't put in the +- # Linux ELF values. +- ccdlflags=' ' +- cccdlflags=' ' +- ccflags="-DOVR_DBL_DIG=14 $ccflags" +- so='sa' +- dlext='o' +- nm_so_opt=' ' +- ## If you are using DLD 3.2.4 which does not support shared libs, +- ## uncomment the next two lines: +- #ldflags="-static" +- #so='none' +- +- # In addition, on some systems there is a problem with perl and NDBM +- # which causes AnyDBM and NDBM_File to lock up. This is evidenced +- # in the tests as AnyDBM just freezing. Apparently, this only +- # happens on a.out systems, so we disable NDBM for all a.out linux +- # systems. If someone can suggest a more robust test +- # that would be appreciated. +- # +- # More info: +- # Date: Wed, 7 Feb 1996 03:21:04 +0900 +- # From: Jeffrey Friedl +- # +- # I tried compiling with DBM support and sure enough things locked up +- # just as advertised. Checking into it, I found that the lockup was +- # during the call to dbm_open. Not *in* dbm_open -- but between the call +- # to and the jump into. +- # +- # To make a long story short, making sure that the *.a and *.sa pairs of +- # /usr/lib/lib{m,db,gdbm}.{a,sa} +- # were perfectly in sync took care of it. +- # +- # This will generate a harmless Whoa There! message +- case "$d_dbm_open" in +- '') cat <<'EOM' >&4 +- +-Disabling ndbm. This will generate a Whoa There message in Configure. +-Read hints/linux.sh for further information. +-EOM +- # You can override this with Configure -Dd_dbm_open +- d_dbm_open=undef +- ;; +- esac +-fi +- +-rm -f try.c a.out +- + if ${sh:-/bin/sh} -c exit; then + echo '' + echo 'You appear to have a working bash. Good.' diff --git a/5.024.000-64bit/Dockerfile b/5.024.000-64bit/Dockerfile index 3b4065b..7156e9c 100644 --- a/5.024.000-64bit/Dockerfile +++ b/5.024.000-64bit/Dockerfile @@ -10,7 +10,7 @@ COPY *.patch /usr/src/perl/ WORKDIR /usr/src/perl RUN curl -SL https://cpan.metacpan.org/authors/id/R/RJ/RJBS/perl-5.24.0.tar.bz2 -o perl-5.24.0.tar.bz2 \ - && echo '298fa605138c1a00dab95643130ae0edab369b4d *perl-5.24.0.tar.bz2' | sha1sum -c - \ + && echo '62328a53d157e8153b33e137594155f6f8b64418f7f9238210feb809585290e0 *perl-5.24.0.tar.bz2' | sha256sum -c - \ && tar --strip-components=1 -xjf perl-5.24.0.tar.bz2 -C /usr/src/perl \ && rm perl-5.24.0.tar.bz2 \ && cat *.patch | patch -p1 \ diff --git a/Releases.yaml b/Releases.yaml index a74f50d..4b10cba 100644 --- a/Releases.yaml +++ b/Releases.yaml @@ -1,44 +1,48 @@ releases: - version: 5.8.9 - sha1: 19843b5a7585cf35d96c07dbcd419bbdd5813617 + sha256: 1097fbcd48ceccb2bc735d119c9db399a02a8ab9f7dc53e29e47e6a8d0d72e79 pause: NWCLARK extra_flags: "-A ccflags=-fwrapv" test_parallel: no - version: 5.10.1 - sha1: 98b762b5cd4fb76dd354dfa5ba0d21bc2acacaf2 + sha256: 9385f2c8c2ca8b1dc4a7c31903f1f8dc8f2ba867dc2a9e5c93012ed6b564e826 pause: DAPM extra_flags: "-A ccflags=-fwrapv" test_parallel: no - version: 5.12.5 - sha1: 812139ceef512eb8458af29ffbf46d78ef26c12a + sha256: 10749417fd3010aae320a34181ad4cd6a4855c1fc63403b87fa4d630b18e966c pause: DOM extra_flags: "-A ccflags=-fwrapv" test_parallel: no - version: 5.14.4 - sha1: 3527c9e26f985cba98796439bf555fde8be73cdf + sha256: eece8c2b0d491bf6f746bd1f4f1bb7ce26f6b98e91c54690c617d7af38964745 pause: DAPM extra_flags: "-A ccflags=-fwrapv" test_parallel: no - version: 5.16.3 - sha1: 060bc17cf9f142d043f9bf7b861422ec624875ea + sha256: bb7bc735e6813b177dcfccd480defcde7eddefa173b5967eac11babd1bfa98e8 pause: RJBS extra_flags: "-A ccflags=-fwrapv" test_parallel: no - version: 5.18.4 - sha1: 69c34558a0a939a7adbbc1de48c06ea418d81e27 + sha256: 1fb4d27b75cd244e849f253320260efe1750641aaff4a18ce0d67556ff1b96a5 pause: RJBS extra_flags: "-A ccflags=-fwrapv" test_parallel: no - version: 5.20.3 - sha1: eedf9e3be3c83bef15911996ed18703cffe4d113 + sha256: 1b40068166c242e34a536836286e70b78410602a80615143301e52aa2901493b pause: SHAY - version: 5.22.2 - sha1: e2f465446dcd45a7fa3da696037f9ebe73e78e55 + sha256: f2322b9b04fe0cdbca9fe755360da04892cb6483d44959457cfebc0bcddc8058 pause: SHAY + + - version: 5.24.0 + sha256: 62328a53d157e8153b33e137594155f6f8b64418f7f9238210feb809585290e0 + pause: RJBS diff --git a/generate.pl b/generate.pl index 9cad403..86f9db3 100755 --- a/generate.pl +++ b/generate.pl @@ -13,10 +13,10 @@ The Releases.yaml file must look roughly like: releases: - version: 5.20.0 - sha1: asdasdadas + sha256: asdasdadas pause: RJBS -Where version is the version number of Perl, sha1 is the SHA1 of the +Where version is the version number of Perl, sha256 is the SHA256 of the tar.bz2 file, and pause is the PAUSE account of the release manager. If needed or desired, extra_flags: can be added, which will be passed @@ -49,7 +49,7 @@ if (! -d "downloads") { } for my $release (@{$yaml->{releases}}) { - do { die_with_sample unless $release->{$_}} for (qw(version pause sha1)); + do { die_with_sample unless $release->{$_}} for (qw(version pause sha256)); die "Bad version: $release->{version}" unless $release->{version} =~ /\A5\.\d+\.\d+\Z/; @@ -57,7 +57,7 @@ for my $release (@{$yaml->{releases}}) { my $file = "perl-$release->{version}.tar.bz2"; my $url = "http://www.cpan.org/src/5.0/$file"; if (-f "downloads/$file" && - `sha1sum downloads/$file` =~ /^\Q$release->{sha1}\E\s+\Qdownloads\/$file\E/) { + `sha256sum downloads/$file` =~ /^\Q$release->{sha256}\E\s+\Qdownloads\/$file\E/) { print "Skipping download of $file, already current\n"; } else { print "Downloading $url\n"; @@ -88,7 +88,7 @@ for my $release (@{$yaml->{releases}}) { for my $config (keys %builds) { my $output = $template; - $output =~ s/\{\{$_\}\}/$release->{$_}/mg for (qw(version pause extra_flags sha1)); + $output =~ s/\{\{$_\}\}/$release->{$_}/mg for (qw(version pause extra_flags sha256)); $output =~ s/\{\{args\}\}/$builds{$config}/mg; my $dir = sprintf "%i.%03i.%03i-%s", @@ -143,9 +143,9 @@ each with the following keys: The actual perl version, such as B<5.20.1>. -=item sha1 +=item sha256 -The SHA-1 of the C<.tar.bz2> file for that release. +The SHA-256 of the C<.tar.bz2> file for that release. =item pause @@ -191,7 +191,7 @@ COPY *.patch /usr/src/perl/ WORKDIR /usr/src/perl RUN curl -SL https://cpan.metacpan.org/authors/id/{{pause}}/perl-{{version}}.tar.bz2 -o perl-{{version}}.tar.bz2 \ - && echo '{{sha1}} *perl-{{version}}.tar.bz2' | sha1sum -c - \ + && echo '{{sha256}} *perl-{{version}}.tar.bz2' | sha256sum -c - \ && tar --strip-components=1 -xjf perl-{{version}}.tar.bz2 -C /usr/src/perl \ && rm perl-{{version}}.tar.bz2 \ && cat *.patch | patch -p1 \