Subject: Perl 5.6.0 for sparc64
To: None <port-sparc64@NetBSD.ORG>
From: Martin Husemann <martin@duskware.de>
List: port-sparc64
Date: 11/02/2000 23:49:58
--ELM973205398-2631-0_
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII

I made some progress on getting perl compile (and work) on NetBSD/sparc64.
I ran into at least one perl and one compiler bug, the result is nothing
realy ready to use, but it's a step in the right direction, I think.

To make it compile I applied all patches from pkgsrc, added a hints/netbsd.sh
file (attached) and fixed an uninitialized variable (patch1 attached), that
made miniperl fail during bootstrap (already reported that back to the perl
people).

This made perl build, but fail very early in the basic tests (dumped core
on t/base/lex.t). After Eduardo rewrote the modf library function, I was
able to work around some effect I think is a compiler bug. The call to modf
didn't work, so I moved that inside a new local function - which made it
work (patch2 attached).

Result:

Failed 48 test scripts out of 190, 74.74% okay.

That's not too bad, I think.


Martin

--ELM973205398-2631-0_
Content-Transfer-Encoding: 7bit
Content-Type: application/x-sh
Content-Disposition: attachment; filename=netbsd.sh

# hints/openbsd.sh
#
# hints file for OpenBSD; Todd Miller <millert@openbsd.org>
# Edited to allow Configure command-line overrides by
#  Andy Dougherty <doughera@lafcol.lafayette.edu>
#
# To build with distribution paths, use:
#	./Configure -des -Dopenbsd_distribution=defined
#

# OpenBSD has a better malloc than perl...
test "$usemymalloc" || usemymalloc='n'

# Currently, vfork(2) is not a real win over fork(2) but this will
# change starting with OpenBSD 2.7.
usevfork='true'

# setre?[ug]id() have been replaced by the _POSIX_SAVED_IDS versions
# in 4.4BSD.  Configure will find these but they are just emulated
# and do not have the same semantics as in 4.3BSD.
d_setregid=$undef
d_setreuid=$undef
d_setrgid=$undef
d_setruid=$undef

usedl=$define
d_dlopen=$define
d_dlerror=$define
cccdlflags="-DPIC -fPIC $cccdlflags"
lddlflags="-shared $lddlflags"

optimize='-msoft-quad-float -O2 -g'

--ELM973205398-2631-0_
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=ISO-8859-1
Content-Disposition: attachment; filename=patch1.perl

--- regcomp.c.orig	Tue Aug 22 16:30:00 2000
+++ regcomp.c	Tue Oct 31 23:20:14 2000
@@ -841,12 +841,12 @@
 		cl_and(data->start_class, &and_with);
 	    }
 	    flags &= ~SCF_DO_STCLASS;
 	}
 	else if (strchr((char*)PL_varies,OP(scan))) {
-	    I32 mincount, maxcount, minnext, deltanext, pos_before, fl;
-	    I32 f = flags;
+	    I32 mincount, maxcount, minnext, deltanext, fl;
+	    I32 f = flags, pos_before = 0;
 	    regnode *oscan = scan;
 	    struct regnode_charclass_class this_class;
 	    struct regnode_charclass_class *oclass = NULL;
 
 	    switch (PL_regkind[(U8)OP(scan)]) {

--ELM973205398-2631-0_
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=ISO-8859-1
Content-Disposition: attachment; filename=patch2.perl

--- pp.c	Thu Nov  2 23:45:12 2000
+++ pp.c.orig	Mon Mar 20 16:35:44 2000
@@ -1834,14 +1834,6 @@
     }
 }
 
-double myLocalModf(double theVal, double * theIntRes)
-{
-   double res, ret;
-   ret = modf(theVal, &res);
-   *theIntRes = res;
-   return ret;
-}
-
 PP(pp_int)
 {
     djSP; dTARGET;
@@ -1854,9 +1846,8 @@
 	SETi(iv);
       }
       else {
-	if (value >= 0.0) {
-	  (void)myLocalModf(value, &value);
-	}
+	if (value >= 0.0)
+	  (void)Perl_modf(value, &value);
 	else {
 	  (void)Perl_modf(-value, &value);
 	  value = -value;

--ELM973205398-2631-0_--