[comp.lang.perl] Building Perl pl 36 on Mips Risc/os 4.51

beldar@mips.COM (Gardner Cohen) (10/19/90)

I've been religiously building perl patch releases in the bsd43
environment on Mips machines, tirelessly editing /bsd43's in front of
every /lib, /usr/include, and /bin in the Configure script.  This
time, I decided to try building in the sysv environment, and see
what I'd be missing.

Turns out that Configure will find /usr/include/bsd, /usr/include/sun,
libsun.a, and libbsd.a, and with very little tweaking, will find
almost all the system calls it normally finds in /bsd43 land.

The only exceptions: setpriority, getpriority, and killpg.  I suspect
killpg is harmless and that perl will use system V semantics to kill
groups.

Here's the only change I made to configure.  I've asked several times
why we don't have a /bsd43/bin/nm as well as a /bin/nm.  nm -B
generates bsd style output.  nm alone used to dump core when
confronted with serious tasks; this time it ran for a long time,
generating output Configure was not interested in, while nm -B made
Configure happy.

*** /tmp/,RCSt1a07907	Fri Oct 19 08:57:16 1990
--- Configure	Thu Oct 18 21:51:33 1990
***************
*** 1445,1451 ****
  echo " "
  set `echo $libc $libnames | tr ' ' '\012' | sort | uniq`
  $echo $n "Extracting names from $* for later perusal...$c"
! nm $* 2>/dev/null >libc.tmp
  $sed -n -e 's/^.* [ATD]  *_[_.]*//p' -e 's/^.* [ATD] //p' <libc.tmp >libc.list
  if $contains '^printf$' libc.list >/dev/null 2>&1; then
      echo "done"
--- 1445,1451 ----
  echo " "
  set `echo $libc $libnames | tr ' ' '\012' | sort | uniq`
  $echo $n "Extracting names from $* for later perusal...$c"
! nm -B $* 2>/dev/null >libc.tmp
  $sed -n -e 's/^.* [ATD]  *_[_.]*//p' -e 's/^.* [ATD] //p' <libc.tmp >libc.list
  if $contains '^printf$' libc.list >/dev/null 2>&1; then
      echo "done"

But wait, there's more!  I had to edit config.sh before extracting to
fix a couple of things:

d_charsprf='undef'
d_volatile='undef'

I haven't investigated why Configure decided sprintf returned char *.
Perhaps the int declaration in stdio.h is wrong.

There are known problems with mips compilers and volatile as used by
perl.

As mentioned in an earlier post, there is a problem with -lm not
ending up in the library list, so add that to the list of libraries it
presents to you.

If you normally live in the bsd43 environment (like I do), you will
need to answer

cc -systype sysv

to the what compiler? question.

With the 2.11 compilers, I was able to compile the whole thing

-O -Olimit 10000.

Note that there are core dump producing typos in util.c which I've
reported to Larry.  They're all in hfetch/hdelete calls, where pid
instead of spid is being passed to strlen (and, in one case, to hfetch
itself).

If there's enough demand, I can make a compiled version of perl
available for anonymous FTP from mips.com.

-- 
Gardner Cohen     beldar@mips.com   {ames,decwrl,...}!mips!beldar (408) 524-8267

beldar@mips.COM (Gardner Cohen) (10/20/90)

beldar@mips.COM (Gardner Cohen) writes:

   But wait, there's more!  I had to edit config.sh before extracting to
   fix a couple of things:

   d_charsprf='undef'
   d_volatile='undef'

I've been getting 'Out of memory!' messages from the perl debugger
when single stepping through functions.  These remained even after
compiling without optimization and with -g on.  This was on a machine
with lots of real and virtual memory.

They went away when I used the perl-supplied malloc.  Oops.

-- 
Gardner Cohen     beldar@mips.com   {ames,decwrl,...}!mips!beldar (408) 524-8267

beldar@mips.COM (Gardner Cohen) (10/27/90)

Here are diffs for Configure to make pl 37 build under risc/os 4.51:

*** /tmp/,RCSt1011584   Thu Oct 25 22:04:33 1990
--- Configure   Thu Oct 25 21:19:39 1990
***************
*** 303,305 ****
      echo "Okay, let's see if #! works on this system..."
!     echo "#!/bin/echo hi" > try
      $eunicefix try
--- 303,305 ----
      echo "Okay, let's see if #! works on this system..."
!     echo "#!/bsd43/bin/echo hi" > try
      $eunicefix try
***************
*** 1135,1137 ****
      esac
!     xxx=`./loc lib$thislib.a X /usr/ccs/lib /usr/lib /usr/local/lib /lib`
      if test -f $xxx; then
--- 1135,1137 ----
      esac
!     xxx=`./loc lib$thislib.a X /usr/ccs/lib /usr/lib /usr/local/lib /lib /usr/lib/cmplrs/cc`
      if test -f $xxx; then
***************
*** 1450,1452 ****
  $echo $n "Extracting names from $* for later perusal...$c"
! nm $* 2>/dev/null >libc.tmp
  $sed -n -e 's/^.* [ATD]  *_[_.]*//p' -e 's/^.* [ATD] //p' <libc.tmp >libc.list
--- 1450,1452 ----
  $echo $n "Extracting names from $* for later perusal...$c"
! nm -B $* 2>/dev/null >libc.tmp
  $sed -n -e 's/^.* [ATD]  *_[_.]*//p' -e 's/^.* [ATD] //p' <libc.tmp >libc.list

Tell configure to use cc -systype sysv.

Edit config.sh to disable volatile.

Edit Makefile after substitution to make LDFLAGS (not CLDFLAGS) -systype sysv

Compile with -Olimit 10000 -O if you have a lot of memory.

Available from mips.com (130.62.14.10) in /pub/perl_3.37.tar.Z find a
compressed tar file with a built version of perl 3.37 compiled under
risc/os. (.o's deleted).  The tar file contains a README.mips file for
more info.

-- 
Gardner Cohen     beldar@mips.com   {ames,decwrl,...}!mips!beldar (408) 524-8267