develooper Front page | perl.perl5.porters | Postings from July 2012

NWCLARK TPF grant report #47

Nicholas Clark
July 30, 2012 04:01
NWCLARK TPF grant report #47
Message ID:
[Hours]		[Activity]
2012/07/23	Monday
 2.25		RT #114142
 1.50		reading/responding to list mail
 0.50		t/re/reg_posixcc.t

2012/07/24	Tuesday
 0.25		RT #114142
 0.25		RT #66092
 0.25		process, scalability, mentoring
 5.00		reading/responding to list mail
 0.50		smoke-me/magic_setenv
 2.00		smoke-me/require
 0.25		t/re/reg_posixcc.t

2012/07/25	Wednesday
 0.50		ID 20001202.002 (RT #4821)
 3.25		PV in %ENV
 1.25		reading/responding to list mail
 1.00		smoke-me/require

2012/07/26	Thursday
 0.50		RT #113980
 5.75		reading/responding to list mail
 0.25		smoke-me/require

2012/07/27	Friday
 3.25		HP-UX compiler chokes
 0.50		array test failure on ARM with -Duse64bitint
 2.50		atarist

2012/07/28	Saturday
 0.25		array test failure on ARM with -Duse64bitint

Which I calculate is 31.75 hours

More fun with compilers this week. We'd identified this problem with HP's
compiler a while back, but I'd not yet had time to fix it:

$ cc -DPERL_CORE -c  -Ae -D_HPUX_SOURCE -Wl,+vnocompatwarnings +DD64 -
2 +Onolimit -g pp_sys.c
cc: line 2976: panic 5172: Backend Assert ** Unimplemented CVT. (5172)
$ echo $?

Of course, HP's make just has to be helpfully "special" and despite noticing
the failure exit code does not remove build products from the failed step:

$ make pp_sys.o
        `sh  cflags "optimize='+O2 +Onolimit -g'" pp_sys.o`  pp_sys.c
          CCCMD =  ccache cc -DPERL_CORE -c  -Ae -D_HPUX_SOURCE -Wl,+vnocompatwarnings +DD64 -DDEBUGGING -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64   +O2 +Onolimit -g
cc: warning 404: Pre-processor not invoked, options ignored.
cc: line 2976: panic 5172: Backend Assert ** Unimplemented CVT. (5172)
*** Error exit code 1

$ ls -l pp_sys.o
-rw-r--r--   1 nick       perl         53592 Jul 30 12:04 pp_sys.o
$ file pp_sys.o
pp_sys.o:       awk program text
$ less pp_sys.o
"pp_sys.o" may be a binary file.  See it anyway? 

which of course means that if you re-run make it then assumes that pp_sys.o
is up to date, carries on and then fails at the link. "Special", as I said.

The compiler is failing to deal with this (valid) macro after the
refactorings of commits d2c4d2d1e22d3125 and 8d7906e182f93e18:

#define FT_RETURN_TRUE(X)		 \
    RETURNX((void)(			  \
	PL_op->op_flags & OPf_REF	   \
	    ? (bool)XPUSHs(		    \
		PL_op->op_private & OPpFT_STACKING ? (SV *)cGVOP_gv : (X) \
	      )								  \
	    : (PL_op->op_private & OPpFT_STACKING || SETs(X))		  \

part of a sequence where Father Chrysostomos considerably simplified the
filetest ops so that they are consistent and clear in when they manipulate
the perl stack. Fortunately his simplification also made it possible for me
to see a way to refactor things a bit further to reduce the complexity of
the code generally, and the macros in particular. The diff is slightly

$ git diff -R --stat 4c21785fe645f05e
 pp_sys.c | 80 ++++++++++++++++++++++++++++++++--------------------------------
 1 file changed, 40 insertions(+), 40 deletions(-)

because the forty lines of additions include 6 lines of documenting comments
and 3 lines of whitespace.

The other item of note this week was discovering more dead perl 4 code, and
killing it. While working on the filetest operators, I noticed this piece of
code just below them:

#if defined(atarist) /* this will work with atariST. Configure will
			make guesses for other systems. */
# define FILE_base(f) ((f)->_base)
# define FILE_ptr(f) ((f)->_ptr)
# define FILE_cnt(f) ((f)->_cnt)
# define FILE_bufsiz(f) ((f)->_cnt + ((f)->_ptr - (f)->_base))

Atari STs - I remember them. 16 bit machines from 25 years ago. So does perl
5 really build on the Atari ST? Seems unlikely - so is that another platform
we need to add to the list of "soon to be culled":

So with the help of git blame, I went digging...

The code was refactored with "patch.1i for perl5.001", but has been in
pp_sys.c since it first appeared with perl-5.000 alpha 2. So where as it
in 4.036? doio.c:

and it was added as part of patch #20, a rather big patch from June 1992.
1 line in that says:

    Subject: added Atari ST portability

What as *also* added in that patch was an atarist/ directory, containing
various files relevant to the port. We don't have an atarist/ directory
now, so where did that go? Turns out it was removed on the release of
perl-5.000. That rang a bell - there was also an msdos/ directory in perl 4
(added by perl 3 patch #16), but that was removed with perl-5.000.

So the atarist port is like the old perl 4 MSDOS port - the port specific
files were removed with perl 5, but the tentacles left in the main parts of
the code were not excised.

This I have now done.

And in the process it turned up a bunch of code for I286 support dating
from perl 3 times, mostly specifically coping with 16 bit memory models,
and using %ld instead of %d (because sizeof(int) is 2). So that's gone
too now, and the world is a bit tidier.

Nicholas Clark Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About